Added code for MAC-PHY interface, DU_APP, F1AP, SCTP and CU stub
[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 "envopt.h"        /* environment options */
39 #include "envdep.h"        /* environment dependent */
40 #include "envind.h"        /* environment independent */
41 #include "gen.h"           /* general */
42 #include "ssi.h"           /* system services */
43 #include "cm_tkns.h"       /* Common Token Defines */
44 #include "cm_llist.h"      /* Common Link List Defines */
45 #include "cm_hash.h"       /* Common Hash List Defines */
46 #include "cm_lte.h"        /* Common LTE Defines */
47 #include "cm_mblk.h"        /* Common LTE Defines */
48 #include "tfu.h"           /* RGU Interface defines */
49
50 /* header/extern include files (.x) */
51 #include "gen.x"           /* general */
52 #include "ssi.x"           /* system services */
53 #include "cm_tkns.x"       /* Common Token Definitions */
54 #include "cm_llist.x"      /* Common Link List Definitions */
55 #include "cm_lib.x"        /* Common Library Definitions */
56 #include "cm_hash.x"       /* Common Hash List Definitions */
57 #include "cm_lte.x"        /* Common LTE Defines */
58 #include "cm_mblk.x"        /* Common LTE Defines */
59 #include "tfu.x"           /* RGU Interface includes */
60
61 #if (defined(LCTFU))
62
63 \f
64 /***********************************************************
65 *
66 *     Func : cmPkTfuBndReq
67 *
68 *
69 *     Desc : This API is used to send a Bind Request from MAC to PHY.
70  * @param pst Pointer to the post structure.
71  * @param suId SAP ID of the service user.
72  * @param spId SAP ID of the service provider.
73  * @return ROK/RFAILED
74 *
75 *
76 *     Ret  : S16
77 *
78 *     Notes:
79 *
80 *     File  : 
81 *
82 **********************************************************/
83 #ifdef ANSI
84 PUBLIC S16 cmPkTfuBndReq
85 (
86 Pst * pst,
87 SuId suId,
88 SpId spId
89 )
90 #else
91 PUBLIC S16 cmPkTfuBndReq(pst, suId, spId)
92 Pst * pst;
93 SuId suId;
94 SpId spId;
95 #endif
96 {
97    Buffer *mBuf = NULLP;
98    TRC3(cmPkTfuBndReq)
99
100    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
101 #if (ERRCLASS & ERRCLS_ADD_RES)
102       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
103          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
104          (ErrVal)ETFU001, (ErrVal)0, "Packing failed");
105 #endif
106       RETVALUE(RFAILED);
107    }
108    if (SPkS16(spId, mBuf) != ROK) {
109 #if (ERRCLASS & ERRCLS_ADD_RES)
110       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
111          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
112          (ErrVal)ETFU002, (ErrVal)0, "Packing failed");
113 #endif
114       TFU_FREE_MSG(mBuf);
115       RETVALUE(RFAILED);
116    }
117    if (SPkS16(suId, mBuf) != ROK) {
118 #if (ERRCLASS & ERRCLS_ADD_RES)
119       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
120          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
121          (ErrVal)ETFU003, (ErrVal)0, "Packing failed");
122 #endif
123       TFU_FREE_MSG(mBuf);
124       RETVALUE(RFAILED);
125    }
126    pst->event = (Event) EVTTFUBNDREQ;
127    RETVALUE(SPstTsk(pst,mBuf));
128 }
129
130 \f
131 /***********************************************************
132 *
133 *     Func : cmUnpkTfuBndReq
134 *
135 *
136 *     Desc : This API is used to send a Bind Request from MAC to PHY.
137  * @param pst Pointer to the post structure.
138  * @param suId SAP ID of the service user.
139  * @param spId SAP ID of the service provider.
140  * @return ROK/RFAILED
141 *
142 *
143 *     Ret  : S16
144 *
145 *     Notes:
146 *
147 *     File  : 
148 *
149 **********************************************************/
150 #ifdef ANSI
151 PUBLIC S16 cmUnpkTfuBndReq
152 (
153 TfuBndReq func,
154 Pst *pst,
155 Buffer *mBuf
156 )
157 #else
158 PUBLIC S16 cmUnpkTfuBndReq(func, pst, mBuf)
159 TfuBndReq func;
160 Pst *pst;
161 Buffer *mBuf;
162 #endif
163 {
164    SuId suId;
165    SpId spId;
166    
167    TRC3(cmUnpkTfuBndReq)
168
169    if (SUnpkS16(&suId, mBuf) != ROK) {
170       TFU_FREE_MSG(mBuf);
171 #if (ERRCLASS & ERRCLS_ADD_RES)
172       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
173          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
174          (ErrVal)ETFU004, (ErrVal)0, "Packing failed");
175 #endif
176       RETVALUE(RFAILED);
177    }
178    if (SUnpkS16(&spId, mBuf) != ROK) {
179       TFU_FREE_MSG(mBuf);
180 #if (ERRCLASS & ERRCLS_ADD_RES)
181       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
182          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
183          (ErrVal)ETFU005, (ErrVal)0, "Packing failed");
184 #endif
185       RETVALUE(RFAILED);
186    }
187    TFU_FREE_MSG(mBuf);
188    RETVALUE((*func)(pst, suId, spId));
189 }
190
191 \f
192 /***********************************************************
193 *
194 *     Func : cmPkTfuBndCfm
195 *
196 *
197 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
198  * @param pst Pointer to the post structure.
199  * @param suId SAP ID of the service user.
200  * @param status Status of the bind request.
201  * @return ROK/RFAILED
202 *
203 *
204 *     Ret  : S16
205 *
206 *     Notes:
207 *
208 *     File  : 
209 *
210 **********************************************************/
211 #ifdef ANSI
212 PUBLIC S16 cmPkTfuBndCfm
213 (
214 Pst * pst,
215 SuId suId,
216 U8 status
217 )
218 #else
219 PUBLIC S16 cmPkTfuBndCfm(pst, suId, status)
220 Pst * pst;
221 SuId suId;
222 U8 status;
223 #endif
224 {
225    Buffer *mBuf = NULLP;
226    TRC3(cmPkTfuBndCfm)
227
228    if (SGetMsg(pst->region, pst->pool, &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)ETFU006, (ErrVal)0, "Packing failed");
233 #endif
234       RETVALUE(RFAILED);
235    }
236    if (SPkU8(status, mBuf) != ROK) {
237 #if (ERRCLASS & ERRCLS_ADD_RES)
238       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
239          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
240          (ErrVal)ETFU007, (ErrVal)0, "Packing failed");
241 #endif
242       TFU_FREE_MSG(mBuf);
243       RETVALUE(RFAILED);
244    }
245    if (SPkS16(suId, mBuf) != ROK) {
246 #if (ERRCLASS & ERRCLS_ADD_RES)
247       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
248          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
249          (ErrVal)ETFU008, (ErrVal)0, "Packing failed");
250 #endif
251       TFU_FREE_MSG(mBuf);
252       RETVALUE(RFAILED);
253    }
254    pst->event = (Event) EVTTFUBNDCFM;
255    RETVALUE(SPstTsk(pst,mBuf));
256 }
257
258 \f
259 /***********************************************************
260 *
261 *     Func : cmUnpkTfuBndCfm
262 *
263 *
264 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
265  * @param pst Pointer to the post structure.
266  * @param suId SAP ID of the service user.
267  * @param status Status of the bind request.
268  * @return ROK/RFAILED
269 *
270 *
271 *     Ret  : S16
272 *
273 *     Notes:
274 *
275 *     File  : 
276 *
277 **********************************************************/
278 #ifdef ANSI
279 PUBLIC S16 cmUnpkTfuBndCfm
280 (
281 TfuBndCfm func,
282 Pst *pst,
283 Buffer *mBuf
284 )
285 #else
286 PUBLIC S16 cmUnpkTfuBndCfm(func, pst, mBuf)
287 TfuBndCfm func;
288 Pst *pst;
289 Buffer *mBuf;
290 #endif
291 {
292    SuId suId;
293    U8 status;
294    
295    TRC3(cmUnpkTfuBndCfm)
296
297    if (SUnpkS16(&suId, mBuf) != ROK) {
298       TFU_FREE_MSG(mBuf);
299 #if (ERRCLASS & ERRCLS_ADD_RES)
300       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
301          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
302          (ErrVal)ETFU009, (ErrVal)0, "Packing failed");
303 #endif
304       RETVALUE(RFAILED);
305    }
306    if (SUnpkU8(&status, mBuf) != ROK) {
307       TFU_FREE_MSG(mBuf);
308 #if (ERRCLASS & ERRCLS_ADD_RES)
309       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
310          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
311          (ErrVal)ETFU010, (ErrVal)0, "Packing failed");
312 #endif
313       RETVALUE(RFAILED);
314    }
315    TFU_FREE_MSG(mBuf);
316    RETVALUE((*func)(pst, suId, status));
317 }
318
319 \f
320 /***********************************************************
321 *
322 *     Func : cmPkTfuUbndReq
323 *
324 *
325 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
326  * @param pst Pointer to the post structure.
327  * @param suId SAP ID of the service provider.
328  * @param reason Reason for Unbind request.
329  * @return ROK/RFAILED
330 *
331 *
332 *     Ret  : S16
333 *
334 *     Notes:
335 *
336 *     File  : 
337 *
338 **********************************************************/
339 #ifdef ANSI
340 PUBLIC S16 cmPkTfuUbndReq
341 (
342 Pst * pst,
343 SpId spId,
344 Reason reason
345 )
346 #else
347 PUBLIC S16 cmPkTfuUbndReq(pst, spId, reason)
348 Pst * pst;
349 SpId spId;
350 Reason reason;
351 #endif
352 {
353    Buffer *mBuf = NULLP;
354    TRC3(cmPkTfuUbndReq)
355
356    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
357 #if (ERRCLASS & ERRCLS_ADD_RES)
358       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
359          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
360          (ErrVal)ETFU011, (ErrVal)0, "Packing failed");
361 #endif
362       RETVALUE(RFAILED);
363    }
364    if (SPkS16(reason, mBuf) != ROK) {
365 #if (ERRCLASS & ERRCLS_ADD_RES)
366       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
367          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
368          (ErrVal)ETFU012, (ErrVal)0, "Packing failed");
369 #endif
370       TFU_FREE_MSG(mBuf);
371       RETVALUE(RFAILED);
372    }
373    if (SPkS16(spId, mBuf) != ROK) {
374 #if (ERRCLASS & ERRCLS_ADD_RES)
375       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
376          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
377          (ErrVal)ETFU013, (ErrVal)0, "Packing failed");
378 #endif
379       TFU_FREE_MSG(mBuf);
380       RETVALUE(RFAILED);
381    }
382    pst->event = (Event) EVTTFUUBNDREQ;
383    RETVALUE(SPstTsk(pst,mBuf));
384 }
385
386 \f
387 /***********************************************************
388 *
389 *     Func : cmUnpkTfuUbndReq
390 *
391 *
392 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
393  * @param pst Pointer to the post structure.
394  * @param suId SAP ID of the service provider.
395  * @param reason Reason for Unbind request.
396  * @return ROK/RFAILED
397 *
398 *
399 *     Ret  : S16
400 *
401 *     Notes:
402 *
403 *     File  : 
404 *
405 **********************************************************/
406 #ifdef ANSI
407 PUBLIC S16 cmUnpkTfuUbndReq
408 (
409 TfuUbndReq func,
410 Pst *pst,
411 Buffer *mBuf
412 )
413 #else
414 PUBLIC S16 cmUnpkTfuUbndReq(func, pst, mBuf)
415 TfuUbndReq func;
416 Pst *pst;
417 Buffer *mBuf;
418 #endif
419 {
420    SpId spId;
421    Reason reason;
422    
423    TRC3(cmUnpkTfuUbndReq)
424
425    if (SUnpkS16(&spId, mBuf) != ROK) {
426       TFU_FREE_MSG(mBuf);
427 #if (ERRCLASS & ERRCLS_ADD_RES)
428       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
429          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
430          (ErrVal)ETFU014, (ErrVal)0, "Packing failed");
431 #endif
432       RETVALUE(RFAILED);
433    }
434    if (SUnpkS16(&reason, mBuf) != ROK) {
435       TFU_FREE_MSG(mBuf);
436 #if (ERRCLASS & ERRCLS_ADD_RES)
437       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
438          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
439          (ErrVal)ETFU015, (ErrVal)0, "Packing failed");
440 #endif
441       RETVALUE(RFAILED);
442    }
443    TFU_FREE_MSG(mBuf);
444    RETVALUE((*func)(pst, spId, reason));
445 }
446
447 \f
448 /***********************************************************
449 *
450 *     Func : cmPkTfuSchBndReq
451 *
452 *
453 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
454  * @param pst Pointer to the post structure.
455  * @param suId SAP ID of the service user.
456  * @param spId SAP ID of the service provider.
457  * @return ROK/RFAILED
458 *
459 *
460 *     Ret  : S16
461 *
462 *     Notes:
463 *
464 *     File  : 
465 *
466 **********************************************************/
467 #ifdef ANSI
468 PUBLIC S16 cmPkTfuSchBndReq
469 (
470 Pst * pst,
471 SuId suId,
472 SpId spId
473 )
474 #else
475 PUBLIC S16 cmPkTfuSchBndReq(pst, suId, spId)
476 Pst * pst;
477 SuId suId;
478 SpId spId;
479 #endif
480 {
481    Buffer *mBuf = NULLP;
482    TRC3(cmPkTfuSchBndReq)
483
484    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
485 #if (ERRCLASS & ERRCLS_ADD_RES)
486       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
487          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
488          (ErrVal)ETFU016, (ErrVal)0, "Packing failed");
489 #endif
490       RETVALUE(RFAILED);
491    }
492    if (SPkS16(spId, mBuf) != ROK) {
493 #if (ERRCLASS & ERRCLS_ADD_RES)
494       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
495          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
496          (ErrVal)ETFU017, (ErrVal)0, "Packing failed");
497 #endif
498       TFU_FREE_MSG(mBuf);
499       RETVALUE(RFAILED);
500    }
501    if (SPkS16(suId, mBuf) != ROK) {
502 #if (ERRCLASS & ERRCLS_ADD_RES)
503       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
504          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
505          (ErrVal)ETFU018, (ErrVal)0, "Packing failed");
506 #endif
507       TFU_FREE_MSG(mBuf);
508       RETVALUE(RFAILED);
509    }
510    pst->event = (Event) EVTTFUSCHBNDREQ;
511    RETVALUE(SPstTsk(pst,mBuf));
512 }
513
514 \f
515 /***********************************************************
516 *
517 *     Func : cmUnpkTfuSchBndReq
518 *
519 *
520 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
521  * @param pst Pointer to the post structure.
522  * @param suId SAP ID of the service user.
523  * @param spId SAP ID of the service provider.
524  * @return ROK/RFAILED
525 *
526 *
527 *     Ret  : S16
528 *
529 *     Notes:
530 *
531 *     File  : 
532 *
533 **********************************************************/
534 #ifdef ANSI
535 PUBLIC S16 cmUnpkTfuSchBndReq
536 (
537 TfuSchBndReq func,
538 Pst *pst,
539 Buffer *mBuf
540 )
541 #else
542 PUBLIC S16 cmUnpkTfuSchBndReq(func, pst, mBuf)
543 TfuSchBndReq func;
544 Pst *pst;
545 Buffer *mBuf;
546 #endif
547 {
548    SuId suId;
549    SpId spId;
550    
551    TRC3(cmUnpkTfuSchBndReq)
552
553    if (SUnpkS16(&suId, mBuf) != ROK) {
554       TFU_FREE_MSG(mBuf);
555 #if (ERRCLASS & ERRCLS_ADD_RES)
556       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
557          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
558          (ErrVal)ETFU019, (ErrVal)0, "Packing failed");
559 #endif
560       RETVALUE(RFAILED);
561    }
562    if (SUnpkS16(&spId, mBuf) != ROK) {
563       TFU_FREE_MSG(mBuf);
564 #if (ERRCLASS & ERRCLS_ADD_RES)
565       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
566          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
567          (ErrVal)ETFU020, (ErrVal)0, "Packing failed");
568 #endif
569       RETVALUE(RFAILED);
570    }
571    TFU_FREE_MSG(mBuf);
572    RETVALUE((*func)(pst, suId, spId));
573 }
574
575 \f
576 /***********************************************************
577 *
578 *     Func : cmPkTfuSchBndCfm
579 *
580 *
581 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
582  * @param pst Pointer to the post structure.
583  * @param suId SAP ID of the service user.
584  * @param status Status of the bind request.
585  * @return ROK/RFAILED
586 *
587 *
588 *     Ret  : S16
589 *
590 *     Notes:
591 *
592 *     File  : 
593 *
594 **********************************************************/
595 #ifdef ANSI
596 PUBLIC S16 cmPkTfuSchBndCfm
597 (
598 Pst * pst,
599 SuId suId,
600 U8 status
601 )
602 #else
603 PUBLIC S16 cmPkTfuSchBndCfm(pst, suId, status)
604 Pst * pst;
605 SuId suId;
606 U8 status;
607 #endif
608 {
609    Buffer *mBuf = NULLP;
610    TRC3(cmPkTfuSchBndCfm)
611
612    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
613 #if (ERRCLASS & ERRCLS_ADD_RES)
614       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
615          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
616          (ErrVal)ETFU021, (ErrVal)0, "Packing failed");
617 #endif
618       RETVALUE(RFAILED);
619    }
620    if (SPkU8(status, mBuf) != ROK) {
621 #if (ERRCLASS & ERRCLS_ADD_RES)
622       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
623          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
624          (ErrVal)ETFU022, (ErrVal)0, "Packing failed");
625 #endif
626       TFU_FREE_MSG(mBuf);
627       RETVALUE(RFAILED);
628    }
629    if (SPkS16(suId, mBuf) != ROK) {
630 #if (ERRCLASS & ERRCLS_ADD_RES)
631       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
632          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
633          (ErrVal)ETFU023, (ErrVal)0, "Packing failed");
634 #endif
635       TFU_FREE_MSG(mBuf);
636       RETVALUE(RFAILED);
637    }
638    pst->event = (Event) EVTTFUSCHBNDCFM;
639    RETVALUE(SPstTsk(pst,mBuf));
640 }
641
642 \f
643 /***********************************************************
644 *
645 *     Func : cmUnpkTfuSchBndCfm
646 *
647 *
648 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
649  * @param pst Pointer to the post structure.
650  * @param suId SAP ID of the service user.
651  * @param status Status of the bind request.
652  * @return ROK/RFAILED
653 *
654 *
655 *     Ret  : S16
656 *
657 *     Notes:
658 *
659 *     File  : 
660 *
661 **********************************************************/
662 #ifdef ANSI
663 PUBLIC S16 cmUnpkTfuSchBndCfm
664 (
665 TfuSchBndCfm func,
666 Pst *pst,
667 Buffer *mBuf
668 )
669 #else
670 PUBLIC S16 cmUnpkTfuSchBndCfm(func, pst, mBuf)
671 TfuSchBndCfm func;
672 Pst *pst;
673 Buffer *mBuf;
674 #endif
675 {
676    SuId suId;
677    U8 status;
678    
679    TRC3(cmUnpkTfuSchBndCfm)
680
681    if (SUnpkS16(&suId, mBuf) != ROK) {
682       TFU_FREE_MSG(mBuf);
683 #if (ERRCLASS & ERRCLS_ADD_RES)
684       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
685          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
686          (ErrVal)ETFU024, (ErrVal)0, "Packing failed");
687 #endif
688       RETVALUE(RFAILED);
689    }
690    if (SUnpkU8(&status, mBuf) != ROK) {
691       TFU_FREE_MSG(mBuf);
692 #if (ERRCLASS & ERRCLS_ADD_RES)
693       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
694          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
695          (ErrVal)ETFU025, (ErrVal)0, "Packing failed");
696 #endif
697       RETVALUE(RFAILED);
698    }
699    TFU_FREE_MSG(mBuf);
700    RETVALUE((*func)(pst, suId, status));
701 }
702
703 \f
704 /***********************************************************
705 *
706 *     Func : cmPkTfuSchUbndReq
707 *
708 *
709 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
710  * @param pst Pointer to the post structure.
711  * @param suId SAP ID of the service provider.
712  * @param reason Reason for Unbind request.
713  * @return ROK/RFAILED
714 *
715 *
716 *     Ret  : S16
717 *
718 *     Notes:
719 *
720 *     File  : 
721 *
722 **********************************************************/
723 #ifdef ANSI
724 PUBLIC S16 cmPkTfuSchUbndReq
725 (
726 Pst * pst,
727 SpId spId,
728 Reason reason
729 )
730 #else
731 PUBLIC S16 cmPkTfuSchUbndReq(pst, spId, reason)
732 Pst * pst;
733 SpId spId;
734 Reason reason;
735 #endif
736 {
737    Buffer *mBuf = NULLP;
738    TRC3(cmPkTfuSchUbndReq)
739
740    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
741 #if (ERRCLASS & ERRCLS_ADD_RES)
742       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
743          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
744          (ErrVal)ETFU026, (ErrVal)0, "Packing failed");
745 #endif
746       RETVALUE(RFAILED);
747    }
748    if (SPkS16(reason, mBuf) != ROK) {
749 #if (ERRCLASS & ERRCLS_ADD_RES)
750       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
751          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
752          (ErrVal)ETFU027, (ErrVal)0, "Packing failed");
753 #endif
754       TFU_FREE_MSG(mBuf);
755       RETVALUE(RFAILED);
756    }
757    if (SPkS16(spId, mBuf) != ROK) {
758 #if (ERRCLASS & ERRCLS_ADD_RES)
759       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
760          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
761          (ErrVal)ETFU028, (ErrVal)0, "Packing failed");
762 #endif
763       TFU_FREE_MSG(mBuf);
764       RETVALUE(RFAILED);
765    }
766    pst->event = (Event) EVTTFUSCHUBNDREQ;
767    RETVALUE(SPstTsk(pst,mBuf));
768 }
769
770 \f
771 /***********************************************************
772 *
773 *     Func : cmUnpkTfuSchUbndReq
774 *
775 *
776 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
777  * @param pst Pointer to the post structure.
778  * @param suId SAP ID of the service provider.
779  * @param reason Reason for Unbind request.
780  * @return ROK/RFAILED
781 *
782 *
783 *     Ret  : S16
784 *
785 *     Notes:
786 *
787 *     File  : 
788 *
789 **********************************************************/
790 #ifdef ANSI
791 PUBLIC S16 cmUnpkTfuSchUbndReq
792 (
793 TfuSchUbndReq func,
794 Pst *pst,
795 Buffer *mBuf
796 )
797 #else
798 PUBLIC S16 cmUnpkTfuSchUbndReq(func, pst, mBuf)
799 TfuSchUbndReq func;
800 Pst *pst;
801 Buffer *mBuf;
802 #endif
803 {
804    SpId spId;
805    Reason reason;
806    
807    TRC3(cmUnpkTfuSchUbndReq)
808
809    if (SUnpkS16(&spId, mBuf) != ROK) {
810       TFU_FREE_MSG(mBuf);
811 #if (ERRCLASS & ERRCLS_ADD_RES)
812       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
813          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
814          (ErrVal)ETFU029, (ErrVal)0, "Packing failed");
815 #endif
816       RETVALUE(RFAILED);
817    }
818    if (SUnpkS16(&reason, mBuf) != ROK) {
819       TFU_FREE_MSG(mBuf);
820 #if (ERRCLASS & ERRCLS_ADD_RES)
821       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
822          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
823          (ErrVal)ETFU030, (ErrVal)0, "Packing failed");
824 #endif
825       RETVALUE(RFAILED);
826    }
827    TFU_FREE_MSG(mBuf);
828    RETVALUE((*func)(pst, spId, reason));
829 }
830
831 \f
832 /***********************************************************
833 *
834 *     Func : cmPkTfuRaReqInd
835 *
836 *
837 *     Desc : This API is used to indication Random Access Request reception from
838  * PHY to Scheduler.
839  * @details This primitive is used by physical layer to indicate the reception
840  * of a Random Access Request from a set of UEs. The information passed consists
841  * of the RA-RNTI and the list of preambles received. 
842  * @param pst Pointer to the post structure.
843  * @param suId SAP ID of the service user.
844  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
845  * @return ROK/RFAILED
846 *
847 *
848 *     Ret  : S16
849 *
850 *     Notes:
851 *
852 *     File  : 
853 *
854 **********************************************************/
855 #ifdef ANSI
856 PUBLIC S16 cmPkTfuRaReqInd
857 (
858 Pst * pst,
859 SuId suId,
860 TfuRaReqIndInfo * raReqInd
861 )
862 #else
863 PUBLIC S16 cmPkTfuRaReqInd(pst, suId, raReqInd)
864 Pst * pst;
865 SuId suId;
866 TfuRaReqIndInfo * raReqInd;
867 #endif
868 {
869    Buffer *mBuf = NULLP;
870    TRC3(cmPkTfuRaReqInd)
871
872    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
873 #if (ERRCLASS & ERRCLS_ADD_RES)
874       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
875          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
876          (ErrVal)ETFU031, (ErrVal)0, "Packing failed");
877 #endif
878       TFU_FREE_MEM(raReqInd);
879       RETVALUE(RFAILED);
880    }
881    if (pst->selector == TFU_SEL_LC) {
882       if (cmPkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
883 #if (ERRCLASS & ERRCLS_ADD_RES)
884          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
885             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
886             (ErrVal)ETFU032, (ErrVal)0, "Packing failed");
887 #endif
888          TFU_FREE_MEM(raReqInd);
889          TFU_FREE_MSG(mBuf);
890          RETVALUE(RFAILED);
891       }
892    }
893    else if(pst->selector == TFU_SEL_LWLC)
894    {
895       if (cmPkPtr((PTR)raReqInd, mBuf) != ROK)
896       {
897 #if (ERRCLASS & ERRCLS_ADD_RES)
898          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
899             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
900             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
901 #endif
902          TFU_FREE_MEM(raReqInd);
903          TFU_FREE_MSG(mBuf);
904          RETVALUE(RFAILED);
905       }
906    }
907
908    if (SPkS16(suId, mBuf) != ROK) {
909 #if (ERRCLASS & ERRCLS_ADD_RES)
910       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
911          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
912          (ErrVal)ETFU033, (ErrVal)0, "Packing failed");
913 #endif
914       TFU_FREE_MEM(raReqInd);
915       TFU_FREE_MSG(mBuf);
916       RETVALUE(RFAILED);
917    }
918    if (pst->selector != TFU_SEL_LWLC) {
919       TFU_FREE_MEM(raReqInd);
920    }
921
922    pst->event = (Event) EVTTFURAREQIND;
923    RETVALUE(SPstTsk(pst,mBuf));
924 }
925
926 \f
927 /***********************************************************
928 *
929 *     Func : cmUnpkTfuRaReqInd
930 *
931 *
932 *     Desc : This API is used to indication Random Access Request reception from
933  * PHY to Scheduler.
934  * @details This primitive is used by physical layer to indicate the reception
935  * of a Random Access Request from a set of UEs. The information passed consists
936  * of the RA-RNTI and the list of preambles received. 
937  * @param pst Pointer to the post structure.
938  * @param suId SAP ID of the service user.
939  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
940  * @return ROK/RFAILED
941 *
942 *
943 *     Ret  : S16
944 *
945 *     Notes:
946 *
947 *     File  : 
948 *
949 **********************************************************/
950 #ifdef ANSI
951 PUBLIC S16 cmUnpkTfuRaReqInd
952 (
953 TfuRaReqInd func,
954 Pst *pst,
955 Buffer *mBuf
956 )
957 #else
958 PUBLIC S16 cmUnpkTfuRaReqInd(func, pst, mBuf)
959 TfuRaReqInd func;
960 Pst *pst;
961 Buffer *mBuf;
962 #endif
963 {
964    SuId suId;
965    TfuRaReqIndInfo *raReqInd;
966    
967    TRC3(cmUnpkTfuRaReqInd)
968
969    if (SUnpkS16(&suId, mBuf) != ROK) {
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)ETFU034, (ErrVal)0, "Packing failed");
975 #endif
976       RETVALUE(RFAILED);
977    }
978    if (pst->selector != TFU_SEL_LWLC) {
979       Mem   sMem;
980       sMem.region = pst->region;
981       sMem.pool = pst->pool;
982       if ((cmAllocEvnt(sizeof(TfuRaReqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&raReqInd)) != ROK)            {
983 #if (ERRCLASS & ERRCLS_ADD_RES)
984          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
985             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
986             (ErrVal)ETFU035, (ErrVal)0, "Packing failed");
987 #endif
988          TFU_FREE_MSG(mBuf);
989          RETVALUE(RFAILED);
990       }
991    }
992
993
994    if (pst->selector == TFU_SEL_LC) 
995    {
996       if (cmUnpkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
997          TFU_FREE_MEM(raReqInd);
998          TFU_FREE_MSG(mBuf);
999 #if (ERRCLASS & ERRCLS_ADD_RES)
1000          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1001                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1002                (ErrVal)ETFU036, (ErrVal)0, "Packing failed");
1003 #endif
1004          RETVALUE(RFAILED);
1005       }
1006    }
1007    else if(pst->selector == TFU_SEL_LWLC)
1008    {
1009       if (cmUnpkPtr((PTR *)&raReqInd, mBuf) != ROK)
1010       {
1011 #if (ERRCLASS & ERRCLS_ADD_RES)
1012          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1013             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1014             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1015 #endif
1016          TFU_FREE_MEM(raReqInd);
1017          TFU_FREE_MSG(mBuf);
1018          RETVALUE(RFAILED);
1019       }
1020    }
1021    TFU_FREE_MSG(mBuf);
1022    RETVALUE((*func)(pst, suId, raReqInd));
1023 }
1024
1025 \f
1026 /***********************************************************
1027 *
1028 *     Func : cmPkTfuRecpReq
1029 *
1030 *
1031 *     Desc : This primitive is sent from Scheduler to PHY.
1032  * @details This primitive provides PHY with all the information required by 
1033  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1034  * -# On PUCCH UE can transmit the following
1035  *    -# SR
1036  *    -# HARQ feedback
1037  *    -# CQI report
1038  *    -# HARQ + CQI
1039  *    -# HARQ + SR
1040  * -# On PUSCH UE can transmit the following
1041  *    -# Data
1042  *    -# Data + CQI
1043  *    -# Data + HARQ Feedback
1044  * This primitive carries all the information for the expected subframe for all
1045  * the UEs that have been scheduled to transmit.
1046  * @param pst Pointer to the post structure.
1047  * @param spId SAP ID of the service provider.
1048  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1049  * @return ROK/RFAILED
1050 *
1051 *
1052 *     Ret  : S16
1053 *
1054 *     Notes:
1055 *
1056 *     File  : 
1057 *
1058 **********************************************************/
1059 #ifdef ANSI
1060 PUBLIC S16 cmPkTfuRecpReq
1061 (
1062 Pst * pst,
1063 SpId spId,
1064 TfuRecpReqInfo * recpReq
1065 )
1066 #else
1067 PUBLIC S16 cmPkTfuRecpReq(pst, spId, recpReq)
1068 Pst * pst;
1069 SpId spId;
1070 TfuRecpReqInfo * recpReq;
1071 #endif
1072 {
1073    Buffer *mBuf = NULLP;
1074    TRC3(cmPkTfuRecpReq)
1075
1076    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1077 #if (ERRCLASS & ERRCLS_ADD_RES)
1078       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1079          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1080          (ErrVal)ETFU037, (ErrVal)0, "Packing failed");
1081 #endif
1082       TFU_FREE_MEM(recpReq);
1083       RETVALUE(RFAILED);
1084    }
1085    if (pst->selector == TFU_SEL_LC) {
1086       if (cmPkTfuRecpReqInfo(recpReq, mBuf) != ROK) {
1087 #if (ERRCLASS & ERRCLS_ADD_RES)
1088          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1089             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1090             (ErrVal)ETFU038, (ErrVal)0, "Packing failed");
1091 #endif
1092          TFU_FREE_MEM(recpReq);
1093          TFU_FREE_MSG(mBuf);
1094          RETVALUE(RFAILED);
1095       }
1096    }
1097    else if(pst->selector == TFU_SEL_LWLC)
1098    {
1099       if (cmPkPtr((PTR)recpReq, mBuf) != ROK)
1100       {
1101 #if (ERRCLASS & ERRCLS_ADD_RES)
1102          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1103             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1104             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1105 #endif
1106          TFU_FREE_MEM(recpReq);
1107          TFU_FREE_MSG(mBuf);
1108          RETVALUE(RFAILED);
1109       }
1110    }
1111
1112
1113    if (SPkS16(spId, mBuf) != ROK) {
1114 #if (ERRCLASS & ERRCLS_ADD_RES)
1115       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1116          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1117          (ErrVal)ETFU039, (ErrVal)0, "Packing failed");
1118 #endif
1119       TFU_FREE_MEM(recpReq);
1120       TFU_FREE_MSG(mBuf);
1121       RETVALUE(RFAILED);
1122    }
1123    if (pst->selector != TFU_SEL_LWLC) {
1124       TFU_FREE_MEM(recpReq);
1125    }
1126
1127    pst->event = (Event) EVTTFURECPREQ;
1128    RETVALUE(SPstTsk(pst,mBuf));
1129 }
1130
1131 \f
1132 /***********************************************************
1133 *
1134 *     Func : cmUnpkTfuRecpReq
1135 *
1136 *
1137 *     Desc : This primitive is sent from Scheduler to PHY.
1138  * @details This primitive provides PHY with all the information required by 
1139  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1140  * -# On PUCCH UE can transmit the following
1141  *    -# SR
1142  *    -# HARQ feedback
1143  *    -# CQI report
1144  *    -# HARQ + CQI
1145  *    -# HARQ + SR
1146  * -# On PUSCH UE can transmit the following
1147  *    -# Data
1148  *    -# Data + CQI
1149  *    -# Data + HARQ Feedback
1150  * This primitive carries all the information for the expected subframe for all
1151  * the UEs that have been scheduled to transmit.
1152  * @param pst Pointer to the post structure.
1153  * @param spId SAP ID of the service provider.
1154  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1155  * @return ROK/RFAILED
1156 *
1157 *
1158 *     Ret  : S16
1159 *
1160 *     Notes:
1161 *
1162 *     File  : 
1163 *
1164 **********************************************************/
1165 #ifdef ANSI
1166 PUBLIC S16 cmUnpkTfuRecpReq
1167 (
1168 TfuRecpReq func,
1169 Pst *pst,
1170 Buffer *mBuf
1171 )
1172 #else
1173 PUBLIC S16 cmUnpkTfuRecpReq(func, pst, mBuf)
1174 TfuRecpReq func;
1175 Pst *pst;
1176 Buffer *mBuf;
1177 #endif
1178 {
1179    SpId spId;
1180    TfuRecpReqInfo *recpReq;
1181    
1182    TRC3(cmUnpkTfuRecpReq)
1183
1184    if (SUnpkS16(&spId, mBuf) != ROK) {
1185       TFU_FREE_MSG(mBuf);
1186 #if (ERRCLASS & ERRCLS_ADD_RES)
1187       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1188          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1189          (ErrVal)ETFU040, (ErrVal)0, "Packing failed");
1190 #endif
1191       RETVALUE(RFAILED);
1192    }
1193    if (pst->selector != TFU_SEL_LWLC) {
1194       Mem   sMem;
1195       sMem.region = pst->region;
1196       sMem.pool = pst->pool;
1197       if ((cmAllocEvnt(sizeof(TfuRecpReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&recpReq)) != ROK)            {
1198 #if (ERRCLASS & ERRCLS_ADD_RES)
1199          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1200             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1201             (ErrVal)ETFU041, (ErrVal)0, "Packing failed");
1202 #endif
1203          TFU_FREE_MSG(mBuf);
1204          RETVALUE(RFAILED);
1205       }
1206    }
1207    else if(pst->selector == TFU_SEL_LWLC)
1208    {
1209       if (cmUnpkPtr((PTR *)&recpReq, mBuf) != ROK)
1210       {
1211 #if (ERRCLASS & ERRCLS_ADD_RES)
1212          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1213             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1214             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1215 #endif
1216          TFU_FREE_MEM(recpReq);
1217          TFU_FREE_MSG(mBuf);
1218          RETVALUE(RFAILED);
1219       }
1220    }
1221
1222    if (pst->selector == TFU_SEL_LC) 
1223    {
1224       if (cmUnpkTfuRecpReqInfo(recpReq, (Ptr)&recpReq->memCp, mBuf) != ROK) {
1225          TFU_FREE_MEM(recpReq);
1226          TFU_FREE_MSG(mBuf);
1227 #if (ERRCLASS & ERRCLS_ADD_RES)
1228          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1229                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1230                (ErrVal)ETFU042, (ErrVal)0, "Packing failed");
1231 #endif
1232          RETVALUE(RFAILED);
1233       }
1234    }
1235    else if(pst->selector == TFU_SEL_LWLC)
1236    {
1237       if (cmUnpkPtr((PTR*)&recpReq, mBuf) != ROK)
1238       {
1239 #if (ERRCLASS & ERRCLS_ADD_RES)
1240          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1241             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1242             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1243 #endif
1244          TFU_FREE_MEM(recpReq);
1245          TFU_FREE_MSG(mBuf);
1246          RETVALUE(RFAILED);
1247       }
1248    }
1249
1250    TFU_FREE_MSG(mBuf);
1251    RETVALUE((*func)(pst, spId, recpReq));
1252 }
1253
1254 \f
1255 /***********************************************************
1256 *
1257 *     Func : cmPkTfuUlCqiInd
1258 *
1259 *
1260 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1261  * @details This primitive carries an estimate of the uplink Channel quality
1262  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1263  * quality i.e. the transmission from UE as calculated at the Physical layer at
1264  * the eNodeB. 
1265  * It carries a list of subband CQIs for each UE. 
1266  * @param pst Pointer to the post structure.
1267  * @param suId SAP ID of the service user.
1268  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1269  * @return ROK/RFAILED
1270 *
1271 *
1272 *     Ret  : S16
1273 *
1274 *     Notes:
1275 *
1276 *     File  : 
1277 *
1278 **********************************************************/
1279 #ifdef ANSI
1280 PUBLIC S16 cmPkTfuUlCqiInd
1281 (
1282 Pst * pst,
1283 SuId suId,
1284 TfuUlCqiIndInfo * ulCqiInd
1285 )
1286 #else
1287 PUBLIC S16 cmPkTfuUlCqiInd(pst, suId, ulCqiInd)
1288 Pst * pst;
1289 SuId suId;
1290 TfuUlCqiIndInfo * ulCqiInd;
1291 #endif
1292 {
1293    Buffer *mBuf = NULLP;
1294    TRC3(cmPkTfuUlCqiInd)
1295
1296    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1297 #if (ERRCLASS & ERRCLS_ADD_RES)
1298       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1299          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1300          (ErrVal)ETFU043, (ErrVal)0, "Packing failed");
1301 #endif
1302       TFU_FREE_MEM(ulCqiInd);
1303       RETVALUE(RFAILED);
1304    }
1305    if (pst->selector == TFU_SEL_LC) {
1306       if (cmPkTfuUlCqiIndInfo(ulCqiInd, mBuf) != ROK) {
1307 #if (ERRCLASS & ERRCLS_ADD_RES)
1308          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1309             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1310             (ErrVal)ETFU044, (ErrVal)0, "Packing failed");
1311 #endif
1312          TFU_FREE_MEM(ulCqiInd);
1313          TFU_FREE_MSG(mBuf);
1314          RETVALUE(RFAILED);
1315       }
1316    }
1317    else if(pst->selector == TFU_SEL_LWLC)
1318    {
1319       if (cmPkPtr((PTR)ulCqiInd, mBuf) != ROK)
1320       {
1321 #if (ERRCLASS & ERRCLS_ADD_RES)
1322          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1323             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1324             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1325 #endif
1326          TFU_FREE_MEM(ulCqiInd);
1327          TFU_FREE_MSG(mBuf);
1328          RETVALUE(RFAILED);
1329       }
1330    }
1331
1332    if (SPkS16(suId, mBuf) != ROK) {
1333 #if (ERRCLASS & ERRCLS_ADD_RES)
1334       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1335          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1336          (ErrVal)ETFU045, (ErrVal)0, "Packing failed");
1337 #endif
1338       TFU_FREE_MEM(ulCqiInd);
1339       TFU_FREE_MSG(mBuf);
1340       RETVALUE(RFAILED);
1341    }
1342    if (pst->selector != TFU_SEL_LWLC) {
1343       TFU_FREE_MEM(ulCqiInd);
1344    }
1345
1346    pst->event = (Event) EVTTFUULCQIIND;
1347    RETVALUE(SPstTsk(pst,mBuf));
1348 }
1349
1350 \f
1351 /***********************************************************
1352 *
1353 *     Func : cmUnpkTfuUlCqiInd
1354 *
1355 *
1356 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1357  * @details This primitive carries an estimate of the uplink Channel quality
1358  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1359  * quality i.e. the transmission from UE as calculated at the Physical layer at
1360  * the eNodeB. 
1361  * It carries a list of subband CQIs for each UE. 
1362  * @param pst Pointer to the post structure.
1363  * @param suId SAP ID of the service user.
1364  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1365  * @return ROK/RFAILED
1366 *
1367 *
1368 *     Ret  : S16
1369 *
1370 *     Notes:
1371 *
1372 *     File  : 
1373 *
1374 **********************************************************/
1375 #ifdef ANSI
1376 PUBLIC S16 cmUnpkTfuUlCqiInd
1377 (
1378 TfuUlCqiInd func,
1379 Pst *pst,
1380 Buffer *mBuf
1381 )
1382 #else
1383 PUBLIC S16 cmUnpkTfuUlCqiInd(func, pst, mBuf)
1384 TfuUlCqiInd func;
1385 Pst *pst;
1386 Buffer *mBuf;
1387 #endif
1388 {
1389    SuId suId;
1390    TfuUlCqiIndInfo *ulCqiInd;
1391    
1392    TRC3(cmUnpkTfuUlCqiInd)
1393
1394    if (SUnpkS16(&suId, mBuf) != ROK) {
1395       TFU_FREE_MSG(mBuf);
1396 #if (ERRCLASS & ERRCLS_ADD_RES)
1397       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1398          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1399          (ErrVal)ETFU046, (ErrVal)0, "Packing failed");
1400 #endif
1401       RETVALUE(RFAILED);
1402    }
1403    if (pst->selector != TFU_SEL_LWLC) {
1404       Mem   sMem;
1405       sMem.region = pst->region;
1406       sMem.pool = pst->pool;
1407       if ((cmAllocEvnt(sizeof(TfuUlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&ulCqiInd)) != ROK)            {
1408 #if (ERRCLASS & ERRCLS_ADD_RES)
1409          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1410             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1411             (ErrVal)ETFU047, (ErrVal)0, "Packing failed");
1412 #endif
1413          TFU_FREE_MSG(mBuf);
1414          RETVALUE(RFAILED);
1415       }
1416    }
1417
1418
1419    if (pst->selector == TFU_SEL_LC) 
1420    {
1421       if (cmUnpkTfuUlCqiIndInfo(ulCqiInd, (Ptr)&ulCqiInd->memCp, mBuf) != ROK) {
1422          TFU_FREE_MEM(ulCqiInd);
1423          TFU_FREE_MSG(mBuf);
1424 #if (ERRCLASS & ERRCLS_ADD_RES)
1425          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1426                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1427                (ErrVal)ETFU048, (ErrVal)0, "Packing failed");
1428 #endif
1429          RETVALUE(RFAILED);
1430       }
1431    }
1432    else if(pst->selector == TFU_SEL_LWLC)
1433    {
1434       if (cmUnpkPtr((PTR *)&ulCqiInd, mBuf) != ROK)
1435       {
1436 #if (ERRCLASS & ERRCLS_ADD_RES)
1437          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1438             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1439             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1440 #endif
1441          TFU_FREE_MEM(ulCqiInd);
1442          TFU_FREE_MSG(mBuf);
1443          RETVALUE(RFAILED);
1444       }
1445    }
1446    TFU_FREE_MSG(mBuf);
1447    RETVALUE((*func)(pst, suId, ulCqiInd));
1448 }
1449
1450 \f
1451 /***********************************************************
1452 *
1453 *     Func : cmPkTfuHqInd
1454 *
1455 *
1456 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1457  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1458  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1459  * sent. This feedback is utilized by MAC for further scheduling, for instance
1460  * it could schedule an adaptive retransmission of the same data. 
1461  * @param pst 
1462  * @param spId
1463  * @param tfuHqInd pointer to TfuHqIndInfo
1464  * @return
1465 *
1466 *
1467 *     Ret  : S16
1468 *
1469 *     Notes:
1470 *
1471 *     File  : 
1472 *
1473 **********************************************************/
1474 #ifdef ANSI
1475 PUBLIC S16 cmPkTfuHqInd
1476 (
1477 Pst * pst,
1478 SpId spId,
1479 TfuHqIndInfo * hqInd
1480 )
1481 #else
1482 PUBLIC S16 cmPkTfuHqInd(pst, spId, hqInd)
1483 Pst * pst;
1484 SpId spId;
1485 TfuHqIndInfo * hqInd;
1486 #endif
1487 {
1488    Buffer *mBuf = NULLP;
1489    TRC3(cmPkTfuHqInd)
1490
1491    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1492 #if (ERRCLASS & ERRCLS_ADD_RES)
1493       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1494          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1495          (ErrVal)ETFU049, (ErrVal)0, "Packing failed");
1496 #endif
1497       TFU_FREE_MEM(hqInd);
1498       RETVALUE(RFAILED);
1499    }
1500    if (pst->selector == TFU_SEL_LC) {
1501       if (cmPkTfuHqIndInfo(hqInd, mBuf) != ROK) {
1502 #if (ERRCLASS & ERRCLS_ADD_RES)
1503          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1504             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1505             (ErrVal)ETFU050, (ErrVal)0, "Packing failed");
1506 #endif
1507          TFU_FREE_MEM(hqInd);
1508          TFU_FREE_MSG(mBuf);
1509          RETVALUE(RFAILED);
1510       }
1511    }
1512    else if(pst->selector == TFU_SEL_LWLC)
1513    {
1514       if (cmPkPtr((PTR)hqInd, mBuf) != ROK)
1515       {
1516 #if (ERRCLASS & ERRCLS_ADD_RES)
1517          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1518             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1519             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1520 #endif
1521          TFU_FREE_MEM(hqInd);
1522          TFU_FREE_MSG(mBuf);
1523          RETVALUE(RFAILED);
1524       }
1525    }
1526
1527    if (SPkS16(spId, mBuf) != ROK) {
1528 #if (ERRCLASS & ERRCLS_ADD_RES)
1529       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1530          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1531          (ErrVal)ETFU051, (ErrVal)0, "Packing failed");
1532 #endif
1533       TFU_FREE_MEM(hqInd);
1534       TFU_FREE_MSG(mBuf);
1535       RETVALUE(RFAILED);
1536    }
1537    if (pst->selector != TFU_SEL_LWLC) {
1538       TFU_FREE_MEM(hqInd);
1539    }
1540
1541    pst->event = (Event) EVTTFUHQIND;
1542    RETVALUE(SPstTsk(pst,mBuf));
1543 }
1544
1545 \f
1546 /***********************************************************
1547 *
1548 *     Func : cmUnpkTfuHqInd
1549 *
1550 *
1551 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1552  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1553  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1554  * sent. This feedback is utilized by MAC for further scheduling, for instance
1555  * it could schedule an adaptive retransmission of the same data. 
1556  * @param pst 
1557  * @param spId
1558  * @param tfuHqInd pointer to TfuHqIndInfo
1559  * @return
1560 *
1561 *
1562 *     Ret  : S16
1563 *
1564 *     Notes:
1565 *
1566 *     File  : 
1567 *
1568 **********************************************************/
1569 #ifdef ANSI
1570 PUBLIC S16 cmUnpkTfuHqInd
1571 (
1572 TfuHqInd func,
1573 Pst *pst,
1574 Buffer *mBuf
1575 )
1576 #else
1577 PUBLIC S16 cmUnpkTfuHqInd(func, pst, mBuf)
1578 TfuHqInd func;
1579 Pst *pst;
1580 Buffer *mBuf;
1581 #endif
1582 {
1583    SpId spId;
1584    TfuHqIndInfo *hqInd;
1585    
1586    TRC3(cmUnpkTfuHqInd)
1587
1588    if (SUnpkS16(&spId, mBuf) != ROK) {
1589       TFU_FREE_MSG(mBuf);
1590 #if (ERRCLASS & ERRCLS_ADD_RES)
1591       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1592          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1593          (ErrVal)ETFU052, (ErrVal)0, "Packing failed");
1594 #endif
1595       RETVALUE(RFAILED);
1596    }
1597    if (pst->selector != TFU_SEL_LWLC) {
1598       Mem   sMem;
1599       sMem.region = pst->region;
1600       sMem.pool = pst->pool;
1601       if ((cmAllocEvnt(sizeof(TfuHqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&hqInd)) != ROK)            {
1602 #if (ERRCLASS & ERRCLS_ADD_RES)
1603          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1604             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1605             (ErrVal)ETFU053, (ErrVal)0, "Packing failed");
1606 #endif
1607          TFU_FREE_MSG(mBuf);
1608          RETVALUE(RFAILED);
1609       }
1610    }
1611
1612
1613    if (pst->selector == TFU_SEL_LC) 
1614    {
1615       if (cmUnpkTfuHqIndInfo(hqInd, (Ptr)&hqInd->memCp, mBuf) != ROK) {
1616          TFU_FREE_MEM(hqInd);
1617          TFU_FREE_MSG(mBuf);
1618 #if (ERRCLASS & ERRCLS_ADD_RES)
1619          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1620                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1621                (ErrVal)ETFU054, (ErrVal)0, "Packing failed");
1622 #endif
1623          RETVALUE(RFAILED);
1624       }
1625    }
1626    else if(pst->selector == TFU_SEL_LWLC)
1627    {
1628       if (cmUnpkPtr((PTR *)&hqInd, mBuf) != ROK)
1629       {
1630 #if (ERRCLASS & ERRCLS_ADD_RES)
1631          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1632             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1633             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1634 #endif
1635          TFU_FREE_MEM(hqInd);
1636          TFU_FREE_MSG(mBuf);
1637          RETVALUE(RFAILED);
1638       }
1639    }
1640    TFU_FREE_MSG(mBuf);
1641    RETVALUE((*func)(pst, spId, hqInd));
1642 }
1643
1644 \f
1645 /***********************************************************
1646 *
1647 *     Func : cmPkTfuSrInd
1648 *
1649 *
1650 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1651  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1652  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1653  * UEs received in the indicated subframe. 
1654  * @param pst 
1655  * @param spId
1656  * @param tfqSrInd pointer to TfuSrIndInfo
1657  * @return
1658 *
1659 *
1660 *     Ret  : S16
1661 *
1662 *     Notes:
1663 *
1664 *     File  : 
1665 *
1666 **********************************************************/
1667 #ifdef ANSI
1668 PUBLIC S16 cmPkTfuSrInd
1669 (
1670 Pst * pst,
1671 SpId spId,
1672 TfuSrIndInfo * srInd
1673 )
1674 #else
1675 PUBLIC S16 cmPkTfuSrInd(pst, spId, srInd)
1676 Pst * pst;
1677 SpId spId;
1678 TfuSrIndInfo * srInd;
1679 #endif
1680 {
1681    Buffer *mBuf = NULLP;
1682    TRC3(cmPkTfuSrInd)
1683
1684    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1685 #if (ERRCLASS & ERRCLS_ADD_RES)
1686       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1687          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1688          (ErrVal)ETFU055, (ErrVal)0, "Packing failed");
1689 #endif
1690       TFU_FREE_MEM(srInd);
1691       RETVALUE(RFAILED);
1692    }
1693    if (pst->selector == TFU_SEL_LC) {
1694       if (cmPkTfuSrIndInfo(srInd, mBuf) != ROK) {
1695 #if (ERRCLASS & ERRCLS_ADD_RES)
1696          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1697             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1698             (ErrVal)ETFU056, (ErrVal)0, "Packing failed");
1699 #endif
1700          TFU_FREE_MEM(srInd);
1701          TFU_FREE_MSG(mBuf);
1702          RETVALUE(RFAILED);
1703       }
1704    }
1705    else if(pst->selector == TFU_SEL_LWLC)
1706    {
1707       if (cmPkPtr((PTR)srInd, mBuf) != ROK)
1708       {
1709 #if (ERRCLASS & ERRCLS_ADD_RES)
1710          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1711             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1712             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1713 #endif
1714          TFU_FREE_MEM(srInd);
1715          TFU_FREE_MSG(mBuf);
1716          RETVALUE(RFAILED);
1717       }
1718    }
1719
1720    if (SPkS16(spId, mBuf) != ROK) {
1721 #if (ERRCLASS & ERRCLS_ADD_RES)
1722       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1723          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1724          (ErrVal)ETFU057, (ErrVal)0, "Packing failed");
1725 #endif
1726       TFU_FREE_MEM(srInd);
1727       TFU_FREE_MSG(mBuf);
1728       RETVALUE(RFAILED);
1729    }
1730    if (pst->selector != TFU_SEL_LWLC) {
1731       TFU_FREE_MEM(srInd);
1732    }
1733
1734    pst->event = (Event) EVTTFUSRIND;
1735    RETVALUE(SPstTsk(pst,mBuf));
1736 }
1737
1738 \f
1739 /***********************************************************
1740 *
1741 *     Func : cmUnpkTfuSrInd
1742 *
1743 *
1744 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1745  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1746  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1747  * UEs received in the indicated subframe. 
1748  * @param pst 
1749  * @param spId
1750  * @param tfqSrInd pointer to TfuSrIndInfo
1751  * @return
1752 *
1753 *
1754 *     Ret  : S16
1755 *
1756 *     Notes:
1757 *
1758 *     File  : 
1759 *
1760 **********************************************************/
1761 #ifdef ANSI
1762 PUBLIC S16 cmUnpkTfuSrInd
1763 (
1764 TfuSrInd func,
1765 Pst *pst,
1766 Buffer *mBuf
1767 )
1768 #else
1769 PUBLIC S16 cmUnpkTfuSrInd(func, pst, mBuf)
1770 TfuSrInd func;
1771 Pst *pst;
1772 Buffer *mBuf;
1773 #endif
1774 {
1775    SpId spId;
1776    TfuSrIndInfo *srInd;
1777    
1778    TRC3(cmUnpkTfuSrInd)
1779
1780    if (SUnpkS16(&spId, mBuf) != ROK) {
1781       TFU_FREE_MSG(mBuf);
1782 #if (ERRCLASS & ERRCLS_ADD_RES)
1783       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1784          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1785          (ErrVal)ETFU058, (ErrVal)0, "Packing failed");
1786 #endif
1787       RETVALUE(RFAILED);
1788    }
1789    if (pst->selector != TFU_SEL_LWLC) {
1790       Mem   sMem;
1791       sMem.region = pst->region;
1792       sMem.pool = pst->pool;
1793       if ((cmAllocEvnt(sizeof(TfuSrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srInd)) != ROK)            {
1794 #if (ERRCLASS & ERRCLS_ADD_RES)
1795          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1796             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1797             (ErrVal)ETFU059, (ErrVal)0, "Packing failed");
1798 #endif
1799          TFU_FREE_MSG(mBuf);
1800          RETVALUE(RFAILED);
1801       }
1802    }
1803
1804
1805    if (pst->selector == TFU_SEL_LC) 
1806    {
1807       if (cmUnpkTfuSrIndInfo(srInd, (Ptr)&srInd->memCp, mBuf) != ROK) {
1808          TFU_FREE_MEM(srInd);
1809          TFU_FREE_MSG(mBuf);
1810 #if (ERRCLASS & ERRCLS_ADD_RES)
1811          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1812                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1813                (ErrVal)ETFU060, (ErrVal)0, "Packing failed");
1814 #endif
1815          RETVALUE(RFAILED);
1816       }
1817    }
1818    else if(pst->selector == TFU_SEL_LWLC)
1819    {
1820       if (cmUnpkPtr((PTR *)&srInd, mBuf) != ROK)
1821       {
1822 #if (ERRCLASS & ERRCLS_ADD_RES)
1823          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1824             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1825             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1826 #endif
1827          TFU_FREE_MEM(srInd);
1828          TFU_FREE_MSG(mBuf);
1829          RETVALUE(RFAILED);
1830       }
1831    }
1832    TFU_FREE_MSG(mBuf);
1833    RETVALUE((*func)(pst, spId, srInd));
1834 }
1835
1836 \f
1837 /***********************************************************
1838 *
1839 *     Func : cmPkTfuDlCqiInd
1840 *
1841 *
1842 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1843  * Scheduler, also carries the RI.
1844  * @param pst Pointer to the post structure.
1845  * @param suId SAP ID of the service user.
1846  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1847  * @return ROK/RFAILED
1848 *
1849 *
1850 *     Ret  : S16
1851 *
1852 *     Notes:
1853 *
1854 *     File  : 
1855 *
1856 **********************************************************/
1857 #ifdef ANSI
1858 PUBLIC S16 cmPkTfuDlCqiInd
1859 (
1860 Pst * pst,
1861 SuId suId,
1862 TfuDlCqiIndInfo * dlCqiInd
1863 )
1864 #else
1865 PUBLIC S16 cmPkTfuDlCqiInd(pst, suId, dlCqiInd)
1866 Pst * pst;
1867 SuId suId;
1868 TfuDlCqiIndInfo * dlCqiInd;
1869 #endif
1870 {
1871    Buffer *mBuf = NULLP;
1872    TRC3(cmPkTfuDlCqiInd)
1873
1874    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1875 #if (ERRCLASS & ERRCLS_ADD_RES)
1876       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1877          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1878          (ErrVal)ETFU061, (ErrVal)0, "Packing failed");
1879 #endif
1880       TFU_FREE_MEM(dlCqiInd);
1881       RETVALUE(RFAILED);
1882    }
1883    if (pst->selector == TFU_SEL_LC) {
1884       if (cmPkTfuDlCqiIndInfo(dlCqiInd, mBuf) != ROK) {
1885 #if (ERRCLASS & ERRCLS_ADD_RES)
1886          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1887             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1888             (ErrVal)ETFU062, (ErrVal)0, "Packing failed");
1889 #endif
1890          TFU_FREE_MEM(dlCqiInd);
1891          TFU_FREE_MSG(mBuf);
1892          RETVALUE(RFAILED);
1893       }
1894    }
1895    else if(pst->selector == TFU_SEL_LWLC)
1896    {
1897       if (cmPkPtr((PTR)dlCqiInd, mBuf) != ROK)
1898       {
1899 #if (ERRCLASS & ERRCLS_ADD_RES)
1900          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1901             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1902             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1903 #endif
1904          TFU_FREE_MEM(dlCqiInd);
1905          TFU_FREE_MSG(mBuf);
1906          RETVALUE(RFAILED);
1907       }
1908    }
1909
1910    if (SPkS16(suId, mBuf) != ROK) {
1911 #if (ERRCLASS & ERRCLS_ADD_RES)
1912       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1913          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1914          (ErrVal)ETFU063, (ErrVal)0, "Packing failed");
1915 #endif
1916       TFU_FREE_MEM(dlCqiInd);
1917       TFU_FREE_MSG(mBuf);
1918       RETVALUE(RFAILED);
1919    }
1920    if (pst->selector != TFU_SEL_LWLC) {
1921       TFU_FREE_MEM(dlCqiInd);
1922    }
1923    pst->event = (Event) EVTTFUDLCQIIND;
1924    RETVALUE(SPstTsk(pst,mBuf));
1925 }
1926
1927 \f
1928 /***********************************************************
1929 *
1930 *     Func : cmUnpkTfuDlCqiInd
1931 *
1932 *
1933 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1934  * Scheduler, also carries the RI.
1935  * @param pst Pointer to the post structure.
1936  * @param suId SAP ID of the service user.
1937  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1938  * @return ROK/RFAILED
1939 *
1940 *
1941 *     Ret  : S16
1942 *
1943 *     Notes:
1944 *
1945 *     File  : 
1946 *
1947 **********************************************************/
1948 #ifdef ANSI
1949 PUBLIC S16 cmUnpkTfuDlCqiInd
1950 (
1951 TfuDlCqiInd func,
1952 Pst *pst,
1953 Buffer *mBuf
1954 )
1955 #else
1956 PUBLIC S16 cmUnpkTfuDlCqiInd(func, pst, mBuf)
1957 TfuDlCqiInd func;
1958 Pst *pst;
1959 Buffer *mBuf;
1960 #endif
1961 {
1962    SuId suId;
1963    TfuDlCqiIndInfo *dlCqiInd;
1964    
1965    TRC3(cmUnpkTfuDlCqiInd)
1966
1967    if (SUnpkS16(&suId, mBuf) != ROK) {
1968       TFU_FREE_MSG(mBuf);
1969 #if (ERRCLASS & ERRCLS_ADD_RES)
1970       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1971          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1972          (ErrVal)ETFU064, (ErrVal)0, "Packing failed");
1973 #endif
1974       RETVALUE(RFAILED);
1975    }
1976    if (pst->selector != TFU_SEL_LWLC) {
1977       Mem   sMem;
1978       sMem.region = pst->region;
1979       sMem.pool = pst->pool;
1980       if ((cmAllocEvnt(sizeof(TfuDlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&dlCqiInd)) != ROK)            {
1981 #if (ERRCLASS & ERRCLS_ADD_RES)
1982          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1983             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1984             (ErrVal)ETFU065, (ErrVal)0, "Packing failed");
1985 #endif
1986          TFU_FREE_MSG(mBuf);
1987          RETVALUE(RFAILED);
1988       }
1989    }
1990
1991
1992    if (pst->selector == TFU_SEL_LC) 
1993    {
1994       if (cmUnpkTfuDlCqiIndInfo(dlCqiInd, (Ptr)&dlCqiInd->memCp, mBuf) != ROK) {
1995          TFU_FREE_MEM(dlCqiInd);
1996          TFU_FREE_MSG(mBuf);
1997 #if (ERRCLASS & ERRCLS_ADD_RES)
1998          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1999                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2000                (ErrVal)ETFU066, (ErrVal)0, "Packing failed");
2001 #endif
2002          RETVALUE(RFAILED);
2003       }
2004    }
2005    else if(pst->selector == TFU_SEL_LWLC)
2006    {
2007       if (cmUnpkPtr((PTR *)&dlCqiInd, mBuf) != ROK)
2008       {
2009 #if (ERRCLASS & ERRCLS_ADD_RES)
2010          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2011             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2012             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2013 #endif
2014          TFU_FREE_MEM(dlCqiInd);
2015          TFU_FREE_MSG(mBuf);
2016          RETVALUE(RFAILED);
2017       }
2018    }
2019    TFU_FREE_MSG(mBuf);
2020    RETVALUE((*func)(pst, suId, dlCqiInd));
2021 }
2022
2023
2024 #ifdef TFU_UPGRADE
2025
2026 \f
2027 /***********************************************************
2028 *
2029 *     Func : cmPkTfuRawCqiInd
2030 *
2031 *
2032 *     Desc : This Primitive is used to convey the Raw CQI information 
2033  * transmitted by the UE.
2034  * @details Raw CQI report is the actual bits transmitted by the UE when
2035  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2036  * etc. shall be done by MAC.
2037  * 
2038  * @param pst Pointer to the post structure.
2039  * @param suId SAP ID of the service user.
2040  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2041  * @return ROK/RFAILED
2042 *
2043 *
2044 *     Ret  : S16
2045 *
2046 *     Notes:
2047 *
2048 *     File  : 
2049 *
2050 **********************************************************/
2051 #ifdef ANSI
2052 PUBLIC S16 cmPkTfuRawCqiInd
2053 (
2054 Pst * pst,
2055 SuId suId,
2056 TfuRawCqiIndInfo * rawCqiInd
2057 )
2058 #else
2059 PUBLIC S16 cmPkTfuRawCqiInd(pst, suId, rawCqiInd)
2060 Pst * pst;
2061 SuId suId;
2062 TfuRawCqiIndInfo * rawCqiInd;
2063 #endif
2064 {
2065    Buffer *mBuf = NULLP;
2066    TRC3(cmPkTfuRawCqiInd)
2067
2068    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2069 #if (ERRCLASS & ERRCLS_ADD_RES)
2070       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2071          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2072          (ErrVal)ETFU067, (ErrVal)0, "Packing failed");
2073 #endif
2074       TFU_FREE_MEM(rawCqiInd);
2075       RETVALUE(RFAILED);
2076    }
2077       cmPkTfuRawCqiIndInfo(rawCqiInd, mBuf);
2078    if (SPkS16(suId, mBuf) != ROK) {
2079 #if (ERRCLASS & ERRCLS_ADD_RES)
2080       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2081          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2082          (ErrVal)ETFU068, (ErrVal)0, "Packing failed");
2083 #endif
2084       TFU_FREE_MEM(rawCqiInd);
2085       TFU_FREE_MSG(mBuf);
2086       RETVALUE(RFAILED);
2087    }
2088    TFU_FREE_MEM(rawCqiInd);
2089    pst->event = (Event) EVTTFURAWCQIIND;
2090    RETVALUE(SPstTsk(pst,mBuf));
2091 }
2092
2093 \f
2094 /***********************************************************
2095 *
2096 *     Func : cmUnpkTfuRawCqiInd
2097 *
2098 *
2099 *     Desc : This Primitive is used to convey the Raw CQI information 
2100  * transmitted by the UE.
2101  * @details Raw CQI report is the actual bits transmitted by the UE when
2102  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2103  * etc. shall be done by MAC.
2104  * 
2105  * @param pst Pointer to the post structure.
2106  * @param suId SAP ID of the service user.
2107  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2108  * @return ROK/RFAILED
2109 *
2110 *
2111 *     Ret  : S16
2112 *
2113 *     Notes:
2114 *
2115 *     File  : 
2116 *
2117 **********************************************************/
2118 #ifdef ANSI
2119 PUBLIC S16 cmUnpkTfuRawCqiInd
2120 (
2121 TfuRawCqiInd func,
2122 Pst *pst,
2123 Buffer *mBuf
2124 )
2125 #else
2126 PUBLIC S16 cmUnpkTfuRawCqiInd(func, pst, mBuf)
2127 TfuRawCqiInd func;
2128 Pst *pst;
2129 Buffer *mBuf;
2130 #endif
2131 {
2132    SuId suId;
2133    TfuRawCqiIndInfo *rawCqiInd;
2134    
2135    TRC3(cmUnpkTfuRawCqiInd)
2136
2137    if (SUnpkS16(&suId, mBuf) != ROK) {
2138       TFU_FREE_MSG(mBuf);
2139 #if (ERRCLASS & ERRCLS_ADD_RES)
2140       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2141          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2142          (ErrVal)ETFU069, (ErrVal)0, "Packing failed");
2143 #endif
2144       RETVALUE(RFAILED);
2145    }
2146    {
2147       Mem   sMem;
2148       sMem.region = pst->region;
2149       sMem.pool = pst->pool;
2150       if ((cmAllocEvnt(sizeof(TfuRawCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&rawCqiInd)) != ROK)            {
2151 #if (ERRCLASS & ERRCLS_ADD_RES)
2152          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2153             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2154             (ErrVal)ETFU070, (ErrVal)0, "Packing failed");
2155 #endif
2156          TFU_FREE_MSG(mBuf);
2157          RETVALUE(RFAILED);
2158       }
2159    }
2160       cmUnpkTfuRawCqiIndInfo(rawCqiInd, (Ptr)&rawCqiInd->memCp, mBuf);
2161    TFU_FREE_MSG(mBuf);
2162    RETVALUE((*func)(pst, suId, rawCqiInd));
2163 }
2164
2165 \f
2166 /***********************************************************
2167 *
2168 *     Func : cmPkTfuSrsInd
2169 *
2170 *
2171 *     Desc : This Primitive is used to convey the information derived by the
2172  * physical layer from the SRS transmission from the UE.
2173  * @details This primitive carries information derived from the SRS transmission
2174  * from the UE. 
2175  * 
2176  * @param pst Pointer to the post structure.
2177  * @param suId SAP ID of the service user.
2178  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2179  * @return ROK/RFAILED
2180 *
2181 *
2182 *     Ret  : S16
2183 *
2184 *     Notes:
2185 *
2186 *     File  : 
2187 *
2188 **********************************************************/
2189 #ifdef ANSI
2190 PUBLIC S16 cmPkTfuSrsInd
2191 (
2192 Pst * pst,
2193 SuId suId,
2194 TfuSrsIndInfo * srsInd
2195 )
2196 #else
2197 PUBLIC S16 cmPkTfuSrsInd(pst, suId, srsInd)
2198 Pst * pst;
2199 SuId suId;
2200 TfuSrsIndInfo * srsInd;
2201 #endif
2202 {
2203    Buffer *mBuf = NULLP;
2204    TRC3(cmPkTfuSrsInd)
2205
2206    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2207 #if (ERRCLASS & ERRCLS_ADD_RES)
2208       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2209          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2210          (ErrVal)ETFU071, (ErrVal)0, "Packing failed");
2211 #endif
2212       TFU_FREE_MEM(srsInd);
2213       RETVALUE(RFAILED);
2214    }
2215       cmPkTfuSrsIndInfo(srsInd, mBuf);
2216    if (SPkS16(suId, mBuf) != ROK) {
2217 #if (ERRCLASS & ERRCLS_ADD_RES)
2218       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2219          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2220          (ErrVal)ETFU072, (ErrVal)0, "Packing failed");
2221 #endif
2222       TFU_FREE_MEM(srsInd);
2223       TFU_FREE_MSG(mBuf);
2224       RETVALUE(RFAILED);
2225    }
2226    TFU_FREE_MEM(srsInd);
2227    pst->event = (Event) EVTTFUSRSIND;
2228    RETVALUE(SPstTsk(pst,mBuf));
2229 }
2230
2231 \f
2232 /***********************************************************
2233 *
2234 *     Func : cmUnpkTfuSrsInd
2235 *
2236 *
2237 *     Desc : This Primitive is used to convey the information derived by the
2238  * physical layer from the SRS transmission from the UE.
2239  * @details This primitive carries information derived from the SRS transmission
2240  * from the UE. 
2241  * 
2242  * @param pst Pointer to the post structure.
2243  * @param suId SAP ID of the service user.
2244  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2245  * @return ROK/RFAILED
2246 *
2247 *
2248 *     Ret  : S16
2249 *
2250 *     Notes:
2251 *
2252 *     File  : 
2253 *
2254 **********************************************************/
2255 #ifdef ANSI
2256 PUBLIC S16 cmUnpkTfuSrsInd
2257 (
2258 TfuSrsInd func,
2259 Pst *pst,
2260 Buffer *mBuf
2261 )
2262 #else
2263 PUBLIC S16 cmUnpkTfuSrsInd(func, pst, mBuf)
2264 TfuSrsInd func;
2265 Pst *pst;
2266 Buffer *mBuf;
2267 #endif
2268 {
2269    SuId suId;
2270    TfuSrsIndInfo *srsInd;
2271    
2272    TRC3(cmUnpkTfuSrsInd)
2273
2274    if (SUnpkS16(&suId, mBuf) != ROK) {
2275       TFU_FREE_MSG(mBuf);
2276 #if (ERRCLASS & ERRCLS_ADD_RES)
2277       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2278          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2279          (ErrVal)ETFU073, (ErrVal)0, "Packing failed");
2280 #endif
2281       RETVALUE(RFAILED);
2282    }
2283    {
2284       Mem   sMem;
2285       sMem.region = pst->region;
2286       sMem.pool = pst->pool;
2287       if ((cmAllocEvnt(sizeof(TfuSrsIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srsInd)) != ROK)            {
2288 #if (ERRCLASS & ERRCLS_ADD_RES)
2289          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2290             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2291             (ErrVal)ETFU074, (ErrVal)0, "Packing failed");
2292 #endif
2293          TFU_FREE_MSG(mBuf);
2294          RETVALUE(RFAILED);
2295       }
2296    }
2297       cmUnpkTfuSrsIndInfo(srsInd, (Ptr)&srsInd->memCp, mBuf);
2298    TFU_FREE_MSG(mBuf);
2299    RETVALUE((*func)(pst, suId, srsInd));
2300 }
2301 #endif
2302
2303
2304 \f
2305 /***********************************************************
2306 *
2307 *     Func : cmPkTfuDatInd
2308 *
2309 *
2310 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2311  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2312  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2313  * is relayed to MAC using this primitive. 
2314  * @param pst 
2315  * @param spId
2316  * @param tfuDatInd pointer to TfuDatIndInfo
2317  * @return
2318 *
2319 *
2320 *     Ret  : S16
2321 *
2322 *     Notes:
2323 *
2324 *     File  : 
2325 *
2326 **********************************************************/
2327 #ifdef ANSI
2328 PUBLIC S16 cmPkTfuDatInd
2329 (
2330 Pst * pst,
2331 SpId spId,
2332 TfuDatIndInfo * datInd
2333 )
2334 #else
2335 PUBLIC S16 cmPkTfuDatInd(pst, spId, datInd)
2336 Pst * pst;
2337 SpId spId;
2338 TfuDatIndInfo * datInd;
2339 #endif
2340 {
2341    Buffer *mBuf = NULLP;
2342    TRC3(cmPkTfuDatInd)
2343
2344    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2345 #if (ERRCLASS & ERRCLS_ADD_RES)
2346       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2347          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2348          (ErrVal)ETFU075, (ErrVal)0, "Packing failed");
2349 #endif
2350       TFU_FREE_MEM(datInd);
2351       RETVALUE(RFAILED);
2352    }
2353    if (pst->selector == TFU_SEL_LC) {
2354       if (cmPkTfuDatIndInfo(datInd, mBuf) != ROK) {
2355 #if (ERRCLASS & ERRCLS_ADD_RES)
2356          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2357             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2358             (ErrVal)ETFU076, (ErrVal)0, "Packing failed");
2359 #endif
2360          TFU_FREE_MEM(datInd);
2361          TFU_FREE_MSG(mBuf);
2362          RETVALUE(RFAILED);
2363       }
2364    }
2365    else if(pst->selector == TFU_SEL_LWLC)
2366    {
2367       if(cmPkPtr((PTR)datInd, mBuf) != ROK)
2368       {
2369 #if (ERRCLASS & ERRCLS_ADD_RES)
2370          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2371                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2372                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2373 #endif
2374          TFU_FREE_MEM(datInd);
2375          TFU_FREE_MSG(mBuf);
2376          RETVALUE(RFAILED);
2377       }
2378    }
2379
2380    if (SPkS16(spId, mBuf) != ROK) {
2381 #if (ERRCLASS & ERRCLS_ADD_RES)
2382       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2383          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2384          (ErrVal)ETFU077, (ErrVal)0, "Packing failed");
2385 #endif
2386       TFU_FREE_MEM(datInd);
2387       TFU_FREE_MSG(mBuf);
2388       RETVALUE(RFAILED);
2389    }
2390    if (pst->selector != TFU_SEL_LWLC) {
2391       TFU_FREE_MEM(datInd);
2392    }
2393
2394    pst->event = (Event) EVTTFUDATIND;
2395    RETVALUE(SPstTsk(pst,mBuf));
2396 }
2397
2398 \f
2399 /***********************************************************
2400 *
2401 *     Func : cmUnpkTfuDatInd
2402 *
2403 *
2404 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2405  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2406  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2407  * is relayed to MAC using this primitive. 
2408  * @param pst 
2409  * @param spId
2410  * @param tfuDatInd pointer to TfuDatIndInfo
2411  * @return
2412 *
2413 *
2414 *     Ret  : S16
2415 *
2416 *     Notes:
2417 *
2418 *     File  : 
2419 *
2420 **********************************************************/
2421 #ifdef ANSI
2422 PUBLIC S16 cmUnpkTfuDatInd
2423 (
2424 TfuDatInd func,
2425 Pst *pst,
2426 Buffer *mBuf
2427 )
2428 #else
2429 PUBLIC S16 cmUnpkTfuDatInd(func, pst, mBuf)
2430 TfuDatInd func;
2431 Pst *pst;
2432 Buffer *mBuf;
2433 #endif
2434 {
2435    SpId spId;
2436    TfuDatIndInfo *datInd;
2437    
2438    TRC3(cmUnpkTfuDatInd)
2439
2440    if (SUnpkS16(&spId, mBuf) != ROK) {
2441       TFU_FREE_MSG(mBuf);
2442 #if (ERRCLASS & ERRCLS_ADD_RES)
2443       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2444          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2445          (ErrVal)ETFU078, (ErrVal)0, "Packing failed");
2446 #endif
2447       RETVALUE(RFAILED);
2448    }
2449    if (pst->selector != TFU_SEL_LWLC) {
2450       Mem   sMem;
2451       sMem.region = pst->region;
2452       sMem.pool = pst->pool;
2453       if ((cmAllocEvnt(sizeof(TfuDatIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&datInd)) != ROK)            {
2454 #if (ERRCLASS & ERRCLS_ADD_RES)
2455          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2456             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2457             (ErrVal)ETFU079, (ErrVal)0, "Packing failed");
2458 #endif
2459          TFU_FREE_MSG(mBuf);
2460          RETVALUE(RFAILED);
2461       }
2462    }
2463
2464
2465    if (pst->selector == TFU_SEL_LC) 
2466    {
2467       if (cmUnpkTfuDatIndInfo(datInd, (Ptr)&datInd->memCp, mBuf) != ROK) {
2468          TFU_FREE_MEM(datInd);
2469          TFU_FREE_MSG(mBuf);
2470 #if (ERRCLASS & ERRCLS_ADD_RES)
2471          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2472                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2473                (ErrVal)ETFU080, (ErrVal)0, "Packing failed");
2474 #endif
2475          RETVALUE(RFAILED);
2476       }
2477    }
2478    else if(pst->selector == TFU_SEL_LWLC)
2479    {
2480       if(cmUnpkPtr((PTR *)&datInd, mBuf) != ROK)
2481       {
2482 #if (ERRCLASS & ERRCLS_ADD_RES)
2483          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2484                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2485                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2486 #endif
2487          TFU_FREE_MEM(datInd);
2488          TFU_FREE_MSG(mBuf);
2489          RETVALUE(RFAILED);
2490       }
2491    }
2492    TFU_FREE_MSG(mBuf);
2493    RETVALUE((*func)(pst, spId, datInd));
2494 }
2495
2496 \f
2497 /***********************************************************
2498 *
2499 *     Func : cmPkTfuCrcInd
2500 *
2501 *
2502 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2503  * on the PUSCH Data was successful or not.
2504  * @details This primitive carries CRC indication for a list of UEs. This
2505  * is utilized in the scenario where MAC requested the reception of uplink data
2506  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2507  * failed. This CRC failure is indicated to MAC, which would utillize this
2508  * information for further scheduling. 
2509  * Physical layer would indicate failure or success for each PUSCH transmission.
2510  * @param pst Pointer to the post structure.
2511  * @param suId SAP ID of the service user.
2512  * @param crcInd Pointer to the TfuCrcIndInfo.
2513  * @return ROK/RFAILED
2514 *
2515 *
2516 *     Ret  : S16
2517 *
2518 *     Notes:
2519 *
2520 *     File  : 
2521 *
2522 **********************************************************/
2523 #ifdef ANSI
2524 PUBLIC S16 cmPkTfuCrcInd
2525 (
2526 Pst * pst,
2527 SuId suId,
2528 TfuCrcIndInfo * crcIndInfo
2529 )
2530 #else
2531 PUBLIC S16 cmPkTfuCrcInd(pst, suId, crcIndInfo)
2532 Pst * pst;
2533 SuId suId;
2534 TfuCrcIndInfo * crcIndInfo;
2535 #endif
2536 {
2537    Buffer *mBuf = NULLP;
2538    TRC3(cmPkTfuCrcInd)
2539
2540    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2541 #if (ERRCLASS & ERRCLS_ADD_RES)
2542       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2543          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2544          (ErrVal)ETFU081, (ErrVal)0, "Packing failed");
2545 #endif
2546       TFU_FREE_MEM(crcIndInfo);
2547       RETVALUE(RFAILED);
2548    }
2549    if (pst->selector == TFU_SEL_LC) {
2550       if (cmPkTfuCrcIndInfo(crcIndInfo, mBuf) != ROK) {
2551 #if (ERRCLASS & ERRCLS_ADD_RES)
2552          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2553             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2554             (ErrVal)ETFU082, (ErrVal)0, "Packing failed");
2555 #endif
2556          TFU_FREE_MEM(crcIndInfo);
2557          TFU_FREE_MSG(mBuf);
2558          RETVALUE(RFAILED);
2559       }
2560    }
2561    else if(pst->selector == TFU_SEL_LWLC)
2562    {
2563       if (cmPkPtr((PTR)crcIndInfo, mBuf) != ROK)
2564       {
2565 #if (ERRCLASS & ERRCLS_ADD_RES)
2566          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2567             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2568             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2569 #endif
2570          TFU_FREE_MEM(crcIndInfo);
2571          TFU_FREE_MSG(mBuf);
2572          RETVALUE(RFAILED);
2573       }
2574    }
2575
2576
2577    if (SPkS16(suId, mBuf) != ROK) {
2578 #if (ERRCLASS & ERRCLS_ADD_RES)
2579       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2580          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2581          (ErrVal)ETFU083, (ErrVal)0, "Packing failed");
2582 #endif
2583       TFU_FREE_MEM(crcIndInfo);
2584       TFU_FREE_MSG(mBuf);
2585       RETVALUE(RFAILED);
2586    }
2587    if (pst->selector != TFU_SEL_LWLC) {
2588       TFU_FREE_MEM(crcIndInfo);
2589    }
2590
2591    pst->event = (Event) EVTTFUCRCIND;
2592    RETVALUE(SPstTsk(pst,mBuf));
2593 }
2594
2595 \f
2596 /***********************************************************
2597 *
2598 *     Func : cmUnpkTfuCrcInd
2599 *
2600 *
2601 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2602  * on the PUSCH Data was successful or not.
2603  * @details This primitive carries CRC indication for a list of UEs. This
2604  * is utilized in the scenario where MAC requested the reception of uplink data
2605  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2606  * failed. This CRC failure is indicated to MAC, which would utillize this
2607  * information for further scheduling. 
2608  * Physical layer would indicate failure or success for each PUSCH transmission.
2609  * @param pst Pointer to the post structure.
2610  * @param suId SAP ID of the service user.
2611  * @param crcInd Pointer to the TfuCrcIndInfo.
2612  * @return ROK/RFAILED
2613 *
2614 *
2615 *     Ret  : S16
2616 *
2617 *     Notes:
2618 *
2619 *     File  : 
2620 *
2621 **********************************************************/
2622 #ifdef ANSI
2623 PUBLIC S16 cmUnpkTfuCrcInd
2624 (
2625 TfuCrcInd func,
2626 Pst *pst,
2627 Buffer *mBuf
2628 )
2629 #else
2630 PUBLIC S16 cmUnpkTfuCrcInd(func, pst, mBuf)
2631 TfuCrcInd func;
2632 Pst *pst;
2633 Buffer *mBuf;
2634 #endif
2635 {
2636    SuId suId;
2637    TfuCrcIndInfo *crcIndInfo;
2638    
2639    TRC3(cmUnpkTfuCrcInd)
2640
2641    if (SUnpkS16(&suId, mBuf) != ROK) {
2642       TFU_FREE_MSG(mBuf);
2643 #if (ERRCLASS & ERRCLS_ADD_RES)
2644       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2645          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2646          (ErrVal)ETFU084, (ErrVal)0, "Packing failed");
2647 #endif
2648       RETVALUE(RFAILED);
2649    }
2650    if (pst->selector != TFU_SEL_LWLC) {
2651       Mem   sMem;
2652       sMem.region = pst->region;
2653       sMem.pool = pst->pool;
2654       if ((cmAllocEvnt(sizeof(TfuCrcIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&crcIndInfo)) != ROK)            {
2655 #if (ERRCLASS & ERRCLS_ADD_RES)
2656          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2657             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2658             (ErrVal)ETFU085, (ErrVal)0, "Packing failed");
2659 #endif
2660          TFU_FREE_MSG(mBuf);
2661          RETVALUE(RFAILED);
2662       }
2663    }
2664
2665
2666    if (pst->selector == TFU_SEL_LC) 
2667    {
2668       if (cmUnpkTfuCrcIndInfo(crcIndInfo, (Ptr)&crcIndInfo->memCp, mBuf) != ROK) {
2669          TFU_FREE_MEM(crcIndInfo);
2670          TFU_FREE_MSG(mBuf);
2671 #if (ERRCLASS & ERRCLS_ADD_RES)
2672          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2673                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2674                (ErrVal)ETFU086, (ErrVal)0, "Packing failed");
2675 #endif
2676          RETVALUE(RFAILED);
2677       }
2678    }
2679    else if(pst->selector == TFU_SEL_LWLC)
2680    {
2681       if (cmUnpkPtr((PTR *)&crcIndInfo, mBuf) != ROK)
2682       {
2683 #if (ERRCLASS & ERRCLS_ADD_RES)
2684          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2685             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2686             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2687 #endif
2688          TFU_FREE_MEM(crcIndInfo);
2689          TFU_FREE_MSG(mBuf);
2690          RETVALUE(RFAILED);
2691       }
2692    }
2693    TFU_FREE_MSG(mBuf);
2694    RETVALUE((*func)(pst, suId, crcIndInfo));
2695 }
2696
2697 \f
2698 /***********************************************************
2699 *
2700 *     Func : cmPkTfuTimingAdvInd
2701 *
2702 *
2703 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2704  * @details This primitive carries timing advance information for a number of
2705  * UEs that may need timing advance. Timing advance information is an estimate
2706  * of the timing adjustment that a UE would need to apply in order to be
2707  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2708  * @param pst Pointer to the post structure.
2709  * @param suId SAP ID of the service user.
2710  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2711  * @return ROK/RFAILED
2712 *
2713 *
2714 *     Ret  : S16
2715 *
2716 *     Notes:
2717 *
2718 *     File  : 
2719 *
2720 **********************************************************/
2721 #ifdef ANSI
2722 PUBLIC S16 cmPkTfuTimingAdvInd
2723 (
2724 Pst * pst,
2725 SuId suId,
2726 TfuTimingAdvIndInfo * timingAdvInd
2727 )
2728 #else
2729 PUBLIC S16 cmPkTfuTimingAdvInd(pst, suId, timingAdvInd)
2730 Pst * pst;
2731 SuId suId;
2732 TfuTimingAdvIndInfo * timingAdvInd;
2733 #endif
2734 {
2735    Buffer *mBuf = NULLP;
2736    TRC3(cmPkTfuTimingAdvInd)
2737
2738    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2739 #if (ERRCLASS & ERRCLS_ADD_RES)
2740       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2741          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2742          (ErrVal)ETFU087, (ErrVal)0, "Packing failed");
2743 #endif
2744       TFU_FREE_MEM(timingAdvInd);
2745       RETVALUE(RFAILED);
2746    }
2747    if (pst->selector == TFU_SEL_LC) {
2748       if (cmPkTfuTimingAdvIndInfo(timingAdvInd, mBuf) != ROK) {
2749 #if (ERRCLASS & ERRCLS_ADD_RES)
2750          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2751             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2752             (ErrVal)ETFU088, (ErrVal)0, "Packing failed");
2753 #endif
2754          TFU_FREE_MEM(timingAdvInd);
2755          TFU_FREE_MSG(mBuf);
2756          RETVALUE(RFAILED);
2757       }
2758    }
2759    else if(pst->selector == TFU_SEL_LWLC)
2760    {
2761       if (cmPkPtr((PTR)timingAdvInd, mBuf) != ROK)
2762       {
2763 #if (ERRCLASS & ERRCLS_ADD_RES)
2764          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2765             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2766             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2767 #endif
2768          TFU_FREE_MEM(timingAdvInd);
2769          TFU_FREE_MSG(mBuf);
2770          RETVALUE(RFAILED);
2771       }
2772    }
2773
2774    if (SPkS16(suId, mBuf) != ROK) {
2775 #if (ERRCLASS & ERRCLS_ADD_RES)
2776       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2777          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2778          (ErrVal)ETFU089, (ErrVal)0, "Packing failed");
2779 #endif
2780       TFU_FREE_MEM(timingAdvInd);
2781       TFU_FREE_MSG(mBuf);
2782       RETVALUE(RFAILED);
2783    }
2784    if (pst->selector != TFU_SEL_LWLC) {
2785       TFU_FREE_MEM(timingAdvInd);
2786    }
2787
2788    pst->event = (Event) EVTTFUTIMINGADVIND;
2789    RETVALUE(SPstTsk(pst,mBuf));
2790 }
2791
2792 \f
2793 /***********************************************************
2794 *
2795 *     Func : cmUnpkTfuTimingAdvInd
2796 *
2797 *
2798 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2799  * @details This primitive carries timing advance information for a number of
2800  * UEs that may need timing advance. Timing advance information is an estimate
2801  * of the timing adjustment that a UE would need to apply in order to be
2802  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2803  * @param pst Pointer to the post structure.
2804  * @param suId SAP ID of the service user.
2805  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2806  * @return ROK/RFAILED
2807 *
2808 *
2809 *     Ret  : S16
2810 *
2811 *     Notes:
2812 *
2813 *     File  : 
2814 *
2815 **********************************************************/
2816 #ifdef ANSI
2817 PUBLIC S16 cmUnpkTfuTimingAdvInd
2818 (
2819 TfuTimingAdvInd func,
2820 Pst *pst,
2821 Buffer *mBuf
2822 )
2823 #else
2824 PUBLIC S16 cmUnpkTfuTimingAdvInd(func, pst, mBuf)
2825 TfuTimingAdvInd func;
2826 Pst *pst;
2827 Buffer *mBuf;
2828 #endif
2829 {
2830    SuId suId;
2831    TfuTimingAdvIndInfo *timingAdvInd;
2832    
2833    TRC3(cmUnpkTfuTimingAdvInd)
2834
2835    if (SUnpkS16(&suId, mBuf) != ROK) {
2836       TFU_FREE_MSG(mBuf);
2837 #if (ERRCLASS & ERRCLS_ADD_RES)
2838       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2839          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2840          (ErrVal)ETFU090, (ErrVal)0, "Packing failed");
2841 #endif
2842       RETVALUE(RFAILED);
2843    }
2844    if (pst->selector != TFU_SEL_LWLC) {
2845       Mem   sMem;
2846       sMem.region = pst->region;
2847       sMem.pool = pst->pool;
2848       if ((cmAllocEvnt(sizeof(TfuTimingAdvIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&timingAdvInd)) != ROK)            {
2849 #if (ERRCLASS & ERRCLS_ADD_RES)
2850          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2851             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2852             (ErrVal)ETFU091, (ErrVal)0, "Packing failed");
2853 #endif
2854          TFU_FREE_MSG(mBuf);
2855          RETVALUE(RFAILED);
2856       }
2857    }
2858
2859
2860    if (pst->selector == TFU_SEL_LC) 
2861    {
2862       if (cmUnpkTfuTimingAdvIndInfo(timingAdvInd, (Ptr)&timingAdvInd->memCp, mBuf) != ROK) {
2863          TFU_FREE_MEM(timingAdvInd);
2864          TFU_FREE_MSG(mBuf);
2865 #if (ERRCLASS & ERRCLS_ADD_RES)
2866          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2867                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2868                (ErrVal)ETFU092, (ErrVal)0, "Packing failed");
2869 #endif
2870          RETVALUE(RFAILED);
2871       }
2872    }
2873    else if(pst->selector == TFU_SEL_LWLC)
2874    {
2875       if (cmUnpkPtr((PTR *)&timingAdvInd, mBuf) != ROK)
2876       {
2877 #if (ERRCLASS & ERRCLS_ADD_RES)
2878          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2879             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2880             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2881 #endif
2882          TFU_FREE_MEM(timingAdvInd);
2883          TFU_FREE_MSG(mBuf);
2884          RETVALUE(RFAILED);
2885       }
2886    }
2887    TFU_FREE_MSG(mBuf);
2888    RETVALUE((*func)(pst, suId, timingAdvInd));
2889 }
2890
2891 \f
2892 /***********************************************************
2893 *
2894 *     Func : cmPkTfuDatReq
2895 *
2896 *
2897 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2898   * transmission. 
2899   * @details The data being sent in this primitive is meant to be transmitted on
2900   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2901   * layer processing, requisite control information is also sent along with the
2902   * data. 
2903   * @sa TfUiTfuCntrlReq
2904   * @param pst 
2905   * @param spId
2906   * @param tfuDatReq pointer to TfuDatReqInfo
2907   * @return
2908 *
2909 *
2910 *     Ret  : S16
2911 *
2912 *     Notes:
2913 *
2914 *     File  : 
2915 *
2916 **********************************************************/
2917 #ifdef ANSI
2918 PUBLIC S16 cmPkTfuDatReq
2919 (
2920 Pst * pst,
2921 SpId spId,
2922 TfuDatReqInfo * datReq
2923 )
2924 #else
2925 PUBLIC S16 cmPkTfuDatReq(pst, spId, datReq)
2926 Pst * pst;
2927 SpId spId;
2928 TfuDatReqInfo * datReq;
2929 #endif
2930 {
2931    Buffer *mBuf = NULLP;
2932    TRC3(cmPkTfuDatReq)
2933
2934    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2935 #if (ERRCLASS & ERRCLS_ADD_RES)
2936       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2937          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2938          (ErrVal)ETFU093, (ErrVal)0, "Packing failed");
2939 #endif
2940       TFU_FREE_MEM(datReq);
2941       RETVALUE(RFAILED);
2942    }
2943    if (pst->selector == TFU_SEL_LC) {
2944       if (cmPkTfuDatReqInfo(datReq, mBuf) != ROK) {
2945 #if (ERRCLASS & ERRCLS_ADD_RES)
2946          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2947             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2948             (ErrVal)ETFU094, (ErrVal)0, "Packing failed");
2949 #endif
2950          TFU_FREE_MEM(datReq);
2951          TFU_FREE_MSG(mBuf);
2952          RETVALUE(RFAILED);
2953       }
2954    }
2955    else if(pst->selector == TFU_SEL_LWLC)
2956    {
2957       if(cmPkPtr((PTR)datReq, mBuf) != ROK)
2958       {
2959 #if (ERRCLASS & ERRCLS_ADD_RES)
2960          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2961             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2962             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2963 #endif
2964          TFU_FREE_MEM(datReq);
2965          TFU_FREE_MSG(mBuf);
2966          RETVALUE(RFAILED);
2967       }
2968    }
2969
2970    if (SPkS16(spId, mBuf) != ROK) {
2971 #if (ERRCLASS & ERRCLS_ADD_RES)
2972       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2973          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2974          (ErrVal)ETFU095, (ErrVal)0, "Packing failed");
2975 #endif
2976       TFU_FREE_MEM(datReq);
2977       TFU_FREE_MSG(mBuf);
2978       RETVALUE(RFAILED);
2979    }
2980    if (pst->selector != TFU_SEL_LWLC) {
2981       TFU_FREE_MEM(datReq);
2982    }
2983
2984    pst->event = (Event) EVTTFUDATREQ;
2985    RETVALUE(SPstTsk(pst,mBuf));
2986 }
2987
2988 \f
2989 /***********************************************************
2990 *
2991 *     Func : cmUnpkTfuDatReq
2992 *
2993 *
2994 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2995   * transmission. 
2996   * @details The data being sent in this primitive is meant to be transmitted on
2997   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2998   * layer processing, requisite control information is also sent along with the
2999   * data. 
3000   * @sa TfUiTfuCntrlReq
3001   * @param pst 
3002   * @param spId
3003   * @param tfuDatReq pointer to TfuDatReqInfo
3004   * @return
3005 *
3006 *
3007 *     Ret  : S16
3008 *
3009 *     Notes:
3010 *
3011 *     File  : 
3012 *
3013 **********************************************************/
3014 #ifdef ANSI
3015 PUBLIC S16 cmUnpkTfuDatReq
3016 (
3017 TfuDatReq func,
3018 Pst *pst,
3019 Buffer *mBuf
3020 )
3021 #else
3022 PUBLIC S16 cmUnpkTfuDatReq(func, pst, mBuf)
3023 TfuDatReq func;
3024 Pst *pst;
3025 Buffer *mBuf;
3026 #endif
3027 {
3028    SpId spId;
3029    TfuDatReqInfo *datReq;
3030    
3031    TRC3(cmUnpkTfuDatReq)
3032
3033    if (SUnpkS16(&spId, mBuf) != ROK) {
3034       TFU_FREE_MSG(mBuf);
3035 #if (ERRCLASS & ERRCLS_ADD_RES)
3036       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3037          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3038          (ErrVal)ETFU096, (ErrVal)0, "Packing failed");
3039 #endif
3040       RETVALUE(RFAILED);
3041    }
3042    if (pst->selector != TFU_SEL_LWLC) {
3043       Mem   sMem;
3044       sMem.region = pst->region;
3045       sMem.pool = pst->pool;
3046       if ((cmAllocEvnt(sizeof(TfuDatReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&datReq)) != ROK)            {
3047 #if (ERRCLASS & ERRCLS_ADD_RES)
3048          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3049             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3050             (ErrVal)ETFU097, (ErrVal)0, "Packing failed");
3051 #endif
3052          TFU_FREE_MSG(mBuf);
3053          RETVALUE(RFAILED);
3054       }
3055    }
3056
3057
3058    if (pst->selector == TFU_SEL_LC) 
3059    {
3060       if (cmUnpkTfuDatReqInfo(datReq, (Ptr)&datReq->memCp, mBuf) != ROK) {
3061          TFU_FREE_MEM(datReq);
3062          TFU_FREE_MSG(mBuf);
3063 #if (ERRCLASS & ERRCLS_ADD_RES)
3064          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3065                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3066                (ErrVal)ETFU098, (ErrVal)0, "Unpacking failed");
3067 #endif
3068          RETVALUE(RFAILED);
3069       }
3070    }
3071    else if (pst->selector == TFU_SEL_LWLC)
3072    {
3073       if(cmUnpkPtr((PTR *)&datReq, mBuf) != ROK)
3074       {
3075          TFU_FREE_MEM(datReq);
3076          TFU_FREE_MSG(mBuf);
3077 #if (ERRCLASS & ERRCLS_ADD_RES)
3078          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3079                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3080                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Un-Packing failed");
3081 #endif
3082          RETVALUE(RFAILED);
3083       }
3084    }
3085    TFU_FREE_MSG(mBuf);
3086    RETVALUE((*func)(pst, spId, datReq));
3087 }
3088
3089 \f
3090 /***********************************************************
3091 *
3092 *     Func : cmPkTfuCntrlReq
3093 *
3094 *
3095 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3096   * all the control information
3097   * @details This primitive carries the information sent on the following
3098   * channels - 
3099   * -# PDCCH
3100   * -# PHICH
3101   * -# PCFICH
3102   * 
3103   * @param pst
3104   * @param spId
3105   * @param cntrlReq pointer to TfuCntrlReqInfo
3106   * @return ROK/RFAILED
3107 *
3108 *
3109 *     Ret  : S16
3110 *
3111 *     Notes:
3112 *
3113 *     File  : 
3114 *
3115 **********************************************************/
3116 #ifdef ANSI
3117 PUBLIC S16 cmPkTfuCntrlReq
3118 (
3119 Pst * pst,
3120 SpId spId,
3121 TfuCntrlReqInfo * cntrlReq
3122 )
3123 #else
3124 PUBLIC S16 cmPkTfuCntrlReq(pst, spId, cntrlReq)
3125 Pst * pst;
3126 SpId spId;
3127 TfuCntrlReqInfo * cntrlReq;
3128 #endif
3129 {
3130    Buffer *mBuf = NULLP;
3131    TRC3(cmPkTfuCntrlReq)
3132
3133    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3134 #if (ERRCLASS & ERRCLS_ADD_RES)
3135       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3136          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3137          (ErrVal)ETFU099, (ErrVal)0, "Packing failed");
3138 #endif
3139       TFU_FREE_MEM(cntrlReq);
3140       RETVALUE(RFAILED);
3141    }
3142    if (pst->selector == TFU_SEL_LC) {
3143       if (cmPkTfuCntrlReqInfo(cntrlReq, mBuf) != ROK) {
3144 #if (ERRCLASS & ERRCLS_ADD_RES)
3145          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3146             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3147             (ErrVal)ETFU100, (ErrVal)0, "Packing failed");
3148 #endif
3149          TFU_FREE_MEM(cntrlReq);
3150          TFU_FREE_MSG(mBuf);
3151          RETVALUE(RFAILED);
3152       }
3153    }
3154    else if(pst->selector == TFU_SEL_LWLC)
3155    {
3156       if (cmPkPtr((PTR)cntrlReq, mBuf) != ROK)
3157       {
3158 #if (ERRCLASS & ERRCLS_ADD_RES)
3159          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3160             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3161             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3162 #endif
3163          TFU_FREE_MEM(cntrlReq);
3164          TFU_FREE_MSG(mBuf);
3165          RETVALUE(RFAILED);
3166       }
3167    }
3168
3169
3170    if (SPkS16(spId, mBuf) != ROK) {
3171 #if (ERRCLASS & ERRCLS_ADD_RES)
3172       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3173          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3174          (ErrVal)ETFU101, (ErrVal)0, "Packing failed");
3175 #endif
3176       TFU_FREE_MEM(cntrlReq);
3177       TFU_FREE_MSG(mBuf);
3178       RETVALUE(RFAILED);
3179    }
3180    if (pst->selector != TFU_SEL_LWLC) {
3181       TFU_FREE_MEM(cntrlReq);
3182    }
3183
3184    pst->event = (Event) EVTTFUCNTRLREQ;
3185    RETVALUE(SPstTsk(pst,mBuf));
3186 }
3187
3188 \f
3189 /***********************************************************
3190 *
3191 *     Func : cmUnpkTfuCntrlReq
3192 *
3193 *
3194 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3195   * all the control information
3196   * @details This primitive carries the information sent on the following
3197   * channels - 
3198   * -# PDCCH
3199   * -# PHICH
3200   * -# PCFICH
3201   * 
3202   * @param pst
3203   * @param spId
3204   * @param cntrlReq pointer to TfuCntrlReqInfo
3205   * @return ROK/RFAILED
3206 *
3207 *
3208 *     Ret  : S16
3209 *
3210 *     Notes:
3211 *
3212 *     File  : 
3213 *
3214 **********************************************************/
3215 #ifdef ANSI
3216 PUBLIC S16 cmUnpkTfuCntrlReq
3217 (
3218 TfuCntrlReq func,
3219 Pst *pst,
3220 Buffer *mBuf
3221 )
3222 #else
3223 PUBLIC S16 cmUnpkTfuCntrlReq(func, pst, mBuf)
3224 TfuCntrlReq func;
3225 Pst *pst;
3226 Buffer *mBuf;
3227 #endif
3228 {
3229    SpId spId;
3230    TfuCntrlReqInfo *cntrlReq;
3231    
3232    TRC3(cmUnpkTfuCntrlReq)
3233
3234    if (SUnpkS16(&spId, mBuf) != ROK) {
3235       TFU_FREE_MSG(mBuf);
3236 #if (ERRCLASS & ERRCLS_ADD_RES)
3237       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3238          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3239          (ErrVal)ETFU102, (ErrVal)0, "Packing failed");
3240 #endif
3241       RETVALUE(RFAILED);
3242    }
3243    if (pst->selector != TFU_SEL_LWLC) {
3244       Mem   sMem;
3245       sMem.region = pst->region;
3246       sMem.pool = pst->pool;
3247       if ((cmAllocEvnt(sizeof(TfuCntrlReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&cntrlReq)) != ROK)            {
3248 #if (ERRCLASS & ERRCLS_ADD_RES)
3249          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3250             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3251             (ErrVal)ETFU103, (ErrVal)0, "Packing failed");
3252 #endif
3253          TFU_FREE_MSG(mBuf);
3254          RETVALUE(RFAILED);
3255       }
3256    }
3257
3258
3259    if (pst->selector == TFU_SEL_LC) 
3260    {
3261       if (cmUnpkTfuCntrlReqInfo(cntrlReq, (Ptr)&cntrlReq->memCp, mBuf) != ROK) {
3262          TFU_FREE_MEM(cntrlReq);
3263          TFU_FREE_MSG(mBuf);
3264 #if (ERRCLASS & ERRCLS_ADD_RES)
3265          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3266                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3267                (ErrVal)ETFU104, (ErrVal)0, "Packing failed");
3268 #endif
3269          RETVALUE(RFAILED);
3270       }
3271    }
3272    else if(pst->selector == TFU_SEL_LWLC)
3273    {
3274       if (cmUnpkPtr((PTR *)&cntrlReq, mBuf) != ROK)
3275       {
3276 #if (ERRCLASS & ERRCLS_ADD_RES)
3277          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3278             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3279             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3280 #endif
3281          TFU_FREE_MEM(cntrlReq);
3282          TFU_FREE_MSG(mBuf);
3283          RETVALUE(RFAILED);
3284       }
3285    }
3286    TFU_FREE_MSG(mBuf);
3287    RETVALUE((*func)(pst, spId, cntrlReq));
3288 }
3289
3290
3291 \f
3292 /***********************************************************
3293 *
3294 *     Func : cmPkTfuTtiInd
3295 *
3296 *
3297 *     Desc : This API is the TTI indication from PHY to MAC . 
3298  * @details This primitive provides the timing information (SFN and subframe)
3299  * which is currently running on the physical layer. 
3300  * @param pst Pointer to the post structure.
3301  * @param suId SAP ID of the service user.
3302  * @param ttiInd Pointer to the TfuTtiIndInfo.
3303  * @return ROK/RFAILED
3304 *
3305 *
3306 *     Ret  : S16
3307 *
3308 *     Notes:
3309 *
3310 *     File  : 
3311 *
3312 **********************************************************/
3313 #ifdef ANSI
3314 PUBLIC S16 cmPkTfuTtiInd
3315 (
3316 Pst * pst,
3317 SuId suId,
3318 TfuTtiIndInfo * ttiInd
3319 )
3320 #else
3321 PUBLIC S16 cmPkTfuTtiInd(pst, suId, ttiInd)
3322 Pst * pst;
3323 SuId suId;
3324 TfuTtiIndInfo * ttiInd;
3325 #endif
3326 {
3327    Buffer *mBuf = NULLP;
3328    TRC3(cmPkTfuTtiInd)
3329
3330    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3331 #if (ERRCLASS & ERRCLS_ADD_RES)
3332       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3333          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3334          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3335 #endif
3336       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3337       RETVALUE(RFAILED);
3338    }
3339    if (pst->selector == TFU_SEL_LC) {
3340       if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3341 #if (ERRCLASS & ERRCLS_ADD_RES)
3342          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3343             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3344             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
3345 #endif
3346          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3347          TFU_FREE_MSG(mBuf);
3348          RETVALUE(RFAILED);
3349       }
3350    }
3351    else if(pst->selector == TFU_SEL_LWLC)
3352    {
3353       if (cmPkPtr((PTR)ttiInd, mBuf) != ROK)
3354       {
3355 #if (ERRCLASS & ERRCLS_ADD_RES)
3356          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3357             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3358             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3359 #endif
3360          
3361          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
3362          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3363          TFU_FREE_MSG(mBuf);
3364          RETVALUE(RFAILED);
3365       }
3366    }
3367
3368    if (SPkS16(suId, mBuf) != ROK) {
3369 #if (ERRCLASS & ERRCLS_ADD_RES)
3370       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3371          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3372          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3373 #endif
3374       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3375       TFU_FREE_MSG(mBuf);
3376       RETVALUE(RFAILED);
3377    }
3378    if (pst->selector != TFU_SEL_LWLC) {
3379       if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
3380 #if (ERRCLASS & ERRCLS_ADD_RES)
3381       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3382          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3383          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
3384 #endif
3385          TFU_FREE_MSG(mBuf);
3386          RETVALUE(RFAILED);
3387       }
3388    }
3389
3390    pst->event = (Event) EVTTFUTTIIND;
3391    RETVALUE(SPstTsk(pst,mBuf));
3392 }
3393
3394 \f
3395 /***********************************************************
3396 *
3397 *     Func : cmUnpkTfuTtiInd
3398 *
3399 *
3400 *     Desc : This API is the TTI indication from PHY to MAC . 
3401  * @details This primitive provides the timing information (SFN and subframe)
3402  * which is currently running on the physical layer. 
3403  * @param pst Pointer to the post structure.
3404  * @param suId SAP ID of the service user.
3405  * @param ttiInd Pointer to the TfuTtiIndInfo.
3406  * @return ROK/RFAILED
3407 *
3408 *
3409 *     Ret  : S16
3410 *
3411 *     Notes:
3412 *
3413 *     File  : 
3414 *
3415 **********************************************************/
3416 #ifdef ANSI
3417 PUBLIC S16 cmUnpkTfuTtiInd
3418 (
3419 TfuTtiInd func,
3420 Pst *pst,
3421 Buffer *mBuf
3422 )
3423 #else
3424 PUBLIC S16 cmUnpkTfuTtiInd(func, pst, mBuf)
3425 TfuTtiInd func;
3426 Pst *pst;
3427 Buffer *mBuf;
3428 #endif
3429 {
3430    SuId suId;
3431    TfuTtiIndInfo *ttiInd;
3432    
3433    TRC3(cmUnpkTfuTtiInd)
3434
3435    if (SUnpkS16(&suId, mBuf) != ROK) {
3436       TFU_FREE_MSG(mBuf);
3437 #if (ERRCLASS & ERRCLS_ADD_RES)
3438       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3439          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3440          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3441 #endif
3442       RETVALUE(RFAILED);
3443    }
3444    if (pst->selector != TFU_SEL_LWLC) {
3445       if ((SGetSBuf(pst->region, pst->pool, (Data **)&ttiInd,             sizeof(TfuTtiIndInfo))) != ROK) {
3446 #if (ERRCLASS & ERRCLS_ADD_RES)
3447          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3448             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3449             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
3450 #endif
3451          TFU_FREE_MSG(mBuf);
3452          RETVALUE(RFAILED);
3453       }
3454    }
3455
3456    if (pst->selector == TFU_SEL_LC) 
3457    {
3458       if (cmUnpkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3459          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3460          TFU_FREE_MSG(mBuf);
3461 #if (ERRCLASS & ERRCLS_ADD_RES)
3462          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3463                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3464                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
3465 #endif
3466          RETVALUE(RFAILED);
3467       }
3468    }
3469    else if(pst->selector == TFU_SEL_LWLC)
3470    {
3471       if (cmUnpkPtr((PTR *)&ttiInd, mBuf) != ROK)
3472       {
3473 #if (ERRCLASS & ERRCLS_ADD_RES)
3474          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3475             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3476             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3477 #endif
3478          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3479          TFU_FREE_MSG(mBuf);
3480          RETVALUE(RFAILED);
3481       }
3482    }
3483    TFU_FREE_MSG(mBuf);
3484    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
3485    (*func)(pst, suId, ttiInd);
3486    SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3487
3488    RETVALUE((*func)(pst, suId, ttiInd));
3489 }
3490
3491 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
3492 /***********************************************************
3493  *
3494  *     Func : cmPkTfuNonRtInd
3495  *
3496  *
3497  *     Desc : This API is the Non-Rt indication from CL to MAC . 
3498  * @param pst Pointer to the post structure.
3499  * @param suId SAP ID of the service user.
3500  * @return ROK/RFAILED
3501  *
3502  *
3503  *     Ret  : S16
3504  *
3505  *     Notes:
3506  *
3507  *     File  : 
3508  *
3509 **********************************************************/
3510 #ifdef ANSI
3511 PUBLIC S16 cmPkTfuNonRtInd
3512 (
3513 Pst * pst,
3514 SuId suId
3515 )
3516 #else
3517 PUBLIC S16 cmPkTfuNonRtInd(pst, suId)
3518 Pst * pst;
3519 SuId suId;
3520 #endif
3521 {
3522    Buffer *mBuf = NULLP;
3523    TRC3(cmPkTfuNonRtInd)
3524
3525    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3526 #if (ERRCLASS & ERRCLS_ADD_RES)
3527       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3528          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3529          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3530 #endif
3531       RETVALUE(RFAILED);
3532   }
3533   if (SPkS16(suId, mBuf) != ROK) {
3534 #if (ERRCLASS & ERRCLS_ADD_RES)
3535       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3536          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3537          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3538 #endif
3539       TFU_FREE_MSG(mBuf);
3540       RETVALUE(RFAILED);
3541   }
3542   pst->event = (Event) EVTTFUNONRTIND;
3543   RETVALUE(SPstTsk(pst,mBuf));
3544 }
3545
3546 /***********************************************************
3547 *
3548 *     Func : cmUnpkTfuNonRtInd
3549 *
3550 *
3551 *     Desc : This API is the Non Rt indication from PHY to MAC . 
3552 * @param pst Pointer to the post structure.
3553 * @param suId SAP ID of the service user.
3554 * @return ROK/RFAILED
3555 *
3556 *
3557 *     Ret  : S16
3558 *
3559 *     Notes:
3560 *
3561 *     File  : 
3562 *
3563 **********************************************************/
3564 #ifdef ANSI
3565 PUBLIC S16 cmUnpkTfuNonRtInd
3566 (
3567 TfuNonRtInd func,
3568 Pst *pst,
3569 Buffer *mBuf
3570 )
3571 #else
3572 PUBLIC S16 cmUnpkTfuNonRtInd(func, pst, mBuf)
3573 TfuNonRtInd func;
3574 Pst *pst;
3575 Buffer *mBuf;
3576 #endif
3577 {
3578    SuId suId;
3579    TRC3(cmUnpkTfuNonRtInd)
3580
3581    if (SUnpkS16(&suId, mBuf) != ROK) {
3582       TFU_FREE_MSG(mBuf);
3583 #if (ERRCLASS & ERRCLS_ADD_RES)
3584       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3585          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3586          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3587 #endif
3588       RETVALUE(RFAILED);
3589    }
3590    TFU_FREE_MSG(mBuf);
3591    RETVALUE((*func)(pst, suId));
3592 }
3593
3594 #endif
3595
3596 /***********************************************************
3597 *
3598 *     Func : cmPkTfuSchTtiInd
3599 *
3600 *
3601 *     Desc : This API is the TTI indication from PHY to scheduler. 
3602  * @details This primitive provides the timing information (SFN and subframe)
3603  * which is currently running on the physical layer. 
3604  * @param pst Pointer to the post structure.
3605  * @param suId SAP ID of the service user.
3606  * @param ttiInd Pointer to the TfuTtiIndInfo.
3607  * @return ROK/RFAILED
3608 *
3609 *
3610 *     Ret  : S16
3611 *
3612 *     Notes:
3613 *
3614 *     File  : 
3615 *
3616 **********************************************************/
3617 #ifdef ANSI
3618 PUBLIC S16 cmPkTfuSchTtiInd
3619 (
3620 Pst * pst,
3621 SuId suId,
3622 TfuTtiIndInfo * ttiInd
3623 )
3624 #else
3625 PUBLIC S16 cmPkTfuSchTtiInd(pst, suId, ttiInd)
3626 Pst * pst;
3627 SuId suId;
3628 TfuTtiIndInfo * ttiInd;
3629 #endif
3630 {
3631    Buffer *mBuf = NULLP;
3632    TRC3(cmPkTfuSchTtiInd)
3633
3634    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3635 #if (ERRCLASS & ERRCLS_ADD_RES)
3636       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3637          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3638          (ErrVal)ETFU112, (ErrVal)0, "Packing failed");
3639 #endif
3640       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3641       RETVALUE(RFAILED);
3642    }
3643    if (pst->selector == TFU_SEL_LC) {
3644       if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3645 #if (ERRCLASS & ERRCLS_ADD_RES)
3646          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3647             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3648             (ErrVal)ETFU113, (ErrVal)0, "Packing failed");
3649 #endif
3650          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3651          TFU_FREE_MSG(mBuf);
3652          RETVALUE(RFAILED);
3653       }
3654    }
3655    else if(pst->selector == TFU_SEL_LWLC)
3656    {
3657       if (cmPkPtr((PTR)ttiInd, mBuf) != ROK)
3658       {
3659 #if (ERRCLASS & ERRCLS_ADD_RES)
3660          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3661             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3662             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3663 #endif
3664          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3665          TFU_FREE_MSG(mBuf);
3666          RETVALUE(RFAILED);
3667       }
3668    }
3669
3670    if (SPkS16(suId, mBuf) != ROK) {
3671 #if (ERRCLASS & ERRCLS_ADD_RES)
3672       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3673          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3674          (ErrVal)ETFU114, (ErrVal)0, "Packing failed");
3675 #endif
3676       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3677       TFU_FREE_MSG(mBuf);
3678       RETVALUE(RFAILED);
3679    }
3680    if (pst->selector != TFU_SEL_LWLC) {
3681       if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
3682 #if (ERRCLASS & ERRCLS_ADD_RES)
3683       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3684          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3685          (ErrVal)ETFU115, (ErrVal)0, "Packing failed");
3686 #endif
3687          TFU_FREE_MSG(mBuf);
3688          RETVALUE(RFAILED);
3689       }
3690    }
3691    pst->event = (Event) EVTTFUSCHTTIIND;
3692    RETVALUE(SPstTsk(pst,mBuf));
3693 }
3694
3695 \f
3696 /***********************************************************
3697 *
3698 *     Func : cmUnpkTfuSchTtiInd
3699 *
3700 *
3701 *     Desc : This API is the TTI indication from PHY to scheduler. 
3702  * @details This primitive provides the timing information (SFN and subframe)
3703  * which is currently running on the physical layer. 
3704  * @param pst Pointer to the post structure.
3705  * @param suId SAP ID of the service user.
3706  * @param ttiInd Pointer to the TfuTtiIndInfo.
3707  * @return ROK/RFAILED
3708 *
3709 *
3710 *     Ret  : S16
3711 *
3712 *     Notes:
3713 *
3714 *     File  : 
3715 *
3716 **********************************************************/
3717 #ifdef ANSI
3718 PUBLIC S16 cmUnpkTfuSchTtiInd
3719 (
3720 TfuSchTtiInd func,
3721 Pst *pst,
3722 Buffer *mBuf
3723 )
3724 #else
3725 PUBLIC S16 cmUnpkTfuSchTtiInd(func, pst, mBuf)
3726 TfuSchTtiInd func;
3727 Pst *pst;
3728 Buffer *mBuf;
3729 #endif
3730 {
3731    SuId suId;
3732    TfuTtiIndInfo *ttiInd;
3733    
3734    TRC3(cmUnpkTfuSchTtiInd)
3735
3736    if (SUnpkS16(&suId, mBuf) != ROK) {
3737       TFU_FREE_MSG(mBuf);
3738 #if (ERRCLASS & ERRCLS_ADD_RES)
3739       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3740          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3741          (ErrVal)ETFU116, (ErrVal)0, "Packing failed");
3742 #endif
3743       RETVALUE(RFAILED);
3744    }
3745    if (pst->selector != TFU_SEL_LWLC) {
3746       if ((SGetSBuf(pst->region, pst->pool, (Data **)&ttiInd,             sizeof(TfuTtiIndInfo))) != ROK) {
3747 #if (ERRCLASS & ERRCLS_ADD_RES)
3748          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3749             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3750             (ErrVal)ETFU117, (ErrVal)0, "Packing failed");
3751 #endif
3752          TFU_FREE_MSG(mBuf);
3753          RETVALUE(RFAILED);
3754       }
3755    }
3756
3757    if (pst->selector == TFU_SEL_LC) 
3758    {
3759       if (cmUnpkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3760          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3761          TFU_FREE_MSG(mBuf);
3762 #if (ERRCLASS & ERRCLS_ADD_RES)
3763          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3764                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3765                (ErrVal)ETFU118, (ErrVal)0, "Packing failed");
3766 #endif
3767          RETVALUE(RFAILED);
3768       }
3769    }
3770    else if(pst->selector == TFU_SEL_LWLC)
3771    {
3772       if (cmUnpkPtr((PTR *)&ttiInd, mBuf) != ROK)
3773       {
3774 #if (ERRCLASS & ERRCLS_ADD_RES)
3775          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3776             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3777             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3778 #endif
3779          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3780          TFU_FREE_MSG(mBuf);
3781          RETVALUE(RFAILED);
3782       }
3783    }
3784    TFU_FREE_MSG(mBuf);
3785    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
3786    (*func)(pst, suId, ttiInd);
3787    SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3788  
3789    RETVALUE(ROK);
3790 }
3791
3792 \f
3793 /***********************************************************
3794 *
3795 *     Func : cmPkTfuPucchDeltaPwr
3796 *
3797 *
3798 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3799  * Physical layer.
3800  * This information is utilized by Scheduler for power control. 
3801  * @param pst Pointer to the post structure.
3802  * @param suId SAP ID of the service user.
3803  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3804  * @return ROK/RFAILED
3805 *
3806 *
3807 *     Ret  : S16
3808 *
3809 *     Notes:
3810 *
3811 *     File  : 
3812 *
3813 **********************************************************/
3814 #ifdef ANSI
3815 PUBLIC S16 cmPkTfuPucchDeltaPwr
3816 (
3817 Pst * pst,
3818 SuId suId,
3819 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr
3820 )
3821 #else
3822 PUBLIC S16 cmPkTfuPucchDeltaPwr(pst, suId, pucchDeltaPwr)
3823 Pst * pst;
3824 SuId suId;
3825 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr;
3826 #endif
3827 {
3828    Buffer *mBuf = NULLP;
3829    TRC3(cmPkTfuPucchDeltaPwr)
3830
3831    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3832 #if (ERRCLASS & ERRCLS_ADD_RES)
3833       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3834          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3835          (ErrVal)ETFU119, (ErrVal)0, "Packing failed");
3836 #endif
3837       SPutSBuf(pst->region, pst->pool, (Data *)pucchDeltaPwr, sizeof(TfuPucchDeltaPwrIndInfo));
3838       RETVALUE(RFAILED);
3839    }
3840    if (pst->selector == TFU_SEL_LC) {
3841       if (cmPkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, mBuf) != ROK) {
3842 #if (ERRCLASS & ERRCLS_ADD_RES)
3843          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3844             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3845             (ErrVal)ETFU120, (ErrVal)0, "Packing failed");
3846 #endif
3847          TFU_FREE_MEM(pucchDeltaPwr);
3848          TFU_FREE_MSG(mBuf);
3849          RETVALUE(RFAILED);
3850       }
3851    }
3852    else if(pst->selector == TFU_SEL_LWLC)
3853    {
3854       if (cmPkPtr((PTR)pucchDeltaPwr, mBuf) != ROK)
3855       {
3856 #if (ERRCLASS & ERRCLS_ADD_RES)
3857          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3858             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3859             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3860 #endif
3861          TFU_FREE_MEM(pucchDeltaPwr);
3862          TFU_FREE_MSG(mBuf);
3863          RETVALUE(RFAILED);
3864       }
3865    }
3866
3867    if (SPkS16(suId, mBuf) != ROK) {
3868 #if (ERRCLASS & ERRCLS_ADD_RES)
3869       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3870          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3871          (ErrVal)ETFU121, (ErrVal)0, "Packing failed");
3872 #endif
3873       TFU_FREE_MEM(pucchDeltaPwr);
3874       TFU_FREE_MSG(mBuf);
3875       RETVALUE(RFAILED);
3876    }
3877    if (pst->selector != TFU_SEL_LWLC) {
3878       TFU_FREE_MEM(pucchDeltaPwr);
3879    }
3880    pst->event = (Event) EVTTFUPUCCHDELPWR;
3881    RETVALUE(SPstTsk(pst,mBuf));
3882 }
3883
3884 \f
3885 /***********************************************************
3886 *
3887 *     Func : cmUnpkTfuPucchDeltaPwr
3888 *
3889 *
3890 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3891  * Physical layer.
3892  * This information is utilized by Scheduler for power control. 
3893  * @param pst Pointer to the post structure.
3894  * @param suId SAP ID of the service user.
3895  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3896  * @return ROK/RFAILED
3897 *
3898 *
3899 *     Ret  : S16
3900 *
3901 *     Notes:
3902 *
3903 *     File  : 
3904 *
3905 **********************************************************/
3906 #ifdef ANSI
3907 PUBLIC S16 cmUnpkTfuPucchDeltaPwr
3908 (
3909 TfuPucchDeltaPwrInd func,
3910 Pst *pst,
3911 Buffer *mBuf
3912 )
3913 #else
3914 PUBLIC S16 cmUnpkTfuPucchDeltaPwr(func, pst, mBuf)
3915 TfuPucchDeltaPwrInd func;
3916 Pst *pst;
3917 Buffer *mBuf;
3918 #endif
3919 {
3920    SuId suId;
3921    TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
3922    
3923    TRC3(cmUnpkTfuPucchDeltaPwr)
3924
3925    if (SUnpkS16(&suId, mBuf) != ROK) {
3926       TFU_FREE_MSG(mBuf);
3927 #if (ERRCLASS & ERRCLS_ADD_RES)
3928       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3929          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3930          (ErrVal)ETFU122, (ErrVal)0, "Packing failed");
3931 #endif
3932       RETVALUE(RFAILED);
3933    }
3934    if (pst->selector != TFU_SEL_LWLC) {
3935       Mem   sMem;
3936       sMem.region = pst->region;
3937       sMem.pool = pst->pool;
3938       if ((cmAllocEvnt(sizeof(TfuPucchDeltaPwrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&pucchDeltaPwr)) != ROK)            {
3939 #if (ERRCLASS & ERRCLS_ADD_RES)
3940          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3941             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3942             (ErrVal)ETFU123, (ErrVal)0, "Packing failed");
3943 #endif
3944          TFU_FREE_MSG(mBuf);
3945          RETVALUE(RFAILED);
3946       }
3947    }
3948
3949    if (pst->selector == TFU_SEL_LC) 
3950    {
3951       if (cmUnpkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, (Ptr)&pucchDeltaPwr->memCp, mBuf) != ROK) {
3952          TFU_FREE_MEM(pucchDeltaPwr);
3953          TFU_FREE_MSG(mBuf);
3954 #if (ERRCLASS & ERRCLS_ADD_RES)
3955          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3956                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3957                (ErrVal)ETFU124, (ErrVal)0, "Packing failed");
3958 #endif
3959          RETVALUE(RFAILED);
3960       }
3961    }
3962    else if(pst->selector == TFU_SEL_LWLC)
3963    {
3964       if (cmUnpkPtr((PTR *)&pucchDeltaPwr, mBuf) != ROK)
3965       {
3966 #if (ERRCLASS & ERRCLS_ADD_RES)
3967          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3968             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3969             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3970 #endif
3971          TFU_FREE_MEM(pucchDeltaPwr);
3972          TFU_FREE_MSG(mBuf);
3973          RETVALUE(RFAILED);
3974       }
3975    }
3976    TFU_FREE_MSG(mBuf);
3977    RETVALUE((*func)(pst, suId, pucchDeltaPwr));
3978 }
3979
3980 #ifdef TFU_5GTF
3981 \f
3982 /***********************************************************
3983 *
3984 *     Func : cmPkTfuRbAssignA1Val324
3985 *
3986 *
3987 *     Desc : This structure contains the information needed to convey  RIV value 324.
3988 *
3989 *
3990 *     Ret  : S16
3991 *
3992 *     Notes:
3993 *
3994 *     File  : 
3995 *
3996 **********************************************************/
3997 #ifdef ANSI
3998 PUBLIC S16 cmPkTfuRbAssignA1Val324
3999 (
4000 TfuRbAssignA1Val324 *param,
4001 Buffer *mBuf
4002 )
4003 #else
4004 PUBLIC S16 cmPkTfuRbAssignA1Val324(param, mBuf)
4005 TfuRbAssignA1Val324 *param;
4006 Buffer *mBuf;
4007 #endif
4008 {
4009
4010    TRC3(cmPkTfuRbAssignA1Val324)
4011
4012    CMCHKPK(SPkU8, param->ndi, mBuf);
4013    CMCHKPK(SPkU8, param->mcs, mBuf);
4014    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4015 #ifdef UL_ADPT_DBG   
4016    printf("cmPkTfuRbAssignA1Val324 param->ndi %d mcs %d param->hqProcId %d \n",param->ndi,param->mcs,param->hqProcId);
4017 #endif   
4018    RETVALUE(ROK);
4019 }
4020
4021 \f
4022 /***********************************************************
4023 *
4024 *     Func : cmPkTfuRbAssignB1Val324
4025 *
4026 *
4027 *     Desc : This structure contains the information needed to convey  RIV value 324.
4028 *
4029 *
4030 *     Ret  : S16
4031 *
4032 *     Notes:
4033 *
4034 *     File  : 
4035 *
4036 **********************************************************/
4037 #ifdef ANSI
4038 PUBLIC S16 cmPkTfuRbAssignB1Val324
4039 (
4040 TfuRbAssignB1Val324 *param,
4041 Buffer *mBuf
4042 )
4043 #else
4044 PUBLIC S16 cmPkTfuRbAssignB1Val324(param, mBuf)
4045 TfuRbAssignB1Val324 *param;
4046 Buffer *mBuf;
4047 #endif
4048 {
4049
4050    TRC3(cmPkTfuRbAssignB1Val324)
4051
4052    CMCHKPK(SPkU8, param->bmiHqAckNack, mBuf);
4053    CMCHKPK(SPkU8, param->RV, mBuf);
4054    CMCHKPK(SPkU8, param->ndi, mBuf);
4055    CMCHKPK(SPkU8, param->mcs, mBuf);
4056    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4057    RETVALUE(ROK);
4058 }
4059
4060 \f
4061 /***********************************************************
4062 *
4063 *     Func : cmPkTfuRbAssignVal326
4064 *
4065 *
4066 *     Desc : This structure contains the information needed to convey  RIV value 326.
4067 *
4068 *
4069 *     Ret  : S16
4070 *
4071 *     Notes:
4072 *
4073 *     File  : 
4074 *
4075 **********************************************************/
4076 #ifdef ANSI
4077 PUBLIC S16 cmPkTfuRbAssignVal326
4078 (
4079 TfuRbAssignVal326 *param,
4080 Buffer *mBuf
4081 )
4082 #else
4083 PUBLIC S16 cmPkTfuRbAssignVal326(param, mBuf)
4084 TfuRbAssignVal326 *param;
4085 Buffer *mBuf;
4086 #endif
4087 {
4088
4089    TRC3(cmPkTfuRbAssignVal326)
4090
4091    CMCHKPK(SPkU8, param->CyclicShiftInd, mBuf);
4092    CMCHKPK(SPkU8, param->OCCInd, mBuf);
4093    CMCHKPK(SPkU8, param->FreqBandIdx, mBuf);
4094    RETVALUE(ROK);
4095 }
4096
4097 \f
4098 /***********************************************************
4099 *
4100 *     Func : cmUnpkTfuRbAssignA1Val324
4101 *
4102 *
4103 *     Desc : This structure contains the information needed to convey  RIV value 324.
4104 *
4105 *
4106 *     Ret  : S16
4107 *
4108 *     Notes:
4109 *
4110 *     File  : 
4111 *
4112 **********************************************************/
4113 #ifdef ANSI
4114 PUBLIC S16 cmUnpkTfuRbAssignA1Val324
4115 (
4116 TfuRbAssignA1Val324 *param,
4117 Buffer *mBuf
4118 )
4119 #else
4120 PUBLIC S16 cmUnpkTfuRbAssignA1Val324(param, mBuf)
4121 TfuRbAssignA1Val324 *param;
4122 Buffer *mBuf;
4123 #endif
4124 {
4125
4126    TRC3(cmUnpkTfuRbAssignA1Val324)
4127
4128    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4129    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4130    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4131    RETVALUE(ROK);
4132 }
4133
4134 \f
4135 /***********************************************************
4136 *
4137 *     Func : cmUnpkTfuRbAssignB1Val324
4138 *
4139 *
4140 *     Desc : This structure contains the information needed to convey  RIV value 324.
4141 *
4142 *
4143 *     Ret  : S16
4144 *
4145 *     Notes:
4146 *
4147 *     File  : 
4148 *
4149 **********************************************************/
4150 #ifdef ANSI
4151 PUBLIC S16 cmUnpkTfuRbAssignB1Val324
4152 (
4153 TfuRbAssignB1Val324 *param,
4154 Buffer *mBuf
4155 )
4156 #else
4157 PUBLIC S16 cmUnpkTfuRbAssignB1Val324(param, mBuf)
4158 TfuRbAssignB1Val324 *param;
4159 Buffer *mBuf;
4160 #endif
4161 {
4162
4163    TRC3(cmUnpkTfuRbAssignB1Val324)
4164
4165    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4166    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4167    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4168    CMCHKUNPK(SUnpkU8, &param->RV, mBuf);
4169    CMCHKUNPK(SUnpkU8, &param->bmiHqAckNack, mBuf);
4170    RETVALUE(ROK);
4171 }
4172
4173 \f
4174 /***********************************************************
4175 *
4176 *     Func : cmUnpkTfuRbAssignVal326
4177 *
4178 *
4179 *     Desc : This structure contains the information needed to convey  RIV value 326.
4180 *
4181 *
4182 *     Ret  : S16
4183 *
4184 *     Notes:
4185 *
4186 *     File  : 
4187 *
4188 **********************************************************/
4189 #ifdef ANSI
4190 PUBLIC S16 cmUnpkTfuRbAssignVal326
4191 (
4192 TfuRbAssignVal326 *param,
4193 Buffer *mBuf
4194 )
4195 #else
4196 PUBLIC S16 cmUnpkTfuRbAssignVal326(param, mBuf)
4197 TfuRbAssignVal326 *param;
4198 Buffer *mBuf;
4199 #endif
4200 {
4201
4202    TRC3(cmUnpkTfuRbAssignVal326)
4203
4204    CMCHKUNPK(SUnpkU8, &param->FreqBandIdx, mBuf);
4205    CMCHKUNPK(SUnpkU8, &param->OCCInd, mBuf);
4206    CMCHKUNPK(SUnpkU8, &param->CyclicShiftInd, mBuf);
4207    RETVALUE(ROK);
4208 }
4209
4210
4211 \f
4212 /***********************************************************
4213 *
4214 *     Func : cmPkTfuDciFormatA1A2Info
4215 *
4216 *
4217 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4218 *
4219 *
4220 *     Ret  : S16
4221 *
4222 *     Notes:
4223 *
4224 *     File  : 
4225 *
4226 **********************************************************/
4227 #ifdef ANSI
4228 PUBLIC S16 cmPkTfuDciFormatA1A2Info
4229 (
4230 TfuDciFormatA1Info *param,
4231 Buffer *mBuf
4232 )
4233 #else
4234 PUBLIC S16 cmPkTfuDciFormatA1A2Info(param, mBuf)
4235 TfuDciFormatA1Info *param;
4236 Buffer *mBuf;
4237 #endif
4238 {
4239
4240    TRC3(cmPkTfuDciFormatA1A2Info)
4241
4242    //printf("5GTF_DBG: cmPkTfuDciFormatA1Info() called by eNB\n");   
4243    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4244    CMCHKPK(SPkU8, param->UL_PCRS, mBuf);
4245    CMCHKPK(SPkU8, param->PMI, mBuf);
4246    CMCHKPK(SPkU8, param->SCID, mBuf);
4247
4248    CMCHKPK(SPkU8, param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4249    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4250    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4251    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4252    CMCHKPK(SPkU8, param->uciOnxPUSCH, mBuf);
4253
4254    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4255    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4256    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4257    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4258    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4259    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4260
4261    if(param->RBAssign <= TFU_RIV_324)
4262    {
4263       CMCHKPK(cmPkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4264    }
4265    else if (param->RBAssign == TFU_RIV_326)
4266    {
4267       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4268    }
4269
4270    CMCHKPK(SPkU8, param->rv, mBuf);
4271    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4272    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4273    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4274    CMCHKPK(SPkU8, param->xPUSCH_TxTiming, mBuf);
4275    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
4276    CMCHKPK(SPkU8, param->formatType, mBuf);
4277    RETVALUE(ROK);
4278 }
4279
4280 \f
4281 /***********************************************************
4282 *
4283 *     Func : cmPkTfuDciFormatB1B2Info
4284 *
4285 *
4286 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4287 *
4288 *
4289 *     Ret  : S16
4290 *
4291 *     Notes:
4292 *
4293 *     File  : 
4294 *
4295 **********************************************************/
4296 #ifdef ANSI
4297 PUBLIC S16 cmPkTfuDciFormatB1B2Info
4298 (
4299 TfuDciFormatB1Info *param,
4300 Buffer *mBuf
4301 )
4302 #else
4303 PUBLIC S16 cmPkTfuDciFormatB1B2Info(param, mBuf)
4304 TfuDciFormatB1Info *param;
4305 Buffer *mBuf;
4306 #endif
4307 {
4308
4309    TRC3(cmPkTfuDciFormatB1B2Info)
4310
4311    CMCHKPK(SPkU8, param->DL_PCRS, mBuf);
4312    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4313    CMCHKPK(SPkU8, param->SCID, mBuf);
4314
4315    CMCHKPK(SPkU8, param->AntPorts_numLayers, mBuf);
4316    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4317    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4318    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4319    CMCHKPK(SPkU8, param->freqResIdx_xPUCCH, mBuf);
4320
4321    CMCHKPK(SPkU8, param->xPUCCH_TxTiming, mBuf);
4322
4323    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4324    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4325    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4326    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4327    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4328    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4329
4330    if(param->RBAssign <= TFU_RIV_324)
4331    {
4332       CMCHKPK(cmPkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4333    }
4334    else if (param->RBAssign == TFU_RIV_326)
4335    {
4336       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4337    }
4338   
4339    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4340    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4341    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4342    CMCHKPK(SPkU8, param->xPDSCHRange, mBuf);
4343    CMCHKPK(SPkU8, param->formatType, mBuf);
4344    RETVALUE(ROK);
4345 }
4346
4347
4348 \f
4349 /***********************************************************
4350 *
4351 *     Func : cmUnpkTfuDciFormatA1A2Info
4352 *
4353 *
4354 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4355 *
4356 *
4357 *     Ret  : S16
4358 *
4359 *     Notes:
4360 *
4361 *     File  : 
4362 *
4363 **********************************************************/
4364 #ifdef ANSI
4365 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info
4366 (
4367 TfuDciFormatA1Info *param,
4368 Buffer *mBuf
4369 )
4370 #else
4371 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info(param, mBuf)
4372 TfuDciFormatA1Info *param;
4373 Buffer *mBuf;
4374 #endif
4375 {
4376
4377    TRC3(cmUnpkTfuDciFormatA1A2Info)
4378
4379    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4380    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
4381    CMCHKUNPK(SUnpkU8, &param->xPUSCH_TxTiming, mBuf);
4382    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4383    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4384    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4385    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4386
4387    if(param->RBAssign <= TFU_RIV_324)
4388    {
4389       CMCHKUNPK(cmUnpkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4390    }
4391    else if(param->RBAssign == TFU_RIV_326)
4392    {
4393       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4394    }
4395
4396    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4397    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4398    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4399    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4400    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4401    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4402
4403    CMCHKUNPK(SUnpkU8, &param->uciOnxPUSCH, mBuf);
4404    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4405    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4406    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4407    CMCHKUNPK(SUnpkU8, &param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4408
4409    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4410    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
4411    CMCHKUNPK(SUnpkU8, &param->UL_PCRS, mBuf);
4412    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4413
4414    RETVALUE(ROK);
4415 }
4416
4417 \f
4418 /***********************************************************
4419 *
4420 *     Func : cmUnpkTfuDciFormatB1B2Info
4421 *
4422 *
4423 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4424 *
4425 *
4426 *     Ret  : S16
4427 *
4428 *     Notes:
4429 *
4430 *     File  : 
4431 *
4432 **********************************************************/
4433 #ifdef ANSI
4434 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info
4435 (
4436 TfuDciFormatB1Info *param,
4437 Buffer *mBuf
4438 )
4439 #else
4440 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info(param, mBuf)
4441 TfuDciFormatB1Info *param;
4442 Buffer *mBuf;
4443 #endif
4444 {
4445
4446    TRC3(cmUnpkTfuDciFormatB1B2Info)
4447
4448    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4449    CMCHKUNPK(SUnpkU8, &param->xPDSCHRange, mBuf);
4450    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4451    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4452    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4453
4454    if(param->RBAssign <= TFU_RIV_324)
4455    {
4456       CMCHKUNPK(cmUnpkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4457    }
4458    else if (param->RBAssign == TFU_RIV_326)
4459    {
4460       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4461    }
4462
4463    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4464    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4465    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4466    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4467    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4468    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4469
4470    CMCHKUNPK(SUnpkU8, &param->xPUCCH_TxTiming, mBuf);
4471    CMCHKUNPK(SUnpkU8, &param->freqResIdx_xPUCCH, mBuf);
4472    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4473    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4474    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4475    CMCHKUNPK(SUnpkU8, &param->AntPorts_numLayers, mBuf);
4476    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4477    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4478    CMCHKUNPK(SUnpkU8, &param->DL_PCRS, mBuf);
4479
4480    RETVALUE(ROK);
4481 }
4482
4483
4484 #endif /* TFU_5GTF */
4485
4486 \f
4487 /***********************************************************
4488 *
4489 *     Func : cmPkTfuDciFormat0Info
4490 *
4491 *
4492 *     Desc : This structure contains the information needed to convey DCI format 0.
4493 *
4494 *
4495 *     Ret  : S16
4496 *
4497 *     Notes:
4498 *
4499 *     File  : 
4500 *
4501 **********************************************************/
4502 #ifdef ANSI
4503 PUBLIC S16 cmPkTfuDciFormat0Info
4504 (
4505 TfuDciFormat0Info *param,
4506 Buffer *mBuf
4507 )
4508 #else
4509 PUBLIC S16 cmPkTfuDciFormat0Info(param, mBuf)
4510 TfuDciFormat0Info *param;
4511 Buffer *mBuf;
4512 #endif
4513 {
4514
4515    TRC3(cmPkTfuDciFormat0Info)
4516
4517    /* tfu_c_001.main_3: Adding pack for hqProcId */
4518    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4519    CMCHKPK(SPkU8, param->txAntenna, mBuf);
4520    CMCHKPK(SPkU8, param->numCqiBit, mBuf);
4521    CMCHKPK(SPkU8, param->cqiReq, mBuf);
4522    CMCHKPK(SPkU8, param->nDmrs, mBuf);
4523
4524 #ifdef TFU_TDD
4525    CMCHKPK(SPkU8, param->dai, mBuf);
4526    CMCHKPK(SPkU8, param->ulIdx, mBuf);
4527
4528 #endif
4529    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4530    CMCHKPK(SPkU8, param->ndi, mBuf);
4531    CMCHKPK(SPkU8, param->mcs, mBuf);
4532    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
4533 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
4534 #ifdef TFU_UPGRADE
4535    CMCHKPK(SPkU32, param->riv, mBuf);
4536 #endif
4537    CMCHKPK(SPkU8, param->numRb, mBuf);
4538    CMCHKPK(SPkU8, param->rbStart, mBuf);
4539    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
4540    RETVALUE(ROK);
4541 }
4542
4543
4544 \f
4545 /***********************************************************
4546 *
4547 *     Func : cmUnpkTfuDciFormat0Info
4548 *
4549 *
4550 *     Desc : This structure contains the information needed to convey DCI format 0.
4551 *
4552 *
4553 *     Ret  : S16
4554 *
4555 *     Notes:
4556 *
4557 *     File  : 
4558 *
4559 **********************************************************/
4560 #ifdef ANSI
4561 PUBLIC S16 cmUnpkTfuDciFormat0Info
4562 (
4563 TfuDciFormat0Info *param,
4564 Buffer *mBuf
4565 )
4566 #else
4567 PUBLIC S16 cmUnpkTfuDciFormat0Info(param, mBuf)
4568 TfuDciFormat0Info *param;
4569 Buffer *mBuf;
4570 #endif
4571 {
4572
4573    TRC3(cmUnpkTfuDciFormat0Info)
4574
4575    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
4576    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
4577    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
4578 #ifdef TFU_UPGRADE
4579    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4580 #endif /* TFU_UPGRADE */
4581    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
4582    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4583    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4584    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4585
4586 #ifdef TFU_TDD
4587    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
4588    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4589
4590 #endif
4591    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
4592    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
4593    CMCHKUNPK(SUnpkU8, &param->numCqiBit, mBuf);
4594    CMCHKUNPK(SUnpkU8, &param->txAntenna, mBuf);
4595    /* tfu_c_001.main_3: Adding unpack for hqProcId */
4596    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4597
4598    RETVALUE(ROK);
4599 }
4600
4601
4602 \f
4603 /***********************************************************
4604 *
4605 *     Func : cmPkTfuAllocMapOrRiv
4606 *
4607 *
4608 *     Desc : This Structure could either contain a resource allocation bit map OR a
4609  * RIV Value as defined in 213 - 7.1.6.
4610 *
4611 *
4612 *     Ret  : S16
4613 *
4614 *     Notes:
4615 *
4616 *     File  : 
4617 *
4618 **********************************************************/
4619 #ifdef ANSI
4620 PUBLIC S16 cmPkTfuAllocMapOrRiv
4621 (
4622 TfuAllocMapOrRiv *param,
4623 Buffer *mBuf
4624 )
4625 #else
4626 PUBLIC S16 cmPkTfuAllocMapOrRiv(param, mBuf)
4627 TfuAllocMapOrRiv *param;
4628 Buffer *mBuf;
4629 #endif
4630 {
4631
4632    S32 i;
4633    TRC3(cmPkTfuAllocMapOrRiv)
4634
4635       switch(param->type) {
4636       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4637 #ifdef TFU_RESMAP_CHANGE
4638          case UnKnown:
4639             CMCHKPK(cmPkTfuAllocMap, &param->u.allocMap, mBuf);
4640             break;
4641    
4642 #endif
4643    
4644       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4645 #ifndef TFU_RESMAP_CHANGE
4646          case TFU_ALLOC_TYPE_MAP:
4647             for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4648                CMCHKPK(SPkU8, param->u.resAllocMap[i], mBuf);
4649             }
4650             break;
4651    
4652 #endif
4653          case TFU_ALLOC_TYPE_RIV:
4654             CMCHKPK(SPkU32, param->u.riv, mBuf);
4655             break;
4656          default :
4657             RETVALUE(RFAILED);
4658       }
4659    CMCHKPK(SPkU32, param->type, mBuf);
4660    RETVALUE(ROK);
4661 }
4662
4663
4664 \f
4665 /***********************************************************
4666 *
4667 *     Func : cmUnpkTfuAllocMapOrRiv
4668 *
4669 *
4670 *     Desc : This Structure could either contain a resource allocation bit map OR a
4671  * RIV Value as defined in 213 - 7.1.6.
4672 *
4673 *
4674 *     Ret  : S16
4675 *
4676 *     Notes:
4677 *
4678 *     File  : 
4679 *
4680 **********************************************************/
4681 #ifdef ANSI
4682 PUBLIC S16 cmUnpkTfuAllocMapOrRiv
4683 (
4684 TfuAllocMapOrRiv *param,
4685 Buffer *mBuf
4686 )
4687 #else
4688 PUBLIC S16 cmUnpkTfuAllocMapOrRiv(param, mBuf)
4689 TfuAllocMapOrRiv *param;
4690 Buffer *mBuf;
4691 #endif
4692 {
4693
4694    S32 i;
4695    TRC3(cmUnpkTfuAllocMapOrRiv)
4696
4697    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
4698       switch(param->type) {
4699          case TFU_ALLOC_TYPE_RIV:
4700             CMCHKUNPK(SUnpkU32, &param->u.riv, mBuf);
4701             break;
4702    
4703       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4704 #ifndef TFU_RESMAP_CHANGE
4705          case TFU_ALLOC_TYPE_MAP:
4706             for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4707                CMCHKUNPK(SUnpkU8, &param->u.resAllocMap[i], mBuf);
4708             }
4709             break;
4710    
4711 #endif
4712    
4713       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4714 #ifdef TFU_RESMAP_CHANGE
4715          case UnKnown:
4716             CMCHKUNPK(cmUnpkTfuAllocMap, &param->u.allocMap, mBuf);
4717             break;
4718    
4719 #endif
4720          default :
4721             RETVALUE(RFAILED);
4722       }
4723    RETVALUE(ROK);
4724 }
4725
4726
4727 \f
4728 /***********************************************************
4729 *
4730 *     Func : cmPkTfuDciFormat1AllocInfo
4731 *
4732 *
4733 *     Desc : This structure contains only the allocation information, thats part
4734  * of DCI format 1. 
4735  * @details Allocation information also contains parameters necessary
4736  * for Physical layer to process Downlink Data. This structure accompanies the
4737  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4738  * @sa TfuDciFormat1Info
4739 *
4740 *
4741 *     Ret  : S16
4742 *
4743 *     Notes:
4744 *
4745 *     File  : 
4746 *
4747 **********************************************************/
4748 #ifdef ANSI
4749 PUBLIC S16 cmPkTfuDciFormat1AllocInfo
4750 (
4751 TfuDciFormat1AllocInfo *param,
4752 Buffer *mBuf
4753 )
4754 #else
4755 PUBLIC S16 cmPkTfuDciFormat1AllocInfo(param, mBuf)
4756 TfuDciFormat1AllocInfo *param;
4757 Buffer *mBuf;
4758 #endif
4759 {
4760
4761    S32 i;
4762    TRC3(cmPkTfuDciFormat1AllocInfo)
4763
4764    CMCHKPK(SPkU8, param->rv, mBuf);
4765    CMCHKPK(SPkU8, param->mcs, mBuf);
4766    CMCHKPK(SPkU8, param->ndi, mBuf);
4767    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4768    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4769       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4770    }
4771    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4772    RETVALUE(ROK);
4773 }
4774
4775
4776 \f
4777 /***********************************************************
4778 *
4779 *     Func : cmUnpkTfuDciFormat1AllocInfo
4780 *
4781 *
4782 *     Desc : This structure contains only the allocation information, thats part
4783  * of DCI format 1. 
4784  * @details Allocation information also contains parameters necessary
4785  * for Physical layer to process Downlink Data. This structure accompanies the
4786  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4787  * @sa TfuDciFormat1Info
4788 *
4789 *
4790 *     Ret  : S16
4791 *
4792 *     Notes:
4793 *
4794 *     File  : 
4795 *
4796 **********************************************************/
4797 #ifdef ANSI
4798 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo
4799 (
4800 TfuDciFormat1AllocInfo *param,
4801 Buffer *mBuf
4802 )
4803 #else
4804 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo(param, mBuf)
4805 TfuDciFormat1AllocInfo *param;
4806 Buffer *mBuf;
4807 #endif
4808 {
4809
4810    S32 i;
4811    TRC3(cmUnpkTfuDciFormat1AllocInfo)
4812
4813    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4814    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4815       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4816    }
4817    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4818    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4819    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4820    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4821    RETVALUE(ROK);
4822 }
4823
4824 \f
4825 /***********************************************************
4826 *
4827 *     Func : cmPkTfuDciFormat1Info
4828 *
4829 *
4830 *     Desc : This structure contains the information needed to convey DCI format 1.
4831  * @details Allocation information is separated from the other control
4832  * information carried in this format. This separation is needed as Data shall
4833  * also carry some control information, essentially allocation information,
4834  * along with it, in order to aid physical layer processing of the data.
4835 *
4836 *
4837 *     Ret  : S16
4838 *
4839 *     Notes:
4840 *
4841 *     File  : 
4842 *
4843 **********************************************************/
4844 #ifdef ANSI
4845 PUBLIC S16 cmPkTfuDciFormat1Info
4846 (
4847 TfuDciFormat1Info *param,
4848 Buffer *mBuf
4849 )
4850 #else
4851 PUBLIC S16 cmPkTfuDciFormat1Info(param, mBuf)
4852 TfuDciFormat1Info *param;
4853 Buffer *mBuf;
4854 #endif
4855 {
4856
4857    TRC3(cmPkTfuDciFormat1Info)
4858
4859    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4860
4861 #ifdef TFU_TDD
4862    CMCHKPK(SPkU8, param->dai, mBuf);
4863
4864 #endif
4865    CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4866    RETVALUE(ROK);
4867 }
4868
4869
4870 \f
4871 /***********************************************************
4872 *
4873 *     Func : cmUnpkTfuDciFormat1Info
4874 *
4875 *
4876 *     Desc : This structure contains the information needed to convey DCI format 1.
4877  * @details Allocation information is separated from the other control
4878  * information carried in this format. This separation is needed as Data shall
4879  * also carry some control information, essentially allocation information,
4880  * along with it, in order to aid physical layer processing of the data.
4881 *
4882 *
4883 *     Ret  : S16
4884 *
4885 *     Notes:
4886 *
4887 *     File  : 
4888 *
4889 **********************************************************/
4890 #ifdef ANSI
4891 PUBLIC S16 cmUnpkTfuDciFormat1Info
4892 (
4893 TfuDciFormat1Info *param,
4894 Buffer *mBuf
4895 )
4896 #else
4897 PUBLIC S16 cmUnpkTfuDciFormat1Info(param, mBuf)
4898 TfuDciFormat1Info *param;
4899 Buffer *mBuf;
4900 #endif
4901 {
4902
4903    TRC3(cmUnpkTfuDciFormat1Info)
4904
4905    CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4906
4907 #ifdef TFU_TDD
4908    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4909
4910 #endif
4911    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4912    RETVALUE(ROK);
4913 }
4914
4915
4916 \f
4917 /***********************************************************
4918 *
4919 *     Func : cmPkTfuDciFormat2AAllocInfo
4920 *
4921 *
4922 *     Desc : This structure contains only the allocation information, that is part
4923   * of DCI format 2A. 
4924   * @details Allocation information also contains parameters necessary
4925   * for Physical layer to process Downlink data. This structure accompanies the
4926   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4927   * @sa TfuDciFormat2AInfo
4928 *
4929 *
4930 *     Ret  : S16
4931 *
4932 *     Notes:
4933 *
4934 *     File  : 
4935 *
4936 **********************************************************/
4937 #ifdef ANSI
4938 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo
4939 (
4940 TfuDciFormat2AAllocInfo *param,
4941 Buffer *mBuf
4942 )
4943 #else
4944 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo(param, mBuf)
4945 TfuDciFormat2AAllocInfo *param;
4946 Buffer *mBuf;
4947 #endif
4948 {
4949
4950    S32 i;
4951    TRC3(cmPkTfuDciFormat2AAllocInfo)
4952
4953    CMCHKPK(SPkU8, param->transSwap, mBuf);
4954    CMCHKPK(SPkU8, param->precoding, mBuf);
4955
4956    for (i=1; i >= 0; i--) {
4957       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4958    }
4959
4960    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4961    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4962       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4963    }
4964
4965    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4966
4967    RETVALUE(ROK);
4968 }
4969
4970
4971 \f
4972 /***********************************************************
4973 *
4974 *     Func : cmUnpkTfuDciFormat2AAllocInfo
4975 *
4976 *
4977 *     Desc : This structure contains only the allocation information, that is part
4978   * of DCI format 2A. 
4979   * @details Allocation information also contains parameters necessary
4980   * for Physical layer to process Downlink data. This structure accompanies the
4981   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4982   * @sa TfuDciFormat2AInfo
4983 *
4984 *
4985 *     Ret  : S16
4986 *
4987 *     Notes:
4988 *
4989 *     File  : 
4990 *
4991 **********************************************************/
4992 #ifdef ANSI
4993 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo
4994 (
4995 TfuDciFormat2AAllocInfo *param,
4996 Buffer *mBuf
4997 )
4998 #else
4999 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo(param, mBuf)
5000 TfuDciFormat2AAllocInfo *param;
5001 Buffer *mBuf;
5002 #endif
5003 {
5004
5005    S32 i;
5006    TRC3(cmUnpkTfuDciFormat2AAllocInfo)
5007
5008
5009 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5010 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5011    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
5012
5013
5014 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5015 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5016    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
5017       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
5018    }
5019    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5020
5021 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5022 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5023
5024 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5025 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5026    for (i=0; i<=1; i++) {
5027       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5028    }
5029
5030    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
5031    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
5032    RETVALUE(ROK);
5033 }
5034
5035 #ifdef EMTC_ENABLE
5036 /***********************************************************
5037 *
5038 *     Func : cmPkTfuDciFormat6AAllocInfo
5039 *
5040 *
5041 *     Desc : This structure contains only the allocation information, that is part
5042   * of DCI format 6-1A. 
5043   * @details Allocation information also contains parameters necessary
5044   * for Physical layer to process Downlink data. This structure accompanies the
5045   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5046   * @sa TfuDciFormat61aInfo
5047 *
5048 *
5049 *     Ret  : S16
5050 *
5051 *     Notes:
5052 *
5053 *     File  : 
5054 *
5055 **********************************************************/
5056 #ifdef ANSI
5057 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo
5058 (
5059 TfuDciFormat61AllocInfo *param,
5060 Buffer *mBuf
5061 )
5062 #else
5063 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo(param, mBuf)
5064 TfuDciFormat61AllocInfo *param;
5065 Buffer *mBuf;
5066 #endif
5067 {
5068
5069    TRC3(cmPkTfuDciFormat6AAllocInfo)
5070
5071    CMCHKPK(SPkU8, param->rv, mBuf);
5072    CMCHKPK(SPkU8, param->mcs, mBuf);
5073    CMCHKPK(SPkU8, param->ndi, mBuf);
5074    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5075    CMCHKPK(SPkU32, param->riv, mBuf);
5076
5077    RETVALUE(ROK);
5078 }
5079
5080
5081 \f
5082 /***********************************************************
5083 *
5084 *     Func : cmUnpkTfuDciFormat6AAllocInfo
5085 *
5086 *
5087 *     Desc : This structure contains only the allocation information, that is part
5088   * of DCI format 6-1A. 
5089   * @details Allocation information also contains parameters necessary
5090   * for Physical layer to process Downlink data. This structure accompanies the
5091   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5092   * @sa TfuDciFormat61aInfo
5093 *
5094 *
5095 *     Ret  : S16
5096 *
5097 *     Notes:
5098 *
5099 *     File  : 
5100 *
5101 **********************************************************/
5102 #ifdef ANSI
5103 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo
5104 (
5105 TfuDciFormat61AllocInfo *param,
5106 Buffer *mBuf
5107 )
5108 #else
5109 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo(param, mBuf)
5110 TfuDciFormat61AllocInfo *param;
5111 Buffer *mBuf;
5112 #endif
5113 {
5114
5115    TRC3(cmUnpkTfuDciFormat6AAllocInfo)
5116
5117    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5118    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5119    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5120    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5121    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5122    printf("In cmUnpkTfuDciFormat6AAllocInfo :: Passed \n");
5123    RETVALUE(ROK);
5124 }
5125 #endif
5126
5127
5128 \f
5129 /***********************************************************
5130 *
5131 *     Func : cmPkTfuDciFormat2AInfo
5132 *
5133 *
5134 *     Desc : This structure contains the information carried by DCI format 2A. 
5135  * @details It carries the allocation information and other control information.
5136 *
5137 *
5138 *     Ret  : S16
5139 *
5140 *     Notes:
5141 *
5142 *     File  : 
5143 *
5144 **********************************************************/
5145 #ifdef ANSI
5146 PUBLIC S16 cmPkTfuDciFormat2AInfo
5147 (
5148 TfuDciFormat2AInfo *param,
5149 Buffer *mBuf
5150 )
5151 #else
5152 PUBLIC S16 cmPkTfuDciFormat2AInfo(param, mBuf)
5153 TfuDciFormat2AInfo *param;
5154 Buffer *mBuf;
5155 #endif
5156 {
5157
5158    TRC3(cmPkTfuDciFormat2AInfo)
5159
5160    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5161
5162 #ifdef TFU_TDD
5163    CMCHKPK(SPkU8, param->dai, mBuf);
5164
5165 #endif
5166    CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5167    RETVALUE(ROK);
5168 }
5169
5170
5171 \f
5172 /***********************************************************
5173 *
5174 *     Func : cmUnpkTfuDciFormat2AInfo
5175 *
5176 *
5177 *     Desc : This structure contains the information carried by DCI format 2A. 
5178  * @details It carries the allocation information and other control information.
5179 *
5180 *
5181 *     Ret  : S16
5182 *
5183 *     Notes:
5184 *
5185 *     File  : 
5186 *
5187 **********************************************************/
5188 #ifdef ANSI
5189 PUBLIC S16 cmUnpkTfuDciFormat2AInfo
5190 (
5191 TfuDciFormat2AInfo *param,
5192 Buffer *mBuf
5193 )
5194 #else
5195 PUBLIC S16 cmUnpkTfuDciFormat2AInfo(param, mBuf)
5196 TfuDciFormat2AInfo *param;
5197 Buffer *mBuf;
5198 #endif
5199 {
5200
5201    TRC3(cmUnpkTfuDciFormat2AInfo)
5202
5203    CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5204
5205 #ifdef TFU_TDD
5206    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5207
5208 #endif
5209    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5210    RETVALUE(ROK);
5211 }
5212
5213
5214 \f
5215 /***********************************************************
5216 *
5217 *     Func : cmPkTfuDciFormat2AllocInfo
5218 *
5219 *
5220 *     Desc : This structure contains only the allocation information, that is part
5221   * of DCI format 2. 
5222   * @details Allocation information also contains parameters necessary
5223   * for Physical layer to process Downlink data. This structure accompanies the
5224   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5225   * @sa TfuDciFormat2Info
5226 *
5227 *
5228 *     Ret  : S16
5229 *
5230 *     Notes:
5231 *
5232 *     File  : 
5233 *
5234 **********************************************************/
5235 #ifdef ANSI
5236 PUBLIC S16 cmPkTfuDciFormat2AllocInfo
5237 (
5238 TfuDciFormat2AllocInfo *param,
5239 Buffer *mBuf
5240 )
5241 #else
5242 PUBLIC S16 cmPkTfuDciFormat2AllocInfo(param, mBuf)
5243 TfuDciFormat2AllocInfo *param;
5244 Buffer *mBuf;
5245 #endif
5246 {
5247
5248    S32 i;
5249    TRC3(cmPkTfuDciFormat2AllocInfo)
5250
5251
5252 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5253 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5254    for (i=1; i >= 0; i--) {
5255       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5256    }
5257    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5258
5259    CMCHKPK(SPkU8, param->precoding, mBuf);
5260    CMCHKPK(SPkU8, param->transSwap, mBuf);
5261
5262 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5263 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5264
5265 #ifdef TFU_TDD
5266    CMCHKPK(SPkU8, param->dai, mBuf);
5267
5268 #endif
5269    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
5270       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
5271    }
5272
5273 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5274 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5275
5276 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5277 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5278    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
5279
5280    RETVALUE(ROK);
5281 }
5282
5283
5284 \f
5285 /***********************************************************
5286 *
5287 *     Func : cmUnpkTfuDciFormat2AllocInfo
5288 *
5289 *
5290 *     Desc : This structure contains only the allocation information, that is part
5291   * of DCI format 2. 
5292   * @details Allocation information also contains parameters necessary
5293   * for Physical layer to process Downlink data. This structure accompanies the
5294   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5295   * @sa TfuDciFormat2Info
5296 *
5297 *
5298 *     Ret  : S16
5299 *
5300 *     Notes:
5301 *
5302 *     File  : 
5303 *
5304 **********************************************************/
5305 #ifdef ANSI
5306 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo
5307 (
5308 TfuDciFormat2AllocInfo *param,
5309 Buffer *mBuf
5310 )
5311 #else
5312 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo(param, mBuf)
5313 TfuDciFormat2AllocInfo *param;
5314 Buffer *mBuf;
5315 #endif
5316 {
5317
5318    S32 i;
5319    TRC3(cmUnpkTfuDciFormat2AllocInfo)
5320
5321
5322 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5323 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5324    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
5325
5326
5327 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5328 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5329    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
5330       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
5331    }
5332
5333 #ifdef TFU_TDD
5334    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5335
5336 #endif
5337
5338 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5339 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5340    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
5341    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
5342
5343 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5344 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5345    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5346    for (i=0; i<=1; i++) {
5347       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5348    }
5349
5350    RETVALUE(ROK);
5351 }
5352
5353
5354 \f
5355 /***********************************************************
5356 *
5357 *     Func : cmPkTfuDciFormat2Info
5358 *
5359 *
5360 *     Desc : This structure contains the information carried by DCI format 2.
5361  * @details Allocation information is separated from the other control
5362  * information carried in this format. This separation is needed as Data must
5363  * also carry some control information, essentially, allocation information
5364  * along with it, in order to aid physical layer processing of the data.
5365 *
5366 *
5367 *     Ret  : S16
5368 *
5369 *     Notes:
5370 *
5371 *     File  : 
5372 *
5373 **********************************************************/
5374 #ifdef ANSI
5375 PUBLIC S16 cmPkTfuDciFormat2Info
5376 (
5377 TfuDciFormat2Info *param,
5378 Buffer *mBuf
5379 )
5380 #else
5381 PUBLIC S16 cmPkTfuDciFormat2Info(param, mBuf)
5382 TfuDciFormat2Info *param;
5383 Buffer *mBuf;
5384 #endif
5385 {
5386
5387    TRC3(cmPkTfuDciFormat2Info)
5388
5389
5390 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5391 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5392
5393 #ifdef TFU_TDD
5394    CMCHKPK(SPkU8, param->dai, mBuf);
5395
5396 #endif
5397
5398    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5399
5400 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5401 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5402    CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5403    RETVALUE(ROK);
5404 }
5405
5406
5407 \f
5408 /***********************************************************
5409 *
5410 *     Func : cmUnpkTfuDciFormat2Info
5411 *
5412 *
5413 *     Desc : This structure contains the information carried by DCI format 2.
5414  * @details Allocation information is separated from the other control
5415  * information carried in this format. This separation is needed as Data must
5416  * also carry some control information, essentially, allocation information
5417  * along with it, in order to aid physical layer processing of the data.
5418 *
5419 *
5420 *     Ret  : S16
5421 *
5422 *     Notes:
5423 *
5424 *     File  : 
5425 *
5426 **********************************************************/
5427 #ifdef ANSI
5428 PUBLIC S16 cmUnpkTfuDciFormat2Info
5429 (
5430 TfuDciFormat2Info *param,
5431 Buffer *mBuf
5432 )
5433 #else
5434 PUBLIC S16 cmUnpkTfuDciFormat2Info(param, mBuf)
5435 TfuDciFormat2Info *param;
5436 Buffer *mBuf;
5437 #endif
5438 {
5439
5440    TRC3(cmUnpkTfuDciFormat2Info)
5441
5442    CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5443
5444 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5445 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5446    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5447
5448 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5449 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5450
5451 #ifdef TFU_TDD
5452    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5453
5454 #endif
5455
5456    RETVALUE(ROK);
5457 }
5458
5459
5460 \f
5461 /***********************************************************
5462 *
5463 *     Func : cmPkTfuDciFormat3Info
5464 *
5465 *
5466 *     Desc : This structure contains the information carried in DCI format 3.
5467 *
5468 *
5469 *     Ret  : S16
5470 *
5471 *     Notes:
5472 *
5473 *     File  : 
5474 *
5475 **********************************************************/
5476 #ifdef ANSI
5477 PUBLIC S16 cmPkTfuDciFormat3Info
5478 (
5479 TfuDciFormat3Info *param,
5480 Buffer *mBuf
5481 )
5482 #else
5483 PUBLIC S16 cmPkTfuDciFormat3Info(param, mBuf)
5484 TfuDciFormat3Info *param;
5485 Buffer *mBuf;
5486 #endif
5487 {
5488
5489    S32 i;
5490    TRC3(cmPkTfuDciFormat3Info)
5491
5492    CMCHKPK(SPkU8, param->isPucch, mBuf);
5493    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5494       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5495    }
5496    RETVALUE(ROK);
5497 }
5498
5499
5500 \f
5501 /***********************************************************
5502 *
5503 *     Func : cmUnpkTfuDciFormat3Info
5504 *
5505 *
5506 *     Desc : This structure contains the information carried in DCI format 3.
5507 *
5508 *
5509 *     Ret  : S16
5510 *
5511 *     Notes:
5512 *
5513 *     File  : 
5514 *
5515 **********************************************************/
5516 #ifdef ANSI
5517 PUBLIC S16 cmUnpkTfuDciFormat3Info
5518 (
5519 TfuDciFormat3Info *param,
5520 Buffer *mBuf
5521 )
5522 #else
5523 PUBLIC S16 cmUnpkTfuDciFormat3Info(param, mBuf)
5524 TfuDciFormat3Info *param;
5525 Buffer *mBuf;
5526 #endif
5527 {
5528
5529    S32 i;
5530    TRC3(cmUnpkTfuDciFormat3Info)
5531
5532    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5533       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5534    }
5535    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5536    RETVALUE(ROK);
5537 }
5538
5539
5540 \f
5541 /***********************************************************
5542 *
5543 *     Func : cmPkTfuDciFormat3AInfo
5544 *
5545 *
5546 *     Desc : This structure contains the information carried by DCI format 3A.
5547 *
5548 *
5549 *     Ret  : S16
5550 *
5551 *     Notes:
5552 *
5553 *     File  : 
5554 *
5555 **********************************************************/
5556 #ifdef ANSI
5557 PUBLIC S16 cmPkTfuDciFormat3AInfo
5558 (
5559 TfuDciFormat3AInfo *param,
5560 Buffer *mBuf
5561 )
5562 #else
5563 PUBLIC S16 cmPkTfuDciFormat3AInfo(param, mBuf)
5564 TfuDciFormat3AInfo *param;
5565 Buffer *mBuf;
5566 #endif
5567 {
5568
5569    S32 i;
5570    TRC3(cmPkTfuDciFormat3AInfo)
5571    CMCHKPK(SPkU8, param->isPucch, mBuf);
5572    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5573       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5574    }
5575    RETVALUE(ROK);
5576 }
5577
5578
5579 \f
5580 /***********************************************************
5581 *
5582 *     Func : cmUnpkTfuDciFormat3AInfo
5583 *
5584 *
5585 *     Desc : This structure contains the information carried by DCI format 3A.
5586 *
5587 *
5588 *     Ret  : S16
5589 *
5590 *     Notes:
5591 *
5592 *     File  : 
5593 *
5594 **********************************************************/
5595 #ifdef ANSI
5596 PUBLIC S16 cmUnpkTfuDciFormat3AInfo
5597 (
5598 TfuDciFormat3AInfo *param,
5599 Buffer *mBuf
5600 )
5601 #else
5602 PUBLIC S16 cmUnpkTfuDciFormat3AInfo(param, mBuf)
5603 TfuDciFormat3AInfo *param;
5604 Buffer *mBuf;
5605 #endif
5606 {
5607
5608    S32 i;
5609    TRC3(cmUnpkTfuDciFormat3AInfo)
5610
5611    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5612       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5613    }
5614    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5615    RETVALUE(ROK);
5616 }
5617
5618 #ifdef EMTC_ENABLE
5619
5620
5621 /***********************************************************
5622 *
5623 *     Func : cmPkTfuDciFormat60aInfo 
5624 *
5625 *
5626 *     Desc : This structure contains the information that is carried in DCI
5627   * format 6-0A
5628 *
5629 *
5630 *     Ret  : S16
5631 *
5632 *     Notes:
5633 *
5634 *     File  :
5635 *
5636 ************************************************************/
5637
5638 #ifdef ANSI
5639 PRIVATE S16 cmPkTfuDciFormat60aInfo
5640 (
5641 TfuDciFormat60aInfo *param,
5642 Buffer *mBuf
5643 )
5644 #else
5645 PRIVATE S16 cmPkTfuDciFormat60aInfo(param, mBuf)
5646 TfuDciFormat60aInfo *param;
5647 Buffer *mBuf;
5648 #endif
5649 {
5650
5651    TRC3(cmPkTfuDciFormat60aInfo)
5652
5653    CMCHKPK(SPkU8, param->dciRep, mBuf);
5654    CMCHKPK(SPkU8, param->isSrs, mBuf);
5655    CMCHKPK(SPkU8, param->cqiReq, mBuf);
5656 #ifdef TFU_TDD
5657    CMCHKPK(SPkU8, param->dai, mBuf);
5658    CMCHKPK(SPkU8, param->ulIdx, mBuf);
5659 #endif
5660    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5661    CMCHKPK(SPkU8, param->rv, mBuf);
5662    CMCHKPK(SPkU8, param->ndi, mBuf);
5663    CMCHKPK(SPkU8, param->hqProcId, mBuf);
5664    CMCHKPK(SPkU8, param->rep, mBuf);
5665    CMCHKPK(SPkU8, param->mcs, mBuf);
5666    CMCHKPK(SPkU32, param->riv, mBuf);
5667    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5668    RETVALUE(ROK);
5669 }
5670 /***********************************************************
5671 *
5672 *     Func : cmPkTfuPdcchOrderInfoEmtc
5673 *
5674 *
5675 *     Desc : This structure contains the information that is carried in DCI
5676   * format 6-1A in the case of a PDCCH order.
5677 *
5678 *
5679 *     Ret  : S16
5680 *
5681 *     Notes:
5682 *
5683 *     File  : 
5684 *
5685 **********************************************************/
5686 #ifdef ANSI
5687 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc
5688 (
5689 TfuPdcchOrderInfoEmtc *param,
5690 Buffer *mBuf
5691 )
5692 #else
5693 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc(param, mBuf)
5694 TfuPdcchOrderInfoEmtc *param;
5695 Buffer *mBuf;
5696 #endif
5697 {
5698
5699    TRC3(cmPkTfuPdcchOrderInfoEmtc)
5700
5701    CMCHKPK(SPkU8, param->ceLevel, mBuf);
5702    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
5703    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
5704    CMCHKPK(SPkU32, param->riv, mBuf);
5705    RETVALUE(ROK);
5706 }
5707
5708 /***********************************************************
5709 *
5710 *     Func : cmPkTfudciformat61aPdsch
5711 *
5712 *
5713 *     Desc : This structure contains the information carried in DCI format 6-1A
5714   * when it is NOT used for a PDCCH order.
5715 *
5716 *
5717 *     Ret  : S16
5718 *
5719 *     Notes:
5720 *
5721 *     File  : 
5722 *
5723 **********************************************************/
5724 #ifdef ANSI
5725 PRIVATE S16 cmPkTfudciformat61aPdsch
5726 (
5727 Tfudciformat61aPdsch *param,
5728 Buffer *mBuf
5729 )
5730 #else
5731 PRIVATE S16 cmPkTfudciformat61aPdsch(param, mBuf)
5732 Tfudciformat61aPdsch *param;
5733 Buffer *mBuf;
5734 #endif
5735 {
5736
5737    TRC3(cmPkTfudciformat61aPdsch)
5738
5739    CMCHKPK(SPkU8, param->isTBMsg4, mBuf);
5740    CMCHKPK(SPkU8, param->dciRep, mBuf);
5741    CMCHKPK(SPkU8, param->harqAckOffst, mBuf);
5742    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
5743    CMCHKPK(SPkU8, param->tPmi, mBuf);
5744    CMCHKPK(SPkU8, param->isSrs, mBuf);
5745    CMCHKPK(SPkU8, param->antPortAndScrId, mBuf);
5746
5747 #ifdef TFU_TDD
5748    CMCHKPK(SPkU8, param->dai, mBuf);
5749 #endif
5750    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5751    CMCHKPK(SPkU8, param->rep, mBuf);
5752    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5753    CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
5754    RETVALUE(ROK);
5755 }
5756
5757
5758 /***********************************************************
5759 *
5760 *     Func : cmPkTfuDciFormat61aInfo
5761 *
5762 *
5763 *     Desc : This structure contains the information needed to convey DCI format 6-1A.
5764  * @details Format can possibly carry PDSCH allocation or information needed for
5765  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
5766  * sync with eNodeB.
5767 *
5768 *
5769 *     Ret  : S16
5770 *
5771 *     Notes:
5772 *
5773 *     File  : 
5774 *
5775 **********************************************************/
5776 #ifdef ANSI
5777 PUBLIC S16 cmPkTfuDciFormat61aInfo
5778 (
5779 TfuDciFormat61aInfo *param,
5780 Buffer *mBuf
5781 )
5782 #else
5783 PUBLIC S16 cmPkTfuDciFormat61aInfo(param, mBuf)
5784 TfuDciFormat61aInfo *param;
5785 Buffer *mBuf;
5786 #endif
5787 {
5788
5789    TRC3(cmPkTfuDciFormat61aInfo)
5790
5791    switch(param->isPdcchOrder) {
5792       case FALSE:
5793          CMCHKPK(cmPkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5794          break;
5795       case TRUE:
5796          CMCHKPK(cmPkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5797          break;
5798       default :
5799          RETVALUE(RFAILED);
5800       }
5801    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
5802
5803    RETVALUE(ROK);
5804 }
5805
5806 /***********************************************************
5807 *
5808 *     Func : cmUnpkTfuDciFormat60aInfo
5809 *
5810 *
5811 *     Desc : This structure contains the information that is carried in DCI
5812   * format 6-0A.
5813 *
5814 *
5815 *     Ret  : S16
5816 *
5817 *     Notes:
5818 *
5819 *     File  : 
5820 *
5821 * **********************************************************/
5822
5823 #ifdef ANSI
5824 PRIVATE S16 cmUnpkTfuDciFormat60aInfo 
5825 (
5826 TfuDciFormat60aInfo *param,
5827 Buffer *mBuf
5828 )
5829 #else
5830 PRIVATE S16 cmUnpkTfuDciFormat60aInfo(param, mBuf)
5831 TfuDciFormat60aInfo *param;
5832 Buffer *mBuf;
5833 #endif
5834 {
5835
5836    TRC3(cmUnpkTfuDciFormat60aInfo)
5837
5838    printf("In cmUnpkTfuDciFormat60aInfo :: Entry \n");
5839    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
5840    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5841    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5842    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
5843    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
5844    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5845    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5846    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5847 #ifdef TFU_TDD
5848    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
5849    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5850 #endif
5851    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
5852    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
5853    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
5854    printf("In cmUnpkTfuDciFormat60aInfo :: Exit \n");
5855    RETVALUE(ROK);
5856 }
5857 /***********************************************************
5858 *
5859 *     Func : cmUnpkTfuPdcchOrderInfoEmtc
5860 *
5861 *
5862 *     Desc : This structure contains the information that is carried in DCI
5863   * format 6-1A in the case of a PDCCH order.
5864 *
5865 *
5866 *     Ret  : S16
5867 *
5868 *     Notes:
5869 *
5870 *     File  : 
5871 *
5872 **********************************************************/
5873 #ifdef ANSI
5874 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc
5875 (
5876 TfuPdcchOrderInfoEmtc *param,
5877 Buffer *mBuf
5878 )
5879 #else
5880 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc(param, mBuf)
5881 TfuPdcchOrderInfoEmtc *param;
5882 Buffer *mBuf;
5883 #endif
5884 {
5885
5886    TRC3(cmUnpkTfuPdcchOrderInfoEmtc)
5887
5888    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Entry \n");
5889    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5890    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
5891    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
5892    CMCHKUNPK(SUnpkU8, &param->ceLevel, mBuf);
5893    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Passed \n");
5894    RETVALUE(ROK);
5895 }
5896
5897 /***********************************************************
5898 *
5899 *     Func : cmUnpkTfuDciFormat61aInfo
5900 *
5901 *
5902 *     Desc : This structure contains the information carried by DCI format 6-1A.
5903 *
5904 *
5905 *     Ret  : S16
5906 *
5907 *     Notes:
5908 *
5909 *     File  : 
5910 *
5911 **********************************************************/
5912 #ifdef ANSI
5913 PUBLIC S16 cmUnpkTfuDciFormat61aInfo
5914 (
5915 TfuDciFormat61aInfo *param,
5916 Buffer *mBuf
5917 )
5918 #else
5919 PUBLIC S16 cmUnpkTfuDciFormat61aInfo(param, mBuf)
5920 TfuDciFormat61aInfo *param;
5921 Buffer *mBuf;
5922 #endif
5923 {
5924
5925    TRC3(cmUnpkTfuDciFormat61aInfo)
5926
5927    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
5928    printf("1. cmUnpkTfuDciFormat61aInfo ::  isPdcchOrder %d \n", param->isPdcchOrder); 
5929    switch(param->isPdcchOrder) {
5930       case TRUE:
5931          CMCHKUNPK(cmUnpkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5932          break;
5933       case FALSE:
5934          CMCHKUNPK(cmUnpkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5935          break;
5936       default :
5937          RETVALUE(RFAILED);
5938       }
5939    RETVALUE(ROK);
5940 }
5941 #endif
5942 \f
5943 /***********************************************************
5944 *
5945 *     Func : cmPkTfuDciFormat1dAllocInfo
5946 *
5947 *
5948 *     Desc : This structure contains only the allocation information, thats part
5949   * of DCI format 1D. 
5950   * @details Allocation information also contains parameters necessary
5951   * for Physical layer to process Downlink Data. This structure accompanies the
5952   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5953   * @sa TfuDciFormat1dInfo
5954 *
5955 *
5956 *     Ret  : S16
5957 *
5958 *     Notes:
5959 *
5960 *     File  : 
5961 *
5962 **********************************************************/
5963 #ifdef ANSI
5964 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo
5965 (
5966 TfuDciFormat1dAllocInfo *param,
5967 Buffer *mBuf
5968 )
5969 #else
5970 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo(param, mBuf)
5971 TfuDciFormat1dAllocInfo *param;
5972 Buffer *mBuf;
5973 #endif
5974 {
5975
5976    TRC3(cmPkTfuDciFormat1dAllocInfo)
5977
5978    CMCHKPK(SPkU8, param->tPmi, mBuf);
5979    CMCHKPK(SPkU8, param->rv, mBuf);
5980    CMCHKPK(SPkU8, param->mcs, mBuf);
5981    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5982    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5983    CMCHKPK(SPkU8, param->isLocal, mBuf);
5984    RETVALUE(ROK);
5985 }
5986
5987
5988 \f
5989 /***********************************************************
5990 *
5991 *     Func : cmUnpkTfuDciFormat1dAllocInfo
5992 *
5993 *
5994 *     Desc : This structure contains only the allocation information, thats part
5995   * of DCI format 1D. 
5996   * @details Allocation information also contains parameters necessary
5997   * for Physical layer to process Downlink Data. This structure accompanies the
5998   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5999   * @sa TfuDciFormat1dInfo
6000 *
6001 *
6002 *     Ret  : S16
6003 *
6004 *     Notes:
6005 *
6006 *     File  : 
6007 *
6008 **********************************************************/
6009 #ifdef ANSI
6010 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo
6011 (
6012 TfuDciFormat1dAllocInfo *param,
6013 Buffer *mBuf
6014 )
6015 #else
6016 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo(param, mBuf)
6017 TfuDciFormat1dAllocInfo *param;
6018 Buffer *mBuf;
6019 #endif
6020 {
6021
6022    TRC3(cmUnpkTfuDciFormat1dAllocInfo)
6023
6024    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6025    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6026    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6027    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6028    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6029    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6030    RETVALUE(ROK);
6031 }
6032
6033
6034 \f
6035 /***********************************************************
6036 *
6037 *     Func : cmPkTfuDciFormat1dInfo
6038 *
6039 *
6040 *     Desc : This structure contains the information carried by DCI format 1D.
6041  * @details Allocation information is separated from the other control
6042  * information carried in this format. This separation is needed as Data shall
6043  * also carry some control information, essentially allocation information,
6044  * along with it, in order to aid physical layer processing of the data.
6045 *
6046 *
6047 *     Ret  : S16
6048 *
6049 *     Notes:
6050 *
6051 *     File  : 
6052 *
6053 **********************************************************/
6054 #ifdef ANSI
6055 PUBLIC S16 cmPkTfuDciFormat1dInfo
6056 (
6057 TfuDciFormat1dInfo *param,
6058 Buffer *mBuf
6059 )
6060 #else
6061 PUBLIC S16 cmPkTfuDciFormat1dInfo(param, mBuf)
6062 TfuDciFormat1dInfo *param;
6063 Buffer *mBuf;
6064 #endif
6065 {
6066
6067    TRC3(cmPkTfuDciFormat1dInfo)
6068
6069    CMCHKPK(SPkU8, param->dlPwrOffset, mBuf);
6070
6071 #ifdef TFU_TDD
6072    CMCHKPK(SPkU8, param->dai, mBuf);
6073
6074 #endif
6075    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6076    CMCHKPK(SPkU8, param->ndi, mBuf);
6077    CMCHKPK(SPkU8, param->harqProcId, mBuf);
6078    CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
6079    RETVALUE(ROK);
6080 }
6081
6082
6083 \f
6084 /***********************************************************
6085 *
6086 *     Func : cmUnpkTfuDciFormat1dInfo
6087 *
6088 *
6089 *     Desc : This structure contains the information carried by DCI format 1D.
6090  * @details Allocation information is separated from the other control
6091  * information carried in this format. This separation is needed as Data shall
6092  * also carry some control information, essentially allocation information,
6093  * along with it, in order to aid physical layer processing of the data.
6094 *
6095 *
6096 *     Ret  : S16
6097 *
6098 *     Notes:
6099 *
6100 *     File  : 
6101 *
6102 **********************************************************/
6103 #ifdef ANSI
6104 PUBLIC S16 cmUnpkTfuDciFormat1dInfo
6105 (
6106 TfuDciFormat1dInfo *param,
6107 Buffer *mBuf
6108 )
6109 #else
6110 PUBLIC S16 cmUnpkTfuDciFormat1dInfo(param, mBuf)
6111 TfuDciFormat1dInfo *param;
6112 Buffer *mBuf;
6113 #endif
6114 {
6115
6116    TRC3(cmUnpkTfuDciFormat1dInfo)
6117
6118    CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
6119    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6120    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6121    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6122
6123 #ifdef TFU_TDD
6124    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6125
6126 #endif
6127    CMCHKUNPK(SUnpkU8, &param->dlPwrOffset, mBuf);
6128    RETVALUE(ROK);
6129 }
6130
6131
6132 \f
6133 /***********************************************************
6134 *
6135 *     Func : cmPkTfuDciFormat1cInfo
6136 *
6137 *
6138 *     Desc : This structure contains only the allocation information, thats part
6139   * of DCI format 1C. 
6140   * @details Allocation information also contains parameters necessary
6141   * for Physical layer to process Downlink Data. This structure accompanies the
6142   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6143   * @sa TfuDciFormat1CInfo
6144 *
6145 *
6146 *     Ret  : S16
6147 *
6148 *     Notes:
6149 *
6150 *     File  : 
6151 *
6152 **********************************************************/
6153 #ifdef ANSI
6154 PUBLIC S16 cmPkTfuDciFormat1cInfo
6155 (
6156 TfuDciFormat1cInfo *param,
6157 Buffer *mBuf
6158 )
6159 #else
6160 PUBLIC S16 cmPkTfuDciFormat1cInfo(param, mBuf)
6161 TfuDciFormat1cInfo *param;
6162 Buffer *mBuf;
6163 #endif
6164 {
6165
6166    TRC3(cmPkTfuDciFormat1cInfo)
6167
6168    CMCHKPK(SPkU8, param->iTbs, mBuf);
6169    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6170    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6171    RETVALUE(ROK);
6172 }
6173
6174
6175 \f
6176 /***********************************************************
6177 *
6178 *     Func : cmUnpkTfuDciFormat1cInfo
6179 *
6180 *
6181 *     Desc : This structure contains only the allocation information, thats part
6182   * of DCI format 1C. 
6183   * @details Allocation information also contains parameters necessary
6184   * for Physical layer to process Downlink Data. This structure accompanies the
6185   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6186   * @sa TfuDciFormat1CInfo
6187 *
6188 *
6189 *     Ret  : S16
6190 *
6191 *     Notes:
6192 *
6193 *     File  : 
6194 *
6195 **********************************************************/
6196 #ifdef ANSI
6197 PUBLIC S16 cmUnpkTfuDciFormat1cInfo
6198 (
6199 TfuDciFormat1cInfo *param,
6200 Buffer *mBuf
6201 )
6202 #else
6203 PUBLIC S16 cmUnpkTfuDciFormat1cInfo(param, mBuf)
6204 TfuDciFormat1cInfo *param;
6205 Buffer *mBuf;
6206 #endif
6207 {
6208
6209    TRC3(cmUnpkTfuDciFormat1cInfo)
6210
6211    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6212    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6213    CMCHKUNPK(SUnpkU8, &param->iTbs, mBuf);
6214    RETVALUE(ROK);
6215 }
6216
6217
6218 \f
6219 /***********************************************************
6220 *
6221 *     Func : cmPkTfuDciFormat1bAllocInfo
6222 *
6223 *
6224 *     Desc : This structure contains only the allocation information, thats part
6225   * of DCI format 1 B. 
6226   * @details Allocation information also contains parameters necessary
6227   * for Physical layer to process Downlink Data. This structure accompanies the
6228   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6229   * @sa TfuDciFormat1BInfo
6230 *
6231 *
6232 *     Ret  : S16
6233 *
6234 *     Notes:
6235 *
6236 *     File  : 
6237 *
6238 **********************************************************/
6239 #ifdef ANSI
6240 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo
6241 (
6242 TfuDciFormat1bAllocInfo *param,
6243 Buffer *mBuf
6244 )
6245 #else
6246 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo(param, mBuf)
6247 TfuDciFormat1bAllocInfo *param;
6248 Buffer *mBuf;
6249 #endif
6250 {
6251
6252    TRC3(cmPkTfuDciFormat1bAllocInfo)
6253
6254    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
6255    CMCHKPK(SPkU8, param->tPmi, mBuf);
6256    CMCHKPK(SPkU8, param->ndi, mBuf);
6257    CMCHKPK(SPkU8, param->harqProcId, mBuf);
6258    CMCHKPK(SPkU8, param->rv, mBuf);
6259    CMCHKPK(SPkU8, param->mcs, mBuf);
6260    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6261    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6262    CMCHKPK(SPkU8, param->isLocal, mBuf);
6263    RETVALUE(ROK);
6264 }
6265
6266
6267 \f
6268 /***********************************************************
6269 *
6270 *     Func : cmUnpkTfuDciFormat1bAllocInfo
6271 *
6272 *
6273 *     Desc : This structure contains only the allocation information, thats part
6274   * of DCI format 1 B. 
6275   * @details Allocation information also contains parameters necessary
6276   * for Physical layer to process Downlink Data. This structure accompanies the
6277   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6278   * @sa TfuDciFormat1BInfo
6279 *
6280 *
6281 *     Ret  : S16
6282 *
6283 *     Notes:
6284 *
6285 *     File  : 
6286 *
6287 **********************************************************/
6288 #ifdef ANSI
6289 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo
6290 (
6291 TfuDciFormat1bAllocInfo *param,
6292 Buffer *mBuf
6293 )
6294 #else
6295 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo(param, mBuf)
6296 TfuDciFormat1bAllocInfo *param;
6297 Buffer *mBuf;
6298 #endif
6299 {
6300
6301    TRC3(cmUnpkTfuDciFormat1bAllocInfo)
6302
6303    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6304    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6305    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6306    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6307    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6308    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6309    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6310    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6311    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6312    RETVALUE(ROK);
6313 }
6314
6315
6316 \f
6317 /***********************************************************
6318 *
6319 *     Func : cmPkTfuPdcchOrderInfo
6320 *
6321 *
6322 *     Desc : This structure contains the information that is carried in DCI
6323   * format 1A in the case of a PDCCH order.
6324 *
6325 *
6326 *     Ret  : S16
6327 *
6328 *     Notes:
6329 *
6330 *     File  : 
6331 *
6332 **********************************************************/
6333 #ifdef ANSI
6334 PUBLIC S16 cmPkTfuPdcchOrderInfo
6335 (
6336 TfuPdcchOrderInfo *param,
6337 Buffer *mBuf
6338 )
6339 #else
6340 PUBLIC S16 cmPkTfuPdcchOrderInfo(param, mBuf)
6341 TfuPdcchOrderInfo *param;
6342 Buffer *mBuf;
6343 #endif
6344 {
6345
6346    TRC3(cmPkTfuPdcchOrderInfo)
6347
6348    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
6349    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
6350    RETVALUE(ROK);
6351 }
6352
6353
6354 \f
6355 /***********************************************************
6356 *
6357 *     Func : cmUnpkTfuPdcchOrderInfo
6358 *
6359 *
6360 *     Desc : This structure contains the information that is carried in DCI
6361   * format 1A in the case of a PDCCH order.
6362 *
6363 *
6364 *     Ret  : S16
6365 *
6366 *     Notes:
6367 *
6368 *     File  : 
6369 *
6370 **********************************************************/
6371 #ifdef ANSI
6372 PUBLIC S16 cmUnpkTfuPdcchOrderInfo
6373 (
6374 TfuPdcchOrderInfo *param,
6375 Buffer *mBuf
6376 )
6377 #else
6378 PUBLIC S16 cmUnpkTfuPdcchOrderInfo(param, mBuf)
6379 TfuPdcchOrderInfo *param;
6380 Buffer *mBuf;
6381 #endif
6382 {
6383
6384    TRC3(cmUnpkTfuPdcchOrderInfo)
6385
6386    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
6387    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
6388    RETVALUE(ROK);
6389 }
6390
6391
6392 \f
6393 /***********************************************************
6394 *
6395 *     Func : cmPkTfuDciFormat1aAllocInfo
6396 *
6397 *
6398 *     Desc : This structure contains only the allocation information, thats part
6399   * of DCI format 1A. 
6400   * @details Allocation information also contains parameters necessary
6401   * for Physical layer to process Downlink Data. This structure accompanies the
6402   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6403   * @sa TfuDciFormat1AInfo
6404 *
6405 *
6406 *     Ret  : S16
6407 *
6408 *     Notes:
6409 *
6410 *     File  : 
6411 *
6412 **********************************************************/
6413 #ifdef ANSI
6414 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo
6415 (
6416 TfuDciFormat1aAllocInfo *param,
6417 Buffer *mBuf
6418 )
6419 #else
6420 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo(param, mBuf)
6421 TfuDciFormat1aAllocInfo *param;
6422 Buffer *mBuf;
6423 #endif
6424 {
6425
6426    TRC3(cmPkTfuDciFormat1aAllocInfo)
6427
6428    CMCHKPK(SPkU8, param->ndi, mBuf);
6429    CMCHKPK(cmPkTknU8, &param->harqProcId, mBuf);
6430    CMCHKPK(SPkU8, param->rv, mBuf);
6431    CMCHKPK(SPkU8, param->mcs, mBuf);
6432    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6433    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6434    CMCHKPK(SPkU8, param->isLocal, mBuf);
6435    RETVALUE(ROK);
6436 }
6437
6438
6439 \f
6440 /***********************************************************
6441 *
6442 *     Func : cmUnpkTfuDciFormat1aAllocInfo
6443 *
6444 *
6445 *     Desc : This structure contains only the allocation information, thats part
6446   * of DCI format 1A. 
6447   * @details Allocation information also contains parameters necessary
6448   * for Physical layer to process Downlink Data. This structure accompanies the
6449   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6450   * @sa TfuDciFormat1AInfo
6451 *
6452 *
6453 *     Ret  : S16
6454 *
6455 *     Notes:
6456 *
6457 *     File  : 
6458 *
6459 **********************************************************/
6460 #ifdef ANSI
6461 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo
6462 (
6463 TfuDciFormat1aAllocInfo *param,
6464 Buffer *mBuf
6465 )
6466 #else
6467 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo(param, mBuf)
6468 TfuDciFormat1aAllocInfo *param;
6469 Buffer *mBuf;
6470 #endif
6471 {
6472
6473    TRC3(cmUnpkTfuDciFormat1aAllocInfo)
6474
6475    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6476    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6477    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6478    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6479    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6480    CMCHKUNPK(cmUnpkTknU8, &param->harqProcId, mBuf);
6481    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6482    RETVALUE(ROK);
6483 }
6484
6485
6486 \f
6487 /***********************************************************
6488 *
6489 *     Func : cmPkTfudciformat1aPdsch
6490 *
6491 *
6492 *     Desc : This structure contains the information carried in DCI format 1A
6493   * when it is NOT used for a PDCCH order.
6494 *
6495 *
6496 *     Ret  : S16
6497 *
6498 *     Notes:
6499 *
6500 *     File  : 
6501 *
6502 **********************************************************/
6503 #ifdef ANSI
6504 PUBLIC S16 cmPkTfudciformat1aPdsch
6505 (
6506 Tfudciformat1aPdsch *param,
6507 Buffer *mBuf
6508 )
6509 #else
6510 PUBLIC S16 cmPkTfudciformat1aPdsch(param, mBuf)
6511 Tfudciformat1aPdsch *param;
6512 Buffer *mBuf;
6513 #endif
6514 {
6515
6516    TRC3(cmPkTfudciformat1aPdsch)
6517
6518    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6519
6520 #ifdef TFU_TDD
6521    CMCHKPK(cmPkTknU8, &param->dai, mBuf);
6522
6523 #endif
6524    CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6525    RETVALUE(ROK);
6526 }
6527
6528
6529 \f
6530 /***********************************************************
6531 *
6532 *     Func : cmUnpkTfudciformat1aPdsch
6533 *
6534 *
6535 *     Desc : This structure contains the information carried in DCI format 1A
6536   * when it is NOT used for a PDCCH order.
6537 *
6538 *
6539 *     Ret  : S16
6540 *
6541 *     Notes:
6542 *
6543 *     File  : 
6544 *
6545 **********************************************************/
6546 #ifdef ANSI
6547 PUBLIC S16 cmUnpkTfudciformat1aPdsch
6548 (
6549 Tfudciformat1aPdsch *param,
6550 Buffer *mBuf
6551 )
6552 #else
6553 PUBLIC S16 cmUnpkTfudciformat1aPdsch(param, mBuf)
6554 Tfudciformat1aPdsch *param;
6555 Buffer *mBuf;
6556 #endif
6557 {
6558
6559    TRC3(cmUnpkTfudciformat1aPdsch)
6560
6561    CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6562
6563 #ifdef TFU_TDD
6564    CMCHKUNPK(cmUnpkTknU8, &param->dai, mBuf);
6565
6566 #endif
6567    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6568    RETVALUE(ROK);
6569 }
6570
6571 #ifdef EMTC_ENABLE
6572
6573 \f
6574 /***********************************************************
6575 *
6576 *     Func : cmUnpkTfudciformat61aPdsch
6577 *
6578 *
6579 *     Desc : This structure contains the information carried in DCI format 6-1A
6580   * when it is NOT used for a PDCCH order.
6581 *
6582 *
6583 *     Ret  : S16
6584 *
6585 *     Notes:
6586 *
6587 *     File  : 
6588 *
6589 **********************************************************/
6590 #ifdef ANSI
6591 PUBLIC S16 cmUnpkTfudciformat61aPdsch
6592 (
6593 Tfudciformat61aPdsch *param,
6594 Buffer *mBuf
6595 )
6596 #else
6597 PUBLIC S16 cmUnpkTfudciformat61aPdsch(param, mBuf)
6598 Tfudciformat61aPdsch *param;
6599 Buffer *mBuf;
6600 #endif
6601 {
6602
6603    TRC3(cmUnpkTfudciformat61aPdsch)
6604
6605    printf("1. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6606    CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
6607    printf("2. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6608    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
6609    printf("3. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6610    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
6611    printf("4. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6612    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6613    printf("5. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6614 #ifdef TFU_TDD
6615    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6616    printf("6. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6617 #endif
6618    CMCHKUNPK(SUnpkU8, &param->antPortAndScrId, mBuf);
6619    printf("7. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6620    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
6621    printf("8. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6622    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6623    printf("9. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6624    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6625    printf("10. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6626    CMCHKUNPK(SUnpkU8, &param->harqAckOffst, mBuf);
6627    printf("11. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6628    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
6629    printf("12. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6630    CMCHKUNPK(SUnpkU8, &param->isTBMsg4, mBuf);
6631    printf("1. cmUnpkTfudciformat61aPdsch ::  Passed \n"); 
6632    RETVALUE(ROK);
6633 }
6634 /***********************************************************
6635  *
6636  *     Func : cmUnpkTfuDirectIndication
6637  *
6638  *
6639  *     Desc : This structure contains the information that is carried in DCI
6640  *       format 6-2 in the case of a Direct information indication.
6641  *
6642  *
6643  *     Ret  : S16
6644  *
6645  *     Notes:
6646  *
6647  *     File  : 
6648  *
6649  **********************************************************/
6650 #ifdef ANSI
6651 PRIVATE S16 cmUnpkTfuDirectIndication
6652 (
6653  TfuDirectIndication *param,
6654  Buffer *mBuf
6655  )
6656 #else
6657 PRIVATE S16 cmUnpkTfuDirectIndication(param, mBuf)
6658    TfuDirectIndication *param;
6659    Buffer *mBuf;
6660 #endif
6661 {
6662
6663    TRC3(cmUnpkTfuDirectIndication)
6664    CMCHKUNPK(SUnpkU8, &param->directInd, mBuf);
6665
6666
6667
6668    RETVALUE(ROK);
6669 }
6670 /***********************************************************
6671  *
6672  *     Func : cmUnpkTfuDciFormat62AllocInfo
6673  *
6674  *
6675  *     Desc : This structure contains only the allocation information, that is part
6676  * of DCI format 6-2. 
6677  * @details Allocation information also contains parameters necessary
6678  * for Physical layer to process Downlink data. This structure accompanies the
6679  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6680  * @sa TfuDciFormat62Info
6681  *
6682  *
6683  *     Ret  : S16
6684  *
6685  *     Notes:
6686  *
6687  *     File  : 
6688  *
6689  **********************************************************/
6690 #ifdef ANSI
6691 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo
6692 (
6693  TfuDciFormat62AllocInfo *param,
6694  Buffer *mBuf
6695  )
6696 #else
6697 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo(param, mBuf)
6698    TfuDciFormat62AllocInfo *param;
6699    Buffer *mBuf;
6700 #endif
6701 {
6702    TRC3(cmUnpkTfuDciFormat62AllocInfo)
6703    CMCHKUNPK(SUnpkU8, &param->riv, mBuf);
6704    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6705    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6706
6707    RETVALUE(ROK);
6708 }
6709
6710 /***********************************************************
6711  *
6712  *     Func : cmUnpkTfudciformat62Pdsch
6713  *
6714  *
6715  *     Desc : This structure contains the information carried in DCI format 6-2
6716  *            when It is used for Paging message.
6717  *
6718  *
6719  *     Ret  : S16
6720  *
6721  *     Notes:
6722  *
6723  *     File  : 
6724  *
6725  **********************************************************/
6726 #ifdef ANSI
6727 PRIVATE S16 cmUnpkTfudciformat62Pdsch
6728 (
6729  Tfudciformat62Pdsch *param,
6730  Buffer *mBuf
6731  )
6732 #else
6733 PRIVATE S16 cmUnpkTfudciformat62Pdsch(param, mBuf)
6734    Tfudciformat62Pdsch *param;
6735    Buffer *mBuf;
6736 #endif
6737 {
6738
6739    TRC3(cmUnpkTfudciformat62Pdsch)
6740
6741
6742    CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6743    CMCHKUNPK(SUnpkU8, &param->repNum, mBuf);
6744    CMCHKUNPK(SUnpkU8, &param->dciSubRepNum, mBuf);
6745    RETVALUE(ROK);
6746 }
6747
6748
6749 /***********************************************************
6750  *
6751  *     Func : cmUnpkTfuDciFormat62Info
6752  *
6753  *
6754  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6755  *     @details Format can possibly carry PDSCH allocation or information needed for
6756  *     a Direct information Indication.
6757  * 
6758  *
6759  *
6760  *     Ret  : S16
6761  *
6762  *     Notes:
6763  *
6764  *     File  : 
6765  *
6766  **********************************************************/
6767 #ifdef ANSI
6768 PUBLIC S16 cmUnpkTfuDciFormat62Info
6769 (
6770  TfuDciFormat62Info *param,
6771  Buffer *mBuf
6772  )
6773 #else
6774 PUBLIC S16 cmUnpkTfuDciFormat62Info(param, mBuf)
6775    TfuDciFormat62Info *param;
6776    Buffer *mBuf;
6777 #endif
6778 {
6779
6780    TRC3(cmUnpkTfuDciFormat62Info)
6781       CMCHKUNPK(SUnpkU8, &param->isPaging, mBuf);
6782    switch(param->isPaging) {
6783       case FALSE:
6784          CMCHKUNPK(cmUnpkTfuDirectIndication, &param->t.directIndication, mBuf);
6785          break;
6786       case TRUE:
6787          CMCHKUNPK(cmUnpkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6788          break;
6789       default :
6790          RETVALUE(RFAILED);
6791    }
6792
6793
6794    RETVALUE(ROK);
6795 }
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808 /***********************************************************
6809  *
6810  *     Func : cmPkTfuDirectIndication
6811  *
6812  *
6813  *     Desc : This structure contains the information that is carried in DCI
6814  *       format 6-2 in the case of a Direct information indication.
6815  *
6816  *
6817  *     Ret  : S16
6818  *
6819  *     Notes:
6820  *
6821  *     File  : 
6822  *
6823  **********************************************************/
6824 #ifdef ANSI
6825 PRIVATE S16 cmPkTfuDirectIndication
6826 (
6827  TfuDirectIndication *param,
6828  Buffer *mBuf
6829  )
6830 #else
6831 PRIVATE S16 cmPkTfuDirectIndication(param, mBuf)
6832    TfuDirectIndication *param;
6833    Buffer *mBuf;
6834 #endif
6835 {
6836
6837    TRC3(cmPkTfuDirectIndication)
6838    CMCHKPK(SPkU8, param->directInd, mBuf);
6839
6840
6841    RETVALUE(ROK);
6842 }
6843
6844
6845
6846 /***********************************************************
6847  *
6848  *     Func : cmPkTfuDciFormat62AllocInfo
6849  *
6850  *
6851  *     Desc : This structure contains only the allocation information, that is part
6852  * of DCI format 6-2. 
6853  * @details Allocation information also contains parameters necessary
6854  * for Physical layer to process Downlink data. This structure accompanies the
6855  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6856  * @sa TfuDciFormat62Info
6857  *
6858  *
6859  *     Ret  : S16
6860  *
6861  *     Notes:
6862  *
6863  *     File  : 
6864  *
6865  **********************************************************/
6866 #ifdef ANSI
6867 PUBLIC S16 cmPkTfuDciFormat62AllocInfo
6868 (
6869  TfuDciFormat62AllocInfo *param,
6870  Buffer *mBuf
6871  )
6872 #else
6873 PUBLIC S16 cmPkTfuDciFormat62AllocInfo(param, mBuf)
6874    TfuDciFormat62AllocInfo *param;
6875    Buffer *mBuf;
6876 #endif
6877 {
6878
6879    TRC3(cmPkTfuDciFormat6AAllocInfo)
6880
6881    CMCHKPK(SPkU8, param->rv, mBuf);
6882    CMCHKPK(SPkU8, param->mcs, mBuf);
6883    CMCHKPK(SPkU8, param->riv, mBuf);
6884
6885    RETVALUE(ROK);
6886 }
6887
6888
6889
6890 /***********************************************************
6891  *
6892  *     Func : cmPkTfudciformat62Pdsch
6893  *
6894  *
6895  *     Desc : This structure contains the information carried in DCI format 6-2
6896  *            when It is used for Paging message.
6897  *
6898  *
6899  *     Ret  : S16
6900  *
6901  *     Notes:
6902  *
6903  *     File  : 
6904  *
6905  **********************************************************/
6906 #ifdef ANSI
6907 PRIVATE S16 cmPkTfudciformat62Pdsch
6908 (
6909  Tfudciformat62Pdsch *param,
6910  Buffer *mBuf
6911  )
6912 #else
6913 PRIVATE S16 cmPkTfudciformat62Pdsch(param, mBuf)
6914    Tfudciformat62Pdsch *param;
6915    Buffer *mBuf;
6916 #endif
6917 {
6918
6919    TRC3(cmPkTfudciformat62Pdsch)
6920    CMCHKPK(SPkU8, param->dciSubRepNum, mBuf);
6921    CMCHKPK(SPkU8, param->repNum, mBuf);
6922    CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6923    RETVALUE(ROK);
6924 }
6925
6926
6927
6928
6929 /***********************************************************
6930  *
6931  *     Func : cmPkTfuDciFormat62Info
6932  *
6933  *
6934  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6935  *      @details Format can possibly carry PDSCH allocation or information needed for
6936  *      a Direct information Indication.
6937  * 
6938  *
6939  *
6940  *     Ret  : S16
6941  *
6942  *     Notes:
6943  *
6944  *     File  : 
6945  *
6946  **********************************************************/
6947 #ifdef ANSI
6948 PUBLIC S16 cmPkTfuDciFormat62Info
6949 (
6950  TfuDciFormat62Info *param,
6951  Buffer *mBuf
6952  )
6953 #else
6954 PUBLIC S16 cmPkTfuDciFormat62Info(param, mBuf)
6955    TfuDciFormat62Info *param;
6956    Buffer *mBuf;
6957 #endif
6958 {
6959
6960    TRC3(cmPkTfuDciFormat62Info)
6961
6962       switch(param->isPaging) {
6963          case TRUE:
6964             CMCHKPK(cmPkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6965             break;
6966          case FALSE:
6967             CMCHKPK(cmPkTfuDirectIndication, &param->t.directIndication, mBuf);
6968             break;
6969          default :
6970             RETVALUE(RFAILED);
6971       }
6972    CMCHKPK(SPkU8, param->isPaging, mBuf);
6973
6974    RETVALUE(ROK);
6975 }
6976
6977
6978
6979
6980
6981
6982 #endif
6983
6984 \f
6985 /***********************************************************
6986 *
6987 *     Func : cmPkTfuDciFormat1aInfo
6988 *
6989 *
6990 *     Desc : This structure contains the information needed to convey DCI format 1A.
6991  * @details Format can possibly carry PDSCH allocation or information needed for
6992  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6993  * sync with eNodeB.
6994 *
6995 *
6996 *     Ret  : S16
6997 *
6998 *     Notes:
6999 *
7000 *     File  : 
7001 *
7002 **********************************************************/
7003 #ifdef ANSI
7004 PUBLIC S16 cmPkTfuDciFormat1aInfo
7005 (
7006 TfuDciFormat1aInfo *param,
7007 Buffer *mBuf
7008 )
7009 #else
7010 PUBLIC S16 cmPkTfuDciFormat1aInfo(param, mBuf)
7011 TfuDciFormat1aInfo *param;
7012 Buffer *mBuf;
7013 #endif
7014 {
7015
7016    TRC3(cmPkTfuDciFormat1aInfo)
7017
7018    switch(param->isPdcchOrder) {
7019       case FALSE:
7020          CMCHKPK(cmPkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
7021          break;
7022       case TRUE:
7023          CMCHKPK(cmPkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
7024          break;
7025       default :
7026          RETVALUE(RFAILED);
7027       }
7028    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
7029
7030    RETVALUE(ROK);
7031 }
7032
7033
7034 \f
7035 /***********************************************************
7036 *
7037 *     Func : cmUnpkTfuDciFormat1aInfo
7038 *
7039 *
7040 *     Desc : This structure contains the information needed to convey DCI format 1A.
7041  * @details Format can possibly carry PDSCH allocation or information needed for
7042  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
7043  * sync with eNodeB.
7044 *
7045 *
7046 *     Ret  : S16
7047 *
7048 *     Notes:
7049 *
7050 *     File  : 
7051 *
7052 **********************************************************/
7053 #ifdef ANSI
7054 PUBLIC S16 cmUnpkTfuDciFormat1aInfo
7055 (
7056 TfuDciFormat1aInfo *param,
7057 Buffer *mBuf
7058 )
7059 #else
7060 PUBLIC S16 cmUnpkTfuDciFormat1aInfo(param, mBuf)
7061 TfuDciFormat1aInfo *param;
7062 Buffer *mBuf;
7063 #endif
7064 {
7065
7066    TRC3(cmUnpkTfuDciFormat1aInfo)
7067
7068    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
7069    switch(param->isPdcchOrder) {
7070       case TRUE:
7071          CMCHKUNPK(cmUnpkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
7072          break;
7073       case FALSE:
7074          CMCHKUNPK(cmUnpkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
7075          break;
7076       default :
7077          RETVALUE(RFAILED);
7078       }
7079    RETVALUE(ROK);
7080 }
7081
7082
7083 \f
7084 /***********************************************************
7085 *
7086 *     Func : cmPkTfuDciFormat1bInfo
7087 *
7088 *
7089 *     Desc : This structure contains the information needed to convey DCI format 1A.
7090  * @details Allocation information is separated from the other control
7091  * information carried in this format. This separation is needed as Data shall
7092  * also carry some control information, essentially allocation information,
7093  * along with it, in order to aid physical layer processing of the data.
7094 *
7095 *
7096 *     Ret  : S16
7097 *
7098 *     Notes:
7099 *
7100 *     File  : 
7101 *
7102 **********************************************************/
7103 #ifdef ANSI
7104 PUBLIC S16 cmPkTfuDciFormat1bInfo
7105 (
7106 TfuDciFormat1bInfo *param,
7107 Buffer *mBuf
7108 )
7109 #else
7110 PUBLIC S16 cmPkTfuDciFormat1bInfo(param, mBuf)
7111 TfuDciFormat1bInfo *param;
7112 Buffer *mBuf;
7113 #endif
7114 {
7115
7116    TRC3(cmPkTfuDciFormat1bInfo)
7117
7118    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
7119
7120 #ifdef TFU_TDD
7121    CMCHKPK(SPkU8, param->dai, mBuf);
7122
7123 #endif
7124    CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
7125    RETVALUE(ROK);
7126 }
7127
7128
7129 \f
7130 /***********************************************************
7131 *
7132 *     Func : cmUnpkTfuDciFormat1bInfo
7133 *
7134 *
7135 *     Desc : This structure contains the information needed to convey DCI format 1A.
7136  * @details Allocation information is separated from the other control
7137  * information carried in this format. This separation is needed as Data shall
7138  * also carry some control information, essentially allocation information,
7139  * along with it, in order to aid physical layer processing of the data.
7140 *
7141 *
7142 *     Ret  : S16
7143 *
7144 *     Notes:
7145 *
7146 *     File  : 
7147 *
7148 **********************************************************/
7149 #ifdef ANSI
7150 PUBLIC S16 cmUnpkTfuDciFormat1bInfo
7151 (
7152 TfuDciFormat1bInfo *param,
7153 Buffer *mBuf
7154 )
7155 #else
7156 PUBLIC S16 cmUnpkTfuDciFormat1bInfo(param, mBuf)
7157 TfuDciFormat1bInfo *param;
7158 Buffer *mBuf;
7159 #endif
7160 {
7161
7162    TRC3(cmUnpkTfuDciFormat1bInfo)
7163
7164    CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
7165
7166 #ifdef TFU_TDD
7167    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
7168
7169 #endif
7170    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
7171    RETVALUE(ROK);
7172 }
7173
7174
7175 \f
7176 /***********************************************************
7177 *
7178 *     Func : cmPkTfuDciInfo
7179 *
7180 *
7181 *     Desc : This structure contains the information needed to convey the possible DCI
7182  * formats. The following are the supported formats - 
7183  * -# Format 0    - used for PUSCH scheduling
7184  * -# Format 1    - used for PDSCH scheduling
7185  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7186  *                   intitiated by a PDCCH order.
7187  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7188  *                   information.
7189  * -# Format 1C   - used for very compact scheduling of PDSCH.
7190  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7191  *                   information with power offset.
7192  * -# Format 2    - used for PDSCH Scheduling
7193  * -# Format 2A   - used for PDSCH Scheduling
7194  * -# Format 3    - used for power control 
7195  * -# Format 3A   - used for power control
7196 *
7197 *
7198 *     Ret  : S16
7199 *
7200 *     Notes:
7201 *
7202 *     File  : 
7203 *
7204 **********************************************************/
7205 #ifdef ANSI
7206 PUBLIC S16 cmPkTfuDciInfo
7207 (
7208 TfuDciInfo *param,
7209 Buffer *mBuf
7210 )
7211 #else
7212 PUBLIC S16 cmPkTfuDciInfo(param, mBuf)
7213 TfuDciInfo *param;
7214 Buffer *mBuf;
7215 #endif
7216 {
7217
7218    TRC3(cmPkTfuDciInfo)
7219
7220       switch(param->dciFormat) {
7221 #ifdef TFU_5GTF
7222          case TFU_DCI_FORMAT_B1:
7223             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7224             break;
7225          case TFU_DCI_FORMAT_B2:
7226             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7227             break;
7228          case TFU_DCI_FORMAT_A1:
7229             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7230             break;
7231          case TFU_DCI_FORMAT_A2:
7232             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7233             break;
7234 #endif
7235 #ifdef EMTC_ENABLE            
7236          case TFU_DCI_FORMAT_6_2:
7237             CMCHKPK(cmPkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7238             break;
7239          case TFU_DCI_FORMAT_6_1A:
7240             CMCHKPK(cmPkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7241             break;
7242          case TFU_DCI_FORMAT_6_0A:
7243             CMCHKPK(cmPkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7244             break;
7245 #endif            
7246          case TFU_DCI_FORMAT_3A:
7247             CMCHKPK(cmPkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7248             break;
7249          case TFU_DCI_FORMAT_3:
7250             CMCHKPK(cmPkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7251             break;
7252          case TFU_DCI_FORMAT_2A:
7253             CMCHKPK(cmPkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7254             break;
7255          case TFU_DCI_FORMAT_2:
7256             CMCHKPK(cmPkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7257             break;
7258          case TFU_DCI_FORMAT_1D:
7259             CMCHKPK(cmPkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7260             break;
7261          case TFU_DCI_FORMAT_1C:
7262             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7263             break;
7264          case TFU_DCI_FORMAT_1B:
7265             CMCHKPK(cmPkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7266             break;
7267          case TFU_DCI_FORMAT_1A:
7268             CMCHKPK(cmPkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7269             break;
7270          case TFU_DCI_FORMAT_1:
7271             CMCHKPK(cmPkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7272             break;
7273          case TFU_DCI_FORMAT_0:
7274             CMCHKPK(cmPkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7275             break;
7276          default :
7277             RETVALUE(RFAILED);
7278       }
7279    CMCHKPK(SPkU32, param->dciFormat, mBuf);
7280    RETVALUE(ROK);
7281 }
7282
7283
7284 \f
7285 /***********************************************************
7286 *
7287 *     Func : cmUnpkTfuDciInfo
7288 *
7289 *
7290 *     Desc : This structure contains the information needed to convey the possible DCI
7291  * formats. The following are the supported formats - 
7292  * -# Format 0    - used for PUSCH scheduling
7293  * -# Format 1    - used for PDSCH scheduling
7294  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7295  *                   intitiated by a PDCCH order.
7296  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7297  *                   information.
7298  * -# Format 1C   - used for very compact scheduling of PDSCH.
7299  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7300  *                   information with power offset.
7301  * -# Format 2    - used for PDSCH Scheduling
7302  * -# Format 2A   - used for PDSCH Scheduling
7303  * -# Format 3    - used for power control 
7304  * -# Format 3A   - used for power control
7305 *
7306 *
7307 *     Ret  : S16
7308 *
7309 *     Notes:
7310 *
7311 *     File  : 
7312 *
7313 **********************************************************/
7314 #ifdef ANSI
7315 PUBLIC S16 cmUnpkTfuDciInfo
7316 (
7317 TfuDciInfo *param,
7318 Buffer *mBuf
7319 )
7320 #else
7321 PUBLIC S16 cmUnpkTfuDciInfo(param, mBuf)
7322 TfuDciInfo *param;
7323 Buffer *mBuf;
7324 #endif
7325 {
7326
7327    TRC3(cmUnpkTfuDciInfo)
7328
7329
7330    CMCHKUNPK(SUnpkU32, (U32 *)&param->dciFormat, mBuf);
7331       switch(param->dciFormat) {
7332          case TFU_DCI_FORMAT_0:
7333             CMCHKUNPK(cmUnpkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7334             break;
7335          case TFU_DCI_FORMAT_1:
7336             CMCHKUNPK(cmUnpkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7337             break;
7338          case TFU_DCI_FORMAT_1A:
7339             CMCHKUNPK(cmUnpkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7340             break;
7341          case TFU_DCI_FORMAT_1B:
7342             CMCHKUNPK(cmUnpkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7343             break;
7344          case TFU_DCI_FORMAT_1C:
7345             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7346             break;
7347          case TFU_DCI_FORMAT_1D:
7348             CMCHKUNPK(cmUnpkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7349             break;
7350          case TFU_DCI_FORMAT_2:
7351             CMCHKUNPK(cmUnpkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7352             break;
7353          case TFU_DCI_FORMAT_2A:
7354             CMCHKUNPK(cmUnpkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7355             break;
7356          case TFU_DCI_FORMAT_3:
7357             CMCHKUNPK(cmUnpkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7358             break;
7359          case TFU_DCI_FORMAT_3A:
7360             CMCHKUNPK(cmUnpkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7361             break;
7362 #ifdef EMTC_ENABLE            
7363          case TFU_DCI_FORMAT_6_0A:
7364             CMCHKUNPK(cmUnpkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7365             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7366             break;
7367          case TFU_DCI_FORMAT_6_1A:
7368             CMCHKUNPK(cmUnpkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7369             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7370             break;
7371          case TFU_DCI_FORMAT_6_2:
7372             CMCHKUNPK(cmUnpkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7373             break;
7374
7375 #endif            
7376 #ifdef TFU_5GTF
7377          case TFU_DCI_FORMAT_A1:
7378             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7379             break;
7380                         case TFU_DCI_FORMAT_A2:
7381             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7382             break;
7383          case TFU_DCI_FORMAT_B1:
7384             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7385             break;
7386                         case TFU_DCI_FORMAT_B2:
7387             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7388             break;
7389 #endif
7390          default :
7391             RETVALUE(RFAILED);
7392       }
7393    RETVALUE(ROK);
7394 }
7395
7396
7397 \f
7398 /***********************************************************
7399 *
7400 *     Func : cmPkTfuSubbandInfo
7401 *
7402 *
7403 *     Desc : This structure contains the information needed to convey the start and size
7404  * of the subband in the CQI report.
7405 *
7406 *
7407 *     Ret  : S16
7408 *
7409 *     Notes:
7410 *
7411 *     File  : 
7412 *
7413 **********************************************************/
7414 #ifdef ANSI
7415 PUBLIC S16 cmPkTfuSubbandInfo
7416 (
7417 TfuSubbandInfo *param,
7418 Buffer *mBuf
7419 )
7420 #else
7421 PUBLIC S16 cmPkTfuSubbandInfo(param, mBuf)
7422 TfuSubbandInfo *param;
7423 Buffer *mBuf;
7424 #endif
7425 {
7426
7427    TRC3(cmPkTfuSubbandInfo)
7428
7429    CMCHKPK(SPkU8, param->numRb, mBuf);
7430    CMCHKPK(SPkU8, param->rbStart, mBuf);
7431    RETVALUE(ROK);
7432 }
7433
7434
7435 \f
7436 /***********************************************************
7437 *
7438 *     Func : cmUnpkTfuSubbandInfo
7439 *
7440 *
7441 *     Desc : This structure contains the information needed to convey the start and size
7442  * of the subband in the CQI report.
7443 *
7444 *
7445 *     Ret  : S16
7446 *
7447 *     Notes:
7448 *
7449 *     File  : 
7450 *
7451 **********************************************************/
7452 #ifdef ANSI
7453 PUBLIC S16 cmUnpkTfuSubbandInfo
7454 (
7455 TfuSubbandInfo *param,
7456 Buffer *mBuf
7457 )
7458 #else
7459 PUBLIC S16 cmUnpkTfuSubbandInfo(param, mBuf)
7460 TfuSubbandInfo *param;
7461 Buffer *mBuf;
7462 #endif
7463 {
7464
7465    TRC3(cmUnpkTfuSubbandInfo)
7466
7467    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
7468    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
7469    RETVALUE(ROK);
7470 }
7471
7472
7473
7474 \f
7475 /***********************************************************
7476 *
7477 *     Func : cmPkTfuSubbandCqiInfo
7478 *
7479 *
7480 *     Desc : This structure is used to convey the subbannd CQI reported.
7481 *
7482 *
7483 *     Ret  : S16
7484 *
7485 *     Notes:
7486 *
7487 *     File  : 
7488 *
7489 **********************************************************/
7490 #ifdef ANSI
7491 PUBLIC S16 cmPkTfuSubbandCqiInfo
7492 (
7493 TfuSubbandCqiInfo *param,
7494 Buffer *mBuf
7495 )
7496 #else
7497 PUBLIC S16 cmPkTfuSubbandCqiInfo(param, mBuf)
7498 TfuSubbandCqiInfo *param;
7499 Buffer *mBuf;
7500 #endif
7501 {
7502
7503    TRC3(cmPkTfuSubbandCqiInfo)
7504
7505    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
7506    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
7507    RETVALUE(ROK);
7508 }
7509
7510
7511 \f
7512 /***********************************************************
7513 *
7514 *     Func : cmUnpkTfuSubbandCqiInfo
7515 *
7516 *
7517 *     Desc : This structure is used to convey the subbannd CQI reported.
7518 *
7519 *
7520 *     Ret  : S16
7521 *
7522 *     Notes:
7523 *
7524 *     File  : 
7525 *
7526 **********************************************************/
7527 #ifdef ANSI
7528 PUBLIC S16 cmUnpkTfuSubbandCqiInfo
7529 (
7530 TfuSubbandCqiInfo *param,
7531 Buffer *mBuf
7532 )
7533 #else
7534 PUBLIC S16 cmUnpkTfuSubbandCqiInfo(param, mBuf)
7535 TfuSubbandCqiInfo *param;
7536 Buffer *mBuf;
7537 #endif
7538 {
7539
7540    TRC3(cmUnpkTfuSubbandCqiInfo)
7541
7542    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
7543    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
7544    RETVALUE(ROK);
7545 }
7546
7547
7548 \f
7549 /***********************************************************
7550 *
7551 *     Func : cmPkTfuPdcchCceInfo
7552 *
7553 *
7554 *     Desc : This structure conveys the CCE information.
7555 *
7556 *
7557 *     Ret  : S16
7558 *
7559 *     Notes:
7560 *
7561 *     File  : 
7562 *
7563 **********************************************************/
7564 #ifdef ANSI
7565 PUBLIC S16 cmPkTfuPdcchCceInfo
7566 (
7567 TfuPdcchCceInfo *param,
7568 Buffer *mBuf
7569 )
7570 #else
7571 PUBLIC S16 cmPkTfuPdcchCceInfo(param, mBuf)
7572 TfuPdcchCceInfo *param;
7573 Buffer *mBuf;
7574 #endif
7575 {
7576
7577    TRC3(cmPkTfuPdcchCceInfo)
7578
7579    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
7580    CMCHKPK(SPkU8, param->cceIdx, mBuf);
7581    RETVALUE(ROK);
7582 }
7583
7584
7585 \f
7586 /***********************************************************
7587 *
7588 *     Func : cmUnpkTfuPdcchCceInfo
7589 *
7590 *
7591 *     Desc : This structure conveys the CCE information.
7592 *
7593 *
7594 *     Ret  : S16
7595 *
7596 *     Notes:
7597 *
7598 *     File  : 
7599 *
7600 **********************************************************/
7601 #ifdef ANSI
7602 PUBLIC S16 cmUnpkTfuPdcchCceInfo
7603 (
7604 TfuPdcchCceInfo *param,
7605 Buffer *mBuf
7606 )
7607 #else
7608 PUBLIC S16 cmUnpkTfuPdcchCceInfo(param, mBuf)
7609 TfuPdcchCceInfo *param;
7610 Buffer *mBuf;
7611 #endif
7612 {
7613
7614    TRC3(cmUnpkTfuPdcchCceInfo)
7615
7616    CMCHKUNPK(SUnpkU8, &param->cceIdx, mBuf);
7617    CMCHKUNPK(cmUnpkLteAggrLvl,(U32 *)&param->aggrLvl, mBuf);
7618    RETVALUE(ROK);
7619 }
7620
7621
7622 \f
7623 /***********************************************************
7624 *
7625 *     Func : cmPkTfuCqiPucchMode10
7626 *
7627 *
7628 *     Desc : This structure maps to the CQI mode 10. The report could either
7629   * convey a Rank index or a wideband CQI.
7630 *
7631 *
7632 *     Ret  : S16
7633 *
7634 *     Notes:
7635 *
7636 *     File  : 
7637 *
7638 **********************************************************/
7639 #ifdef ANSI
7640 PUBLIC S16 cmPkTfuCqiPucchMode10
7641 (
7642 TfuCqiPucchMode10 *param,
7643 Buffer *mBuf
7644 )
7645 #else
7646 PUBLIC S16 cmPkTfuCqiPucchMode10(param, mBuf)
7647 TfuCqiPucchMode10 *param;
7648 Buffer *mBuf;
7649 #endif
7650 {
7651
7652    TRC3(cmPkTfuCqiPucchMode10)
7653
7654       switch(param->type) {
7655          case TFU_RPT_CQI:
7656             CMCHKPK(SPkU8, param->u.cqi, mBuf);
7657             break;
7658          case TFU_RPT_RI:
7659             CMCHKPK(SPkU8, param->u.ri, mBuf);
7660             break;
7661          default :
7662             RETVALUE(RFAILED);
7663       }
7664    CMCHKPK(SPkU32, param->type, mBuf);
7665    RETVALUE(ROK);
7666 }
7667
7668
7669 \f
7670 /***********************************************************
7671 *
7672 *     Func : cmUnpkTfuCqiPucchMode10
7673 *
7674 *
7675 *     Desc : This structure maps to the CQI mode 10. The report could either
7676   * convey a Rank index or a wideband CQI.
7677 *
7678 *
7679 *     Ret  : S16
7680 *
7681 *     Notes:
7682 *
7683 *     File  : 
7684 *
7685 **********************************************************/
7686 #ifdef ANSI
7687 PUBLIC S16 cmUnpkTfuCqiPucchMode10
7688 (
7689 TfuCqiPucchMode10 *param,
7690 Buffer *mBuf
7691 )
7692 #else
7693 PUBLIC S16 cmUnpkTfuCqiPucchMode10(param, mBuf)
7694 TfuCqiPucchMode10 *param;
7695 Buffer *mBuf;
7696 #endif
7697 {
7698
7699    TRC3(cmUnpkTfuCqiPucchMode10)
7700
7701    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7702       switch(param->type) {
7703          case TFU_RPT_RI:
7704             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7705             break;
7706          case TFU_RPT_CQI:
7707             CMCHKUNPK(SUnpkU8, &param->u.cqi, mBuf);
7708             break;
7709          default :
7710             RETVALUE(RFAILED);
7711       }
7712    RETVALUE(ROK);
7713 }
7714
7715
7716 \f
7717 /***********************************************************
7718 *
7719 *     Func : cmPkTfuCqiMode11Cqi
7720 *
7721 *
7722 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7723   * wideband differential CQI.
7724 *
7725 *
7726 *     Ret  : S16
7727 *
7728 *     Notes:
7729 *
7730 *     File  : 
7731 *
7732 **********************************************************/
7733 #ifdef ANSI
7734 PUBLIC S16 cmPkTfuCqiMode11Cqi
7735 (
7736 TfuCqiMode11Cqi *param,
7737 Buffer *mBuf
7738 )
7739 #else
7740 PUBLIC S16 cmPkTfuCqiMode11Cqi(param, mBuf)
7741 TfuCqiMode11Cqi *param;
7742 Buffer *mBuf;
7743 #endif
7744 {
7745
7746    TRC3(cmPkTfuCqiMode11Cqi)
7747
7748    CMCHKPK(cmPkTknU8, &param->wideDiffCqi, mBuf);
7749    CMCHKPK(SPkU8, param->pmi, mBuf);
7750    CMCHKPK(SPkU8, param->cqi, mBuf);
7751    RETVALUE(ROK);
7752 }
7753
7754
7755 \f
7756 /***********************************************************
7757 *
7758 *     Func : cmUnpkTfuCqiMode11Cqi
7759 *
7760 *
7761 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7762   * wideband differential CQI.
7763 *
7764 *
7765 *     Ret  : S16
7766 *
7767 *     Notes:
7768 *
7769 *     File  : 
7770 *
7771 **********************************************************/
7772 #ifdef ANSI
7773 PUBLIC S16 cmUnpkTfuCqiMode11Cqi
7774 (
7775 TfuCqiMode11Cqi *param,
7776 Buffer *mBuf
7777 )
7778 #else
7779 PUBLIC S16 cmUnpkTfuCqiMode11Cqi(param, mBuf)
7780 TfuCqiMode11Cqi *param;
7781 Buffer *mBuf;
7782 #endif
7783 {
7784
7785    TRC3(cmUnpkTfuCqiMode11Cqi)
7786
7787    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7788    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
7789    CMCHKUNPK(cmUnpkTknU8, &param->wideDiffCqi, mBuf);
7790    RETVALUE(ROK);
7791 }
7792
7793
7794 \f
7795 /***********************************************************
7796 *
7797 *     Func : cmPkTfuCqiPucchMode11
7798 *
7799 *
7800 *     Desc : This structure maps to the CQI mode 11. The report could either
7801   * convey a Rank index or a CQI report.
7802 *
7803 *
7804 *     Ret  : S16
7805 *
7806 *     Notes:
7807 *
7808 *     File  : 
7809 *
7810 **********************************************************/
7811 #ifdef ANSI
7812 PUBLIC S16 cmPkTfuCqiPucchMode11
7813 (
7814 TfuCqiPucchMode11 *param,
7815 Buffer *mBuf
7816 )
7817 #else
7818 PUBLIC S16 cmPkTfuCqiPucchMode11(param, mBuf)
7819 TfuCqiPucchMode11 *param;
7820 Buffer *mBuf;
7821 #endif
7822 {
7823
7824    TRC3(cmPkTfuCqiPucchMode11)
7825
7826       switch(param->type) {
7827          case TFU_RPT_CQI:
7828             CMCHKPK(cmPkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7829             break;
7830          case TFU_RPT_RI:
7831             CMCHKPK(SPkU8, param->u.ri, mBuf);
7832             break;
7833          default :
7834             RETVALUE(RFAILED);
7835       }
7836    CMCHKPK(SPkU32, param->type, mBuf);
7837    RETVALUE(ROK);
7838 }
7839
7840
7841 \f
7842 /***********************************************************
7843 *
7844 *     Func : cmUnpkTfuCqiPucchMode11
7845 *
7846 *
7847 *     Desc : This structure maps to the CQI mode 11. The report could either
7848   * convey a Rank index or a CQI report.
7849 *
7850 *
7851 *     Ret  : S16
7852 *
7853 *     Notes:
7854 *
7855 *     File  : 
7856 *
7857 **********************************************************/
7858 #ifdef ANSI
7859 PUBLIC S16 cmUnpkTfuCqiPucchMode11
7860 (
7861 TfuCqiPucchMode11 *param,
7862 Buffer *mBuf
7863 )
7864 #else
7865 PUBLIC S16 cmUnpkTfuCqiPucchMode11(param, mBuf)
7866 TfuCqiPucchMode11 *param;
7867 Buffer *mBuf;
7868 #endif
7869 {
7870
7871    TRC3(cmUnpkTfuCqiPucchMode11)
7872
7873    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7874       switch(param->type) {
7875          case TFU_RPT_RI:
7876             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7877             break;
7878          case TFU_RPT_CQI:
7879             CMCHKUNPK(cmUnpkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7880             break;
7881          default :
7882             RETVALUE(RFAILED);
7883       }
7884    RETVALUE(ROK);
7885 }
7886
7887
7888 \f
7889 /***********************************************************
7890 *
7891 *     Func : cmPkTfuCqiMode20SubCqi
7892 *
7893 *
7894 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7895 *
7896 *
7897 *     Ret  : S16
7898 *
7899 *     Notes:
7900 *
7901 *     File  : 
7902 *
7903 **********************************************************/
7904 #ifdef ANSI
7905 PUBLIC S16 cmPkTfuCqiMode20SubCqi
7906 (
7907 TfuCqiMode20SubCqi *param,
7908 Buffer *mBuf
7909 )
7910 #else
7911 PUBLIC S16 cmPkTfuCqiMode20SubCqi(param, mBuf)
7912 TfuCqiMode20SubCqi *param;
7913 Buffer *mBuf;
7914 #endif
7915 {
7916
7917    TRC3(cmPkTfuCqiMode20SubCqi)
7918
7919    CMCHKPK(SPkU8, param->l, mBuf);
7920    CMCHKPK(SPkU8, param->cqi, mBuf);
7921    RETVALUE(ROK);
7922 }
7923
7924
7925 \f
7926 /***********************************************************
7927 *
7928 *     Func : cmUnpkTfuCqiMode20SubCqi
7929 *
7930 *
7931 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7932 *
7933 *
7934 *     Ret  : S16
7935 *
7936 *     Notes:
7937 *
7938 *     File  : 
7939 *
7940 **********************************************************/
7941 #ifdef ANSI
7942 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi
7943 (
7944 TfuCqiMode20SubCqi *param,
7945 Buffer *mBuf
7946 )
7947 #else
7948 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi(param, mBuf)
7949 TfuCqiMode20SubCqi *param;
7950 Buffer *mBuf;
7951 #endif
7952 {
7953
7954    TRC3(cmUnpkTfuCqiMode20SubCqi)
7955
7956    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7957    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
7958    RETVALUE(ROK);
7959 }
7960
7961
7962 \f
7963 /***********************************************************
7964 *
7965 *     Func : cmPkTfuCqiMode20Cqi
7966 *
7967 *
7968 *     Desc : This structure contains Mode20 CQI report. It could either be a
7969   * wideband CQI or a sub-band CQI.
7970 *
7971 *
7972 *     Ret  : S16
7973 *
7974 *     Notes:
7975 *
7976 *     File  : 
7977 *
7978 **********************************************************/
7979 #ifdef ANSI
7980 PUBLIC S16 cmPkTfuCqiMode20Cqi
7981 (
7982 TfuCqiMode20Cqi *param,
7983 Buffer *mBuf
7984 )
7985 #else
7986 PUBLIC S16 cmPkTfuCqiMode20Cqi(param, mBuf)
7987 TfuCqiMode20Cqi *param;
7988 Buffer *mBuf;
7989 #endif
7990 {
7991
7992    TRC3(cmPkTfuCqiMode20Cqi)
7993
7994       switch(param->isWideband) {
7995          case FALSE:
7996             CMCHKPK(cmPkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7997             break;
7998          case TRUE:
7999             CMCHKPK(SPkU8, param->u.wideCqi, mBuf);
8000             break;
8001          default :
8002             RETVALUE(RFAILED);
8003       }
8004    CMCHKPK(SPkU8, param->isWideband, mBuf);
8005    RETVALUE(ROK);
8006 }
8007
8008
8009 \f
8010 /***********************************************************
8011 *
8012 *     Func : cmUnpkTfuCqiMode20Cqi
8013 *
8014 *
8015 *     Desc : This structure contains Mode20 CQI report. It could either be a
8016   * wideband CQI or a sub-band CQI.
8017 *
8018 *
8019 *     Ret  : S16
8020 *
8021 *     Notes:
8022 *
8023 *     File  : 
8024 *
8025 **********************************************************/
8026 #ifdef ANSI
8027 PUBLIC S16 cmUnpkTfuCqiMode20Cqi
8028 (
8029 TfuCqiMode20Cqi *param,
8030 Buffer *mBuf
8031 )
8032 #else
8033 PUBLIC S16 cmUnpkTfuCqiMode20Cqi(param, mBuf)
8034 TfuCqiMode20Cqi *param;
8035 Buffer *mBuf;
8036 #endif
8037 {
8038
8039    TRC3(cmUnpkTfuCqiMode20Cqi)
8040
8041    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
8042       switch(param->isWideband) {
8043          case TRUE:
8044             CMCHKUNPK(SUnpkU8, &param->u.wideCqi, mBuf);
8045             break;
8046          case FALSE:
8047             CMCHKUNPK(cmUnpkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
8048             break;
8049          default :
8050             RETVALUE(RFAILED);
8051       }
8052    RETVALUE(ROK);
8053 }
8054
8055
8056 \f
8057 /***********************************************************
8058 *
8059 *     Func : cmPkTfuCqiPucchMode20
8060 *
8061 *
8062 *     Desc : This structure maps to CQI mode 20. The report either contains a
8063   * Rank Index or a CQI report.
8064 *
8065 *
8066 *     Ret  : S16
8067 *
8068 *     Notes:
8069 *
8070 *     File  : 
8071 *
8072 **********************************************************/
8073 #ifdef ANSI
8074 PUBLIC S16 cmPkTfuCqiPucchMode20
8075 (
8076 TfuCqiPucchMode20 *param,
8077 Buffer *mBuf
8078 )
8079 #else
8080 PUBLIC S16 cmPkTfuCqiPucchMode20(param, mBuf)
8081 TfuCqiPucchMode20 *param;
8082 Buffer *mBuf;
8083 #endif
8084 {
8085
8086    TRC3(cmPkTfuCqiPucchMode20)
8087
8088       switch(param->type) {
8089          case TFU_RPT_CQI:
8090             CMCHKPK(cmPkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
8091             break;
8092          case TFU_RPT_RI:
8093             CMCHKPK(SPkU8, param->u.ri, mBuf);
8094             break;
8095          default :
8096             RETVALUE(RFAILED);
8097       }
8098    CMCHKPK(SPkU32, param->type, mBuf);
8099    RETVALUE(ROK);
8100 }
8101
8102
8103 \f
8104 /***********************************************************
8105 *
8106 *     Func : cmUnpkTfuCqiPucchMode20
8107 *
8108 *
8109 *     Desc : This structure maps to CQI mode 20. The report either contains a
8110   * Rank Index or a CQI report.
8111 *
8112 *
8113 *     Ret  : S16
8114 *
8115 *     Notes:
8116 *
8117 *     File  : 
8118 *
8119 **********************************************************/
8120 #ifdef ANSI
8121 PUBLIC S16 cmUnpkTfuCqiPucchMode20
8122 (
8123 TfuCqiPucchMode20 *param,
8124 Buffer *mBuf
8125 )
8126 #else
8127 PUBLIC S16 cmUnpkTfuCqiPucchMode20(param, mBuf)
8128 TfuCqiPucchMode20 *param;
8129 Buffer *mBuf;
8130 #endif
8131 {
8132
8133    TRC3(cmUnpkTfuCqiPucchMode20)
8134
8135    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8136       switch(param->type) {
8137          case TFU_RPT_RI:
8138             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8139             break;
8140          case TFU_RPT_CQI:
8141             CMCHKUNPK(cmUnpkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
8142             break;
8143          default :
8144             RETVALUE(RFAILED);
8145       }
8146    RETVALUE(ROK);
8147 }
8148
8149
8150 \f
8151 /***********************************************************
8152 *
8153 *     Func : cmPkTfuCqiMode21SubCqi
8154 *
8155 *
8156 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8157   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8158 *
8159 *
8160 *     Ret  : S16
8161 *
8162 *     Notes:
8163 *
8164 *     File  : 
8165 *
8166 **********************************************************/
8167 #ifdef ANSI
8168 PUBLIC S16 cmPkTfuCqiMode21SubCqi
8169 (
8170 TfuCqiMode21SubCqi *param,
8171 Buffer *mBuf
8172 )
8173 #else
8174 PUBLIC S16 cmPkTfuCqiMode21SubCqi(param, mBuf)
8175 TfuCqiMode21SubCqi *param;
8176 Buffer *mBuf;
8177 #endif
8178 {
8179
8180    TRC3(cmPkTfuCqiMode21SubCqi)
8181
8182    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8183    CMCHKPK(SPkU8, param->l, mBuf);
8184    CMCHKPK(SPkU8, param->cqi, mBuf);
8185    RETVALUE(ROK);
8186 }
8187
8188
8189 \f
8190 /***********************************************************
8191 *
8192 *     Func : cmUnpkTfuCqiMode21SubCqi
8193 *
8194 *
8195 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8196   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8197 *
8198 *
8199 *     Ret  : S16
8200 *
8201 *     Notes:
8202 *
8203 *     File  : 
8204 *
8205 **********************************************************/
8206 #ifdef ANSI
8207 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi
8208 (
8209 TfuCqiMode21SubCqi *param,
8210 Buffer *mBuf
8211 )
8212 #else
8213 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi(param, mBuf)
8214 TfuCqiMode21SubCqi *param;
8215 Buffer *mBuf;
8216 #endif
8217 {
8218
8219    TRC3(cmUnpkTfuCqiMode21SubCqi)
8220
8221    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8222    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
8223    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8224    RETVALUE(ROK);
8225 }
8226
8227
8228 \f
8229 /***********************************************************
8230 *
8231 *     Func : cmPkTfuCqiMode21WideCqi
8232 *
8233 *
8234 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8235   * It carries a wideband CQI, PMI and optionally a differential CQI.
8236 *
8237 *
8238 *     Ret  : S16
8239 *
8240 *     Notes:
8241 *
8242 *     File  : 
8243 *
8244 **********************************************************/
8245 #ifdef ANSI
8246 PUBLIC S16 cmPkTfuCqiMode21WideCqi
8247 (
8248 TfuCqiMode21WideCqi *param,
8249 Buffer *mBuf
8250 )
8251 #else
8252 PUBLIC S16 cmPkTfuCqiMode21WideCqi(param, mBuf)
8253 TfuCqiMode21WideCqi *param;
8254 Buffer *mBuf;
8255 #endif
8256 {
8257
8258    TRC3(cmPkTfuCqiMode21WideCqi)
8259
8260    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8261    CMCHKPK(SPkU8, param->pmi, mBuf);
8262    CMCHKPK(SPkU8, param->cqi, mBuf);
8263    RETVALUE(ROK);
8264 }
8265
8266
8267 \f
8268 /***********************************************************
8269 *
8270 *     Func : cmUnpkTfuCqiMode21WideCqi
8271 *
8272 *
8273 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8274   * It carries a wideband CQI, PMI and optionally a differential CQI.
8275 *
8276 *
8277 *     Ret  : S16
8278 *
8279 *     Notes:
8280 *
8281 *     File  : 
8282 *
8283 **********************************************************/
8284 #ifdef ANSI
8285 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi
8286 (
8287 TfuCqiMode21WideCqi *param,
8288 Buffer *mBuf
8289 )
8290 #else
8291 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi(param, mBuf)
8292 TfuCqiMode21WideCqi *param;
8293 Buffer *mBuf;
8294 #endif
8295 {
8296
8297    TRC3(cmUnpkTfuCqiMode21WideCqi)
8298
8299    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8300    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8301    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8302    RETVALUE(ROK);
8303 }
8304
8305
8306 \f
8307 /***********************************************************
8308 *
8309 *     Func : cmPkTfuCqiMode21Cqi
8310 *
8311 *
8312 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8313   * could either be wideband or sub-band.
8314 *
8315 *
8316 *     Ret  : S16
8317 *
8318 *     Notes:
8319 *
8320 *     File  : 
8321 *
8322 **********************************************************/
8323 #ifdef ANSI
8324 PUBLIC S16 cmPkTfuCqiMode21Cqi
8325 (
8326 TfuCqiMode21Cqi *param,
8327 Buffer *mBuf
8328 )
8329 #else
8330 PUBLIC S16 cmPkTfuCqiMode21Cqi(param, mBuf)
8331 TfuCqiMode21Cqi *param;
8332 Buffer *mBuf;
8333 #endif
8334 {
8335
8336    TRC3(cmPkTfuCqiMode21Cqi)
8337
8338       switch(param->isWideband) {
8339          case FALSE:
8340             CMCHKPK(cmPkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8341             break;
8342          case TRUE:
8343             CMCHKPK(cmPkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8344             break;
8345          default :
8346             RETVALUE(RFAILED);
8347       }
8348    CMCHKPK(SPkU8, param->isWideband, mBuf);
8349    RETVALUE(ROK);
8350 }
8351
8352
8353 \f
8354 /***********************************************************
8355 *
8356 *     Func : cmUnpkTfuCqiMode21Cqi
8357 *
8358 *
8359 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8360   * could either be wideband or sub-band.
8361 *
8362 *
8363 *     Ret  : S16
8364 *
8365 *     Notes:
8366 *
8367 *     File  : 
8368 *
8369 **********************************************************/
8370 #ifdef ANSI
8371 PUBLIC S16 cmUnpkTfuCqiMode21Cqi
8372 (
8373 TfuCqiMode21Cqi *param,
8374 Buffer *mBuf
8375 )
8376 #else
8377 PUBLIC S16 cmUnpkTfuCqiMode21Cqi(param, mBuf)
8378 TfuCqiMode21Cqi *param;
8379 Buffer *mBuf;
8380 #endif
8381 {
8382
8383    TRC3(cmUnpkTfuCqiMode21Cqi)
8384
8385    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
8386       switch(param->isWideband) {
8387          case TRUE:
8388             CMCHKUNPK(cmUnpkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8389             break;
8390          case FALSE:
8391             CMCHKUNPK(cmUnpkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8392             break;
8393          default :
8394             RETVALUE(RFAILED);
8395       }
8396    RETVALUE(ROK);
8397 }
8398
8399
8400 \f
8401 /***********************************************************
8402 *
8403 *     Func : cmPkTfuCqiPucchMode21
8404 *
8405 *
8406 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8407   * conveys a Rank Indicator or a CQI report.
8408 *
8409 *
8410 *     Ret  : S16
8411 *
8412 *     Notes:
8413 *
8414 *     File  : 
8415 *
8416 **********************************************************/
8417 #ifdef ANSI
8418 PUBLIC S16 cmPkTfuCqiPucchMode21
8419 (
8420 TfuCqiPucchMode21 *param,
8421 Buffer *mBuf
8422 )
8423 #else
8424 PUBLIC S16 cmPkTfuCqiPucchMode21(param, mBuf)
8425 TfuCqiPucchMode21 *param;
8426 Buffer *mBuf;
8427 #endif
8428 {
8429
8430    TRC3(cmPkTfuCqiPucchMode21)
8431
8432       switch(param->type) {
8433          case TFU_RPT_CQI:
8434             CMCHKPK(cmPkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8435             break;
8436          case TFU_RPT_RI:
8437             CMCHKPK(SPkU8, param->u.ri, mBuf);
8438             break;
8439          default :
8440             RETVALUE(RFAILED);
8441       }
8442    CMCHKPK(SPkU32, param->type, mBuf);
8443    RETVALUE(ROK);
8444 }
8445
8446
8447 \f
8448 /***********************************************************
8449 *
8450 *     Func : cmUnpkTfuCqiPucchMode21
8451 *
8452 *
8453 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8454   * conveys a Rank Indicator or a CQI report.
8455 *
8456 *
8457 *     Ret  : S16
8458 *
8459 *     Notes:
8460 *
8461 *     File  : 
8462 *
8463 **********************************************************/
8464 #ifdef ANSI
8465 PUBLIC S16 cmUnpkTfuCqiPucchMode21
8466 (
8467 TfuCqiPucchMode21 *param,
8468 Buffer *mBuf
8469 )
8470 #else
8471 PUBLIC S16 cmUnpkTfuCqiPucchMode21(param, mBuf)
8472 TfuCqiPucchMode21 *param;
8473 Buffer *mBuf;
8474 #endif
8475 {
8476
8477    TRC3(cmUnpkTfuCqiPucchMode21)
8478
8479    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8480       switch(param->type) {
8481          case TFU_RPT_RI:
8482             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8483             break;
8484          case TFU_RPT_CQI:
8485             CMCHKUNPK(cmUnpkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8486             break;
8487          default :
8488             RETVALUE(RFAILED);
8489       }
8490    RETVALUE(ROK);
8491 }
8492
8493
8494 \f
8495 /***********************************************************
8496 *
8497 *     Func : cmPkTfuDlCqiPucch
8498 *
8499 *
8500 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8501 *
8502 *
8503 *     Ret  : S16
8504 *
8505 *     Notes:
8506 *
8507 *     File  : 
8508 *
8509 **********************************************************/
8510 #ifdef ANSI
8511 PUBLIC S16 cmPkTfuDlCqiPucch
8512 (
8513 TfuDlCqiPucch *param,
8514 Buffer *mBuf
8515 )
8516 #else
8517 PUBLIC S16 cmPkTfuDlCqiPucch(param, mBuf)
8518 TfuDlCqiPucch *param;
8519 Buffer *mBuf;
8520 #endif
8521 {
8522
8523    TRC3(cmPkTfuDlCqiPucch)
8524
8525       switch(param->mode) {
8526          case TFU_PUCCH_CQI_MODE21:
8527             CMCHKPK(cmPkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8528             break;
8529          case TFU_PUCCH_CQI_MODE20:
8530             CMCHKPK(cmPkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8531             break;
8532          case TFU_PUCCH_CQI_MODE11:
8533             CMCHKPK(cmPkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8534             break;
8535          case TFU_PUCCH_CQI_MODE10:
8536             CMCHKPK(cmPkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8537             break;
8538          default :
8539             RETVALUE(RFAILED);
8540       }
8541    CMCHKPK(SPkU32, param->mode, mBuf);
8542    CMCHKPK(SPkU8, param->cellIdx, mBuf);
8543    RETVALUE(ROK);
8544 }
8545
8546
8547 \f
8548 /***********************************************************
8549 *
8550 *     Func : cmUnpkTfuDlCqiPucch
8551 *
8552 *
8553 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8554 *
8555 *
8556 *     Ret  : S16
8557 *
8558 *     Notes:
8559 *
8560 *     File  : 
8561 *
8562 **********************************************************/
8563 #ifdef ANSI
8564 PUBLIC S16 cmUnpkTfuDlCqiPucch
8565 (
8566 TfuDlCqiPucch *param,
8567 Buffer *mBuf
8568 )
8569 #else
8570 PUBLIC S16 cmUnpkTfuDlCqiPucch(param, mBuf)
8571 TfuDlCqiPucch *param;
8572 Buffer *mBuf;
8573 #endif
8574 {
8575
8576    TRC3(cmUnpkTfuDlCqiPucch)
8577
8578    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
8579    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
8580       switch(param->mode) {
8581          case TFU_PUCCH_CQI_MODE10:
8582             CMCHKUNPK(cmUnpkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8583             break;
8584          case TFU_PUCCH_CQI_MODE11:
8585             CMCHKUNPK(cmUnpkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8586             break;
8587          case TFU_PUCCH_CQI_MODE20:
8588             CMCHKUNPK(cmUnpkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8589             break;
8590          case TFU_PUCCH_CQI_MODE21:
8591             CMCHKUNPK(cmUnpkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8592             break;
8593          default :
8594             RETVALUE(RFAILED);
8595       }
8596    RETVALUE(ROK);
8597 }
8598
8599
8600 \f
8601 /***********************************************************
8602 *
8603 *     Func : cmPkTfuSubbandMode12
8604 *
8605 *
8606 *     Desc : This structure carries subband information and PMI, in the CQI
8607   * reporting format 1-2.
8608 *
8609 *
8610 *     Ret  : S16
8611 *
8612 *     Notes:
8613 *
8614 *     File  : 
8615 *
8616 **********************************************************/
8617 #ifdef ANSI
8618 PUBLIC S16 cmPkTfuSubbandMode12
8619 (
8620 TfuSubbandMode12 *param,
8621 Buffer *mBuf
8622 )
8623 #else
8624 PUBLIC S16 cmPkTfuSubbandMode12(param, mBuf)
8625 TfuSubbandMode12 *param;
8626 Buffer *mBuf;
8627 #endif
8628 {
8629
8630    TRC3(cmPkTfuSubbandMode12)
8631
8632    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8633    CMCHKPK(SPkU8, param->pmi, mBuf);
8634    RETVALUE(ROK);
8635 }
8636
8637
8638 \f
8639 /***********************************************************
8640 *
8641 *     Func : cmUnpkTfuSubbandMode12
8642 *
8643 *
8644 *     Desc : This structure carries subband information and PMI, in the CQI
8645   * reporting format 1-2.
8646 *
8647 *
8648 *     Ret  : S16
8649 *
8650 *     Notes:
8651 *
8652 *     File  : 
8653 *
8654 **********************************************************/
8655 #ifdef ANSI
8656 PUBLIC S16 cmUnpkTfuSubbandMode12
8657 (
8658 TfuSubbandMode12 *param,
8659 Buffer *mBuf
8660 )
8661 #else
8662 PUBLIC S16 cmUnpkTfuSubbandMode12(param, mBuf)
8663 TfuSubbandMode12 *param;
8664 Buffer *mBuf;
8665 #endif
8666 {
8667
8668    TRC3(cmUnpkTfuSubbandMode12)
8669
8670    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8671    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8672    RETVALUE(ROK);
8673 }
8674
8675
8676 \f
8677 /***********************************************************
8678 *
8679 *     Func : cmPkTfuCqiPuschMode12
8680 *
8681 *
8682 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8683  * over PUSCH.
8684 *
8685 *
8686 *     Ret  : S16
8687 *
8688 *     Notes:
8689 *
8690 *     File  : 
8691 *
8692 **********************************************************/
8693 #ifdef ANSI
8694 PUBLIC S16 cmPkTfuCqiPuschMode12
8695 (
8696 TfuCqiPuschMode12 *param,
8697 Buffer *mBuf
8698 )
8699 #else
8700 PUBLIC S16 cmPkTfuCqiPuschMode12(param, mBuf)
8701 TfuCqiPuschMode12 *param;
8702 Buffer *mBuf;
8703 #endif
8704 {
8705
8706    S32 i;
8707    TRC3(cmPkTfuCqiPuschMode12)
8708
8709    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8710       CMCHKPK(cmPkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8711    }
8712    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8713       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
8714    }
8715    CMCHKPK(SPkU8, param->numSubband, mBuf);
8716    RETVALUE(ROK);
8717 }
8718
8719
8720 \f
8721 /***********************************************************
8722 *
8723 *     Func : cmUnpkTfuCqiPuschMode12
8724 *
8725 *
8726 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8727  * over PUSCH.
8728 *
8729 *
8730 *     Ret  : S16
8731 *
8732 *     Notes:
8733 *
8734 *     File  : 
8735 *
8736 **********************************************************/
8737 #ifdef ANSI
8738 PUBLIC S16 cmUnpkTfuCqiPuschMode12
8739 (
8740 TfuCqiPuschMode12 *param,
8741 Buffer *mBuf
8742 )
8743 #else
8744 PUBLIC S16 cmUnpkTfuCqiPuschMode12(param, mBuf)
8745 TfuCqiPuschMode12 *param;
8746 Buffer *mBuf;
8747 #endif
8748 {
8749
8750    S32 i;
8751    TRC3(cmUnpkTfuCqiPuschMode12)
8752
8753    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8754    for (i=0; i<TFU_MAX_TB; i++) {
8755       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
8756    }
8757    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8758       CMCHKUNPK(cmUnpkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8759    }
8760    RETVALUE(ROK);
8761 }
8762
8763
8764 \f
8765 /***********************************************************
8766 *
8767 *     Func : cmPkTfuCqiPuschMode20
8768 *
8769 *
8770 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8771  * over PUSCH. This mode is for UE selected sub-band feedback.
8772 *
8773 *
8774 *     Ret  : S16
8775 *
8776 *     Notes:
8777 *
8778 *     File  : 
8779 *
8780 **********************************************************/
8781 #ifdef ANSI
8782 PUBLIC S16 cmPkTfuCqiPuschMode20
8783 (
8784 TfuCqiPuschMode20 *param,
8785 Buffer *mBuf
8786 )
8787 #else
8788 PUBLIC S16 cmPkTfuCqiPuschMode20(param, mBuf)
8789 TfuCqiPuschMode20 *param;
8790 Buffer *mBuf;
8791 #endif
8792 {
8793
8794    S32 i;
8795    TRC3(cmPkTfuCqiPuschMode20)
8796
8797    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8798       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8799    }
8800    CMCHKPK(SPkU8, param->numSubband, mBuf);
8801    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8802    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
8803    RETVALUE(ROK);
8804 }
8805
8806
8807 \f
8808 /***********************************************************
8809 *
8810 *     Func : cmUnpkTfuCqiPuschMode20
8811 *
8812 *
8813 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8814  * over PUSCH. This mode is for UE selected sub-band feedback.
8815 *
8816 *
8817 *     Ret  : S16
8818 *
8819 *     Notes:
8820 *
8821 *     File  : 
8822 *
8823 **********************************************************/
8824 #ifdef ANSI
8825 PUBLIC S16 cmUnpkTfuCqiPuschMode20
8826 (
8827 TfuCqiPuschMode20 *param,
8828 Buffer *mBuf
8829 )
8830 #else
8831 PUBLIC S16 cmUnpkTfuCqiPuschMode20(param, mBuf)
8832 TfuCqiPuschMode20 *param;
8833 Buffer *mBuf;
8834 #endif
8835 {
8836
8837    S32 i;
8838    TRC3(cmUnpkTfuCqiPuschMode20)
8839
8840    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
8841    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8842    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8843    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8844       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8845    }
8846    RETVALUE(ROK);
8847 }
8848
8849 \f
8850 /***********************************************************
8851 *
8852 *     Func : cmPkTfuCqiPuschMode22
8853 *
8854 *
8855 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8856  * over PUSCH.
8857 *
8858 *
8859 *     Ret  : S16
8860 *
8861 *     Notes:
8862 *
8863 *     File  : 
8864 *
8865 **********************************************************/
8866 #ifdef ANSI
8867 PUBLIC S16 cmPkTfuCqiPuschMode22
8868 (
8869 TfuCqiPuschMode22 *param,
8870 Buffer *mBuf
8871 )
8872 #else
8873 PUBLIC S16 cmPkTfuCqiPuschMode22(param, mBuf)
8874 TfuCqiPuschMode22 *param;
8875 Buffer *mBuf;
8876 #endif
8877 {
8878
8879    S32 i;
8880    TRC3(cmPkTfuCqiPuschMode22)
8881
8882
8883    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8884       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8885    }
8886
8887    CMCHKPK(SPkU8, param->numSubband, mBuf);
8888    CMCHKPK(SPkU8, param->wideBandPmi, mBuf);
8889    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8890       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
8891    }
8892    CMCHKPK(SPkU8, param->pmi, mBuf);
8893    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8894       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8895    }
8896    RETVALUE(ROK);
8897 }
8898
8899
8900 \f
8901 /***********************************************************
8902 *
8903 *     Func : cmUnpkTfuCqiPuschMode22
8904 *
8905 *
8906 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8907  * over PUSCH.
8908 *
8909 *
8910 *     Ret  : S16
8911 *
8912 *     Notes:
8913 *
8914 *     File  : 
8915 *
8916 **********************************************************/
8917 #ifdef ANSI
8918 PUBLIC S16 cmUnpkTfuCqiPuschMode22
8919 (
8920 TfuCqiPuschMode22 *param,
8921 Buffer *mBuf
8922 )
8923 #else
8924 PUBLIC S16 cmUnpkTfuCqiPuschMode22(param, mBuf)
8925 TfuCqiPuschMode22 *param;
8926 Buffer *mBuf;
8927 #endif
8928 {
8929
8930    S32 i;
8931    TRC3(cmUnpkTfuCqiPuschMode22)
8932
8933    for (i=0; i<TFU_MAX_TB; i++) {
8934       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8935    }
8936    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8937    for (i=0; i<TFU_MAX_TB; i++) {
8938       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
8939    }
8940    CMCHKUNPK(SUnpkU8, &param->wideBandPmi, mBuf);
8941    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8942
8943    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8944       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8945    }
8946
8947    RETVALUE(ROK);
8948 }
8949
8950
8951 #ifdef ANSI
8952 PUBLIC S16 cmPkTfuSubbandMode30
8953 (
8954 TfuSubbandMode30 *param,
8955 Buffer *mBuf
8956 )
8957 #else
8958 PUBLIC S16 cmPkTfuSubbandMode30(param, mBuf)
8959 TfuSubbandMode30 *param;
8960 Buffer *mBuf;
8961 #endif
8962 {
8963
8964    TRC3(cmPkTfuSubbandMode30)
8965
8966    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8967    CMCHKPK(SPkU8, param->cqi, mBuf);
8968    RETVALUE(ROK);
8969 }
8970
8971
8972 #ifdef ANSI
8973 PUBLIC S16 cmUnpkTfuSubbandMode30
8974 (
8975 TfuSubbandMode30 *param,
8976 Buffer *mBuf
8977 )
8978 #else
8979 PUBLIC S16 cmUnpkTfuSubbandMode30(param, mBuf)
8980 TfuSubbandMode30 *param;
8981 Buffer *mBuf;
8982 #endif
8983 {
8984
8985    TRC3(cmUnpkTfuSubbandMode30)
8986
8987    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8988    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8989    RETVALUE(ROK);
8990 }
8991
8992
8993 \f
8994 /***********************************************************
8995 *
8996 *     Func : cmPkTfuCqiPuschMode30
8997 *
8998 *
8999 *     Desc : This structure conveys information present in CQI reporting mode 3-0
9000  * received over PUSCH.
9001 *
9002 *
9003 *     Ret  : S16
9004 *
9005 *     Notes:
9006 *
9007 *     File  : 
9008 *
9009 **********************************************************/
9010 #ifdef ANSI
9011 PUBLIC S16 cmPkTfuCqiPuschMode30
9012 (
9013 TfuCqiPuschMode30 *param,
9014 Buffer *mBuf
9015 )
9016 #else
9017 PUBLIC S16 cmPkTfuCqiPuschMode30(param, mBuf)
9018 TfuCqiPuschMode30 *param;
9019 Buffer *mBuf;
9020 #endif
9021 {
9022
9023    S32 i;
9024    TRC3(cmPkTfuCqiPuschMode30)
9025
9026    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
9027       CMCHKPK(cmPkTfuSubbandMode30, &param->subbandArr[i], mBuf);
9028    }
9029    CMCHKPK(SPkU8, param->numSubband, mBuf);
9030    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
9031    RETVALUE(ROK);
9032 }
9033
9034
9035 \f
9036 /***********************************************************
9037 *
9038 *     Func : cmUnpkTfuCqiPuschMode30
9039 *
9040 *
9041 *     Desc : This structure conveys information present in CQI reporting mode 3-0
9042  * received over PUSCH.
9043 *
9044 *
9045 *     Ret  : S16
9046 *
9047 *     Notes:
9048 *
9049 *     File  : 
9050 *
9051 **********************************************************/
9052 #ifdef ANSI
9053 PUBLIC S16 cmUnpkTfuCqiPuschMode30
9054 (
9055 TfuCqiPuschMode30 *param,
9056 Buffer *mBuf
9057 )
9058 #else
9059 PUBLIC S16 cmUnpkTfuCqiPuschMode30(param, mBuf)
9060 TfuCqiPuschMode30 *param;
9061 Buffer *mBuf;
9062 #endif
9063 {
9064
9065    S32 i;
9066    TRC3(cmUnpkTfuCqiPuschMode30)
9067
9068    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
9069    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
9070    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
9071       CMCHKUNPK(cmUnpkTfuSubbandMode30, &param->subbandArr[i], mBuf);
9072    }
9073    RETVALUE(ROK);
9074 }
9075
9076
9077 #ifdef ANSI
9078 PUBLIC S16 cmPkTfuSubbandMode31
9079 (
9080 TfuSubbandMode31 *param,
9081 Buffer *mBuf
9082 )
9083 #else
9084 PUBLIC S16 cmPkTfuSubbandMode31(param, mBuf)
9085 TfuSubbandMode31 *param;
9086 Buffer *mBuf;
9087 #endif
9088 {
9089
9090    S32 i;
9091    TRC3(cmPkTfuSubbandMode31)
9092
9093    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
9094    for (i=TFU_MAX_TB-1; i >= 0; i--) {
9095       CMCHKPK(SPkU8, param->cqi[i], mBuf);
9096    }
9097    RETVALUE(ROK);
9098 }
9099
9100
9101 #ifdef ANSI
9102 PUBLIC S16 cmUnpkTfuSubbandMode31
9103 (
9104 TfuSubbandMode31 *param,
9105 Buffer *mBuf
9106 )
9107 #else
9108 PUBLIC S16 cmUnpkTfuSubbandMode31(param, mBuf)
9109 TfuSubbandMode31 *param;
9110 Buffer *mBuf;
9111 #endif
9112 {
9113
9114    S32 i;
9115    TRC3(cmUnpkTfuSubbandMode31)
9116
9117    for (i=0; i<TFU_MAX_TB; i++) {
9118       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
9119    }
9120    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
9121    RETVALUE(ROK);
9122 }
9123
9124
9125 \f
9126 /***********************************************************
9127 *
9128 *     Func : cmPkTfuCqiPuschMode31
9129 *
9130 *
9131 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9132  * received over PUSCH.
9133 *
9134 *
9135 *     Ret  : S16
9136 *
9137 *     Notes:
9138 *
9139 *     File  : 
9140 *
9141 **********************************************************/
9142 #ifdef ANSI
9143 PUBLIC S16 cmPkTfuCqiPuschMode31
9144 (
9145 TfuCqiPuschMode31 *param,
9146 Buffer *mBuf
9147 )
9148 #else
9149 PUBLIC S16 cmPkTfuCqiPuschMode31(param, mBuf)
9150 TfuCqiPuschMode31 *param;
9151 Buffer *mBuf;
9152 #endif
9153 {
9154
9155    S32 i;
9156    TRC3(cmPkTfuCqiPuschMode31)
9157
9158
9159 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9160 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9161
9162 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9163 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9164    for (i=param->numSubband-1; i >= 0; i--) {
9165       CMCHKPK(cmPkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9166    }
9167
9168    CMCHKPK(SPkU8, param->numSubband, mBuf);
9169    for (i=TFU_MAX_TB-1; i >= 0; i--) {
9170       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
9171    }
9172    CMCHKPK(SPkU8, param->pmi, mBuf);
9173    RETVALUE(ROK);
9174 }
9175
9176
9177 \f
9178 /***********************************************************
9179 *
9180 *     Func : cmUnpkTfuCqiPuschMode31
9181 *
9182 *
9183 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9184  * received over PUSCH.
9185 *
9186 *
9187 *     Ret  : S16
9188 *
9189 *     Notes:
9190 *
9191 *     File  : 
9192 *
9193 **********************************************************/
9194 #ifdef ANSI
9195 PUBLIC S16 cmUnpkTfuCqiPuschMode31
9196 (
9197 TfuCqiPuschMode31 *param,
9198 Buffer *mBuf
9199 )
9200 #else
9201 PUBLIC S16 cmUnpkTfuCqiPuschMode31(param, mBuf)
9202 TfuCqiPuschMode31 *param;
9203 Buffer *mBuf;
9204 #endif
9205 {
9206
9207    S32 i;
9208    TRC3(cmUnpkTfuCqiPuschMode31)
9209
9210    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
9211    for (i=0; i<TFU_MAX_TB; i++) {
9212       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
9213    }
9214    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
9215
9216 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9217 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9218    for (i=0; i<param->numSubband; i++) {
9219       CMCHKUNPK(cmUnpkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9220    }
9221
9222
9223 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9224 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9225
9226    RETVALUE(ROK);
9227 }
9228
9229
9230 \f
9231 /***********************************************************
9232 *
9233 *     Func : cmPkTfuDlCqiPusch
9234 *
9235 *
9236 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9237  * CQI) received over PUSCH.
9238 *
9239 *
9240 *     Ret  : S16
9241 *
9242 *     Notes:
9243 *
9244 *     File  : 
9245 *
9246 **********************************************************/
9247 #ifdef ANSI
9248 PUBLIC S16 cmPkTfuDlCqiPusch
9249 (
9250 TfuDlCqiPusch *param,
9251 Buffer *mBuf
9252 )
9253 #else
9254 PUBLIC S16 cmPkTfuDlCqiPusch(param, mBuf)
9255 TfuDlCqiPusch *param;
9256 Buffer *mBuf;
9257 #endif
9258 {
9259
9260    TRC3(cmPkTfuDlCqiPusch)
9261
9262       switch(param->mode) {
9263          case TFU_PUSCH_CQI_MODE_31:
9264             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9265             break;
9266          case TFU_PUSCH_CQI_MODE_30:
9267             CMCHKPK(cmPkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9268             break;
9269          case TFU_PUSCH_CQI_MODE_22:
9270             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9271             break;
9272          case TFU_PUSCH_CQI_MODE_20:
9273             CMCHKPK(cmPkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9274             break;
9275          case TFU_PUSCH_CQI_MODE_12:
9276             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9277             break;
9278          default :
9279             RETVALUE(RFAILED);
9280       }
9281
9282    CMCHKPK(cmPkTknU8, &param->ri, mBuf);
9283    CMCHKPK(SPkU32, param->mode, mBuf);
9284
9285    CMCHKPK(SPkU8, param->cellIdx, mBuf);
9286    RETVALUE(ROK);
9287 }
9288
9289
9290 \f
9291 /***********************************************************
9292 *
9293 *     Func : cmUnpkTfuDlCqiPusch
9294 *
9295 *
9296 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9297  * CQI) received over PUSCH.
9298 *
9299 *
9300 *     Ret  : S16
9301 *
9302 *     Notes:
9303 *
9304 *     File  : 
9305 *
9306 **********************************************************/
9307 #ifdef ANSI
9308 PUBLIC S16 cmUnpkTfuDlCqiPusch
9309 (
9310 TfuDlCqiPusch *param,
9311 Buffer *mBuf
9312 )
9313 #else
9314 PUBLIC S16 cmUnpkTfuDlCqiPusch(param, mBuf)
9315 TfuDlCqiPusch *param;
9316 Buffer *mBuf;
9317 #endif
9318 {
9319
9320    TRC3(cmUnpkTfuDlCqiPusch)
9321
9322    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
9323    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
9324    CMCHKUNPK(cmUnpkTknU8, &param->ri, mBuf);
9325    switch(param->mode) {
9326       case TFU_PUSCH_CQI_MODE_12:
9327          CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9328          break;
9329       case TFU_PUSCH_CQI_MODE_20:
9330          CMCHKUNPK(cmUnpkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9331          break;
9332       case TFU_PUSCH_CQI_MODE_22:
9333          CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9334          break;
9335       case TFU_PUSCH_CQI_MODE_30:
9336          CMCHKUNPK(cmUnpkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9337          break;
9338       case TFU_PUSCH_CQI_MODE_31:
9339          CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9340          break;
9341       default :
9342          RETVALUE(RFAILED);
9343    }
9344    RETVALUE(ROK);
9345 }
9346
9347 \f
9348 /***********************************************************
9349 *
9350 *     Func : cmPkTfuDlCqiInfo
9351 *
9352 *
9353 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9354 *
9355 *
9356 *     Ret  : S16
9357 *
9358 *     Notes:
9359 *
9360 *     File  : 
9361 *
9362 **********************************************************/
9363 #ifdef ANSI
9364 PUBLIC S16 cmPkTfuDlCqiInfo
9365 (
9366 U8 selector,
9367 TfuDlCqiInfo *param,
9368 Buffer *mBuf
9369 )
9370 #else
9371 PUBLIC S16 cmPkTfuDlCqiInfo(selector, param, mBuf)
9372 U8 selector;
9373 TfuDlCqiInfo *param;
9374 Buffer *mBuf;
9375 #endif
9376 {
9377    U32 idx;
9378
9379    TRC3(cmPkTfuDlCqiInfo)
9380
9381    switch(selector) {
9382       case FALSE:
9383          for (idx = 0; idx < param->pusch.numOfCells; idx++)
9384          {
9385             CMCHKPK(cmPkTfuDlCqiPusch, &param->pusch.puschCqi[idx], mBuf);
9386          }
9387          CMCHKPK(SPkU8, param->pusch.numOfCells, mBuf);
9388          break;
9389       case TRUE:
9390          CMCHKPK(cmPkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9391          break;
9392       default :
9393          RETVALUE(RFAILED);
9394    }
9395    RETVALUE(ROK);
9396 }
9397
9398
9399 \f
9400 /***********************************************************
9401 *
9402 *     Func : cmUnpkTfuDlCqiInfo
9403 *
9404 *
9405 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9406 *
9407 *
9408 *     Ret  : S16
9409 *
9410 *     Notes:
9411 *
9412 *     File  : 
9413 *
9414 **********************************************************/
9415 #ifdef ANSI
9416 PUBLIC S16 cmUnpkTfuDlCqiInfo
9417 (
9418 U8 selector,
9419 TfuDlCqiInfo *param,
9420 Buffer *mBuf
9421 )
9422 #else
9423 PUBLIC S16 cmUnpkTfuDlCqiInfo(selector, param, mBuf)
9424 U8 selector;
9425 TfuDlCqiInfo *param;
9426 Buffer *mBuf;
9427 #endif
9428 {
9429
9430    U8 idx;
9431    TRC3(cmUnpkTfuDlCqiInfo)
9432
9433    switch(selector) {
9434       case TRUE:
9435          CMCHKUNPK(cmUnpkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9436          break;
9437       case FALSE:
9438          CMCHKUNPK(SUnpkU8, &param->pusch.numOfCells, mBuf);
9439          for (idx = param->pusch.numOfCells; idx > 0; idx--)
9440          {
9441             CMCHKUNPK(cmUnpkTfuDlCqiPusch, &param->pusch.puschCqi[idx-1], mBuf);
9442          }
9443          break;
9444       default :
9445          RETVALUE(RFAILED);
9446    }
9447    RETVALUE(ROK);
9448 }
9449
9450
9451 \f
9452 /***********************************************************
9453 *
9454 *     Func : cmPkTfuRecpReqInfo
9455 *
9456 *
9457 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9458  * needed by PHY to decode the following 
9459  * 1. DATA on PUSCH
9460  * 2. HARQ Feedback on PUCCH
9461  * 3. CQI Report 
9462  * 4. RI Report
9463  * 5. SR Indications.
9464  * This structure carries the reception information for all the scheduled UE.
9465 *
9466 *
9467 *     Ret  : S16
9468 *
9469 *     Notes:
9470 *
9471 *     File  : 
9472 *
9473 **********************************************************/
9474 #ifdef ANSI
9475 PUBLIC S16 cmPkTfuRecpReqInfo
9476 (
9477 TfuRecpReqInfo *param,
9478 Buffer *mBuf
9479 )
9480 #else
9481 PUBLIC S16 cmPkTfuRecpReqInfo(param, mBuf)
9482 TfuRecpReqInfo *param;
9483 Buffer *mBuf;
9484 #endif
9485 {
9486    CmLList *node;
9487    U32 count;
9488    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9489
9490    TRC3(cmPkTfuRecpReqInfo)
9491
9492    /*ccpu00116923 - ADD - SRS present support*/
9493    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9494 #ifdef TFU_UPGRADE
9495    CMCHKPK(SPkU8, param->srsPres, mBuf);
9496 #endif
9497    count = param->ueRecpReqLst.count;
9498    node = param->ueRecpReqLst.last;
9499    while (node) {
9500       tfuUeRecpReqInfo = (TfuUeRecpReqInfo *)node->node;
9501       node=node->prev;
9502       CMCHKPK(cmPkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9503       cmLListDelFrm(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9504       tfuUeRecpReqInfo->lnk.node = (PTR)NULLP;
9505    }
9506    CMCHKPK(SPkU32, count, mBuf);
9507    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
9508    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9509    RETVALUE(ROK);
9510 }
9511
9512
9513 \f
9514 /***********************************************************
9515 *
9516 *     Func : cmUnpkTfuRecpReqInfo
9517 *
9518 *
9519 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9520  * needed by PHY to decode the following 
9521  * 1. DATA on PUSCH
9522  * 2. HARQ Feedback on PUCCH
9523  * 3. CQI Report 
9524  * 4. RI Report
9525  * 5. SR Indications.
9526  * This structure carries the reception information for all the scheduled UE.
9527 *
9528 *
9529 *     Ret  : S16
9530 *
9531 *     Notes:
9532 *
9533 *     File  : 
9534 *
9535 **********************************************************/
9536 #ifdef ANSI
9537 PUBLIC S16 cmUnpkTfuRecpReqInfo
9538 (
9539 TfuRecpReqInfo *param,
9540 Ptr memCp,
9541 Buffer *mBuf
9542 )
9543 #else
9544 PUBLIC S16 cmUnpkTfuRecpReqInfo(param, memCp, mBuf)
9545 TfuRecpReqInfo *param;
9546 Ptr memCp;
9547 Buffer *mBuf;
9548 #endif
9549 {
9550
9551    U32 count, loopCnt;
9552    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9553
9554    TRC3(cmUnpkTfuRecpReqInfo)
9555
9556    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9557    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
9558    cmLListInit(&param->ueRecpReqLst);
9559    CMCHKUNPK(SUnpkU32, &count, mBuf);
9560    for (loopCnt=0; loopCnt<count; loopCnt++) {
9561       cmGetMem((Ptr)memCp, sizeof(*tfuUeRecpReqInfo), (Ptr *)&tfuUeRecpReqInfo);
9562       CMCHKUNPK(cmUnpkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9563       cmLListAdd2Tail(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9564       tfuUeRecpReqInfo->lnk.node = (PTR)tfuUeRecpReqInfo;
9565    }
9566    /*ccpu00116923 - ADD - SRS present support*/
9567    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9568 #ifdef TFU_UPGRADE
9569    CMCHKUNPK(SUnpkU8, &param->srsPres, mBuf);
9570 #endif
9571    RETVALUE(ROK);
9572 }
9573
9574
9575 \f
9576 /***********************************************************
9577 *
9578 *     Func : cmPkTfuPdcchInfo
9579 *
9580 *
9581 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9582   * formats. This information is associated with an RNTI.
9583 *
9584 *
9585 *     Ret  : S16
9586 *
9587 *     Notes:
9588 *
9589 *     File  : 
9590 *
9591 **********************************************************/
9592 #ifdef ANSI
9593 PUBLIC S16 cmPkTfuPdcchInfo
9594 (
9595 TfuPdcchInfo *param,
9596 Buffer *mBuf
9597 )
9598 #else
9599 PUBLIC S16 cmPkTfuPdcchInfo(param, mBuf)
9600 TfuPdcchInfo *param;
9601 Buffer *mBuf;
9602 #endif
9603 {
9604
9605    TRC3(cmPkTfuPdcchInfo)
9606 #ifdef TFU_5GTF
9607    CMCHKPK(SPkU8, param->grpId, mBuf);
9608    CMCHKPK(SPkU8, param->sccIdx, mBuf);
9609    CMCHKPK(SPkU8, param->sectorId, mBuf);
9610 #endif /* TFU_5GTF */
9611    CMCHKPK(cmPkTfuDciInfo, &param->dci, mBuf);
9612    CMCHKPK(SPkU8, param->dciNumOfBits, mBuf);
9613    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
9614    CMCHKPK(SPkU16, param->nCce, mBuf);
9615 #ifdef LTEMAC_SPS
9616    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9617    CMCHKPK(SPkU8, param->isSpsRnti, mBuf);
9618 #endif
9619    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9620    RETVALUE(ROK);
9621 }
9622
9623
9624 \f
9625 /***********************************************************
9626 *
9627 *     Func : cmUnpkTfuPdcchInfo
9628 *
9629 *
9630 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9631   * formats. This information is associated with an RNTI.
9632 *
9633 *
9634 *     Ret  : S16
9635 *
9636 *     Notes:
9637 *
9638 *     File  : 
9639 *
9640 **********************************************************/
9641 #ifdef ANSI
9642 PUBLIC S16 cmUnpkTfuPdcchInfo
9643 (
9644 TfuPdcchInfo *param,
9645 Buffer *mBuf
9646 )
9647 #else
9648 PUBLIC S16 cmUnpkTfuPdcchInfo(param, mBuf)
9649 TfuPdcchInfo *param;
9650 Buffer *mBuf;
9651 #endif
9652 {
9653
9654    TRC3(cmUnpkTfuPdcchInfo)
9655
9656    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9657 #ifdef LTEMAC_SPS
9658    CMCHKUNPK(SUnpkU8, &param->isSpsRnti, mBuf);
9659    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9660 #endif
9661    CMCHKUNPK(SUnpkU16, &param->nCce, mBuf);
9662    CMCHKUNPK(cmUnpkLteAggrLvl, (U32*)&param->aggrLvl, mBuf);
9663    CMCHKUNPK(SUnpkU8, &param->dciNumOfBits, mBuf);
9664    CMCHKUNPK(cmUnpkTfuDciInfo, &param->dci, mBuf);
9665 #ifdef TFU_5GTF 
9666    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
9667    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
9668    CMCHKUNPK(SUnpkU8, &param->grpId, mBuf);
9669 #endif /* TFU_5GTF */
9670    RETVALUE(ROK);
9671 }
9672
9673
9674 \f
9675 /***********************************************************
9676 *
9677 *     Func : cmPkTfuPhichInfo
9678 *
9679 *
9680 *     Desc : This structure contains one PHICH information. In order to locate the
9681  * resources to be used for PHICH the following information is provided along
9682  * with the feedback -
9683  * -# rbStart
9684  * -# nDmrs
9685 *
9686 *
9687 *     Ret  : S16
9688 *
9689 *     Notes:
9690 *
9691 *     File  : 
9692 *
9693 **********************************************************/
9694 #ifdef ANSI
9695 PUBLIC S16 cmPkTfuPhichInfo
9696 (
9697 TfuPhichInfo *param,
9698 Buffer *mBuf
9699 )
9700 #else
9701 PUBLIC S16 cmPkTfuPhichInfo(param, mBuf)
9702 TfuPhichInfo *param;
9703 Buffer *mBuf;
9704 #endif
9705 {
9706
9707    TRC3(cmPkTfuPhichInfo)
9708 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9709 #ifdef TFU_UPGRADE
9710    CMCHKPK(SPkU16, param->txPower, mBuf);
9711 #endif
9712 #ifdef TFU_TDD
9713    CMCHKPK(SPkU8, param->iPhich, mBuf);
9714 #endif
9715    CMCHKPK(SPkU8, param->isAck, mBuf);
9716    CMCHKPK(SPkU8, param->nDmrs, mBuf);
9717    CMCHKPK(SPkU8, param->rbStart, mBuf);
9718    RETVALUE(ROK);
9719 }
9720
9721
9722 \f
9723 /***********************************************************
9724 *
9725 *     Func : cmUnpkTfuPhichInfo
9726 *
9727 *
9728 *     Desc : This structure contains one PHICH information. In order to locate the
9729  * resources to be used for PHICH the following information is provided along
9730  * with the feedback -
9731  * -# rbStart
9732  * -# nDmrs
9733 *
9734 *
9735 *     Ret  : S16
9736 *
9737 *     Notes:
9738 *
9739 *     File  : 
9740 *
9741 **********************************************************/
9742 #ifdef ANSI
9743 PUBLIC S16 cmUnpkTfuPhichInfo
9744 (
9745 TfuPhichInfo *param,
9746 Buffer *mBuf
9747 )
9748 #else
9749 PUBLIC S16 cmUnpkTfuPhichInfo(param, mBuf)
9750 TfuPhichInfo *param;
9751 Buffer *mBuf;
9752 #endif
9753 {
9754
9755    TRC3(cmUnpkTfuPhichInfo)
9756
9757    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
9758    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
9759    CMCHKUNPK(SUnpkU8, &param->isAck, mBuf);
9760 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9761 #ifdef TFU_TDD
9762    CMCHKUNPK(SUnpkU8, &param->iPhich, mBuf);
9763 #endif
9764 #ifdef TFU_UPGRADE   
9765    CMCHKUNPK(SUnpkU16, &param->txPower, mBuf);
9766 #endif
9767    RETVALUE(ROK);
9768 }
9769
9770
9771 \f
9772 /***********************************************************
9773 *
9774 *     Func : cmPkTfuCntrlReqInfo
9775 *
9776 *
9777 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9778  * control information to be sent to the UE. 
9779  * -# PDCCH  Physical Downlink Control Channel
9780  * -# PHICH  Physical HARQ Indicator Channel
9781  * -# PCFICH Physical Control Format Indicator Channel
9782 *
9783 *
9784 *     Ret  : S16
9785 *
9786 *     Notes:
9787 *
9788 *     File  : 
9789 *
9790 **********************************************************/
9791 #ifdef ANSI
9792 PUBLIC S16 cmPkTfuCntrlReqInfo
9793 (
9794 TfuCntrlReqInfo *param,
9795 Buffer *mBuf
9796 )
9797 #else
9798 PUBLIC S16 cmPkTfuCntrlReqInfo(param, mBuf)
9799 TfuCntrlReqInfo *param;
9800 Buffer *mBuf;
9801 #endif
9802 {
9803
9804    TfuPdcchInfo   *tfuPdcchInfo;
9805    TfuPhichInfo *tfuPhichInfo;
9806    CmLList *node;
9807    U32 count;
9808
9809    TRC3(cmPkTfuCntrlReqInfo)
9810 #ifdef EMTC_ENABLE
9811    count = param->dlMpdcchLst.count;
9812    node = param->dlMpdcchLst.last;
9813    while (node) {
9814       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9815       node=node->prev;
9816       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9817       cmLListDelFrm(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9818       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9819    }
9820    CMCHKPK(SPkU32, count, mBuf);
9821    count = param->ulMpdcchLst.count;
9822    node = param->ulMpdcchLst.last;
9823    while (node) {
9824       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9825       node=node->prev;
9826       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9827       cmLListDelFrm(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9828       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9829    }
9830    CMCHKPK(SPkU32, count, mBuf);
9831 #endif      
9832 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9833    CMCHKPK(cmPkBool, param->isSPSOcc, mBuf);
9834 #endif
9835    count = param->phichLst.count;
9836    node = param->phichLst.last;
9837    while (node) {
9838       tfuPhichInfo = (TfuPhichInfo *)node->node;
9839       node=node->prev;
9840       CMCHKPK(cmPkTfuPhichInfo, tfuPhichInfo, mBuf);
9841       cmLListDelFrm(&param->phichLst, &tfuPhichInfo->lnk);
9842       tfuPhichInfo->lnk.node = (PTR)NULLP;
9843    }
9844    CMCHKPK(SPkU32, count, mBuf);
9845    count = param->dlPdcchLst.count;
9846    node = param->dlPdcchLst.last;
9847    while (node) {
9848       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9849       node=node->prev;
9850       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9851       cmLListDelFrm(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9852       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9853    }
9854    CMCHKPK(SPkU32, count, mBuf);
9855    count = param->ulPdcchLst.count;
9856    node = param->ulPdcchLst.last;
9857    while (node) {
9858       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9859       node=node->prev;
9860 #ifdef UL_ADPT_DBG      
9861       printf("ulPdcchLst count %d  time[ %d %d] \n",count,param->ulTiming.sfn,param->ulTiming.subframe);
9862 #endif
9863       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9864       cmLListDelFrm(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9865       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9866    }
9867    CMCHKPK(SPkU32, count, mBuf);
9868    CMCHKPK(SPkU8, param->cfi, mBuf);
9869    CMCHKPK(cmPkLteTimingInfo, &param->dlTiming, mBuf);
9870    CMCHKPK(cmPkLteTimingInfo, &param->ulTiming, mBuf);
9871    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9872    RETVALUE(ROK);
9873 }
9874
9875
9876 \f
9877 /***********************************************************
9878 *
9879 *     Func : cmUnpkTfuCntrlReqInfo
9880 *
9881 *
9882 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9883  * control information to be sent to the UE. 
9884  * -# PDCCH  Physical Downlink Control Channel
9885  * -# PHICH  Physical HARQ Indicator Channel
9886  * -# PCFICH Physical Control Format Indicator Channel
9887 *
9888 *
9889 *     Ret  : S16
9890 *
9891 *     Notes:
9892 *
9893 *     File  : 
9894 *
9895 **********************************************************/
9896 #ifdef ANSI
9897 PUBLIC S16 cmUnpkTfuCntrlReqInfo
9898 (
9899 TfuCntrlReqInfo *param,
9900 Ptr memCp,
9901 Buffer *mBuf
9902 )
9903 #else
9904 PUBLIC S16 cmUnpkTfuCntrlReqInfo(param, memCp, mBuf)
9905 TfuCntrlReqInfo *param;
9906 Ptr memCp;
9907 Buffer *mBuf;
9908 #endif
9909 {
9910
9911    TfuPdcchInfo *tfuPdcchInfo;
9912    U32 count, loopCnt;
9913    TfuPhichInfo *tfuPhichInfo;
9914
9915    TRC3(cmUnpkTfuCntrlReqInfo)
9916
9917    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9918    CMCHKUNPK(cmUnpkLteTimingInfo, &param->ulTiming, mBuf);
9919    CMCHKUNPK(cmUnpkLteTimingInfo, &param->dlTiming, mBuf);
9920    CMCHKUNPK(SUnpkU8, &param->cfi, mBuf);
9921    cmLListInit(&param->ulPdcchLst);
9922    CMCHKUNPK(SUnpkU32, &count, mBuf);
9923    for (loopCnt=0; loopCnt<count; loopCnt++) {
9924       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9925       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9926       cmLListAdd2Tail(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9927       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9928    }
9929    cmLListInit(&param->dlPdcchLst);
9930    CMCHKUNPK(SUnpkU32, &count, mBuf);
9931    for (loopCnt=0; loopCnt<count; loopCnt++) {
9932       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9933       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9934       cmLListAdd2Tail(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9935       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9936    }
9937    cmLListInit(&param->phichLst);
9938    CMCHKUNPK(SUnpkU32, &count, mBuf);
9939    for (loopCnt=0; loopCnt<count; loopCnt++) {
9940       cmGetMem((Ptr)memCp, sizeof(*tfuPhichInfo), (Ptr *)&tfuPhichInfo);
9941       CMCHKUNPK(cmUnpkTfuPhichInfo, tfuPhichInfo, mBuf);
9942       cmLListAdd2Tail(&param->phichLst, &tfuPhichInfo->lnk);
9943       tfuPhichInfo->lnk.node = (PTR)tfuPhichInfo;
9944    }
9945
9946 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9947    CMCHKUNPK(cmUnpkBool, &param->isSPSOcc, mBuf);
9948 #endif
9949 #ifdef EMTC_ENABLE   
9950    cmLListInit(&param->ulMpdcchLst);
9951    CMCHKUNPK(SUnpkU32, &count, mBuf);
9952    for (loopCnt=0; loopCnt<count; loopCnt++) {
9953       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9954       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9955       cmLListAdd2Tail(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9956       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9957    }
9958    cmLListInit(&param->dlMpdcchLst);
9959    CMCHKUNPK(SUnpkU32, &count, mBuf);
9960    printf("4. cmUnpkTfuCntrlReqInfo :: count %ld \n", count); 
9961    for (loopCnt=0; loopCnt<count; loopCnt++) {
9962       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9963       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9964       cmLListAdd2Tail(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9965       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9966       printf("5. cmUnpkTfuCntrlReqInfo :: Failed \n"); 
9967    }
9968 #endif  
9969    RETVALUE(ROK);
9970 }
9971
9972
9973 \f
9974 /***********************************************************
9975 *
9976 *     Func : cmPkTfuPdschDciInfo
9977 *
9978 *
9979 *     Desc : This structure Carries the control information that would be needed
9980   * by the Physical layer to process the data to be sent on PDSCH.
9981 *
9982 *
9983 *     Ret  : S16
9984 *
9985 *     Notes:
9986 *
9987 *     File  : 
9988 *
9989 **********************************************************/
9990 #ifdef ANSI
9991 PUBLIC S16 cmPkTfuPdschDciInfo
9992 (
9993 TfuPdschDciInfo *param,
9994 Buffer *mBuf
9995 )
9996 #else
9997 PUBLIC S16 cmPkTfuPdschDciInfo(param, mBuf)
9998 TfuPdschDciInfo *param;
9999 Buffer *mBuf;
10000 #endif
10001 {
10002
10003    TRC3(cmPkTfuPdschDciInfo)
10004
10005       switch(param->format) {
10006 #ifdef TFU_5GTF
10007          case TFU_DCI_FORMAT_B1:
10008             /* 
10009             if (param->u.formatB1Info.RBAssign <= 324)
10010             {
10011                printf("DCI Format: [B1] RBAssign: [%d] MCS: [%d]", 
10012                      param->u.formatB1Info.RBAssign, 
10013                      param->u.formatB1Info.u.rbAssignB1Val324.mcs);
10014             } 
10015             */
10016             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
10017             break;
10018          case TFU_DCI_FORMAT_B2:
10019             /* 
10020             if (param->u.formatB2Info.RBAssign <= 324)
10021             {
10022                printf("DCI Format: [B2] RBAssign: [%d] MCS: [%d]", 
10023                      param->u.formatB2Info.RBAssign, 
10024                      param->u.formatB2Info.u.rbAssignB1Val324.mcs);
10025             } 
10026             */
10027             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
10028             break;
10029          case TFU_DCI_FORMAT_A1:
10030             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
10031             break;
10032          case TFU_DCI_FORMAT_A2:
10033             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
10034             break;
10035 #endif
10036 #ifdef EMTC_ENABLE            
10037          case TFU_DCI_FORMAT_6_2:
10038              CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
10039          break;
10040          case TFU_DCI_FORMAT_6_1A:
10041             CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
10042             break;
10043 #endif            
10044          case TFU_DCI_FORMAT_2A:
10045             CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
10046             break;
10047          case TFU_DCI_FORMAT_2:
10048             CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
10049             break;
10050          case TFU_DCI_FORMAT_1D:
10051             CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
10052             break;
10053          case TFU_DCI_FORMAT_1C:
10054             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
10055             break;
10056          case TFU_DCI_FORMAT_1B:
10057             CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
10058             break;
10059          case TFU_DCI_FORMAT_1A:
10060             CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
10061             break;
10062          case TFU_DCI_FORMAT_1:
10063             CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
10064             break;
10065          default :
10066             RETVALUE(RFAILED);
10067       }
10068    CMCHKPK(SPkU32, param->format, mBuf);
10069    RETVALUE(ROK);
10070 }
10071
10072
10073 \f
10074 /***********************************************************
10075 *
10076 *     Func : cmUnpkTfuPdschDciInfo
10077 *
10078 *
10079 *     Desc : This structure Carries the control information that would be needed
10080   * by the Physical layer to process the data to be sent on PDSCH.
10081 *
10082 *
10083 *     Ret  : S16
10084 *
10085 *     Notes:
10086 *
10087 *     File  : 
10088 *
10089 **********************************************************/
10090 #ifdef ANSI
10091 PUBLIC S16 cmUnpkTfuPdschDciInfo
10092 (
10093 TfuPdschDciInfo *param,
10094 Buffer *mBuf
10095 )
10096 #else
10097 PUBLIC S16 cmUnpkTfuPdschDciInfo(param, mBuf)
10098 TfuPdschDciInfo *param;
10099 Buffer *mBuf;
10100 #endif
10101 {
10102
10103    TRC3(cmUnpkTfuPdschDciInfo)
10104
10105    CMCHKUNPK(SUnpkU32, (U32 *)&param->format, mBuf);
10106       switch(param->format) {
10107          case TFU_DCI_FORMAT_1:
10108             CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
10109             break;
10110          case TFU_DCI_FORMAT_1A:
10111             CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
10112             break;
10113          case TFU_DCI_FORMAT_1B:
10114             CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
10115             break;
10116          case TFU_DCI_FORMAT_1C:
10117             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
10118             break;
10119          case TFU_DCI_FORMAT_1D:
10120             CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
10121             break;
10122          case TFU_DCI_FORMAT_2:
10123             CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
10124             break;
10125          case TFU_DCI_FORMAT_2A:
10126             CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
10127             break;
10128 #ifdef EMTC_ENABLE            
10129          case TFU_DCI_FORMAT_6_1A:
10130             CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
10131             break;
10132          case TFU_DCI_FORMAT_6_2:
10133             CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
10134             break;
10135 #endif   
10136 #ifdef TFU_5GTF
10137          case TFU_DCI_FORMAT_A1:
10138             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
10139             break;
10140                         case TFU_DCI_FORMAT_A2:
10141             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
10142             break;
10143          case TFU_DCI_FORMAT_B1:
10144             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
10145             break;
10146                         case TFU_DCI_FORMAT_B2:
10147             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
10148             break;
10149 #endif
10150          default :
10151             RETVALUE(RFAILED);
10152       }
10153    RETVALUE(ROK);
10154 }
10155 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10156 #ifdef TFU_UPGRADE
10157 /***********************************************************
10158 *
10159 *     Func : cmPkTfuBfVectorInfo
10160 *
10161 *
10162 *     Desc : This structure conveys the BeamForming Vector 
10163 *               Information that hold relevance to Tx Mode 7
10164 *
10165 *
10166 *     Ret  : S16
10167 *
10168 *     Notes:
10169 *
10170 *     File  : 
10171 *
10172 **********************************************************/
10173 #ifdef ANSI
10174 PUBLIC S16 cmPkTfuBfVectorInfo
10175 (
10176 TfuBfVectorInfo *param,
10177 Buffer *mBuf
10178 )
10179 #else
10180 PUBLIC S16 cmPkTfuBfVectorInfo(param, mBuf)
10181 TfuBfVectorInfo *param;
10182 Buffer *mBuf;
10183 #endif
10184 {
10185    S32 idx, idx2;
10186    TRC3(cmPkTfuBfVectorInfo)
10187    for(idx=TFU_MAX_DL_SUBBAND-1;idx>=0; idx--)
10188    {
10189       for (idx2=param->numPhyAnt -1; idx2 >= 0; idx2--) {
10190       CMCHKPK(SPkU16, param->bfValue[idx2], mBuf);}
10191       CMCHKPK(SPkU8, param->numPhyAnt, mBuf);
10192       CMCHKPK(SPkU8, param->sbIndex, mBuf);
10193    }
10194    RETVALUE(ROK);
10195 }
10196
10197 /***********************************************************
10198 *
10199 *     Func : cmUnpkTfuBfVectorInfo
10200 *
10201 *
10202 *     Desc : This structure conveys the BeamForming Vector 
10203 *               Information that hold relevance to Tx Mode 7
10204 *
10205 *
10206 *     Ret  : S16
10207 *
10208 *     Notes:
10209 *
10210 *     File  : 
10211 *
10212 **********************************************************/
10213 #ifdef ANSI
10214 PUBLIC S16 cmUnpkTfuBfVectorInfo
10215 (
10216    TfuBfVectorInfo *param,
10217    Buffer *mBuf
10218 )
10219 #else
10220 PUBLIC S16 cmUnpkTfuBfVectorInfo(param, mBuf)
10221  TfuBfVectorInfo *param;
10222  Buffer *mBuf;
10223 #endif
10224 {
10225    S32 idx, idx2;
10226    TRC3(cmUnpkTfuBfVectorInfo)
10227     for(idx=0;idx<TFU_MAX_DL_SUBBAND; idx++)
10228    {
10229       CMCHKUNPK(SUnpkU8, &param->sbIndex, mBuf);
10230       CMCHKUNPK(SUnpkU8, &param->numPhyAnt, mBuf);
10231       for (idx2=0; idx2 <param->numPhyAnt; idx2++) {
10232       CMCHKUNPK(SUnpkU16, &param->bfValue[idx2], mBuf);}
10233    }
10234   
10235    RETVALUE(ROK);
10236 }
10237 #endif 
10238 \f
10239 /***********************************************************
10240 *
10241 *     Func : cmPkTfuDatReqPduInfo
10242 *
10243 *
10244 *     Desc : Pack Function for Tfu Dat Req PDU.
10245 *
10246 *
10247 *     Ret  : S16
10248 *
10249 *     Notes:
10250 *
10251 *     File  : 
10252 *
10253 **********************************************************/
10254 #ifdef ANSI
10255 PUBLIC S16 cmPkTfuDatReqPduInfo
10256 (
10257 TfuDatReqPduInfo *param,
10258 Buffer *mBuf
10259 )
10260 #else
10261 PUBLIC S16 cmPkTfuDatReqPduInfo(param, mBuf)
10262 TfuDatReqPduInfo *param;
10263 Buffer *mBuf;
10264 #endif
10265 {
10266
10267    S32 i;
10268    U8  tbMask = 0;
10269 #ifdef L2_OPTMZ
10270    U32 lchIdx, pduIdx;
10271 #endif
10272
10273    TRC3(cmPkTfuDatReqPduInfo)
10274
10275    /* LTE_ADV_FLAG_REMOVED_START */
10276    CMCHKPK(SPkU8, param->isEnbSFR, mBuf);
10277    /* LTE_ADV_FLAG_REMOVED_END */
10278
10279    /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10280 #ifdef TFU_UPGRADE 
10281    CMCHKPK(SPkU16, param->txPwrOffset, mBuf);
10282    if(param->transMode == TFU_UE_TM_7)
10283    {
10284       CMCHKPK(cmPkTfuBfVectorInfo, param->bfVector, mBuf);
10285       CMCHKPK(SPkU8, param->numBfVectors, mBuf);
10286       CMCHKPK(SPkU8, param->numBfPrbPerSb, mBuf);
10287    }
10288    CMCHKPK(SPkU8, param->deltaPowOffIdx, mBuf);
10289    /* LTE_ADV_FLAG_REMOVED_START */
10290    CMCHKPK(SPkU8, param->pa, mBuf);
10291    /* LTE_ADV_FLAG_REMOVED_END */
10292    CMCHKPK(SPkU8, param->numLayers, mBuf);
10293 #endif
10294    CMCHKPK(cmPkBool, param->isTApres, mBuf);
10295    CMCHKPK(cmPkTknU32, &param->doa, mBuf);
10296    CMCHKPK(SPkU32, param->transMode, mBuf);
10297    CMCHKPK(cmPkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10298    CMCHKPK(SPkU8, param->puschRptUsd, mBuf);
10299    for (i = 0; i < TFU_MAX_TB; i++)
10300    {
10301 #ifndef L2_OPTMZ
10302      if (param->mBuf[i] != NULLP)
10303      {
10304         tbMask = tbMask | (1 << i);
10305      }
10306 #else /* L2_OPTMZ */
10307      for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10308      {
10309         for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10310               pduIdx++)
10311         {
10312            if (param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] != NULLP)
10313            {
10314               tbMask = tbMask | (1 << i);
10315            }
10316         }
10317      }
10318 #endif /* L2_OPTMZ */
10319    }
10320    /* tfu_c_001.main_2: Packing should consider nmbOfTBs.*/
10321    for (i=TFU_MAX_TB - 1; i >= 0; i--) {
10322 #ifndef L2_OPTMZ
10323       if (param->mBuf[i] != NULLP)
10324       {
10325          CMCHKPK(cmPkBuffer, &param->mBuf[i], mBuf);
10326       }
10327 #else
10328      // CMCHKPK(cmPkBuffer, &param->tbInfo[i].macPad, mBuf);
10329       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10330       {
10331          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10332                pduIdx++)
10333          {
10334             CMCHKPK(cmPkBuffer, &param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx],
10335                   mBuf);
10336
10337          }
10338          CMCHKPK(SPkU32, param->tbInfo[i].lchInfo[lchIdx].numPdu, mBuf);
10339       }
10340       CMCHKPK(SPkU32, param->tbInfo[i].numLch, mBuf);
10341       CMCHKPK(SPkU32, param->tbInfo[i].padSize, mBuf);
10342       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macCes, mBuf);
10343       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macHdr, mBuf);
10344       CMCHKPK(cmPkMsgLen, param->tbInfo[i].tbSize, mBuf);
10345       CMCHKPK(cmPkBool, param->tbInfo[i].tbPres, mBuf);
10346 #endif
10347    }
10348    CMCHKPK(SPkU8, tbMask, mBuf);
10349    CMCHKPK(SPkU8, param->nmbOfTBs, mBuf);
10350    CMCHKPK(cmPkTfuPdschDciInfo, &param->dciInfo, mBuf);
10351    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10352    RETVALUE(ROK);
10353 }
10354
10355
10356 \f
10357 /***********************************************************
10358 *
10359 *     Func : cmUnpkTfuDatReqPduInfo
10360 *
10361 *
10362 *     Desc : UnPack function for Tfu Dat req pdu .
10363 *
10364 *
10365 *     Ret  : S16
10366 *
10367 *     Notes:
10368 *
10369 *     File  : 
10370 *
10371 **********************************************************/
10372 #ifdef ANSI
10373 PUBLIC S16 cmUnpkTfuDatReqPduInfo
10374 (
10375 TfuDatReqPduInfo *param,
10376 Buffer *mBuf
10377 )
10378 #else
10379 PUBLIC S16 cmUnpkTfuDatReqPduInfo(param, mBuf)
10380 TfuDatReqPduInfo *param;
10381 Buffer *mBuf;
10382 #endif
10383 {
10384
10385    U8 i;
10386    U8  tbMask = 0;
10387 #ifdef L2_OPTMZ
10388    U32 lchIdx, pduIdx;
10389 #endif
10390    TRC3(cmUnpkTfuDatReqPduInfo)
10391
10392    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10393    CMCHKUNPK(cmUnpkTfuPdschDciInfo, &param->dciInfo, mBuf);
10394    CMCHKUNPK(SUnpkU8, &param->nmbOfTBs, mBuf);
10395
10396    CMCHKUNPK(SUnpkU8, &tbMask, mBuf);
10397    for (i=0; i<TFU_MAX_TB; i++) {
10398 #ifndef L2_OPTMZ
10399       if (tbMask & (1<<i))
10400       {
10401          CMCHKUNPK(cmUnpkBuffer, &param->mBuf[i], mBuf);
10402       }
10403       else
10404       {
10405          param->mBuf[i] = NULLP;
10406       }
10407 #else /* L2_OPTMZ*/
10408       CMCHKUNPK(cmUnpkBool, &param->tbInfo[i].tbPres, mBuf);
10409       CMCHKUNPK(cmUnpkMsgLen, &param->tbInfo[i].tbSize, mBuf);
10410       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macHdr, mBuf);
10411       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macCes, mBuf);
10412       CMCHKUNPK(SUnpkU32, &param->tbInfo[i].padSize, mBuf);
10413       CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].numLch, mBuf);
10414       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10415       {
10416          CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].lchInfo[lchIdx].numPdu,
10417                mBuf);
10418          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10419                pduIdx++)
10420          {
10421             if (tbMask & (1<<i))
10422             {
10423                CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].lchInfo[lchIdx].\
10424                      mBuf[pduIdx], mBuf);
10425             }
10426             else
10427             {
10428                param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] = NULLP;
10429             }
10430          }
10431       }
10432       //CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macPad, mBuf);
10433 #endif /* L2_OPTMZ*/
10434    }
10435
10436    CMCHKUNPK(SUnpkU8, &param->puschRptUsd, mBuf);
10437    CMCHKUNPK(cmUnpkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10438    CMCHKUNPK(SUnpkU32, (U32 *)&param->transMode, mBuf);
10439    CMCHKUNPK(cmUnpkTknU32, &param->doa, mBuf);
10440    CMCHKUNPK(cmUnpkBool, &param->isTApres, mBuf);
10441 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10442 #ifdef TFU_UPGRADE
10443    CMCHKUNPK(SUnpkU8, &param->numLayers, mBuf);
10444    /* LTE_ADV_FLAG_REMOVED_START */
10445    CMCHKUNPK(SUnpkU8, &param->pa, mBuf);
10446    /* LTE_ADV_FLAG_REMOVED_END */
10447    CMCHKUNPK(SUnpkU8, &param->deltaPowOffIdx, mBuf);
10448    if(param->transMode == TFU_UE_TM_7)
10449    {
10450       CMCHKUNPK(SUnpkU8, &param->numBfPrbPerSb, mBuf);
10451       CMCHKUNPK(SUnpkU8, &param->numBfVectors, mBuf);
10452       CMCHKUNPK(cmUnpkTfuBfVectorInfo, param->bfVector, mBuf);
10453    }
10454    CMCHKUNPK(SUnpkU16, &param->txPwrOffset, mBuf);
10455 #endif
10456
10457    /* LTE_ADV_FLAG_REMOVED_START */
10458    CMCHKUNPK(SUnpkU8, &param->isEnbSFR, mBuf);
10459    /* LTE_ADV_FLAG_REMOVED_END */
10460
10461    RETVALUE(ROK);
10462 }
10463
10464
10465 \f
10466 /***********************************************************
10467 *
10468 *     Func : cmPkTfuDatReqInfo
10469 *
10470 *
10471 *     Desc : This structure contains the Data PDUs 
10472  * @details This structure contains Data meant to be sent on both PBCH and
10473  * PDSCH. Control information necessary for processing of the data is sent along
10474  * with the Data.
10475 *
10476 *
10477 *     Ret  : S16
10478 *
10479 *     Notes:
10480 *
10481 *     File  : 
10482 *
10483 **********************************************************/
10484 #ifdef ANSI
10485 PUBLIC S16 cmPkTfuDatReqInfo
10486 (
10487 TfuDatReqInfo *param,
10488 Buffer *mBuf
10489 )
10490 #else
10491 PUBLIC S16 cmPkTfuDatReqInfo(param, mBuf)
10492 TfuDatReqInfo *param;
10493 Buffer *mBuf;
10494 #endif
10495 {
10496
10497    CmLList *node;
10498    U32 count;
10499    TfuDatReqPduInfo *tfuDatReqPduInfo;
10500
10501    TRC3(cmPkTfuDatReqInfo)
10502
10503    count = param->pdus.count;
10504    node = param->pdus.last;
10505    while (node) {
10506       tfuDatReqPduInfo = (TfuDatReqPduInfo *)node->node;
10507       node=node->prev;
10508       CMCHKPK(cmPkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10509       cmLListDelFrm(&param->pdus, &tfuDatReqPduInfo->lnk);
10510       tfuDatReqPduInfo->lnk.node = (PTR)NULLP;
10511    }
10512    CMCHKPK(SPkU32, count, mBuf);
10513    CMCHKPK(cmPkTknBuf, &param->bchDat, mBuf);
10514    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10515    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10516    RETVALUE(ROK);
10517 }
10518
10519
10520 \f
10521 /***********************************************************
10522 *
10523 *     Func : cmUnpkTfuDatReqInfo
10524 *
10525 *
10526 *     Desc : This structure contains the Data PDUs 
10527  * @details This structure contains Data meant to be sent on both PBCH and
10528  * PDSCH. Control information necessary for processing of the data is sent along
10529  * with the Data.
10530 *
10531 *
10532 *     Ret  : S16
10533 *
10534 *     Notes:
10535 *
10536 *     File  : 
10537 *
10538 **********************************************************/
10539 #ifdef ANSI
10540 PUBLIC S16 cmUnpkTfuDatReqInfo
10541 (
10542 TfuDatReqInfo *param,
10543 Ptr memCp,
10544 Buffer *mBuf
10545 )
10546 #else
10547 PUBLIC S16 cmUnpkTfuDatReqInfo(param, memCp, mBuf)
10548 TfuDatReqInfo *param;
10549 Ptr memCp;
10550 Buffer *mBuf;
10551 #endif
10552 {
10553
10554    U32 count, loopCnt;
10555    TfuDatReqPduInfo *tfuDatReqPduInfo;
10556
10557    TRC3(cmUnpkTfuDatReqInfo)
10558
10559    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10560    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10561    CMCHKUNPK(cmUnpkTknBuf, &param->bchDat, &mBuf);
10562    cmLListInit(&param->pdus);
10563    CMCHKUNPK(SUnpkU32, &count, mBuf);
10564    for (loopCnt=0; loopCnt<count; loopCnt++) {
10565       cmGetMem((Ptr)memCp, sizeof(*tfuDatReqPduInfo), (Ptr *)&tfuDatReqPduInfo);
10566       CMCHKUNPK(cmUnpkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10567       cmLListAdd2Tail(&param->pdus, &tfuDatReqPduInfo->lnk);
10568       tfuDatReqPduInfo->lnk.node = (PTR)tfuDatReqPduInfo;
10569    }
10570    RETVALUE(ROK);
10571 }
10572
10573
10574 \f
10575 /***********************************************************
10576 *
10577 *     Func : cmPkTfuDatInfo
10578 *
10579 *
10580 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10581 *
10582 *
10583 *     Ret  : S16
10584 *
10585 *     Notes:
10586 *
10587 *     File  : 
10588 *
10589 **********************************************************/
10590 #ifdef ANSI
10591 PUBLIC S16 cmPkTfuDatInfo
10592 (
10593 TfuDatInfo *param,
10594 Buffer *mBuf
10595 )
10596 #else
10597 PUBLIC S16 cmPkTfuDatInfo(param, mBuf)
10598 TfuDatInfo *param;
10599 Buffer *mBuf;
10600 #endif
10601 {
10602
10603    TRC3(cmPkTfuDatInfo)
10604
10605    CMCHKPK(cmPkBuffer, &param->mBuf, mBuf);
10606    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10607    RETVALUE(ROK);
10608 }
10609
10610
10611 \f
10612 /***********************************************************
10613 *
10614 *     Func : cmUnpkTfuDatInfo
10615 *
10616 *
10617 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10618 *
10619 *
10620 *     Ret  : S16
10621 *
10622 *     Notes:
10623 *
10624 *     File  : 
10625 *
10626 **********************************************************/
10627 #ifdef ANSI
10628 PUBLIC S16 cmUnpkTfuDatInfo
10629 (
10630 TfuDatInfo *param,
10631 Buffer *mBuf
10632 )
10633 #else
10634 PUBLIC S16 cmUnpkTfuDatInfo(param, mBuf)
10635 TfuDatInfo *param;
10636 Buffer *mBuf;
10637 #endif
10638 {
10639
10640    TRC3(cmUnpkTfuDatInfo)
10641
10642    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10643    CMCHKUNPK(cmUnpkBuffer, &param->mBuf, mBuf);
10644    RETVALUE(ROK);
10645 }
10646
10647
10648 \f
10649 /***********************************************************
10650 *
10651 *     Func : cmPkTfuDatIndInfo
10652 *
10653 *
10654 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10655  * @details All the PDUs received by Physical layer in one subframe are clubbed
10656  * together into a single data structure and sent to MAC for processing.
10657 *
10658 *
10659 *     Ret  : S16
10660 *
10661 *     Notes:
10662 *
10663 *     File  : 
10664 *
10665 **********************************************************/
10666 #ifdef ANSI
10667 PUBLIC S16 cmPkTfuDatIndInfo
10668 (
10669 TfuDatIndInfo *param,
10670 Buffer *mBuf
10671 )
10672 #else
10673 PUBLIC S16 cmPkTfuDatIndInfo(param, mBuf)
10674 TfuDatIndInfo *param;
10675 Buffer *mBuf;
10676 #endif
10677 {
10678
10679    CmLList *node;
10680    U32 count;
10681    TfuDatInfo *tfuDatInfo;
10682
10683    TRC3(cmPkTfuDatIndInfo)
10684
10685 #ifdef TFU_5GTF
10686    CMCHKPK(SPkU8, param->sccIdx, mBuf);
10687    CMCHKPK(SPkU8, param->sectorId, mBuf);
10688 #endif /* TFU_5GTF */
10689    count = param->datIndLst.count;
10690    node = param->datIndLst.last;
10691    while (node) {
10692       tfuDatInfo = (TfuDatInfo *)node->node;
10693       node=node->prev;
10694       CMCHKPK(cmPkTfuDatInfo, tfuDatInfo, mBuf);
10695       cmLListDelFrm(&param->datIndLst, &tfuDatInfo->lnk);
10696       tfuDatInfo->lnk.node = (PTR)NULLP;
10697    }
10698    CMCHKPK(SPkU32, count, mBuf);
10699    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10700    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10701    RETVALUE(ROK);
10702 }
10703
10704
10705 \f
10706 /***********************************************************
10707 *
10708 *     Func : cmUnpkTfuDatIndInfo
10709 *
10710 *
10711 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10712  * @details All the PDUs received by Physical layer in one subframe are clubbed
10713  * together into a single data structure and sent to MAC for processing.
10714 *
10715 *
10716 *     Ret  : S16
10717 *
10718 *     Notes:
10719 *
10720 *     File  : 
10721 *
10722 **********************************************************/
10723 #ifdef ANSI
10724 PUBLIC S16 cmUnpkTfuDatIndInfo
10725 (
10726 TfuDatIndInfo *param,
10727 Ptr memCp,
10728 Buffer *mBuf
10729 )
10730 #else
10731 PUBLIC S16 cmUnpkTfuDatIndInfo(param, memCp, mBuf)
10732 TfuDatIndInfo *param;
10733 Ptr memCp;
10734 Buffer *mBuf;
10735 #endif
10736 {
10737
10738    U32 count, loopCnt;
10739    TfuDatInfo *tfuDatInfo;
10740
10741    TRC3(cmUnpkTfuDatIndInfo)
10742
10743    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10744    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10745    cmLListInit(&param->datIndLst);
10746    CMCHKUNPK(SUnpkU32, &count, mBuf);
10747    for (loopCnt=0; loopCnt<count; loopCnt++) {
10748       cmGetMem((Ptr)memCp, sizeof(*tfuDatInfo), (Ptr *)&tfuDatInfo);
10749       CMCHKUNPK(cmUnpkTfuDatInfo, tfuDatInfo, mBuf);
10750       cmLListAdd2Tail(&param->datIndLst, &tfuDatInfo->lnk);
10751       tfuDatInfo->lnk.node = (PTR)tfuDatInfo;
10752    }
10753 #ifdef TFU_5GTF
10754    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
10755    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
10756 #endif /* TFU_5GTF */
10757    RETVALUE(ROK);
10758 }
10759
10760
10761 \f
10762 /***********************************************************
10763 *
10764 *     Func : cmPkTfuSrInfo
10765 *
10766 *
10767 *     Desc : This structure contains the SR indication for a UE, identified by
10768   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10769   * calculated by the physical layer, and is used by the scheduler for Power
10770   * control of the UE.
10771 *
10772 *
10773 *     Ret  : S16
10774 *
10775 *     Notes:
10776 *
10777 *     File  : 
10778 *
10779 **********************************************************/
10780 #ifdef ANSI
10781 PUBLIC S16 cmPkTfuSrInfo
10782 (
10783 TfuSrInfo *param,
10784 Buffer *mBuf
10785 )
10786 #else
10787 PUBLIC S16 cmPkTfuSrInfo(param, mBuf)
10788 TfuSrInfo *param;
10789 Buffer *mBuf;
10790 #endif
10791 {
10792
10793    TRC3(cmPkTfuSrInfo)
10794
10795    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10796    RETVALUE(ROK);
10797 }
10798
10799
10800 \f
10801 /***********************************************************
10802 *
10803 *     Func : cmUnpkTfuSrInfo
10804 *
10805 *
10806 *     Desc : This structure contains the SR indication for a UE, identified by
10807   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10808   * calculated by the physical layer, and is used by the scheduler for Power
10809   * control of the UE.
10810 *
10811 *
10812 *     Ret  : S16
10813 *
10814 *     Notes:
10815 *
10816 *     File  : 
10817 *
10818 **********************************************************/
10819 #ifdef ANSI
10820 PUBLIC S16 cmUnpkTfuSrInfo
10821 (
10822 TfuSrInfo *param,
10823 Buffer *mBuf
10824 )
10825 #else
10826 PUBLIC S16 cmUnpkTfuSrInfo(param, mBuf)
10827 TfuSrInfo *param;
10828 Buffer *mBuf;
10829 #endif
10830 {
10831
10832    TRC3(cmUnpkTfuSrInfo)
10833
10834    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10835    RETVALUE(ROK);
10836 }
10837
10838
10839 \f
10840 /***********************************************************
10841 *
10842 *     Func : cmPkTfuSrIndInfo
10843 *
10844 *
10845 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10846   * received in a subframe.
10847 *
10848 *
10849 *     Ret  : S16
10850 *
10851 *     Notes:
10852 *
10853 *     File  : 
10854 *
10855 **********************************************************/
10856 #ifdef ANSI
10857 PUBLIC S16 cmPkTfuSrIndInfo
10858 (
10859 TfuSrIndInfo *param,
10860 Buffer *mBuf
10861 )
10862 #else
10863 PUBLIC S16 cmPkTfuSrIndInfo(param, mBuf)
10864 TfuSrIndInfo *param;
10865 Buffer *mBuf;
10866 #endif
10867 {
10868
10869    CmLList *node;
10870    U32 count;
10871    TfuSrInfo *tfuSrInfo;
10872
10873    TRC3(cmPkTfuSrIndInfo)
10874
10875    count = param->srLst.count;
10876    node = param->srLst.last;
10877    while (node) {
10878       tfuSrInfo = (TfuSrInfo *)node->node;
10879       node=node->prev;
10880       CMCHKPK(cmPkTfuSrInfo, tfuSrInfo, mBuf);
10881       cmLListDelFrm(&param->srLst, &tfuSrInfo->lnk);
10882       tfuSrInfo->lnk.node = (PTR)NULLP;
10883    }
10884    CMCHKPK(SPkU32, count, mBuf);
10885    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10886    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10887    RETVALUE(ROK);
10888 }
10889
10890
10891 \f
10892 /***********************************************************
10893 *
10894 *     Func : cmUnpkTfuSrIndInfo
10895 *
10896 *
10897 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10898   * received in a subframe.
10899 *
10900 *
10901 *     Ret  : S16
10902 *
10903 *     Notes:
10904 *
10905 *     File  : 
10906 *
10907 **********************************************************/
10908 #ifdef ANSI
10909 PUBLIC S16 cmUnpkTfuSrIndInfo
10910 (
10911 TfuSrIndInfo *param,
10912 Ptr memCp,
10913 Buffer *mBuf
10914 )
10915 #else
10916 PUBLIC S16 cmUnpkTfuSrIndInfo(param, memCp, mBuf)
10917 TfuSrIndInfo *param;
10918 Ptr memCp;
10919 Buffer *mBuf;
10920 #endif
10921 {
10922
10923    U32 count, loopCnt;
10924    TfuSrInfo *tfuSrInfo;
10925
10926    TRC3(cmUnpkTfuSrIndInfo)
10927
10928    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10929    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10930    cmLListInit(&param->srLst);
10931    CMCHKUNPK(SUnpkU32, &count, mBuf);
10932    for (loopCnt=0; loopCnt<count; loopCnt++) {
10933       cmGetMem((Ptr)memCp, sizeof(*tfuSrInfo), (Ptr *)&tfuSrInfo);
10934       CMCHKUNPK(cmUnpkTfuSrInfo, tfuSrInfo, mBuf);
10935       cmLListAdd2Tail(&param->srLst, &tfuSrInfo->lnk);
10936       tfuSrInfo->lnk.node = (PTR)tfuSrInfo;
10937    }
10938    RETVALUE(ROK);
10939 }
10940
10941 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10942 /***********************************************************
10943 *
10944 *     Func : cmPkTfuHqInfo
10945 *
10946 *
10947 *     Desc : This structure contains the HARQ feedback for a single UE. 
10948   * @details RNTI is present to identify the UE. 
10949   * For FDD a single feedback is present. 
10950   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10951 *
10952 *
10953 *     Ret  : S16
10954 *
10955 *     Notes:
10956 *
10957 *     File  : 
10958 *
10959 **********************************************************/
10960 #ifdef ANSI
10961 PUBLIC S16 cmPkTfuHqInfo
10962 (
10963 TfuHqInfo *param,
10964 Buffer *mBuf
10965 )
10966 #else
10967 PUBLIC S16 cmPkTfuHqInfo(param, mBuf)
10968 TfuHqInfo *param;
10969 Buffer *mBuf;
10970 #endif
10971 {
10972
10973    S32 i;
10974    TRC3(cmPkTfuHqInfo)
10975
10976    CMCHKPK(SPkU8, param->isPusch, mBuf);
10977    for (i=TFU_MAX_HARQ_FDBKS-1; i >= 0; i--) {
10978       CMCHKPK(SPkU32, param->isAck[i], mBuf);
10979    }
10980 #ifdef TFU_TDD        
10981    CMCHKPK(SPkU8, param->M, mBuf);
10982 #endif/*TFU_TDD*/
10983    CMCHKPK(SPkU8, param->noOfTbs, mBuf);
10984 /* ACC-TDD ccpu00130520 */
10985    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
10986    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10987    RETVALUE(ROK);
10988 }
10989
10990 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10991 /***********************************************************
10992 *
10993 *     Func : cmUnpkTfuHqInfo
10994 *
10995 *
10996 *     Desc : This structure contains the HARQ feedback for a single UE. 
10997   * @details RNTI is present to identify the UE. 
10998   * For FDD a single feedback is present. 
10999   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
11000 *
11001 *
11002 *     Ret  : S16
11003 *
11004 *     Notes:
11005 *
11006 *     File  : 
11007 *
11008 **********************************************************/
11009 #ifdef ANSI
11010 PUBLIC S16 cmUnpkTfuHqInfo
11011 (
11012 TfuHqInfo *param,
11013 Buffer *mBuf
11014 )
11015 #else
11016 PUBLIC S16 cmUnpkTfuHqInfo(param, mBuf)
11017 TfuHqInfo *param;
11018 Buffer *mBuf;
11019 #endif
11020 {
11021    S32 i;
11022    TRC3(cmUnpkTfuHqInfo)
11023
11024    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11025 /* ACC-TDD ccpu00130520 */
11026    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
11027    CMCHKUNPK(SUnpkU8, &param->noOfTbs, mBuf);
11028 #ifdef TFU_TDD
11029    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
11030 #endif
11031    for (i=0; i<TFU_MAX_HARQ_FDBKS; i++) {
11032       CMCHKUNPK(SUnpkU32, (U32 *)&param->isAck[i], mBuf);
11033    }
11034    CMCHKUNPK(SUnpkU8, &param->isPusch, mBuf);
11035    RETVALUE(ROK);
11036 }
11037
11038
11039
11040
11041 \f
11042 /***********************************************************
11043 *
11044 *     Func : cmPkTfuHqIndInfo
11045 *
11046 *
11047 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
11048   * @details All the HARQ feedback received in the subframe are clubbed together
11049   * in this data structure and given to the scheduler for processing.
11050 *
11051 *
11052 *     Ret  : S16
11053 *
11054 *     Notes:
11055 *
11056 *     File  : 
11057 *
11058 **********************************************************/
11059 #ifdef ANSI
11060 PUBLIC S16 cmPkTfuHqIndInfo
11061 (
11062 TfuHqIndInfo *param,
11063 Buffer *mBuf
11064 )
11065 #else
11066 PUBLIC S16 cmPkTfuHqIndInfo(param, mBuf)
11067 TfuHqIndInfo *param;
11068 Buffer *mBuf;
11069 #endif
11070 {
11071
11072    CmLList *node;
11073    U32 count;
11074    TfuHqInfo *tfuHqInfo;
11075
11076    TRC3(cmPkTfuHqIndInfo)
11077
11078    count = param->hqIndLst.count;
11079    node = param->hqIndLst.last;
11080    while (node) {
11081       tfuHqInfo = (TfuHqInfo *)node->node;
11082       node=node->prev;
11083       CMCHKPK(cmPkTfuHqInfo, tfuHqInfo, mBuf);
11084       cmLListDelFrm(&param->hqIndLst, &tfuHqInfo->lnk);
11085       tfuHqInfo->lnk.node = (PTR)NULLP;
11086    }
11087    CMCHKPK(SPkU32, count, mBuf);
11088    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11089    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11090    RETVALUE(ROK);
11091 }
11092
11093
11094 \f
11095 /***********************************************************
11096 *
11097 *     Func : cmUnpkTfuHqIndInfo
11098 *
11099 *
11100 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
11101   * @details All the HARQ feedback received in the subframe are clubbed together
11102   * in this data structure and given to the scheduler for processing.
11103 *
11104 *
11105 *     Ret  : S16
11106 *
11107 *     Notes:
11108 *
11109 *     File  : 
11110 *
11111 **********************************************************/
11112 #ifdef ANSI
11113 PUBLIC S16 cmUnpkTfuHqIndInfo
11114 (
11115 TfuHqIndInfo *param,
11116 Ptr memCp,
11117 Buffer *mBuf
11118 )
11119 #else
11120 PUBLIC S16 cmUnpkTfuHqIndInfo(param, memCp, mBuf)
11121 TfuHqIndInfo *param;
11122 Ptr memCp;
11123 Buffer *mBuf;
11124 #endif
11125 {
11126
11127    U32 count, loopCnt;
11128    TfuHqInfo *tfuHqInfo;
11129
11130    TRC3(cmUnpkTfuHqIndInfo)
11131
11132    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11133    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11134    cmLListInit(&param->hqIndLst);
11135    CMCHKUNPK(SUnpkU32, &count, mBuf);
11136    for (loopCnt=0; loopCnt<count; loopCnt++) {
11137       cmGetMem((Ptr)memCp, sizeof(*tfuHqInfo), (Ptr *)&tfuHqInfo);
11138       CMCHKUNPK(cmUnpkTfuHqInfo, tfuHqInfo, mBuf);
11139       cmLListAdd2Tail(&param->hqIndLst, &tfuHqInfo->lnk);
11140       tfuHqInfo->lnk.node = (PTR)tfuHqInfo;
11141    }
11142    RETVALUE(ROK);
11143 }
11144
11145
11146 \f
11147 /***********************************************************
11148 *
11149 *     Func : cmPkTfuUlCqiInfo
11150 *
11151 *
11152 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11153 *
11154 *
11155 *     Ret  : S16
11156 *
11157 *     Notes:
11158 *
11159 *     File  : 
11160 *
11161 **********************************************************/
11162 #ifdef ANSI
11163 PUBLIC S16 cmPkTfuUlCqiInfo
11164 (
11165 TfuUlCqiInfo *param,
11166 Buffer *mBuf
11167 )
11168 #else
11169 PUBLIC S16 cmPkTfuUlCqiInfo(param, mBuf)
11170 TfuUlCqiInfo *param;
11171 Buffer *mBuf;
11172 #endif
11173 {
11174
11175    TRC3(cmPkTfuUlCqiInfo)
11176
11177    CMCHKPK(cmPkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11178    RETVALUE(ROK);
11179 }
11180
11181
11182 \f
11183 /***********************************************************
11184 *
11185 *     Func : cmUnpkTfuUlCqiInfo
11186 *
11187 *
11188 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11189 *
11190 *
11191 *     Ret  : S16
11192 *
11193 *     Notes:
11194 *
11195 *     File  : 
11196 *
11197 **********************************************************/
11198 #ifdef ANSI
11199 PUBLIC S16 cmUnpkTfuUlCqiInfo
11200 (
11201 TfuUlCqiInfo *param,
11202 Buffer *mBuf
11203 )
11204 #else
11205 PUBLIC S16 cmUnpkTfuUlCqiInfo(param, mBuf)
11206 TfuUlCqiInfo *param;
11207 Buffer *mBuf;
11208 #endif
11209 {
11210
11211    TRC3(cmUnpkTfuUlCqiInfo)
11212
11213    CMCHKUNPK(cmUnpkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11214    RETVALUE(ROK);
11215 }
11216
11217
11218 \f
11219 /***********************************************************
11220 *
11221 *     Func : cmPkTfuUlCqiRpt
11222 *
11223 *
11224 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11225   * @details The report could be wideband CQI or subBand CQI or both.
11226 *
11227 *
11228 *     Ret  : S16
11229 *
11230 *     Notes:
11231 *
11232 *     File  : 
11233 *
11234 **********************************************************/
11235 #ifdef ANSI
11236 PUBLIC S16 cmPkTfuUlCqiRpt
11237 (
11238 TfuUlCqiRpt *param,
11239 Buffer *mBuf
11240 )
11241 #else
11242 PUBLIC S16 cmPkTfuUlCqiRpt(param, mBuf)
11243 TfuUlCqiRpt *param;
11244 Buffer *mBuf;
11245 #endif
11246 {
11247
11248    S32 i;
11249    TRC3(cmPkTfuUlCqiRpt)
11250
11251    for (i=TFU_MAX_UL_SUBBAND-1; i >= 0; i--) {
11252       CMCHKPK(cmPkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11253    }
11254    CMCHKPK(SPkU8, param->numSubband, mBuf);
11255    CMCHKPK(SPkU8, param->wideCqi, mBuf);
11256    CMCHKPK(SPkU8, param->isTxPort0, mBuf);
11257    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11258    RETVALUE(ROK);
11259 }
11260
11261
11262 \f
11263 /***********************************************************
11264 *
11265 *     Func : cmUnpkTfuUlCqiRpt
11266 *
11267 *
11268 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11269   * @details The report could be wideband CQI or subBand CQI or both.
11270 *
11271 *
11272 *     Ret  : S16
11273 *
11274 *     Notes:
11275 *
11276 *     File  : 
11277 *
11278 **********************************************************/
11279 #ifdef ANSI
11280 PUBLIC S16 cmUnpkTfuUlCqiRpt
11281 (
11282 TfuUlCqiRpt *param,
11283 Buffer *mBuf
11284 )
11285 #else
11286 PUBLIC S16 cmUnpkTfuUlCqiRpt(param, mBuf)
11287 TfuUlCqiRpt *param;
11288 Buffer *mBuf;
11289 #endif
11290 {
11291
11292    S32 i;
11293    TRC3(cmUnpkTfuUlCqiRpt)
11294
11295    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11296    CMCHKUNPK(SUnpkU8, &param->isTxPort0, mBuf);
11297    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
11298    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
11299    for (i=0; i<TFU_MAX_UL_SUBBAND; i++) {
11300       CMCHKUNPK(cmUnpkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11301    }
11302    RETVALUE(ROK);
11303 }
11304
11305
11306 \f
11307 /***********************************************************
11308 *
11309 *     Func : cmPkTfuUlCqiIndInfo
11310 *
11311 *
11312 *     Desc : This structure conveys the Uplink CQI information.
11313  * @details Uplink CQI is calculated by the physical layer, and is this
11314  * information is provided to the scheduler. 
11315  * This data structure clubs together the UL CQI estimates for all the UEs that
11316  * have been scheduled in the subframe for uplink transmission.
11317 *
11318 *
11319 *     Ret  : S16
11320 *
11321 *     Notes:
11322 *
11323 *     File  : 
11324 *
11325 **********************************************************/
11326 #ifdef ANSI
11327 PUBLIC S16 cmPkTfuUlCqiIndInfo
11328 (
11329 TfuUlCqiIndInfo *param,
11330 Buffer *mBuf
11331 )
11332 #else
11333 PUBLIC S16 cmPkTfuUlCqiIndInfo(param, mBuf)
11334 TfuUlCqiIndInfo *param;
11335 Buffer *mBuf;
11336 #endif
11337 {
11338
11339    CmLList *node;
11340    U32 count;
11341    TfuUlCqiRpt *tfuUlCqiRpt;
11342
11343    TRC3(cmPkTfuUlCqiIndInfo)
11344
11345    count = param->ulCqiRpt.count;
11346    node = param->ulCqiRpt.last;
11347    while (node) {
11348       tfuUlCqiRpt = (TfuUlCqiRpt *)node->node;
11349       node=node->prev;
11350       CMCHKPK(cmPkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11351       cmLListDelFrm(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11352       tfuUlCqiRpt->lnk.node = (PTR)NULLP;
11353    }
11354    CMCHKPK(SPkU32, count, mBuf);
11355    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11356    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11357    RETVALUE(ROK);
11358 }
11359
11360
11361 \f
11362 /***********************************************************
11363 *
11364 *     Func : cmUnpkTfuUlCqiIndInfo
11365 *
11366 *
11367 *     Desc : This structure conveys the Uplink CQI information.
11368  * @details Uplink CQI is calculated by the physical layer, and is this
11369  * information is provided to the scheduler. 
11370  * This data structure clubs together the UL CQI estimates for all the UEs that
11371  * have been scheduled in the subframe for uplink transmission.
11372 *
11373 *
11374 *     Ret  : S16
11375 *
11376 *     Notes:
11377 *
11378 *     File  : 
11379 *
11380 **********************************************************/
11381 #ifdef ANSI
11382 PUBLIC S16 cmUnpkTfuUlCqiIndInfo
11383 (
11384 TfuUlCqiIndInfo *param,
11385 Ptr memCp,
11386 Buffer *mBuf
11387 )
11388 #else
11389 PUBLIC S16 cmUnpkTfuUlCqiIndInfo(param, memCp, mBuf)
11390 TfuUlCqiIndInfo *param;
11391 Ptr memCp;
11392 Buffer *mBuf;
11393 #endif
11394 {
11395
11396    U32 count, loopCnt;
11397    TfuUlCqiRpt *tfuUlCqiRpt;
11398
11399    TRC3(cmUnpkTfuUlCqiIndInfo)
11400
11401    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11402    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11403    cmLListInit(&param->ulCqiRpt);
11404    CMCHKUNPK(SUnpkU32, &count, mBuf);
11405    for (loopCnt=0; loopCnt<count; loopCnt++) {
11406       cmGetMem((Ptr)memCp, sizeof(*tfuUlCqiRpt), (Ptr *)&tfuUlCqiRpt);
11407       CMCHKUNPK(cmUnpkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11408       cmLListAdd2Tail(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11409       tfuUlCqiRpt->lnk.node = (PTR)tfuUlCqiRpt;
11410    }
11411    RETVALUE(ROK);
11412 }
11413
11414
11415
11416 \f
11417 /***********************************************************
11418 *
11419 *     Func : cmPkTfuDlCqiRpt
11420 *
11421 *
11422 *     Desc : This structure contains the DL CQI report for a single UE. 
11423   * @details The report could either be reported on PUCCH or PUSCH, a flag
11424   * conveys this information.
11425 *
11426 *
11427 *     Ret  : S16
11428 *
11429 *     Notes:
11430 *
11431 *     File  : 
11432 *
11433 **********************************************************/
11434 #ifdef ANSI
11435 PUBLIC S16 cmPkTfuDlCqiRpt
11436 (
11437 TfuDlCqiRpt *param,
11438 Buffer *mBuf
11439 )
11440 #else
11441 PUBLIC S16 cmPkTfuDlCqiRpt(param, mBuf)
11442 TfuDlCqiRpt *param;
11443 Buffer *mBuf;
11444 #endif
11445 {
11446
11447    TRC3(cmPkTfuDlCqiRpt)
11448
11449       if (cmPkTfuDlCqiInfo(param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11450          RETVALUE(RFAILED);
11451    CMCHKPK(SPkU8, param->isPucchInfo, mBuf);
11452    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11453    RETVALUE(ROK);
11454 }
11455
11456
11457 \f
11458 /***********************************************************
11459 *
11460 *     Func : cmUnpkTfuDlCqiRpt
11461 *
11462 *
11463 *     Desc : This structure contains the DL CQI report for a single UE. 
11464   * @details The report could either be reported on PUCCH or PUSCH, a flag
11465   * conveys this information.
11466 *
11467 *
11468 *     Ret  : S16
11469 *
11470 *     Notes:
11471 *
11472 *     File  : 
11473 *
11474 **********************************************************/
11475 #ifdef ANSI
11476 PUBLIC S16 cmUnpkTfuDlCqiRpt
11477 (
11478 TfuDlCqiRpt *param,
11479 Buffer *mBuf
11480 )
11481 #else
11482 PUBLIC S16 cmUnpkTfuDlCqiRpt(param, mBuf)
11483 TfuDlCqiRpt *param;
11484 Buffer *mBuf;
11485 #endif
11486 {
11487
11488    TRC3(cmUnpkTfuDlCqiRpt)
11489
11490    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11491    CMCHKUNPK(SUnpkU8, &param->isPucchInfo, mBuf);
11492    if (cmUnpkTfuDlCqiInfo (param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11493       RETVALUE(RFAILED);
11494    RETVALUE(ROK);
11495 }
11496
11497
11498 \f
11499 /***********************************************************
11500 *
11501 *     Func : cmPkTfuDlCqiIndInfo
11502 *
11503 *
11504 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11505  * UEs. 
11506  * @details This structure clubs together DL CQI reports for a number of UEs.
11507 *
11508 *
11509 *     Ret  : S16
11510 *
11511 *     Notes:
11512 *
11513 *     File  : 
11514 *
11515 **********************************************************/
11516 #ifdef ANSI
11517 PUBLIC S16 cmPkTfuDlCqiIndInfo
11518 (
11519 TfuDlCqiIndInfo *param,
11520 Buffer *mBuf
11521 )
11522 #else
11523 PUBLIC S16 cmPkTfuDlCqiIndInfo(param, mBuf)
11524 TfuDlCqiIndInfo *param;
11525 Buffer *mBuf;
11526 #endif
11527 {
11528
11529    CmLList *node;
11530    U32 count;
11531    TfuDlCqiRpt *tfuDlCqiRpt;
11532
11533    TRC3(cmPkTfuDlCqiIndInfo)
11534
11535    count = param->dlCqiRptsLst.count;
11536    node = param->dlCqiRptsLst.last;
11537    while (node) {
11538       tfuDlCqiRpt = (TfuDlCqiRpt *)node->node;
11539       node=node->prev;
11540       CMCHKPK(cmPkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11541       cmLListDelFrm(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11542       tfuDlCqiRpt->lnk.node = (PTR)NULLP;
11543    }
11544    CMCHKPK(SPkU32, count, mBuf);
11545    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11546    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11547    RETVALUE(ROK);
11548 }
11549
11550
11551 \f
11552 /***********************************************************
11553 *
11554 *     Func : cmUnpkTfuDlCqiIndInfo
11555 *
11556 *
11557 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11558  * UEs. 
11559  * @details This structure clubs together DL CQI reports for a number of UEs.
11560 *
11561 *
11562 *     Ret  : S16
11563 *
11564 *     Notes:
11565 *
11566 *     File  : 
11567 *
11568 **********************************************************/
11569 #ifdef ANSI
11570 PUBLIC S16 cmUnpkTfuDlCqiIndInfo
11571 (
11572 TfuDlCqiIndInfo *param,
11573 Ptr memCp,
11574 Buffer *mBuf
11575 )
11576 #else
11577 PUBLIC S16 cmUnpkTfuDlCqiIndInfo(param, memCp, mBuf)
11578 TfuDlCqiIndInfo *param;
11579 Ptr memCp;
11580 Buffer *mBuf;
11581 #endif
11582 {
11583
11584    U32 count, loopCnt;
11585    TfuDlCqiRpt *tfuDlCqiRpt;
11586
11587    TRC3(cmUnpkTfuDlCqiIndInfo)
11588
11589    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11590    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11591    cmLListInit(&param->dlCqiRptsLst);
11592    CMCHKUNPK(SUnpkU32, &count, mBuf);
11593    for (loopCnt=0; loopCnt<count; loopCnt++) {
11594       cmGetMem((Ptr)memCp, sizeof(*tfuDlCqiRpt), (Ptr *)&tfuDlCqiRpt);
11595       CMCHKUNPK(cmUnpkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11596       cmLListAdd2Tail(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11597       tfuDlCqiRpt->lnk.node = (PTR)tfuDlCqiRpt;
11598    }
11599    RETVALUE(ROK);
11600 }
11601
11602
11603 \f
11604 /***********************************************************
11605 *
11606 *     Func : cmPkTfuCrcInfo
11607 *
11608 *
11609 *     Desc : This structure contains the CRC indication for a single
11610   * UE.
11611 *
11612 *
11613 *     Ret  : S16
11614 *
11615 *     Notes:
11616 *
11617 *     File  : 
11618 *
11619 **********************************************************/
11620 #ifdef ANSI
11621 PUBLIC S16 cmPkTfuCrcInfo
11622 (
11623 TfuCrcInfo *param,
11624 Buffer *mBuf
11625 )
11626 #else
11627 PUBLIC S16 cmPkTfuCrcInfo(param, mBuf)
11628 TfuCrcInfo *param;
11629 Buffer *mBuf;
11630 #endif
11631 {
11632
11633    TRC3(cmPkTfuCrcInfo)
11634
11635    CMCHKPK(cmPkTknU8, &param->rv, mBuf);
11636    CMCHKPK(SPkU8, param->isFailure, mBuf);
11637    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11638    RETVALUE(ROK);
11639 }
11640
11641
11642 \f
11643 /***********************************************************
11644 *
11645 *     Func : cmUnpkTfuCrcInfo
11646 *
11647 *
11648 *     Desc : This structure contains the CRC indication for a single
11649   * UE.
11650 *
11651 *
11652 *     Ret  : S16
11653 *
11654 *     Notes:
11655 *
11656 *     File  : 
11657 *
11658 **********************************************************/
11659 #ifdef ANSI
11660 PUBLIC S16 cmUnpkTfuCrcInfo
11661 (
11662 TfuCrcInfo *param,
11663 Buffer *mBuf
11664 )
11665 #else
11666 PUBLIC S16 cmUnpkTfuCrcInfo(param, mBuf)
11667 TfuCrcInfo *param;
11668 Buffer *mBuf;
11669 #endif
11670 {
11671
11672    TRC3(cmUnpkTfuCrcInfo)
11673
11674    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11675    CMCHKUNPK(SUnpkU8, &param->isFailure, mBuf);
11676    CMCHKUNPK(cmUnpkTknU8, &param->rv, mBuf);
11677    RETVALUE(ROK);
11678 }
11679
11680
11681 \f
11682 /***********************************************************
11683 *
11684 *     Func : cmPkTfuCrcIndInfo
11685 *
11686 *
11687 *     Desc : This structure contains information that is passed as a part of the
11688  * CRC Indication from PHY to MAC.
11689  * @details This structure clubs together all the CRC indications for
11690  * a single subframe and conveys this information to the scheduler.
11691 *
11692 *
11693 *     Ret  : S16
11694 *
11695 *     Notes:
11696 *
11697 *     File  : 
11698 *
11699 **********************************************************/
11700 #ifdef ANSI
11701 PUBLIC S16 cmPkTfuCrcIndInfo
11702 (
11703 TfuCrcIndInfo *param,
11704 Buffer *mBuf
11705 )
11706 #else
11707 PUBLIC S16 cmPkTfuCrcIndInfo(param, mBuf)
11708 TfuCrcIndInfo *param;
11709 Buffer *mBuf;
11710 #endif
11711 {
11712
11713    CmLList *node;
11714    U32 count;
11715    TfuCrcInfo *tfuCrcIndInfo;
11716
11717    TRC3(cmPkTfuCrcIndInfo)
11718
11719 #ifdef TFU_5GTF
11720    CMCHKPK(SPkU8, param->sccIdx, mBuf);
11721    CMCHKPK(SPkU8, param->sectorId, mBuf);
11722 #endif /* TFU_5GTF */
11723    count = param->crcLst.count;
11724    node = param->crcLst.last;
11725    while (node) {
11726       tfuCrcIndInfo = (TfuCrcInfo *)node->node;
11727       node=node->prev;
11728       CMCHKPK(cmPkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11729       cmLListDelFrm(&param->crcLst, &tfuCrcIndInfo->lnk);
11730       tfuCrcIndInfo->lnk.node = (PTR)NULLP;
11731    }
11732    CMCHKPK(SPkU32, count, mBuf);
11733    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11734    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11735    RETVALUE(ROK);
11736 }
11737
11738
11739 \f
11740 /***********************************************************
11741 *
11742 *     Func : cmUnpkTfuCrcIndInfo
11743 *
11744 *
11745 *     Desc : This structure contains information that is passed as a part of the
11746  * CRC Indication from PHY to MAC.
11747  * @details This structure clubs together all the CRC indications for
11748  * a single subframe and conveys this information to the scheduler.
11749 *
11750 *
11751 *     Ret  : S16
11752 *
11753 *     Notes:
11754 *
11755 *     File  : 
11756 *
11757 **********************************************************/
11758 #ifdef ANSI
11759 PUBLIC S16 cmUnpkTfuCrcIndInfo
11760 (
11761 TfuCrcIndInfo *param,
11762 Ptr memCp,
11763 Buffer *mBuf
11764 )
11765 #else
11766 PUBLIC S16 cmUnpkTfuCrcIndInfo(param, memCp, mBuf)
11767 TfuCrcIndInfo *param;
11768 Ptr memCp;
11769 Buffer *mBuf;
11770 #endif
11771 {
11772
11773    U32 count, loopCnt;
11774    TfuCrcInfo *tfuCrcIndInfo;
11775
11776    TRC3(cmUnpkTfuCrcIndInfo)
11777
11778    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11779    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11780    cmLListInit(&param->crcLst);
11781    CMCHKUNPK(SUnpkU32, &count, mBuf);
11782    for (loopCnt=0; loopCnt<count; loopCnt++) {
11783       cmGetMem((Ptr)memCp, sizeof(*tfuCrcIndInfo), (Ptr *)&tfuCrcIndInfo);
11784       CMCHKUNPK(cmUnpkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11785       cmLListAdd2Tail(&param->crcLst, &tfuCrcIndInfo->lnk);
11786       tfuCrcIndInfo->lnk.node = (PTR)tfuCrcIndInfo;
11787    }
11788 #ifdef TFU_5GTF
11789    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
11790    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
11791 #endif /* TFU_5GTF */
11792    RETVALUE(ROK);
11793 }
11794
11795
11796 \f
11797 /***********************************************************
11798 *
11799 *     Func : cmPkTfuTimingAdvInfo
11800 *
11801 *
11802 *     Desc : This structure contains the timing advance information for a single
11803   * UE.
11804 *
11805 *
11806 *     Ret  : S16
11807 *
11808 *     Notes:
11809 *
11810 *     File  : 
11811 *
11812 **********************************************************/
11813 #ifdef ANSI
11814 PUBLIC S16 cmPkTfuTimingAdvInfo
11815 (
11816 TfuTimingAdvInfo *param,
11817 Buffer *mBuf
11818 )
11819 #else
11820 PUBLIC S16 cmPkTfuTimingAdvInfo(param, mBuf)
11821 TfuTimingAdvInfo *param;
11822 Buffer *mBuf;
11823 #endif
11824 {
11825
11826    TRC3(cmPkTfuTimingAdvInfo)
11827
11828    CMCHKPK(SPkU8, param->timingAdv, mBuf);
11829    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11830    RETVALUE(ROK);
11831 }
11832
11833
11834 \f
11835 /***********************************************************
11836 *
11837 *     Func : cmUnpkTfuTimingAdvInfo
11838 *
11839 *
11840 *     Desc : This structure contains the timing advance information for a single
11841   * UE.
11842 *
11843 *
11844 *     Ret  : S16
11845 *
11846 *     Notes:
11847 *
11848 *     File  : 
11849 *
11850 **********************************************************/
11851 #ifdef ANSI
11852 PUBLIC S16 cmUnpkTfuTimingAdvInfo
11853 (
11854 TfuTimingAdvInfo *param,
11855 Buffer *mBuf
11856 )
11857 #else
11858 PUBLIC S16 cmUnpkTfuTimingAdvInfo(param, mBuf)
11859 TfuTimingAdvInfo *param;
11860 Buffer *mBuf;
11861 #endif
11862 {
11863
11864    TRC3(cmUnpkTfuTimingAdvInfo)
11865
11866    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11867    CMCHKUNPK(SUnpkU8, &param->timingAdv, mBuf);
11868    RETVALUE(ROK);
11869 }
11870
11871
11872 \f
11873 /***********************************************************
11874 *
11875 *     Func : cmPkTfuTimingAdvIndInfo
11876 *
11877 *
11878 *     Desc : This structure contains information that is passed as part of the Timing
11879  * Advance indication from PHY to MAC.
11880  * @details This structure clubs together timing advances for a number of UEs.
11881 *
11882 *
11883 *     Ret  : S16
11884 *
11885 *     Notes:
11886 *
11887 *     File  : 
11888 *
11889 **********************************************************/
11890 #ifdef ANSI
11891 PUBLIC S16 cmPkTfuTimingAdvIndInfo
11892 (
11893 TfuTimingAdvIndInfo *param,
11894 Buffer *mBuf
11895 )
11896 #else
11897 PUBLIC S16 cmPkTfuTimingAdvIndInfo(param, mBuf)
11898 TfuTimingAdvIndInfo *param;
11899 Buffer *mBuf;
11900 #endif
11901 {
11902
11903    CmLList *node;
11904    U32 count;
11905    TfuTimingAdvInfo *tfuTimingAdvInfo;
11906
11907    TRC3(cmPkTfuTimingAdvIndInfo)
11908
11909    count = param->timingAdvLst.count;
11910    node = param->timingAdvLst.last;
11911    while (node) {
11912       tfuTimingAdvInfo = (TfuTimingAdvInfo *)node->node;
11913       node=node->prev;
11914       CMCHKPK(cmPkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11915       cmLListDelFrm(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11916       tfuTimingAdvInfo->lnk.node = (PTR)NULLP;
11917    }
11918    CMCHKPK(SPkU32, count, mBuf);
11919    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11920    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11921    RETVALUE(ROK);
11922 }
11923
11924
11925 \f
11926 /***********************************************************
11927 *
11928 *     Func : cmUnpkTfuTimingAdvIndInfo
11929 *
11930 *
11931 *     Desc : This structure contains information that is passed as part of the Timing
11932  * Advance indication from PHY to MAC.
11933  * @details This structure clubs together timing advances for a number of UEs.
11934 *
11935 *
11936 *     Ret  : S16
11937 *
11938 *     Notes:
11939 *
11940 *     File  : 
11941 *
11942 **********************************************************/
11943 #ifdef ANSI
11944 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo
11945 (
11946 TfuTimingAdvIndInfo *param,
11947 Ptr memCp,
11948 Buffer *mBuf
11949 )
11950 #else
11951 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo(param, memCp, mBuf)
11952 TfuTimingAdvIndInfo *param;
11953 Ptr memCp;
11954 Buffer *mBuf;
11955 #endif
11956 {
11957
11958    U32 count, loopCnt;
11959    TfuTimingAdvInfo *tfuTimingAdvInfo;
11960
11961    TRC3(cmUnpkTfuTimingAdvIndInfo)
11962
11963    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11964    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11965    cmLListInit(&param->timingAdvLst);
11966    CMCHKUNPK(SUnpkU32, &count, mBuf);
11967    for (loopCnt=0; loopCnt<count; loopCnt++) {
11968       cmGetMem((Ptr)memCp, sizeof(*tfuTimingAdvInfo), (Ptr *)&tfuTimingAdvInfo);
11969       CMCHKUNPK(cmUnpkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11970       cmLListAdd2Tail(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11971       tfuTimingAdvInfo->lnk.node = (PTR)tfuTimingAdvInfo;
11972    }
11973    RETVALUE(ROK);
11974 }
11975
11976 /*CA dev Start*/
11977 /***********************************************************
11978 *
11979 *     Func : cmPkTfuTtiCellInfo
11980 *
11981 *
11982 *     Desc : This structure contains information that is 
11983 *     passed as a part of the TTI indication sent 
11984 *     from CL to MAC and SCH
11985 *
11986 *
11987 *     Ret  : S16
11988 *
11989 *     Notes:
11990 *
11991 *     File  : 
11992 *
11993 **********************************************************/
11994 #ifdef ANSI
11995 PUBLIC S16 cmPkTfuTtiCellInfo
11996 (
11997 TfuTtiCellInfo *param,
11998 Buffer *mBuf
11999 )
12000 #else
12001 PUBLIC S16 cmPkTfuTtiCellInfo(param, mBuf)
12002 TfuTtiCellInfo *param;
12003 Buffer *mBuf;
12004 #endif
12005 {
12006
12007    TRC3(cmPkTfuTtiCellInfo)
12008
12009    CMCHKPK(SPkU8, param->ulBlankSf, mBuf);
12010    CMCHKPK(SPkU8, param->dlBlankSf, mBuf);
12011    CMCHKPK(SPkU8, param->schTickDelta, mBuf);
12012    CMCHKPK(cmPkBool, param->isDummyTti, mBuf);
12013    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12014    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12015    RETVALUE(ROK);
12016 }
12017 /*CA dev End*/
12018 \f
12019 /***********************************************************
12020 *
12021 *     Func : cmPkTfuTtiIndInfo
12022 *
12023 *
12024 *     Desc : This structure contains information that is passed as a part of the TTI
12025  * indication sent from PHY to MAC.
12026 *
12027 *
12028 *     Ret  : S16
12029 *
12030 *     Notes:
12031 *
12032 *     File  : 
12033 *
12034 **********************************************************/
12035 #ifdef ANSI
12036 PUBLIC S16 cmPkTfuTtiIndInfo
12037 (
12038 TfuTtiIndInfo *param,
12039 Buffer *mBuf
12040 )
12041 #else
12042 PUBLIC S16 cmPkTfuTtiIndInfo(param, mBuf)
12043 TfuTtiIndInfo *param;
12044 Buffer *mBuf;
12045 #endif
12046 {
12047
12048    S32 i;
12049    TRC3(cmPkTfuTtiIndInfo)
12050
12051    /*CA dev Start*/
12052    for (i=(param->numCells-1); i >= 0; i--) {
12053          CMCHKPK(cmPkTfuTtiCellInfo, &param->cells[i], mBuf);
12054       }
12055    CMCHKPK(SPkU8, param->numCells, mBuf);
12056    /*CA dev End*/
12057    RETVALUE(ROK);
12058 }
12059
12060 /* CA dev Start */
12061 /***********************************************************
12062 *
12063 *     Func : cmUnpkTfuTtiCellInfo
12064 *
12065 *
12066 *     Desc : This structure contains information that is 
12067 *     passed as a part of the TTI indication sent 
12068 *     from CL to MAC and SCH
12069 *
12070 *
12071 *     Ret  : S16
12072 *
12073 *     Notes:
12074 *
12075 *     File  : 
12076 *
12077 **********************************************************/
12078 #ifdef ANSI
12079 PUBLIC S16 cmUnpkTfuTtiCellInfo
12080 (
12081 TfuTtiCellInfo *param,
12082 Buffer *mBuf
12083 )
12084 #else
12085 PUBLIC S16 cmUnpkTfuTtiCellInfo(param, mBuf)
12086 TfuTtiCellInfo *param;
12087 Buffer *mBuf;
12088 #endif
12089 {
12090
12091    TRC3(cmUnpkTfuTtiCellInfo)
12092
12093    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12094    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12095    CMCHKUNPK(cmUnpkBool, &param->isDummyTti, mBuf);
12096    CMCHKUNPK(SUnpkU8, &param->schTickDelta, mBuf);
12097    CMCHKUNPK(SUnpkU8, &param->dlBlankSf, mBuf);
12098    CMCHKUNPK(SUnpkU8, &param->ulBlankSf, mBuf);
12099    RETVALUE(ROK);
12100 }
12101 /* CA dev End */
12102
12103 \f
12104 /***********************************************************
12105 *
12106 *     Func : cmUnpkTfuTtiIndInfo
12107 *
12108 *
12109 *     Desc : This structure contains information that is passed as a part of the TTI
12110  * indication sent from PHY to MAC.
12111 *
12112 *
12113 *     Ret  : S16
12114 *
12115 *     Notes:
12116 *
12117 *     File  : 
12118 *
12119 **********************************************************/
12120 #ifdef ANSI
12121 PUBLIC S16 cmUnpkTfuTtiIndInfo
12122 (
12123 TfuTtiIndInfo *param,
12124 Buffer *mBuf
12125 )
12126 #else
12127 PUBLIC S16 cmUnpkTfuTtiIndInfo(param, mBuf)
12128 TfuTtiIndInfo *param;
12129 Buffer *mBuf;
12130 #endif
12131 {
12132
12133    S32 i;
12134    TRC3(cmUnpkTfuTtiIndInfo)
12135
12136    /* CA dev Start */
12137    CMCHKUNPK(SUnpkU8, &param->numCells, mBuf);
12138    for (i=0; i<(param->numCells); i++) {
12139       CMCHKUNPK(cmUnpkTfuTtiCellInfo, &param->cells[i], mBuf);
12140    }
12141    /* CA dev End */
12142    RETVALUE(ROK);
12143 }
12144
12145
12146 \f
12147 /***********************************************************
12148 *
12149 *     Func : cmPkTfuRaReqInfo
12150 *
12151 *
12152 *     Desc : This structure contains the information for a single Random Access Request.
12153  * @details The information present in this structure is for a single preamble.
12154  * Associated with each preamble are fields that the physical layer calculates
12155  * based on the reception of the Random Access Request. These are the following
12156  * -# Timing Advance
12157  * -# TPC
12158  * -# CQI (optional).
12159 *
12160 *
12161 *     Ret  : S16
12162 *
12163 *     Notes:
12164 *
12165 *     File  : 
12166 *
12167 **********************************************************/
12168 #ifdef ANSI
12169 PUBLIC S16 cmPkTfuRaReqInfo
12170 (
12171 TfuRaReqInfo *param,
12172 Buffer *mBuf
12173 )
12174 #else
12175 PUBLIC S16 cmPkTfuRaReqInfo(param, mBuf)
12176 TfuRaReqInfo *param;
12177 Buffer *mBuf;
12178 #endif
12179 {
12180
12181    TRC3(cmPkTfuRaReqInfo)
12182
12183    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
12184    CMCHKPK(SPkU8, param->cqiPres, mBuf);
12185    CMCHKPK(SPkU8, param->tpc, mBuf);
12186    CMCHKPK(SPkU16, param->ta, mBuf);
12187    CMCHKPK(SPkU8, param->rapId, mBuf);
12188    RETVALUE(ROK);
12189 }
12190
12191
12192 \f
12193 /***********************************************************
12194 *
12195 *     Func : cmUnpkTfuRaReqInfo
12196 *
12197 *
12198 *     Desc : This structure contains the information for a single Random Access Request.
12199  * @details The information present in this structure is for a single preamble.
12200  * Associated with each preamble are fields that the physical layer calculates
12201  * based on the reception of the Random Access Request. These are the following
12202  * -# Timing Advance
12203  * -# TPC
12204  * -# CQI (optional).
12205 *
12206 *
12207 *     Ret  : S16
12208 *
12209 *     Notes:
12210 *
12211 *     File  : 
12212 *
12213 **********************************************************/
12214 #ifdef ANSI
12215 PUBLIC S16 cmUnpkTfuRaReqInfo
12216 (
12217 TfuRaReqInfo *param,
12218 Buffer *mBuf
12219 )
12220 #else
12221 PUBLIC S16 cmUnpkTfuRaReqInfo(param, mBuf)
12222 TfuRaReqInfo *param;
12223 Buffer *mBuf;
12224 #endif
12225 {
12226
12227    TRC3(cmUnpkTfuRaReqInfo)
12228
12229    CMCHKUNPK(SUnpkU8, &param->rapId, mBuf);
12230    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
12231    CMCHKUNPK(SUnpkU8, &param->tpc, mBuf);
12232    CMCHKUNPK(SUnpkU8, &param->cqiPres, mBuf);
12233    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
12234    RETVALUE(ROK);
12235 }
12236
12237
12238 \f
12239 /***********************************************************
12240 *
12241 *     Func : cmPkTfuRachInfo
12242 *
12243 *
12244 *     Desc : This structure contains RACH request information for a single
12245   * RA-RNTI.
12246 *
12247 *
12248 *     Ret  : S16
12249 *
12250 *     Notes:
12251 *
12252 *     File  : 
12253 *
12254 **********************************************************/
12255 #ifdef ANSI
12256 PUBLIC S16 cmPkTfuRachInfo
12257 (
12258  CmMemListCp   memCp,
12259 TfuRachInfo *param,
12260 Buffer *mBuf
12261 )
12262 #else
12263 PUBLIC S16 cmPkTfuRachInfo(memCp, param, mBuf)
12264  CmMemListCp   memCp;
12265 TfuRachInfo *param;
12266 Buffer *mBuf;
12267 #endif
12268 {
12269
12270    S32 i;
12271    TRC3(cmPkTfuRachInfo)
12272
12273    for (i= (param->numRaReqInfo - 1); i >= 0; i--) {
12274       CMCHKPK(cmPkTfuRaReqInfo, &(param->raReqInfoArr[i]), mBuf);
12275    }
12276 #ifdef PRACH_5GTF 
12277    CMCHKPK(SPkU16, param->nPwrFactor, mBuf);
12278    CMCHKPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12279    CMCHKPK(SPkU8, param->nf1Value, mBuf);
12280    CMCHKPK(SPkU8, param->nCyclicShift, mBuf);
12281    CMCHKPK(SPkU8, param->nRootSeq, mBuf);
12282    CMCHKPK(SPkU8, param->nPRACHConfiguration, mBuf);
12283    CMCHKPK(SPkU8, param->nPreambleFormat, mBuf);
12284 #endif
12285    CMCHKPK(SPkU8, param->numRaReqInfo, mBuf);
12286    CMCHKPK(cmPkLteRnti, param->raRnti, mBuf);
12287    RETVALUE(ROK);
12288 }
12289
12290
12291 \f
12292 /***********************************************************
12293 *
12294 *     Func : cmUnpkTfuRachInfo
12295 *
12296 *
12297 *     Desc : This structure contains RACH request information for a single
12298   * RA-RNTI.
12299 *
12300 *
12301 *     Ret  : S16
12302 *
12303 *     Notes:
12304 *
12305 *     File  : 
12306 *
12307 **********************************************************/
12308 #ifdef ANSI
12309 PUBLIC S16 cmUnpkTfuRachInfo
12310 (
12311 CmMemListCp   memCp,
12312 TfuRachInfo *param,
12313 Buffer *mBuf
12314 )
12315 #else
12316 PUBLIC S16 cmUnpkTfuRachInfo(memCp, param, mBuf)
12317 CmMemListCp   memCp;
12318 TfuRachInfo *param;
12319 Buffer *mBuf;
12320 #endif
12321 {
12322
12323    S32 i;
12324    TRC3(cmUnpkTfuRachInfo)
12325
12326    CMCHKUNPK(cmUnpkLteRnti, &param->raRnti, mBuf);
12327    CMCHKUNPK(SUnpkU8, &param->numRaReqInfo, mBuf);
12328 #ifdef PRACH_5GTF 
12329    CMCHKUNPK(SPkU8, param->nPreambleFormat, mBuf);
12330    CMCHKUNPK(SPkU8, param->nPRACHConfiguration, mBuf);
12331    CMCHKUNPK(SPkU8, param->nRootSeq, mBuf);
12332    CMCHKUNPK(SPkU8, param->nCyclicShift, mBuf);
12333    CMCHKUNPK(SPkU8, param->nf1Value, mBuf);
12334    CMCHKUNPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12335    CMCHKUNPK(SPkU16, param->nPwrFactor, mBuf);
12336 #endif
12337    if (cmGetMem (&(memCp), (sizeof(TfuRaReqInfo) * param->numRaReqInfo), 
12338             (Ptr *)&param->raReqInfoArr) != ROK)
12339    {
12340       RETVALUE(RFAILED);
12341    }
12342    for (i=0; i<param->numRaReqInfo; i++) {
12343       CMCHKUNPK(cmUnpkTfuRaReqInfo, &param->raReqInfoArr[i], mBuf);
12344    }
12345    RETVALUE(ROK);
12346 }
12347
12348
12349 \f
12350 /***********************************************************
12351 *
12352 *     Func : cmPkTfuRaReqIndInfo
12353 *
12354 *
12355 *     Desc : This structure contains the list of Random Access Requests received in a
12356  * single TTI.
12357  * @details Random Access Request is associated with a RA-RNTI, which remains
12358  * common for all the Random access requests within a subframe. This structure
12359  * thus carries the RA-RNTI and a list of Random Access Request information.
12360  * This information consists of the following 
12361  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12362  * UE.
12363  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12364  * needs to be uplink synchronized. This value is calculated by physical layer. 
12365  * -# tpc - this is the power control command that the physical layer calculates
12366  * from the received RA request. This value is transmitted in the RA Response
12367  * sent out by MAC.
12368  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12369  * physical layer. This aids MAC in the scheduling of this UE.
12370 *
12371 *
12372 *     Ret  : S16
12373 *
12374 *     Notes:
12375 *
12376 *     File  : 
12377 *
12378 **********************************************************/
12379 #ifdef ANSI
12380 PUBLIC S16 cmPkTfuRaReqIndInfo
12381 (
12382 TfuRaReqIndInfo *param,
12383 Buffer *mBuf
12384 )
12385 #else
12386 PUBLIC S16 cmPkTfuRaReqIndInfo(param, mBuf)
12387 TfuRaReqIndInfo *param;
12388 Buffer *mBuf;
12389 #endif
12390 {
12391
12392    S32 i;
12393    TRC3(cmPkTfuRaReqIndInfo)
12394
12395    for (i= (param->nmbOfRaRnti-1); i >= 0; i--) 
12396    {
12397       if (ROK != cmPkTfuRachInfo(param->memCp, 
12398                &(param->rachInfoArr[i]), mBuf))
12399       {
12400          RETVALUE(RFAILED);
12401       }
12402    }
12403    CMCHKPK(SPkU8, param->nmbOfRaRnti, mBuf);
12404    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12405    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12406    RETVALUE(ROK);
12407 }
12408
12409
12410 \f
12411 /***********************************************************
12412 *
12413 *     Func : cmUnpkTfuRaReqIndInfo
12414 *
12415 *
12416 *     Desc : This structure contains the list of Random Access Requests received in a
12417  * single TTI.
12418  * @details Random Access Request is associated with a RA-RNTI, which remains
12419  * common for all the Random access requests within a subframe. This structure
12420  * thus carries the RA-RNTI and a list of Random Access Request information.
12421  * This information consists of the following 
12422  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12423  * UE.
12424  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12425  * needs to be uplink synchronized. This value is calculated by physical layer. 
12426  * -# tpc - this is the power control command that the physical layer calculates
12427  * from the received RA request. This value is transmitted in the RA Response
12428  * sent out by MAC.
12429  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12430  * physical layer. This aids MAC in the scheduling of this UE.
12431 *
12432 *
12433 *     Ret  : S16
12434 *
12435 *     Notes:
12436 *
12437 *     File  : 
12438 *
12439 **********************************************************/
12440 #ifdef ANSI
12441 PUBLIC S16 cmUnpkTfuRaReqIndInfo
12442 (
12443 TfuRaReqIndInfo *param,
12444 Buffer *mBuf
12445 )
12446 #else
12447 PUBLIC S16 cmUnpkTfuRaReqIndInfo(param, mBuf)
12448 TfuRaReqIndInfo *param;
12449 Buffer *mBuf;
12450 #endif
12451 {
12452
12453    S32 i;
12454    TRC3(cmUnpkTfuRaReqIndInfo)
12455
12456    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12457    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12458    CMCHKUNPK(SUnpkU8, &param->nmbOfRaRnti, mBuf);
12459    if (cmGetMem (&(param->memCp), (sizeof(TfuRachInfo) * param->nmbOfRaRnti), 
12460             (Ptr *)&param->rachInfoArr) != ROK)
12461    {
12462       RETVALUE(RFAILED);
12463    }
12464    for (i=0; i<param->nmbOfRaRnti; i++) 
12465    {
12466       if (ROK != cmUnpkTfuRachInfo(param->memCp, &param->rachInfoArr[i], mBuf))
12467       {
12468          RETVALUE(RFAILED);
12469       }
12470    }
12471    RETVALUE(ROK);
12472 }
12473
12474
12475 \f
12476 /***********************************************************
12477 *
12478 *     Func : cmPkTfuPucchDeltaPwr
12479 *
12480 *
12481 *     Desc : This structure contains PUCCH Delta power for a single UE.
12482 *
12483 *
12484 *     Ret  : S16
12485 *
12486 *     Notes:
12487 *
12488 *     File  : 
12489 *
12490 **********************************************************/
12491 #ifdef ANSI
12492 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo
12493 (
12494 TfuPucchDeltaPwr *param,
12495 Buffer *mBuf
12496 )
12497 #else
12498 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo(param, mBuf)
12499 TfuPucchDeltaPwr *param;
12500 Buffer *mBuf;
12501 #endif
12502 {
12503
12504    TRC3(cmPkTfuPucchDeltaPwrInfo)
12505
12506    CMCHKPK(SPkS8, param->pucchDeltaPwr, mBuf);
12507    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12508    RETVALUE(ROK);
12509 }
12510
12511
12512 \f
12513 /***********************************************************
12514 *
12515 *     Func : cmUnpkTfuPucchDeltaPwr
12516 *
12517 *
12518 *     Desc : This structure contains PUCCH Delta power for a single UE.
12519 *
12520 *
12521 *     Ret  : S16
12522 *
12523 *     Notes:
12524 *
12525 *     File  : 
12526 *
12527 **********************************************************/
12528 #ifdef ANSI
12529 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo
12530 (
12531 TfuPucchDeltaPwr *param,
12532 Buffer *mBuf
12533 )
12534 #else
12535 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo(param, mBuf)
12536 TfuPucchDeltaPwr *param;
12537 Buffer *mBuf;
12538 #endif
12539 {
12540
12541    TRC3(cmUnpkTfuPucchDeltaPwrInfo)
12542
12543    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12544    CMCHKUNPK(SUnpkS8, &param->pucchDeltaPwr, mBuf);
12545    RETVALUE(ROK);
12546 }
12547
12548
12549 \f
12550 /***********************************************************
12551 *
12552 *     Func : cmPkTfuPucchDeltaPwrIndInfo
12553 *
12554 *
12555 *     Desc : This structure contains information that is passed as a part of the
12556  * PUCCH Delta power indication from PHY to SCH.
12557  * @details This structure clubs together PUCCH Delta power values for a number
12558  * of UEs.
12559 *
12560 *
12561 *     Ret  : S16
12562 *
12563 *     Notes:
12564 *
12565 *     File  : 
12566 *
12567 **********************************************************/
12568 #ifdef ANSI
12569 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo
12570 (
12571 TfuPucchDeltaPwrIndInfo *param,
12572 Buffer *mBuf
12573 )
12574 #else
12575 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo(param, mBuf)
12576 TfuPucchDeltaPwrIndInfo *param;
12577 Buffer *mBuf;
12578 #endif
12579 {
12580
12581    CmLList *node;
12582    U32 count;
12583    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12584
12585    TRC3(cmPkTfuPucchDeltaPwrIndInfo)
12586
12587    count = param->pucchDeltaPwrLst.count;
12588    node = param->pucchDeltaPwrLst.last;
12589    while (node) {
12590       tfuPucchDeltaPwr = (TfuPucchDeltaPwr *)node->node;
12591       node=node->prev;
12592       CMCHKPK(cmPkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12593       cmLListDelFrm(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12594       tfuPucchDeltaPwr->lnk.node = (PTR)NULLP;
12595    }
12596    CMCHKPK(SPkU32, count, mBuf);
12597    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12598    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12599    RETVALUE(ROK);
12600 }
12601
12602
12603 \f
12604 /***********************************************************
12605 *
12606 *     Func : cmUnpkTfuPucchDeltaPwrIndInfo
12607 *
12608 *
12609 *     Desc : This structure contains information that is passed as a part of the
12610  * PUCCH Delta power indication from PHY to SCH.
12611  * @details This structure clubs together PUCCH Delta power values for a number
12612  * of UEs.
12613 *
12614 *
12615 *     Ret  : S16
12616 *
12617 *     Notes:
12618 *
12619 *     File  : 
12620 *
12621 **********************************************************/
12622 #ifdef ANSI
12623 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo
12624 (
12625 TfuPucchDeltaPwrIndInfo *param,
12626 Ptr memCp,
12627 Buffer *mBuf
12628 )
12629 #else
12630 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo(param, memCp, mBuf)
12631 TfuPucchDeltaPwrIndInfo *param;
12632 Ptr memCp;
12633 Buffer *mBuf;
12634 #endif
12635 {
12636
12637    U32 count, loopCnt;
12638    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12639
12640    TRC3(cmUnpkTfuPucchDeltaPwrIndInfo)
12641
12642    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12643    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12644    cmLListInit(&param->pucchDeltaPwrLst);
12645    CMCHKUNPK(SUnpkU32, &count, mBuf);
12646    for (loopCnt=0; loopCnt<count; loopCnt++) {
12647       cmGetMem((Ptr)memCp, sizeof(*tfuPucchDeltaPwr), (Ptr *)&tfuPucchDeltaPwr);
12648       CMCHKUNPK(cmUnpkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12649       cmLListAdd2Tail(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12650       tfuPucchDeltaPwr->lnk.node = (PTR)tfuPucchDeltaPwr;
12651    }
12652    RETVALUE(ROK);
12653 }
12654
12655 #ifdef ANSI
12656 PUBLIC S16 cmPkBuffer
12657 (
12658 Buffer **param,
12659 Buffer *mBuf
12660 )
12661 #else
12662 PUBLIC S16 cmPkBuffer(param, mBuf)
12663 Buffer **param;
12664 Buffer *mBuf;
12665 #endif
12666 {
12667    MsgLen msgLen=0;
12668    TRC3(cmPkBuffer)
12669    if (SFndLenMsg(*param, &msgLen) != ROK)
12670       RETVALUE(RFAILED);
12671    if (SCatMsg(mBuf, *param, M1M2) != ROK)
12672       RETVALUE(RFAILED);
12673    TFU_FREE_MSG(*param);
12674    *param = NULLP;
12675    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
12676    RETVALUE(ROK);
12677 }
12678 #ifdef ANSI
12679 PUBLIC S16 cmUnpkBuffer
12680 (
12681 Buffer **param,
12682 Buffer *mBuf
12683 )
12684 #else
12685 PUBLIC S16 cmUnpkBuffer(param, mBuf)
12686 Buffer **param;
12687 Buffer *mBuf;
12688 #endif
12689 {
12690    MsgLen msgLen=0, totalMsgLen=0;
12691    TRC3(cmUnpkBuffer)
12692    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
12693    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
12694       RETVALUE(RFAILED);
12695    if (SSegMsg(mBuf, totalMsgLen-msgLen, param) != ROK)
12696       RETVALUE(RFAILED);
12697    RETVALUE(ROK);
12698 }
12699
12700
12701 /***********************************************************
12702 *
12703 *     Func : cmPkTfuDoaInd
12704 *
12705 *
12706 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12707  * identifier for one or more UEs.
12708  * It carries a DOA for each UE. 
12709  * @param pst Pointer to the post structure.
12710  * @param suId SAP ID of the service user.
12711  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12712  * @return ROK/RFAILED
12713 *
12714 *
12715 *     Ret  : S16
12716 *
12717 *     Notes:
12718 *
12719 *     File  : 
12720 *
12721 **********************************************************/
12722 #ifdef ANSI
12723 PUBLIC S16 cmPkTfuDoaInd
12724 (
12725 Pst * pst,
12726 SuId suId,
12727 TfuDoaIndInfo * doaInd
12728 )
12729 #else
12730 PUBLIC S16 cmPkTfuDoaInd(pst, suId, doaInd)
12731 Pst * pst;
12732 SuId suId;
12733 TfuDoaIndInfo * doaInd;
12734 #endif
12735 {
12736    Buffer *mBuf = NULLP;
12737    TRC3(cmPkTfuDoaInd)
12738
12739    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
12740 #if (ERRCLASS & ERRCLS_ADD_RES)
12741       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12742          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12743          (ErrVal)ETFU125, (ErrVal)0, "Packing failed");
12744 #endif
12745       SPutSBuf(pst->region, pst->pool, (Data *)doaInd, sizeof(TfuDoaIndInfo));
12746       RETVALUE(RFAILED);
12747    }
12748       cmPkTfuDoaIndInfo(doaInd, mBuf);
12749    if (SPkS16(suId, mBuf) != ROK) {
12750 #if (ERRCLASS & ERRCLS_ADD_RES)
12751       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12752          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12753          (ErrVal)ETFU126, (ErrVal)0, "Packing failed");
12754 #endif
12755       TFU_FREE_MEM(doaInd);
12756       TFU_FREE_MSG(mBuf);
12757       RETVALUE(RFAILED);
12758    }
12759    TFU_FREE_MEM(doaInd);
12760    pst->event = (Event) EVTTFUDOAIND;
12761    RETVALUE(SPstTsk(pst,mBuf));
12762 }
12763
12764 \f
12765 /***********************************************************
12766 *
12767 *     Func : cmUnpkTfuDoaInd
12768 *
12769 *
12770 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12771  * identifier for one or more UEs.
12772  * It carries a DOA for each UE. 
12773  * @param pst Pointer to the post structure.
12774  * @param suId SAP ID of the service user.
12775  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12776  * @return ROK/RFAILED
12777 *
12778 *
12779 *     Ret  : S16
12780 *
12781 *     Notes:
12782 *
12783 *     File  : 
12784 *
12785 **********************************************************/
12786 #ifdef ANSI
12787 PUBLIC S16 cmUnpkTfuDoaInd
12788 (
12789 TfuDoaInd func,
12790 Pst *pst,
12791 Buffer *mBuf
12792 )
12793 #else
12794 PUBLIC S16 cmUnpkTfuDoaInd(func, pst, mBuf)
12795 TfuDoaInd func;
12796 Pst *pst;
12797 Buffer *mBuf;
12798 #endif
12799 {
12800    SuId suId;
12801    TfuDoaIndInfo *doaInd;
12802    
12803    TRC3(cmUnpkTfuDoaInd)
12804
12805    if (SUnpkS16(&suId, mBuf) != ROK) {
12806       TFU_FREE_MSG(mBuf);
12807 #if (ERRCLASS & ERRCLS_ADD_RES)
12808       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12809          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12810          (ErrVal)ETFU127, (ErrVal)0, "Packing failed");
12811 #endif
12812       RETVALUE(RFAILED);
12813    }
12814    {
12815       Mem   sMem;
12816       sMem.region = pst->region;
12817       sMem.pool = pst->pool;
12818       if ((cmAllocEvnt(sizeof(TfuDoaIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&doaInd)) != ROK)            {
12819 #if (ERRCLASS & ERRCLS_ADD_RES)
12820          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12821             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12822             (ErrVal)ETFU128, (ErrVal)0, "Packing failed");
12823 #endif
12824          TFU_FREE_MSG(mBuf);
12825          RETVALUE(RFAILED);
12826       }
12827    }
12828    
12829       cmUnpkTfuDoaIndInfo(doaInd, (Ptr)&doaInd->memCp, mBuf);
12830    TFU_FREE_MSG(mBuf);
12831    RETVALUE((*func)(pst, suId, doaInd));
12832 }
12833
12834
12835 \f
12836 /***********************************************************
12837 *
12838 *     Func : cmPkTfuDciFormatTbInfo
12839 *
12840 *
12841 *     Desc : This structure contains the TB level DCI signalling
12842   * parameters in case of DCI formats 2 and 2A
12843 *
12844 *
12845 *     Ret  : S16
12846 *
12847 *     Notes:
12848 *
12849 *     File  : 
12850 *
12851 **********************************************************/
12852 #ifdef ANSI
12853 PUBLIC S16 cmPkTfuDciFormatTbInfo
12854 (
12855 TfuDciFormatTbInfo *param,
12856 Buffer *mBuf
12857 )
12858 #else
12859 PUBLIC S16 cmPkTfuDciFormatTbInfo(param, mBuf)
12860 TfuDciFormatTbInfo *param;
12861 Buffer *mBuf;
12862 #endif
12863 {
12864
12865    TRC3(cmPkTfuDciFormatTbInfo)
12866
12867    CMCHKPK(SPkU8, param->mcs, mBuf);
12868    CMCHKPK(SPkU8, param->rv, mBuf);
12869    CMCHKPK(SPkU8, param->ndi, mBuf);
12870    RETVALUE(ROK);
12871 }
12872
12873
12874 \f
12875 /***********************************************************
12876 *
12877 *     Func : cmUnpkTfuDciFormatTbInfo
12878 *
12879 *
12880 *     Desc : This structure contains the TB level DCI signalling
12881   * parameters in case of DCI formats 2 and 2A
12882 *
12883 *
12884 *     Ret  : S16
12885 *
12886 *     Notes:
12887 *
12888 *     File  : 
12889 *
12890 **********************************************************/
12891 #ifdef ANSI
12892 PUBLIC S16 cmUnpkTfuDciFormatTbInfo
12893 (
12894 TfuDciFormatTbInfo *param,
12895 Buffer *mBuf
12896 )
12897 #else
12898 PUBLIC S16 cmUnpkTfuDciFormatTbInfo(param, mBuf)
12899 TfuDciFormatTbInfo *param;
12900 Buffer *mBuf;
12901 #endif
12902 {
12903
12904    TRC3(cmUnpkTfuDciFormatTbInfo)
12905
12906    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
12907    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
12908    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
12909    RETVALUE(ROK);
12910 }
12911
12912
12913 \f
12914 /***********************************************************
12915 *
12916 *     Func : cmPkTfuSubbandDlCqiInfo
12917 *
12918 *
12919 *     Desc : This structure is used to convey the subbannd CQI reported.
12920 *
12921 *
12922 *     Ret  : S16
12923 *
12924 *     Notes:
12925 *
12926 *     File  : 
12927 *
12928 **********************************************************/
12929 #ifdef ANSI
12930 PUBLIC S16 cmPkTfuSubbandDlCqiInfo
12931 (
12932 TfuSubbandDlCqiInfo *param,
12933 Buffer *mBuf
12934 )
12935 #else
12936 PUBLIC S16 cmPkTfuSubbandDlCqiInfo(param, mBuf)
12937 TfuSubbandDlCqiInfo *param;
12938 Buffer *mBuf;
12939 #endif
12940 {
12941
12942    S32 i;
12943    TRC3(cmPkTfuSubbandDlCqiInfo)
12944
12945    for (i=TFU_MAX_TB-1; i >= 0; i--) {
12946       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
12947    }
12948    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
12949    RETVALUE(ROK);
12950 }
12951
12952
12953 \f
12954 /***********************************************************
12955 *
12956 *     Func : cmUnpkTfuSubbandDlCqiInfo
12957 *
12958 *
12959 *     Desc : This structure is used to convey the subbannd CQI reported.
12960 *
12961 *
12962 *     Ret  : S16
12963 *
12964 *     Notes:
12965 *
12966 *     File  : 
12967 *
12968 **********************************************************/
12969 #ifdef ANSI
12970 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo
12971 (
12972 TfuSubbandDlCqiInfo *param,
12973 Buffer *mBuf
12974 )
12975 #else
12976 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo(param, mBuf)
12977 TfuSubbandDlCqiInfo *param;
12978 Buffer *mBuf;
12979 #endif
12980 {
12981
12982    S32 i;
12983    TRC3(cmUnpkTfuSubbandDlCqiInfo)
12984
12985    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
12986    for (i=0; i<TFU_MAX_TB; i++) {
12987       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
12988    }
12989    RETVALUE(ROK);
12990 }
12991
12992 /***********************************************************
12993 *
12994 *     Func : cmPkTfuDlCqiPuschInfo
12995 *
12996 *
12997 *     Desc : This structure conveys explicitly the PMI information in case
12998  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12999 *
13000 *
13001 *     Ret  : S16
13002 *
13003 *     Notes:
13004 *
13005 *     File  : 
13006 *
13007 **********************************************************/
13008 #ifdef ANSI
13009 PUBLIC S16 cmPkTfuDlCqiPuschInfo
13010 (
13011 TfuDlCqiPuschInfo *param,
13012 Buffer *mBuf
13013 )
13014 #else
13015 PUBLIC S16 cmPkTfuDlCqiPuschInfo(param, mBuf)
13016 TfuDlCqiPuschInfo *param;
13017 Buffer *mBuf;
13018 #endif
13019 {
13020
13021    TRC3(cmPkTfuDlCqiPuschInfo)
13022
13023       switch(param->mode) {
13024          case TFU_PUSCH_CQI_MODE_31:
13025             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
13026             break;
13027          case TFU_PUSCH_CQI_MODE_22:
13028             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
13029             break;
13030          case TFU_PUSCH_CQI_MODE_12:
13031             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
13032             break;
13033          default :
13034             RETVALUE(RFAILED);
13035       }
13036    CMCHKPK(SPkU32, param->mode, mBuf);
13037    RETVALUE(ROK);
13038 }
13039
13040
13041 \f
13042 /***********************************************************
13043 *
13044 *     Func : cmUnpkTfuDlCqiPuschInfo
13045 *
13046 *
13047 *     Desc : This structure conveys explicitly the PMI information in case
13048  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
13049 *
13050 *
13051 *     Ret  : S16
13052 *
13053 *     Notes:
13054 *
13055 *     File  : 
13056 *
13057 **********************************************************/
13058 #ifdef ANSI
13059 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo
13060 (
13061 TfuDlCqiPuschInfo *param,
13062 Buffer *mBuf
13063 )
13064 #else
13065 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo(param, mBuf)
13066 TfuDlCqiPuschInfo *param;
13067 Buffer *mBuf;
13068 #endif
13069 {
13070
13071    TRC3(cmUnpkTfuDlCqiPuschInfo)
13072
13073    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
13074       switch(param->mode) {
13075          case TFU_PUSCH_CQI_MODE_12:
13076             CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
13077             break;
13078          case TFU_PUSCH_CQI_MODE_22:
13079             CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
13080             break;
13081          case TFU_PUSCH_CQI_MODE_31:
13082             CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
13083             break;
13084          default :
13085             RETVALUE(RFAILED);
13086       }
13087    RETVALUE(ROK);
13088 }
13089 \f
13090 /***********************************************************
13091 *
13092 *     Func : cmPkTfuDoaRpt
13093 *
13094 *
13095 *     Desc : This structure contains the DOA estimated by the physical layer. 
13096   * @details DOA for a given UE.
13097 *
13098 *
13099 *     Ret  : S16
13100 *
13101 *     Notes:
13102 *
13103 *     File  : 
13104 *
13105 **********************************************************/
13106 #ifdef ANSI
13107 PUBLIC S16 cmPkTfuDoaRpt
13108 (
13109 TfuDoaRpt *param,
13110 Buffer *mBuf
13111 )
13112 #else
13113 PUBLIC S16 cmPkTfuDoaRpt(param, mBuf)
13114 TfuDoaRpt *param;
13115 Buffer *mBuf;
13116 #endif
13117 {
13118
13119    TRC3(cmPkTfuDoaRpt)
13120
13121    CMCHKPK(SPkU32, param->doa, mBuf);
13122    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
13123    RETVALUE(ROK);
13124 }
13125
13126
13127 \f
13128 /***********************************************************
13129 *
13130 *     Func : cmUnpkTfuDoaRpt
13131 *
13132 *
13133 *     Desc : This structure contains the DOA estimated by the physical layer. 
13134   * @details DOA for a given UE.
13135 *
13136 *
13137 *     Ret  : S16
13138 *
13139 *     Notes:
13140 *
13141 *     File  : 
13142 *
13143 **********************************************************/
13144 #ifdef ANSI
13145 PUBLIC S16 cmUnpkTfuDoaRpt
13146 (
13147 TfuDoaRpt *param,
13148 Buffer *mBuf
13149 )
13150 #else
13151 PUBLIC S16 cmUnpkTfuDoaRpt(param, mBuf)
13152 TfuDoaRpt *param;
13153 Buffer *mBuf;
13154 #endif
13155 {
13156
13157    TRC3(cmUnpkTfuDoaRpt)
13158
13159    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
13160    CMCHKUNPK(SUnpkU32, &param->doa, mBuf);
13161    RETVALUE(ROK);
13162 }
13163
13164
13165 \f
13166 /***********************************************************
13167 *
13168 *     Func : cmPkTfuDoaIndInfo
13169 *
13170 *
13171 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13172  * @details DOA is calculated by the physical layer, and this
13173  * information is provided to the scheduler. 
13174  * This data structure clubs together the DOAs for all the UEs
13175  * calculated by PHY in this subframe.
13176 *
13177 *
13178 *     Ret  : S16
13179 *
13180 *     Notes:
13181 *
13182 *     File  : 
13183 *
13184 **********************************************************/
13185 #ifdef ANSI
13186 PUBLIC S16 cmPkTfuDoaIndInfo
13187 (
13188 TfuDoaIndInfo *param,
13189 Buffer *mBuf
13190 )
13191 #else
13192 PUBLIC S16 cmPkTfuDoaIndInfo(param, mBuf)
13193 TfuDoaIndInfo *param;
13194 Buffer *mBuf;
13195 #endif
13196 {
13197
13198    CmLList *node;
13199    U32 count;
13200    TfuDoaRpt *tfuDoaRpt;
13201    TRC3(cmPkTfuDoaIndInfo)
13202
13203    count = param->doaRpt.count;
13204    node = param->doaRpt.last;
13205    while (node) {
13206       tfuDoaRpt = (TfuDoaRpt *)node->node;
13207       node=node->prev;
13208       CMCHKPK(cmPkTfuDoaRpt, tfuDoaRpt, mBuf);
13209       cmLListDelFrm(&param->doaRpt, &tfuDoaRpt->lnk);
13210       tfuDoaRpt->lnk.node = (PTR)NULLP;
13211    }
13212    CMCHKPK(SPkU32, count, mBuf);
13213    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13214    RETVALUE(ROK);
13215 }
13216
13217
13218 \f
13219 /***********************************************************
13220 *
13221 *     Func : cmUnpkTfuDoaIndInfo
13222 *
13223 *
13224 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13225  * @details DOA is calculated by the physical layer, and this
13226  * information is provided to the scheduler. 
13227  * This data structure clubs together the DOAs for all the UEs
13228  * calculated by PHY in this subframe.
13229 *
13230 *
13231 *     Ret  : S16
13232 *
13233 *     Notes:
13234 *
13235 *     File  : 
13236 *
13237 **********************************************************/
13238 #ifdef ANSI
13239 PUBLIC S16 cmUnpkTfuDoaIndInfo
13240 (
13241 TfuDoaIndInfo *param,
13242 Ptr memCp,
13243 Buffer *mBuf
13244 )
13245 #else
13246 PUBLIC S16 cmUnpkTfuDoaIndInfo(param, memCp, mBuf)
13247 TfuDoaIndInfo *param;
13248 Ptr memCp;
13249 Buffer *mBuf;
13250 #endif
13251 {
13252
13253    U32 count, loopCnt;
13254    TfuDoaRpt *tfuDoaRpt;
13255    TRC3(cmUnpkTfuDoaIndInfo)
13256
13257    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13258    cmLListInit(&param->doaRpt);
13259    CMCHKUNPK(SUnpkU32, &count, mBuf);
13260    for (loopCnt=0; loopCnt<count; loopCnt++) {
13261       cmGetMem((Ptr)memCp, sizeof(*tfuDoaRpt), (Ptr *)&tfuDoaRpt);
13262       CMCHKUNPK(cmUnpkTfuDoaRpt, tfuDoaRpt, mBuf);
13263       cmLListAdd2Tail(&param->doaRpt, &tfuDoaRpt->lnk);
13264       tfuDoaRpt->lnk.node = (PTR)tfuDoaRpt;
13265    }
13266    RETVALUE(ROK);
13267 }
13268
13269
13270 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
13271 #ifdef TFU_UPGRADE
13272
13273 \f
13274 /***********************************************************
13275 *
13276 *     Func : cmPkTfuSrsRpt
13277 *
13278 *
13279 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13280  * @details Uplink SRS from each UE is received by the physical layer, and this
13281  * information is provided to the scheduler.
13282 *
13283 *
13284 *     Ret  : S16
13285 *
13286 *     Notes:
13287 *
13288 *     File  : 
13289 *
13290 **********************************************************/
13291 #ifdef ANSI
13292 PUBLIC S16 cmPkTfuSrsRpt
13293 (
13294 TfuSrsRpt *param,
13295 Buffer *mBuf
13296 )
13297 #else
13298 PUBLIC S16 cmPkTfuSrsRpt(param, mBuf)
13299 TfuSrsRpt *param;
13300 Buffer *mBuf;
13301 #endif
13302 {
13303
13304    S32 i;
13305    TRC3(cmPkTfuSrsRpt)
13306
13307    CMCHKPK(SPkU8, param->wideCqi, mBuf);
13308    CMCHKPK(SPkU8, param->wideCqiPres, mBuf);
13309    for (i=TFU_MAX_UL_RB-1; i >= 0; i--) {
13310       CMCHKPK(SPkU8, param->snr[i], mBuf);
13311    }
13312    CMCHKPK(SPkU8, param->rbStart, mBuf);
13313    CMCHKPK(SPkU8, param->numRbs, mBuf);
13314    CMCHKPK(SPkU16, param->ta, mBuf);
13315    CMCHKPK(SPkU16, param->dopEst, mBuf);
13316    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
13317    RETVALUE(ROK);
13318 }
13319
13320
13321 \f
13322 /***********************************************************
13323 *
13324 *     Func : cmUnpkTfuSrsRpt
13325 *
13326 *
13327 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13328  * @details Uplink SRS from each UE is received by the physical layer, and this
13329  * information is provided to the scheduler.
13330 *
13331 *
13332 *     Ret  : S16
13333 *
13334 *     Notes:
13335 *
13336 *     File  : 
13337 *
13338 **********************************************************/
13339 #ifdef ANSI
13340 PUBLIC S16 cmUnpkTfuSrsRpt
13341 (
13342 TfuSrsRpt *param,
13343 Buffer *mBuf
13344 )
13345 #else
13346 PUBLIC S16 cmUnpkTfuSrsRpt(param, mBuf)
13347 TfuSrsRpt *param;
13348 Buffer *mBuf;
13349 #endif
13350 {
13351
13352    S32 i;
13353    TRC3(cmUnpkTfuSrsRpt)
13354
13355    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
13356    CMCHKUNPK(SUnpkU16, &param->dopEst, mBuf);
13357    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
13358    CMCHKUNPK(SUnpkU8, &param->numRbs, mBuf);
13359    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
13360    for (i=0; i<TFU_MAX_UL_RB; i++) {
13361       CMCHKUNPK(SUnpkU8, &param->snr[i], mBuf);
13362    }
13363    CMCHKUNPK(SUnpkU8, &param->wideCqiPres, mBuf);
13364    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
13365    RETVALUE(ROK);
13366 }
13367
13368
13369 \f
13370 /***********************************************************
13371 *
13372 *     Func : cmPkTfuSrsIndInfo
13373 *
13374 *
13375 *     Desc : This structure conveys the Uplink SRS indication.
13376  * @details Uplink SRS is received by the physical layer, and this
13377  * information is provided to the scheduler. 
13378  * This data structure clubs together the UL SRS indications of all the UEs 
13379  * in the subframe.
13380 *
13381 *
13382 *     Ret  : S16
13383 *
13384 *     Notes:
13385 *
13386 *     File  : 
13387 *
13388 **********************************************************/
13389 #ifdef ANSI
13390 PUBLIC S16 cmPkTfuSrsIndInfo
13391 (
13392 TfuSrsIndInfo *param,
13393 Buffer *mBuf
13394 )
13395 #else
13396 PUBLIC S16 cmPkTfuSrsIndInfo(param, mBuf)
13397 TfuSrsIndInfo *param;
13398 Buffer *mBuf;
13399 #endif
13400 {
13401
13402    CmLList *node;
13403    U32 count;
13404    TfuSrsRpt *tfuSrsRpt;
13405
13406    TRC3(cmPkTfuSrsIndInfo)
13407
13408    count = param->srsRpt.count;
13409    node = param->srsRpt.last;
13410    while (node) {
13411       tfuSrsRpt = (TfuSrsRpt *)node->node;
13412       node=node->prev;
13413       CMCHKPK(cmPkTfuSrsRpt, tfuSrsRpt, mBuf);
13414       cmLListDelFrm(&param->srsRpt, &tfuSrsRpt->lnk);
13415       tfuSrsRpt->lnk.node = (PTR)NULLP;
13416    }
13417    CMCHKPK(SPkU32, count, mBuf);
13418    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13419    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13420    RETVALUE(ROK);
13421 }
13422
13423
13424 \f
13425 /***********************************************************
13426 *
13427 *     Func : cmUnpkTfuSrsIndInfo
13428 *
13429 *
13430 *     Desc : This structure conveys the Uplink SRS indication.
13431  * @details Uplink SRS is received by the physical layer, and this
13432  * information is provided to the scheduler. 
13433  * This data structure clubs together the UL SRS indications of all the UEs 
13434  * in the subframe.
13435 *
13436 *
13437 *     Ret  : S16
13438 *
13439 *     Notes:
13440 *
13441 *     File  : 
13442 *
13443 **********************************************************/
13444 #ifdef ANSI
13445 PUBLIC S16 cmUnpkTfuSrsIndInfo
13446 (
13447 TfuSrsIndInfo *param,
13448 Ptr memCp,
13449 Buffer *mBuf
13450 )
13451 #else
13452 PUBLIC S16 cmUnpkTfuSrsIndInfo(param, memCp, mBuf)
13453 TfuSrsIndInfo *param;
13454 Ptr memCp;
13455 Buffer *mBuf;
13456 #endif
13457 {
13458
13459    U32 count, loopCnt;
13460    TfuSrsRpt *tfuSrsRpt;
13461
13462    TRC3(cmUnpkTfuSrsIndInfo)
13463
13464    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13465    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13466    cmLListInit(&param->srsRpt);
13467    CMCHKUNPK(SUnpkU32, &count, mBuf);
13468    for (loopCnt=0; loopCnt<count; loopCnt++) {
13469       cmGetMem((Ptr)memCp, sizeof(*tfuSrsRpt), (Ptr *)&tfuSrsRpt);
13470       CMCHKUNPK(cmUnpkTfuSrsRpt, tfuSrsRpt, mBuf);
13471       cmLListAdd2Tail(&param->srsRpt, &tfuSrsRpt->lnk);
13472       tfuSrsRpt->lnk.node = (PTR)tfuSrsRpt;
13473    }
13474    RETVALUE(ROK);
13475 }
13476
13477
13478 \f
13479 /***********************************************************
13480 *
13481 *     Func : cmPkTfuRawCqiRpt
13482 *
13483 *
13484 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13485  * as transmitted by the UE. 
13486  * @details These bits shall be interpretted by MAC to derive the following 
13487  * -# Wideband CQI
13488  * -# Subband CQI
13489  * -# PMI
13490  * -# RI
13491 *
13492 *
13493 *     Ret  : S16
13494 *
13495 *     Notes:
13496 *
13497 *     File  : 
13498 *
13499 **********************************************************/
13500 #ifdef ANSI
13501 PUBLIC S16 cmPkTfuRawCqiRpt
13502 (
13503 TfuRawCqiRpt *param,
13504 Buffer *mBuf
13505 )
13506 #else
13507 PUBLIC S16 cmPkTfuRawCqiRpt(param, mBuf)
13508 TfuRawCqiRpt *param;
13509 Buffer *mBuf;
13510 #endif
13511 {
13512
13513    TRC3(cmPkTfuRawCqiRpt)
13514 #ifdef TFU_5GTF
13515    CMCHKPK(SPkU32, param->uciPayload, mBuf);
13516 #else
13517    S32 i;
13518    for (i=CM_LTE_MAX_CELLS-1; i >= 0; i--) {
13519       CMCHKPK(SPkU8, param->ri[i], mBuf);
13520    }
13521    for (i=TFU_MAX_CQI_BYTES-1; i >= 0; i--) {
13522       CMCHKPK(SPkU8, param->cqiBits[i], mBuf);
13523    }
13524 #endif
13525    CMCHKPK(SPkU8, param->numBits, mBuf);
13526    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
13527    RETVALUE(ROK);
13528 }
13529
13530
13531 \f
13532 /***********************************************************
13533 *
13534 *     Func : cmUnpkTfuRawCqiRpt
13535 *
13536 *
13537 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13538  * as transmitted by the UE. 
13539  * @details These bits shall be interpretted by MAC to derive the following 
13540  * -# Wideband CQI
13541  * -# Subband CQI
13542  * -# PMI
13543  * -# RI
13544 *
13545 *
13546 *     Ret  : S16
13547 *
13548 *     Notes:
13549 *
13550 *     File  : 
13551 *
13552 **********************************************************/
13553 #ifdef ANSI
13554 PUBLIC S16 cmUnpkTfuRawCqiRpt
13555 (
13556 TfuRawCqiRpt *param,
13557 Buffer *mBuf
13558 )
13559 #else
13560 PUBLIC S16 cmUnpkTfuRawCqiRpt(param, mBuf)
13561 TfuRawCqiRpt *param;
13562 Buffer *mBuf;
13563 #endif
13564 {
13565
13566    TRC3(cmUnpkTfuRawCqiRpt)
13567
13568    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
13569    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
13570 #ifndef TFU_5GTF
13571    S32 i;
13572    for (i=0; i<TFU_MAX_CQI_BYTES; i++) {
13573       CMCHKUNPK(SUnpkU8, &param->cqiBits[i], mBuf);
13574    }
13575    for (i=0; i<CM_LTE_MAX_CELLS; i++) {
13576       CMCHKUNPK(SUnpkU8, &param->ri[i], mBuf);
13577    }
13578 #else
13579       CMCHKUNPK(SUnpkU32, &param->uciPayload, mBuf);
13580 #endif
13581    RETVALUE(ROK);
13582 }
13583
13584
13585 \f
13586 /***********************************************************
13587 *
13588 *     Func : cmPkTfuRawCqiIndInfo
13589 *
13590 *
13591 *     Desc : This structure contains the Raw CQI reports received for the
13592  * transmitting UEs in a single subframe. 
13593  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13594  * interpretation is upto the MAC layer.
13595 *
13596 *
13597 *     Ret  : S16
13598 *
13599 *     Notes:
13600 *
13601 *     File  : 
13602 *
13603 **********************************************************/
13604 #ifdef ANSI
13605 PUBLIC S16 cmPkTfuRawCqiIndInfo
13606 (
13607 TfuRawCqiIndInfo *param,
13608 Buffer *mBuf
13609 )
13610 #else
13611 PUBLIC S16 cmPkTfuRawCqiIndInfo(param, mBuf)
13612 TfuRawCqiIndInfo *param;
13613 Buffer *mBuf;
13614 #endif
13615 {
13616
13617    U32 count;
13618    TfuRawCqiRpt *tfuRawCqiRpt;
13619    CmLList *node;
13620
13621    TRC3(cmPkTfuRawCqiIndInfo)
13622
13623    count = param->rawCqiRpt.count;
13624    node = param->rawCqiRpt.last;
13625    while (node) {
13626       tfuRawCqiRpt = (TfuRawCqiRpt *)node->node;
13627       node=node->prev;
13628       CMCHKPK(cmPkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13629       cmLListDelFrm(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13630       tfuRawCqiRpt->lnk.node = (PTR)NULLP;
13631    }
13632    CMCHKPK(SPkU32, count, mBuf);
13633    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13634    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13635    RETVALUE(ROK);
13636 }
13637
13638
13639 \f
13640 /***********************************************************
13641 *
13642 *     Func : cmUnpkTfuRawCqiIndInfo
13643 *
13644 *
13645 *     Desc : This structure contains the Raw CQI reports received for the
13646  * transmitting UEs in a single subframe. 
13647  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13648  * interpretation is upto the MAC layer.
13649 *
13650 *
13651 *     Ret  : S16
13652 *
13653 *     Notes:
13654 *
13655 *     File  : 
13656 *
13657 **********************************************************/
13658 #ifdef ANSI
13659 PUBLIC S16 cmUnpkTfuRawCqiIndInfo
13660 (
13661 TfuRawCqiIndInfo *param,
13662 Ptr memCp,
13663 Buffer *mBuf
13664 )
13665 #else
13666 PUBLIC S16 cmUnpkTfuRawCqiIndInfo(param, memCp, mBuf)
13667 TfuRawCqiIndInfo *param;
13668 Ptr memCp;
13669 Buffer *mBuf;
13670 #endif
13671 {
13672
13673    U32 count, loopCnt;
13674    TfuRawCqiRpt *tfuRawCqiRpt;
13675
13676    TRC3(cmUnpkTfuRawCqiIndInfo)
13677
13678    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13679    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13680    cmLListInit(&param->rawCqiRpt);
13681    CMCHKUNPK(SUnpkU32, &count, mBuf);
13682    for (loopCnt=0; loopCnt<count; loopCnt++) {
13683       cmGetMem((Ptr)memCp, sizeof(*tfuRawCqiRpt), (Ptr *)&tfuRawCqiRpt);
13684       CMCHKUNPK(cmUnpkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13685       cmLListAdd2Tail(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13686       tfuRawCqiRpt->lnk.node = (PTR)tfuRawCqiRpt;
13687    }
13688    RETVALUE(ROK);
13689 }
13690
13691
13692 #ifdef TFU_TDD
13693
13694 #ifdef TFU_TDD
13695
13696 \f
13697 /***********************************************************
13698 *
13699 *     Func : cmPkTfuUePucchHqRecpInfo
13700 *
13701 *
13702 *     Desc : This structure is sent from scheduler to PHY in order to request the
13703  * reception of harq information on PUCCH.
13704 *
13705 *
13706 *     Ret  : S16
13707 *
13708 *     Notes:
13709 *
13710 *     File  : 
13711 *
13712 **********************************************************/
13713 #ifdef ANSI
13714 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13715 (
13716 TfuUePucchHqRecpInfo *param,
13717 Buffer *mBuf
13718 )
13719 #else
13720 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13721 TfuUePucchHqRecpInfo *param;
13722 Buffer *mBuf;
13723 #endif
13724 {
13725
13726    S32 i;
13727    TRC3(cmPkTfuUePucchHqRecpInfo)
13728
13729    CMCHKPK(SPkU8, param->a, mBuf);
13730    for (i=TFU_MAX_HQ_RES-1; i >= 0; i--) {
13731       CMCHKPK(SPkU16, param->hqRes[i], mBuf);
13732    }
13733    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13734    CMCHKPK(SPkU8, param->hqSz, mBuf);
13735    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13736    RETVALUE(ROK);
13737 }
13738
13739
13740 \f
13741 /***********************************************************
13742 *
13743 *     Func : cmUnpkTfuUePucchHqRecpInfo
13744 *
13745 *
13746 *     Desc : This structure is sent from scheduler to PHY in order to request the
13747  * reception of harq information on PUCCH.
13748 *
13749 *
13750 *     Ret  : S16
13751 *
13752 *     Notes:
13753 *
13754 *     File  : 
13755 *
13756 **********************************************************/
13757 #ifdef ANSI
13758 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13759 (
13760 TfuUePucchHqRecpInfo *param,
13761 Buffer *mBuf
13762 )
13763 #else
13764 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13765 TfuUePucchHqRecpInfo *param;
13766 Buffer *mBuf;
13767 #endif
13768 {
13769
13770    S32 i;
13771    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13772
13773    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13774    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13775    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13776    for (i=0; i<TFU_MAX_HQ_RES; i++) {
13777       CMCHKUNPK(SUnpkU16, &param->hqRes[i], mBuf);
13778    }
13779    CMCHKUNPK(SUnpkU8, &param->a, mBuf);
13780    RETVALUE(ROK);
13781 }
13782
13783
13784 #endif
13785
13786 #endif
13787
13788 #ifndef TFU_TDD  /* else of TFU_TDD */
13789
13790 #ifndef TFU_TDD  /* else of TFU_TDD */
13791
13792 \f
13793 /***********************************************************
13794 *
13795 *     Func : cmPkTfuUePucchHqRecpInfo
13796 *
13797 *
13798 *     Desc : This structure is sent from scheduler to PHY in order to request the
13799  * reception of harq information on PUCCH.
13800 *
13801 *
13802 *     Ret  : S16
13803 *
13804 *     Notes:
13805 *
13806 *     File  : 
13807 *
13808 **********************************************************/
13809 #ifdef ANSI
13810 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13811 (
13812 TfuUePucchHqRecpInfo *param,
13813 Buffer *mBuf
13814 )
13815 #else
13816 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13817 TfuUePucchHqRecpInfo *param;
13818 Buffer *mBuf;
13819 #endif
13820 {
13821
13822    TRC3(cmPkTfuUePucchHqRecpInfo)
13823 #ifdef LTE_ADV
13824    S32 idx;
13825    for (idx=(TFU_MAX_HQ_RES-1); idx >= 0; idx--) {
13826       CMCHKPK(SPkU16, param->hqRes[idx], mBuf);
13827    }
13828 #else
13829    CMCHKPK(SPkU16, param->hqRes[0], mBuf);
13830 #endif
13831    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13832    CMCHKPK(SPkU8, param->hqSz, mBuf);
13833    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13834
13835    RETVALUE(ROK);
13836 }
13837
13838
13839 \f
13840 /***********************************************************
13841 *
13842 *     Func : cmUnpkTfuUePucchHqRecpInfo
13843 *
13844 *
13845 *     Desc : This structure is sent from scheduler to PHY in order to request the
13846  * reception of harq information on PUCCH.
13847 *
13848 *
13849 *     Ret  : S16
13850 *
13851 *     Notes:
13852 *
13853 *     File  : 
13854 *
13855 **********************************************************/
13856 #ifdef ANSI
13857 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13858 (
13859 TfuUePucchHqRecpInfo *param,
13860 Buffer *mBuf
13861 )
13862 #else
13863 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13864 TfuUePucchHqRecpInfo *param;
13865 Buffer *mBuf;
13866 #endif
13867 {
13868    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13869
13870    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13871    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13872    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13873 #ifdef LTE_ADV
13874    S32 idx;
13875    for (idx=0; idx<TFU_MAX_HQ_RES; idx++) {
13876       CMCHKUNPK(SUnpkU16, &param->hqRes[idx], mBuf);
13877    }
13878 #else
13879    CMCHKUNPK(SUnpkU16, &param->hqRes[0], mBuf);
13880 #endif
13881
13882    RETVALUE(ROK);
13883 }
13884
13885
13886 #endif
13887
13888 #endif
13889
13890 \f
13891 /***********************************************************
13892 *
13893 *     Func : cmPkTfuUePucchSrRecpInfo
13894 *
13895 *
13896 *     Desc : This structure is sent from scheduler to PHY in order to request the
13897  * reception of SR information on PUCCH.
13898 *
13899 *
13900 *     Ret  : S16
13901 *
13902 *     Notes:
13903 *
13904 *     File  : 
13905 *
13906 **********************************************************/
13907 #ifdef ANSI
13908 PUBLIC S16 cmPkTfuUePucchSrRecpInfo
13909 (
13910 TfuUePucchSrRecpInfo *param,
13911 Buffer *mBuf
13912 )
13913 #else
13914 PUBLIC S16 cmPkTfuUePucchSrRecpInfo(param, mBuf)
13915 TfuUePucchSrRecpInfo *param;
13916 Buffer *mBuf;
13917 #endif
13918 {
13919
13920    TRC3(cmPkTfuUePucchSrRecpInfo)
13921
13922    CMCHKPK(SPkU16, param->n1PucchIdx, mBuf);
13923    RETVALUE(ROK);
13924 }
13925
13926
13927 \f
13928 /***********************************************************
13929 *
13930 *     Func : cmUnpkTfuUePucchSrRecpInfo
13931 *
13932 *
13933 *     Desc : This structure is sent from scheduler to PHY in order to request the
13934  * reception of SR information on PUCCH.
13935 *
13936 *
13937 *     Ret  : S16
13938 *
13939 *     Notes:
13940 *
13941 *     File  : 
13942 *
13943 **********************************************************/
13944 #ifdef ANSI
13945 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo
13946 (
13947 TfuUePucchSrRecpInfo *param,
13948 Buffer *mBuf
13949 )
13950 #else
13951 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo(param, mBuf)
13952 TfuUePucchSrRecpInfo *param;
13953 Buffer *mBuf;
13954 #endif
13955 {
13956
13957    TRC3(cmUnpkTfuUePucchSrRecpInfo)
13958
13959    CMCHKUNPK(SUnpkU16, &param->n1PucchIdx, mBuf);
13960    RETVALUE(ROK);
13961 }
13962
13963
13964 \f
13965 /***********************************************************
13966 *
13967 *     Func : cmPkTfuUePucchCqiRecpInfo
13968 *
13969 *
13970 *     Desc : This structure is sent from scheduler to PHY in order to request the
13971  * reception of CQI information on PUCCH.
13972 *
13973 *
13974 *     Ret  : S16
13975 *
13976 *     Notes:
13977 *
13978 *     File  : 
13979 *
13980 **********************************************************/
13981 #ifdef ANSI
13982 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo
13983 (
13984 TfuUePucchCqiRecpInfo *param,
13985 Buffer *mBuf
13986 )
13987 #else
13988 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo(param, mBuf)
13989 TfuUePucchCqiRecpInfo *param;
13990 Buffer *mBuf;
13991 #endif
13992 {
13993
13994    TRC3(cmPkTfuUePucchCqiRecpInfo)
13995
13996    CMCHKPK(SPkU8, param->cqiPmiSz, mBuf);
13997    CMCHKPK(SPkU16, param->n2PucchIdx, mBuf);
13998    RETVALUE(ROK);
13999 }
14000
14001
14002 \f
14003 /***********************************************************
14004 *
14005 *     Func : cmUnpkTfuUePucchCqiRecpInfo
14006 *
14007 *
14008 *     Desc : This structure is sent from scheduler to PHY in order to request the
14009  * reception of CQI information on PUCCH.
14010 *
14011 *
14012 *     Ret  : S16
14013 *
14014 *     Notes:
14015 *
14016 *     File  : 
14017 *
14018 **********************************************************/
14019 #ifdef ANSI
14020 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo
14021 (
14022 TfuUePucchCqiRecpInfo *param,
14023 Buffer *mBuf
14024 )
14025 #else
14026 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo(param, mBuf)
14027 TfuUePucchCqiRecpInfo *param;
14028 Buffer *mBuf;
14029 #endif
14030 {
14031
14032    TRC3(cmUnpkTfuUePucchCqiRecpInfo)
14033
14034    CMCHKUNPK(SUnpkU16, &param->n2PucchIdx, mBuf);
14035    CMCHKUNPK(SUnpkU8, &param->cqiPmiSz, mBuf);
14036    RETVALUE(ROK);
14037 }
14038
14039
14040 \f
14041 /***********************************************************
14042 *
14043 *     Func : cmPkTfuUePucchSrsRecpInfo
14044 *
14045 *
14046 *     Desc : This structure is sent from scheduler to PHY in order to request the
14047  * reception of SRS information on PUCCH.
14048 *
14049 *
14050 *     Ret  : S16
14051 *
14052 *     Notes:
14053 *
14054 *     File  : 
14055 *
14056 **********************************************************/
14057 #ifdef ANSI
14058 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo
14059 (
14060 TfuUePucchSrsRecpInfo *param,
14061 Buffer *mBuf
14062 )
14063 #else
14064 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo(param, mBuf)
14065 TfuUePucchSrsRecpInfo *param;
14066 Buffer *mBuf;
14067 #endif
14068 {
14069
14070    TRC3(cmPkTfuUePucchSrsRecpInfo)
14071
14072    CMCHKPK(SPkU32, param->srsCyclicShft, mBuf);
14073    CMCHKPK(SPkU16, param->srsCfgIdx, mBuf);
14074    CMCHKPK(SPkU8, param->transComb, mBuf);
14075    CMCHKPK(SPkU32, param->srsHopBw, mBuf);
14076    CMCHKPK(SPkU8, param->nRrc, mBuf);
14077    CMCHKPK(SPkU32, param->srsBw, mBuf);
14078    RETVALUE(ROK);
14079 }
14080
14081 #ifdef TFU_5GTF
14082 #ifdef ANSI
14083 PUBLIC S16 cmPkTfuUePucchUciRecpInfo
14084 (
14085 TfuUePucchUciRecpInfo *param,
14086 Buffer *mBuf
14087 )
14088 #else
14089 PUBLIC S16 cmPkTfuUePucchUciRecpInfo(param, mBuf)
14090 TfuUePucchUciRecpInfo *param;
14091 Buffer *mBuf;
14092 #endif
14093 {
14094
14095    TRC3(cmPkTfuUePucchUciRecpInfo)
14096
14097    CMCHKPK(SPkU8, param->SCID, mBuf);
14098    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
14099    CMCHKPK(SPkU8, param->numBits, mBuf);
14100    RETVALUE(ROK);
14101 }
14102 #endif
14103
14104 \f
14105 /***********************************************************
14106 *
14107 *     Func : cmUnpkTfuUePucchSrsRecpInfo
14108 *
14109 *
14110 *     Desc : This structure is sent from scheduler to PHY in order to request the
14111  * reception of SRS information on PUCCH.
14112 *
14113 *
14114 *     Ret  : S16
14115 *
14116 *     Notes:
14117 *
14118 *     File  : 
14119 *
14120 **********************************************************/
14121 #ifdef ANSI
14122 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo
14123 (
14124 TfuUePucchSrsRecpInfo *param,
14125 Buffer *mBuf
14126 )
14127 #else
14128 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo(param, mBuf)
14129 TfuUePucchSrsRecpInfo *param;
14130 Buffer *mBuf;
14131 #endif
14132 {
14133
14134    TRC3(cmUnpkTfuUePucchSrsRecpInfo)
14135
14136    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsBw, mBuf);
14137    CMCHKUNPK(SUnpkU8, &param->nRrc, mBuf);
14138    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsHopBw, mBuf);
14139    CMCHKUNPK(SUnpkU8, &param->transComb, mBuf);
14140    CMCHKUNPK(SUnpkU16, &param->srsCfgIdx, mBuf);
14141    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsCyclicShft, mBuf);
14142    RETVALUE(ROK);
14143 }
14144
14145 #ifdef TFU_5GTF 
14146 /***********************************************************
14147 *
14148 *     Func : cmPkTfuUePucchBsiBriRecpInfo
14149 *
14150 *
14151 *     Desc : This structure is sent from scheduler to PHY in order to request the
14152  * reception of BSI_BRI information on PUCCH.
14153 *
14154 *
14155 *     Ret  : S16
14156 *
14157 *     Notes:
14158 *
14159 *     File  : 
14160 *
14161 **********************************************************/
14162 #ifdef ANSI
14163 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo
14164 (
14165 TfuUePucchBsiBriRecpInfo *param,
14166 Buffer *mBuf
14167 )
14168 #else
14169 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo(param, mBuf)
14170 TfuUePucchBsiBriRecpInfo *param;
14171 Buffer *mBuf;
14172 #endif
14173 {
14174
14175    TRC3(cmPkTfuUePucchBsiBriRecpInfo)
14176
14177    CMCHKPK(SPkU8, param->briRpt, mBuf);
14178    CMCHKPK(SPkU8, param->bsiRpt, mBuf);
14179    CMCHKPK(SPkU8, param->SCID, mBuf);
14180    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
14181    CMCHKPK(SPkU8, param->puschFlag, mBuf);
14182    RETVALUE(ROK);
14183 }
14184
14185 /***********************************************************
14186 *
14187 *     Func : cmUnpkTfuUePucchBsiBriRecpInfo
14188 *
14189 *
14190 *     Desc : This structure is sent from scheduler to PHY in order to request the
14191  * reception of BSI_BRI information on PUCCH.
14192 *
14193 *
14194 *     Ret  : S16
14195 *
14196 *     Notes:
14197 *
14198 *     File  : 
14199 *
14200 **********************************************************/
14201 #ifdef ANSI
14202 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo
14203 (
14204 TfuUePucchBsiBriRecpInfo *param,
14205 Buffer *mBuf
14206 )
14207 #else
14208 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo(param, mBuf)
14209 TfuUePucchBsiBriRecpInfo *param;
14210 Buffer *mBuf;
14211 #endif
14212 {
14213
14214    TRC3(cmUnpkTfuUePucchBsiBriRecpInfo)
14215
14216    CMCHKUNPK(SUnpkU8, &param->puschFlag, mBuf);
14217    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14218    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14219    CMCHKUNPK(SUnpkU8, &param->bsiRpt, mBuf);
14220    CMCHKUNPK(SUnpkU8, &param->briRpt, mBuf);
14221    RETVALUE(ROK);
14222 }
14223 #endif
14224
14225 #ifdef TFU_5GTF
14226 #ifdef ANSI
14227 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo
14228 (
14229 TfuUePucchUciRecpInfo *param,
14230 Buffer *mBuf
14231 )
14232 #else
14233 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo(param, mBuf)
14234 TfuUePucchUciRecpInfo *param;
14235 Buffer *mBuf;
14236 #endif
14237 {
14238
14239    TRC3(cmUnpkTfuUePucchUciRecpInfo)
14240
14241    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
14242    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14243    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14244
14245    RETVALUE(ROK);
14246 }
14247 #endif
14248
14249 \f
14250 /***********************************************************
14251 *
14252 *     Func : cmPkTfuUePucchRecpReq
14253 *
14254 *
14255 *     Desc : This structure is sent from scheduler to PHY in order to request the
14256   * reception of UCI on PUCCH. This may contain the following:
14257   * -# HARQ
14258   * -# SR
14259   * -# SRS
14260   * -# CQI
14261   * -# HARQ+SR
14262   * -# HARQ+SRS
14263   * -# HARQ+CQI
14264   * -# HARQ+SR+SRS
14265   * -# HARQ+SR+CQI
14266   * -# SR+SRS
14267   * -# SR+CQI
14268 *
14269 *
14270 *     Ret  : S16
14271 *
14272 *     Notes:
14273 *
14274 *     File  : 
14275 *
14276 **********************************************************/
14277 #ifdef ANSI
14278 PUBLIC S16 cmPkTfuUePucchRecpReq
14279 (
14280 TfuUePucchRecpReq *param,
14281 Buffer *mBuf
14282 )
14283 #else
14284 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14285 TfuUePucchRecpReq *param;
14286 Buffer *mBuf;
14287 #endif
14288 {
14289
14290    TRC3(cmPkTfuUePucchRecpReq)
14291
14292 #ifdef TFU_5GTF
14293    CMCHKPK(cmPkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14294    CMCHKPK(cmPkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14295 #endif /* TFU_5GTF */
14296    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14297    CMCHKPK(cmPkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14298    CMCHKPK(cmPkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14299    CMCHKPK(cmPkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14300    CMCHKPK(SPkU32, param->uciInfo, mBuf);
14301    RETVALUE(ROK);
14302 }
14303
14304
14305 \f
14306 /***********************************************************
14307 *
14308 *     Func : cmUnpkTfuUePucchRecpReq
14309 *
14310 *
14311 *     Desc : This structure is sent from scheduler to PHY in order to request the
14312   * reception of UCI on PUCCH. This may contain the following:
14313   * -# HARQ
14314   * -# SR
14315   * -# SRS
14316   * -# CQI
14317   * -# HARQ+SR
14318   * -# HARQ+SRS
14319   * -# HARQ+CQI
14320   * -# HARQ+SR+SRS
14321   * -# HARQ+SR+CQI
14322   * -# SR+SRS
14323   * -# SR+CQI
14324 *
14325 *
14326 *     Ret  : S16
14327 *
14328 *     Notes:
14329 *
14330 *     File  : 
14331 *
14332 **********************************************************/
14333 #ifdef ANSI
14334 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14335 (
14336 TfuUePucchRecpReq *param,
14337 Buffer *mBuf
14338 )
14339 #else
14340 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14341 TfuUePucchRecpReq *param;
14342 Buffer *mBuf;
14343 #endif
14344 {
14345
14346    TRC3(cmUnpkTfuUePucchRecpReq)
14347
14348    CMCHKUNPK(SUnpkU32, (U32 *)&param->uciInfo, mBuf);
14349    CMCHKUNPK(cmUnpkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14350    CMCHKUNPK(cmUnpkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14351    CMCHKUNPK(cmUnpkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14352    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14353 #ifdef TFU_5GTF
14354    CMCHKUNPK(cmUnpkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14355    CMCHKUNPK(cmUnpkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14356 #endif /* TFU_5GTF */
14357    RETVALUE(ROK);
14358 }
14359
14360
14361 \f
14362 /***********************************************************
14363 *
14364 *     Func : cmPkTfuUeUlSchRecpInfo
14365 *
14366 *
14367 *     Desc : This structure is sent from scheduler to PHY in order to request the
14368   * reception of UEs data on ULSCH.
14369 *
14370 *
14371 *     Ret  : S16
14372 *
14373 *     Notes:
14374 *
14375 *     File  : 
14376 *
14377 **********************************************************/
14378 #ifdef ANSI
14379 PUBLIC S16 cmPkTfuUeUlSchRecpInfo
14380 (
14381 TfuUeUlSchRecpInfo *param,
14382 Buffer *mBuf
14383 )
14384 #else
14385 PUBLIC S16 cmPkTfuUeUlSchRecpInfo(param, mBuf)
14386 TfuUeUlSchRecpInfo *param;
14387 Buffer *mBuf;
14388 #endif
14389 {
14390
14391    TRC3(cmPkTfuUeUlSchRecpInfo)
14392 #ifdef TFU_5GTF
14393    CMCHKPK(SPkU8, param->beamIndex, mBuf);
14394    CMCHKPK(SPkU8, param->uciWoTBFlag, mBuf);
14395    CMCHKPK(SPkU8, param->PMI, mBuf);
14396    CMCHKPK(SPkU8, param->SCID, mBuf);
14397    CMCHKPK(SPkU8, param->nAntPortLayer, mBuf);
14398    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
14399    CMCHKPK(SPkU8, param->numRbg, mBuf);
14400    CMCHKPK(SPkU8, param->rbgStart, mBuf);
14401 #endif
14402    CMCHKPK(SPkU8, param->mcs, mBuf);
14403    CMCHKPK(SPkU8, param->nSrs, mBuf);
14404    CMCHKPK(SPkU8, param->crntTxNb, mBuf);
14405    CMCHKPK(SPkU8, param->txMode, mBuf);
14406    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14407    CMCHKPK(SPkU8, param->rv, mBuf);
14408    CMCHKPK(SPkU8, param->ndi, mBuf);
14409    CMCHKPK(SPkU8, param->isRtx, mBuf);
14410    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
14411    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14412    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14413    CMCHKPK(SPkU32, param->modType, mBuf);
14414    CMCHKPK(SPkU8, param->numRb, mBuf);
14415    CMCHKPK(SPkU8, param->rbStart, mBuf);
14416    CMCHKPK(SPkU16, param->size, mBuf);
14417
14418    RETVALUE(ROK);
14419 }
14420
14421
14422 \f
14423 /***********************************************************
14424 *
14425 *     Func : cmUnpkTfuUeUlSchRecpInfo
14426 *
14427 *
14428 *     Desc : This structure is sent from scheduler to PHY in order to request the
14429   * reception of UEs data on ULSCH.
14430 *
14431 *
14432 *     Ret  : S16
14433 *
14434 *     Notes:
14435 *
14436 *     File  : 
14437 *
14438 **********************************************************/
14439 #ifdef ANSI
14440 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo
14441 (
14442 TfuUeUlSchRecpInfo *param,
14443 Buffer *mBuf
14444 )
14445 #else
14446 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo(param, mBuf)
14447 TfuUeUlSchRecpInfo *param;
14448 Buffer *mBuf;
14449 #endif
14450 {
14451
14452    TRC3(cmUnpkTfuUeUlSchRecpInfo)
14453
14454    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14455    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14456    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14457    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14458    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14459    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14460    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
14461    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14462    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14463    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14464    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14465    CMCHKUNPK(SUnpkU8, &param->txMode, mBuf);
14466    CMCHKUNPK(SUnpkU8, &param->crntTxNb, mBuf);
14467    CMCHKUNPK(SUnpkU8, &param->nSrs, mBuf);
14468    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14469 #ifdef TFU_5GTF 
14470    CMCHKUNPK(SUnpkU8, &param->rbgStart, mBuf);
14471    CMCHKUNPK(SUnpkU8, &param->numRbg, mBuf);
14472    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
14473    CMCHKUNPK(SUnpkU8, &param->nAntPortLayer, mBuf);
14474    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14475    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
14476    CMCHKUNPK(SUnpkU8, &param->uciWoTBFlag, mBuf);
14477    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
14478 #endif
14479    RETVALUE(ROK);
14480 }
14481
14482
14483 \f
14484 /***********************************************************
14485 *
14486 *     Func : cmPkTfuUePuschCqiRecpInfo
14487 *
14488 *
14489 *     Desc : This structure is sent from scheduler to PHY in order to request the
14490   * reception of CQI_RI info on PUSCH.
14491 *
14492 *
14493 *     Ret  : S16
14494 *
14495 *     Notes:
14496 *
14497 *     File  : 
14498 *
14499 **********************************************************/
14500 #ifdef ANSI
14501 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo
14502 (
14503 TfuUePuschCqiRecpInfo *param,
14504 Buffer *mBuf
14505 )
14506 #else
14507 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo(param, mBuf)
14508 TfuUePuschCqiRecpInfo *param;
14509 Buffer *mBuf;
14510 #endif
14511 {
14512
14513    U32 idx = 0;
14514    TRC3(cmPkTfuUePuschCqiRecpInfo)
14515
14516    CMCHKPK(SPkU8, param->riBetaOff, mBuf);
14517    CMCHKPK(SPkU8, param->cqiBetaOff, mBuf);
14518    for (idx = 0; idx < param->cCNum; idx++)
14519    {
14520       CMCHKPK(cmPkTknU8, &param->riSz[idx], mBuf);
14521       CMCHKPK(SPkU8, param->cqiPmiSzRn1[idx], mBuf);
14522       CMCHKPK(SPkU8, param->cqiPmiSzR1[idx], mBuf);
14523    }
14524    CMCHKPK(SPkU8, param->cCNum, mBuf);
14525    CMCHKPK(SPkU8, param->reportType, mBuf);
14526    RETVALUE(ROK);
14527 }
14528
14529
14530 \f
14531 /***********************************************************
14532 *
14533 *     Func : cmUnpkTfuUePuschCqiRecpInfo
14534 *
14535 *
14536 *     Desc : This structure is sent from scheduler to PHY in order to request the
14537   * reception of CQI_RI info on PUSCH.
14538 *
14539 *
14540 *     Ret  : S16
14541 *
14542 *     Notes:
14543 *
14544 *     File  : 
14545 *
14546 **********************************************************/
14547 #ifdef ANSI
14548 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo
14549 (
14550 TfuUePuschCqiRecpInfo *param,
14551 Buffer *mBuf
14552 )
14553 #else
14554 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo(param, mBuf)
14555 TfuUePuschCqiRecpInfo *param;
14556 Buffer *mBuf;
14557 #endif
14558 {
14559
14560    U32 idx;
14561    TRC3(cmUnpkTfuUePuschCqiRecpInfo)
14562
14563    CMCHKUNPK(SUnpkU8, &param->reportType, mBuf);
14564    CMCHKUNPK(SUnpkU8, &param->cCNum, mBuf);
14565    for (idx = param->cCNum; idx > 0; idx--)
14566    {
14567       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzR1[idx-1], mBuf);
14568       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzRn1[idx-1], mBuf);
14569       CMCHKUNPK(cmUnpkTknU8, &param->riSz[idx-1], mBuf);
14570    }
14571    CMCHKUNPK(SUnpkU8, &param->cqiBetaOff, mBuf);
14572    CMCHKUNPK(SUnpkU8, &param->riBetaOff, mBuf);
14573    RETVALUE(ROK);
14574 }
14575
14576
14577 \f
14578 /***********************************************************
14579 *
14580 *     Func : cmPkTfuUePuschHqRecpInfo
14581 *
14582 *
14583 *     Desc : This structure is sent from scheduler to PHY in order to request the
14584   * reception of Harq info on PUSCH.
14585 *
14586 *
14587 *     Ret  : S16
14588 *
14589 *     Notes:
14590 *
14591 *     File  : 
14592 *
14593 **********************************************************/
14594 #ifdef ANSI
14595 PUBLIC S16 cmPkTfuUePuschHqRecpInfo
14596 (
14597 TfuUePuschHqRecpInfo *param,
14598 Buffer *mBuf
14599 )
14600 #else
14601 PUBLIC S16 cmPkTfuUePuschHqRecpInfo(param, mBuf)
14602 TfuUePuschHqRecpInfo *param;
14603 Buffer *mBuf;
14604 #endif
14605 {
14606
14607    TRC3(cmPkTfuUePuschHqRecpInfo)
14608
14609
14610 #ifdef TFU_TDD
14611    CMCHKPK(SPkU8, param->ulDai, mBuf);
14612    CMCHKPK(SPkU8, param->nBundled, mBuf);
14613    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
14614 #endif
14615    CMCHKPK(SPkU8, param->hqBetaOff, mBuf);
14616    CMCHKPK(SPkU8, param->hqSz, mBuf);
14617    RETVALUE(ROK);
14618 }
14619
14620
14621 \f
14622 /***********************************************************
14623 *
14624 *     Func : cmUnpkTfuUePuschHqRecpInfo
14625 *
14626 *
14627 *     Desc : This structure is sent from scheduler to PHY in order to request the
14628   * reception of Harq info on PUSCH.
14629 *
14630 *
14631 *     Ret  : S16
14632 *
14633 *     Notes:
14634 *
14635 *     File  : 
14636 *
14637 **********************************************************/
14638 #ifdef ANSI
14639 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo
14640 (
14641 TfuUePuschHqRecpInfo *param,
14642 Buffer *mBuf
14643 )
14644 #else
14645 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo(param, mBuf)
14646 TfuUePuschHqRecpInfo *param;
14647 Buffer *mBuf;
14648 #endif
14649 {
14650
14651    TRC3(cmUnpkTfuUePuschHqRecpInfo)
14652
14653    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
14654    CMCHKUNPK(SUnpkU8, &param->hqBetaOff, mBuf);
14655
14656 #ifdef TFU_TDD
14657    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
14658    CMCHKUNPK(SUnpkU8, &param->nBundled, mBuf);
14659    CMCHKUNPK(SUnpkU8, &param->ulDai, mBuf);
14660 #endif
14661    RETVALUE(ROK);
14662 }
14663
14664
14665 \f
14666 /***********************************************************
14667 *
14668 *     Func : cmPkTfuUePuschRecpReq
14669 *
14670 *
14671 *     Desc : This structure is sent from scheduler to PHY in order to request the
14672   * reception of UEs data on PUSCH. This may contain the following: 
14673   * -# Data
14674   * -# Data + SRS
14675   * -# Data + HARQ
14676   * -# Data + HARQ + SRS
14677   * -# Data + CQI/RI
14678   * -# Data + CQI/RI + SRS
14679   * -# Data + CQI/RI + HARQ
14680   * -# Data + CQI/RI + HARQ + SRS
14681 *
14682 *
14683 *     Ret  : S16
14684 *
14685 *     Notes:
14686 *
14687 *     File  : 
14688 *
14689 **********************************************************/
14690 #ifdef ANSI
14691 PUBLIC S16 cmPkTfuUePuschRecpReq
14692 (
14693 TfuUePuschRecpReq *param,
14694 Buffer *mBuf
14695 )
14696 #else
14697 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
14698 TfuUePuschRecpReq *param;
14699 Buffer *mBuf;
14700 #endif
14701 {
14702
14703    TRC3(cmPkTfuUePuschRecpReq)
14704
14705    CMCHKPK(cmPkTknU8, &param->initialNumRbs, mBuf);
14706    CMCHKPK(cmPkTknU8, &param->initialNSrs, mBuf);
14707    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14708    CMCHKPK(cmPkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14709    CMCHKPK(cmPkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14710    CMCHKPK(cmPkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14711    CMCHKPK(SPkU32, param->rcpInfo, mBuf);
14712    RETVALUE(ROK);
14713 }
14714
14715
14716 \f
14717 /***********************************************************
14718 *
14719 *     Func : cmUnpkTfuUePuschRecpReq
14720 *
14721 *
14722 *     Desc : This structure is sent from scheduler to PHY in order to request the
14723   * reception of UEs data on PUSCH. This may contain the following: 
14724   * -# Data
14725   * -# Data + SRS
14726   * -# Data + HARQ
14727   * -# Data + HARQ + SRS
14728   * -# Data + CQI/RI
14729   * -# Data + CQI/RI + SRS
14730   * -# Data + CQI/RI + HARQ
14731   * -# Data + CQI/RI + HARQ + SRS
14732 *
14733 *
14734 *     Ret  : S16
14735 *
14736 *     Notes:
14737 *
14738 *     File  : 
14739 *
14740 **********************************************************/
14741 #ifdef ANSI
14742 PUBLIC S16 cmUnpkTfuUePuschRecpReq
14743 (
14744 TfuUePuschRecpReq *param,
14745 Buffer *mBuf
14746 )
14747 #else
14748 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14749 TfuUePuschRecpReq *param;
14750 Buffer *mBuf;
14751 #endif
14752 {
14753
14754    TRC3(cmUnpkTfuUePuschRecpReq)
14755
14756    CMCHKUNPK(SUnpkU32, (U32 *)&param->rcpInfo, mBuf);
14757    CMCHKUNPK(cmUnpkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14758    CMCHKUNPK(cmUnpkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14759    CMCHKUNPK(cmUnpkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14760    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14761    CMCHKUNPK(cmUnpkTknU8, &param->initialNSrs, mBuf);
14762    CMCHKUNPK(cmUnpkTknU8, &param->initialNumRbs, mBuf);
14763    RETVALUE(ROK);
14764 }
14765
14766
14767 \f
14768 /***********************************************************
14769 *
14770 *     Func : cmPkTfuUeRecpReqInfo
14771 *
14772 *
14773 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14774  * data. This contains information needed by PHY to decode the data sent by the
14775  * UE.
14776 *
14777 *
14778 *     Ret  : S16
14779 *
14780 *     Notes:
14781 *
14782 *     File  : 
14783 *
14784 **********************************************************/
14785 #ifdef ANSI
14786 PUBLIC S16 cmPkTfuUeRecpReqInfo
14787 (
14788 TfuUeRecpReqInfo *param,
14789 Buffer *mBuf
14790 )
14791 #else
14792 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14793 TfuUeRecpReqInfo *param;
14794 Buffer *mBuf;
14795 #endif
14796 {
14797
14798    TRC3(cmPkTfuUeRecpReqInfo)
14799
14800       switch(param->type) {
14801          case TFU_RECP_REQ_PUSCH:
14802             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14803             break;
14804          case TFU_RECP_REQ_PUCCH:
14805             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14806             break;
14807          default :
14808             RETVALUE(RFAILED);
14809       }
14810    CMCHKPK(SPkU32, param->type, mBuf);
14811 #ifdef TFU_5GTF
14812    CMCHKPK(SPkU8, param->groupId, mBuf);
14813 #endif /* TFU_5GTF */
14814    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14815    RETVALUE(ROK);
14816 }
14817
14818
14819 \f
14820 /***********************************************************
14821 *
14822 *     Func : cmUnpkTfuUeRecpReqInfo
14823 *
14824 *
14825 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14826  * data. This contains information needed by PHY to decode the data sent by the
14827  * UE.
14828 *
14829 *
14830 *     Ret  : S16
14831 *
14832 *     Notes:
14833 *
14834 *     File  : 
14835 *
14836 **********************************************************/
14837 #ifdef ANSI
14838 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
14839 (
14840 TfuUeRecpReqInfo *param,
14841 Buffer *mBuf
14842 )
14843 #else
14844 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14845 TfuUeRecpReqInfo *param;
14846 Buffer *mBuf;
14847 #endif
14848 {
14849
14850    TRC3(cmUnpkTfuUeRecpReqInfo)
14851
14852    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14853 #ifdef TFU_5GTF
14854    CMCHKUNPK(SUnpkU8, &param->groupId, mBuf);
14855 #endif /* TFU_5GTF */
14856    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14857       switch(param->type) {
14858          case TFU_RECP_REQ_PUCCH:
14859             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14860             break;
14861          case TFU_RECP_REQ_PUSCH:
14862             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14863             break;
14864          default :
14865             RETVALUE(RFAILED);
14866       }
14867    RETVALUE(ROK);
14868 }
14869 #endif /* TFU_UPGRADE */
14870 #ifndef TFU_UPGRADE  /* TFU_UPGRADE */
14871 /***********************************************************
14872 *
14873 *     Func : cmPkTfuUePucchRecpReq
14874 *
14875 *
14876 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14877   * reception of an UEs data on PUCCH. This may contain the following: 
14878   * -# HARQ-ACK 
14879   * -# Scheduling Request (SR)
14880   * -# HARQ-ACK and SR
14881   * -# CQI
14882   * -# CQI and HARQ-ACK
14883 *
14884 *
14885 *     Ret  : S16
14886 *
14887 *     Notes:
14888 *
14889 *     File  : 
14890 *
14891 **********************************************************/
14892 #ifdef ANSI
14893 PUBLIC S16 cmPkTfuUePucchRecpReq
14894 (
14895 TfuUePucchRecpReq *param,
14896 Buffer *mBuf
14897 )
14898 #else
14899 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14900 TfuUePucchRecpReq *param;
14901 Buffer *mBuf;
14902 #endif
14903 {
14904
14905 #ifdef TFU_TDD
14906    S32 i;
14907 #endif
14908    TRC3(cmPkTfuUePucchRecpReq)
14909
14910
14911 #ifdef TFU_TDD
14912    for (i=TFU_MAX_M-1; i >= 0; i--) {
14913       CMCHKPK(SPkU8, param->p[i], mBuf);
14914    }
14915    for (i=TFU_MAX_M-1; i >= 0; i--) {
14916       CMCHKPK(SPkU8, param->m[i], mBuf);
14917    }
14918    CMCHKPK(SPkU8, param->M, mBuf);
14919    CMCHKPK(SPkU8, param->multCnt, mBuf);
14920
14921 #endif
14922    CMCHKPK(SPkU32, param->type, mBuf);
14923       switch(param->hqType) {
14924          case TFU_HQ_RECP_REQ_N1PUCCH:
14925             CMCHKPK(SPkU16, param->t.n1Pucch, mBuf);
14926             break;
14927    
14928 #ifdef TFU_TDD
14929          case TFU_HQ_RECP_REQ_NORMAL:
14930             for (i=TFU_MAX_M-1; i >= 0; i--) {
14931                CMCHKPK(SPkU16, param->t.nCce[i], mBuf);
14932             }
14933             break;
14934    
14935 #endif
14936    
14937 #ifndef TFU_TDD
14938          case TFU_HQ_RECP_REQ_NORMAL:
14939             CMCHKPK(SPkU16, param->t.nCce, mBuf);
14940             break;
14941    
14942 #endif
14943          default :
14944             RETVALUE(RFAILED);
14945       }
14946    CMCHKPK(SPkU32, param->hqType, mBuf);
14947    RETVALUE(ROK);
14948 }
14949
14950
14951 \f
14952 /***********************************************************
14953 *
14954 *     Func : cmUnpkTfuUePucchRecpReq
14955 *
14956 *
14957 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14958   * reception of an UEs data on PUCCH. This may contain the following: 
14959   * -# HARQ-ACK 
14960   * -# Scheduling Request (SR)
14961   * -# HARQ-ACK and SR
14962   * -# CQI
14963   * -# CQI and HARQ-ACK
14964 *
14965 *
14966 *     Ret  : S16
14967 *
14968 *     Notes:
14969 *
14970 *     File  : 
14971 *
14972 **********************************************************/
14973 #ifdef ANSI
14974 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14975 (
14976 TfuUePucchRecpReq *param,
14977 Buffer *mBuf
14978 )
14979 #else
14980 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14981 TfuUePucchRecpReq *param;
14982 Buffer *mBuf;
14983 #endif
14984 {
14985
14986 #ifdef TFU_TDD
14987    S32 i;
14988 #endif
14989    TRC3(cmUnpkTfuUePucchRecpReq)
14990
14991    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqType, mBuf);
14992       switch(param->hqType) {
14993    
14994 #ifndef TFU_TDD
14995          case TFU_HQ_RECP_REQ_NORMAL:
14996             CMCHKUNPK(SUnpkU16, &param->t.nCce, mBuf);
14997             break;
14998    
14999 #endif
15000    
15001 #ifdef TFU_TDD
15002          case TFU_HQ_RECP_REQ_NORMAL:
15003             for (i=0; i<TFU_MAX_M; i++) {
15004                CMCHKUNPK(SUnpkU16, &param->t.nCce[i], mBuf);
15005             }
15006             break;
15007    
15008 #endif
15009          case TFU_HQ_RECP_REQ_N1PUCCH:
15010             CMCHKUNPK(SUnpkU16, &param->t.n1Pucch, mBuf);
15011             break;
15012          default :
15013             RETVALUE(RFAILED);
15014       }
15015    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
15016
15017 #ifdef TFU_TDD
15018    CMCHKUNPK(SUnpkU8, &param->multCnt, mBuf);
15019    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
15020    for (i=0; i<TFU_MAX_M; i++) {
15021       CMCHKUNPK(SUnpkU8, &param->m[i], mBuf);
15022    }
15023    for (i=0; i<TFU_MAX_M; i++) {
15024       CMCHKUNPK(SUnpkU8, &param->p[i], mBuf);
15025    }
15026
15027 #endif
15028    RETVALUE(ROK);
15029 }
15030
15031
15032 \f
15033 /***********************************************************
15034 *
15035 *     Func : cmPkTfuUeMsg3RecpReq
15036 *
15037 *
15038 *     Desc : This structure is sent from scheduler to PHY in order to request the
15039   * reception of UEs data sent as MSG3 for Random access.
15040 *
15041 *
15042 *     Ret  : S16
15043 *
15044 *     Notes:
15045 *
15046 *     File  : 
15047 *
15048 **********************************************************/
15049 #ifdef ANSI
15050 PUBLIC S16 cmPkTfuUeMsg3RecpReq
15051 (
15052 TfuUeMsg3RecpReq *param,
15053 Buffer *mBuf
15054 )
15055 #else
15056 PUBLIC S16 cmPkTfuUeMsg3RecpReq(param, mBuf)
15057 TfuUeMsg3RecpReq *param;
15058 Buffer *mBuf;
15059 #endif
15060 {
15061
15062    TRC3(cmPkTfuUeMsg3RecpReq)
15063
15064    CMCHKPK(SPkU32, param->modType, mBuf);
15065    CMCHKPK(SPkU16, param->size, mBuf);
15066    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
15067    CMCHKPK(SPkU8, param->nDmrs, mBuf);
15068    CMCHKPK(SPkU8, param->rv, mBuf);
15069    CMCHKPK(SPkU8, param->ndi, mBuf);
15070    CMCHKPK(SPkU8, param->harqProcId, mBuf);
15071    CMCHKPK(SPkU8, param->isRtx, mBuf);
15072    CMCHKPK(SPkU8, param->ulDelay, mBuf);
15073    CMCHKPK(SPkU8, param->expCqi, mBuf);
15074    CMCHKPK(SPkU8, param->mcs, mBuf);
15075    CMCHKPK(SPkU8, param->numRb, mBuf);
15076    CMCHKPK(SPkU8, param->rbStart, mBuf);
15077    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
15078    RETVALUE(ROK);
15079 }
15080
15081
15082 \f
15083 /***********************************************************
15084 *
15085 *     Func : cmUnpkTfuUeMsg3RecpReq
15086 *
15087 *
15088 *     Desc : This structure is sent from scheduler to PHY in order to request the
15089   * reception of UEs data sent as MSG3 for Random access.
15090 *
15091 *
15092 *     Ret  : S16
15093 *
15094 *     Notes:
15095 *
15096 *     File  : 
15097 *
15098 **********************************************************/
15099 #ifdef ANSI
15100 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq
15101 (
15102 TfuUeMsg3RecpReq *param,
15103 Buffer *mBuf
15104 )
15105 #else
15106 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq(param, mBuf)
15107 TfuUeMsg3RecpReq *param;
15108 Buffer *mBuf;
15109 #endif
15110 {
15111
15112    TRC3(cmUnpkTfuUeMsg3RecpReq)
15113
15114    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
15115    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
15116    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
15117    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
15118    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
15119    CMCHKUNPK(SUnpkU8, &param->ulDelay, mBuf);
15120    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
15121    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
15122    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
15123    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
15124    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
15125    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
15126    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
15127    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
15128    RETVALUE(ROK);
15129 }
15130
15131
15132 \f
15133 /***********************************************************
15134 *
15135 *     Func : cmPkTfuUePuschRecpReq
15136 *
15137 *
15138 *     Desc : This structure is sent from scheduler to PHY in order to request the
15139   * reception of UEs data on PUSCH. This may contain the following: 
15140   * -# Data
15141   * -# Data + CQI and RI
15142   * -# Data + CQI and HARQ
15143 *
15144 *
15145 *     Ret  : S16
15146 *
15147 *     Notes:
15148 *
15149 *     File  : 
15150 *
15151 **********************************************************/
15152 #ifdef ANSI
15153 PUBLIC S16 cmPkTfuUePuschRecpReq
15154 (
15155 TfuUePuschRecpReq *param,
15156 Buffer *mBuf
15157 )
15158 #else
15159 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
15160 TfuUePuschRecpReq *param;
15161 Buffer *mBuf;
15162 #endif
15163 {
15164
15165    TRC3(cmPkTfuUePuschRecpReq)
15166
15167    CMCHKPK(SPkU32, param->modType, mBuf);
15168    CMCHKPK(SPkU16, param->size, mBuf);
15169    CMCHKPK(SPkU32, param->mode, mBuf);
15170    CMCHKPK(SPkU8, param->expHarq, mBuf);
15171    CMCHKPK(SPkU8, param->expCqi, mBuf);
15172    CMCHKPK(SPkU8, param->nDmrs, mBuf);
15173    CMCHKPK(SPkU8, param->rv, mBuf);
15174    CMCHKPK(SPkU8, param->isRtx, mBuf);
15175    CMCHKPK(SPkU8, param->ndi, mBuf);
15176    CMCHKPK(SPkU8, param->harqProcId, mBuf);
15177    CMCHKPK(SPkU8, param->mcs, mBuf);
15178    CMCHKPK(SPkU8, param->numRb, mBuf);
15179    CMCHKPK(SPkU8, param->rbStart, mBuf);
15180    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
15181    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
15182    RETVALUE(ROK);
15183 }
15184
15185
15186 \f
15187 /***********************************************************
15188 *
15189 *     Func : cmUnpkTfuUePuschRecpReq
15190 *
15191 *
15192 *     Desc : This structure is sent from scheduler to PHY in order to request the
15193   * reception of UEs data on PUSCH. This may contain the following: 
15194   * -# Data
15195   * -# Data + CQI and RI
15196   * -# Data + CQI and HARQ
15197 *
15198 *
15199 *     Ret  : S16
15200 *
15201 *     Notes:
15202 *
15203 *     File  : 
15204 *
15205 **********************************************************/
15206 #ifdef ANSI
15207 PUBLIC S16 cmUnpkTfuUePuschRecpReq
15208 (
15209 TfuUePuschRecpReq *param,
15210 Buffer *mBuf
15211 )
15212 #else
15213 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
15214 TfuUePuschRecpReq *param;
15215 Buffer *mBuf;
15216 #endif
15217 {
15218
15219    TRC3(cmUnpkTfuUePuschRecpReq)
15220
15221    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
15222    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
15223    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
15224    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
15225    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
15226    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
15227    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
15228    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
15229    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
15230    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
15231    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
15232    CMCHKUNPK(SUnpkU8, &param->expHarq, mBuf);
15233    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
15234    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
15235    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
15236    RETVALUE(ROK);
15237 }
15238
15239
15240 \f
15241 /***********************************************************
15242 *
15243 *     Func : cmPkTfuUeRecpReqInfo
15244 *
15245 *
15246 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15247  * data. This contains information needed by PHY to decode the data sent by the
15248  * UE.
15249 *
15250 *
15251 *     Ret  : S16
15252 *
15253 *     Notes:
15254 *
15255 *     File  : 
15256 *
15257 **********************************************************/
15258 #ifdef ANSI
15259 PUBLIC S16 cmPkTfuUeRecpReqInfo
15260 (
15261 TfuUeRecpReqInfo *param,
15262 Buffer *mBuf
15263 )
15264 #else
15265 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
15266 TfuUeRecpReqInfo *param;
15267 Buffer *mBuf;
15268 #endif
15269 {
15270
15271    TRC3(cmPkTfuUeRecpReqInfo)
15272
15273       switch(param->type) {
15274          case TFU_RECP_REQ_PUSCH:
15275             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15276             break;
15277          case TFU_RECP_REQ_MSG3:
15278             CMCHKPK(cmPkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15279             break;
15280          case TFU_RECP_REQ_PUCCH:
15281             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15282             break;
15283          default :
15284             RETVALUE(RFAILED);
15285       }
15286    CMCHKPK(SPkU32, param->type, mBuf);
15287    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
15288    RETVALUE(ROK);
15289 }
15290
15291
15292 \f
15293 /***********************************************************
15294 *
15295 *     Func : cmUnpkTfuUeRecpReqInfo
15296 *
15297 *
15298 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15299  * data. This contains information needed by PHY to decode the data sent by the
15300  * UE.
15301 *
15302 *
15303 *     Ret  : S16
15304 *
15305 *     Notes:
15306 *
15307 *     File  : 
15308 *
15309 **********************************************************/
15310 #ifdef ANSI
15311 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
15312 (
15313 TfuUeRecpReqInfo *param,
15314 Buffer *mBuf
15315 )
15316 #else
15317 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
15318 TfuUeRecpReqInfo *param;
15319 Buffer *mBuf;
15320 #endif
15321 {
15322
15323    TRC3(cmUnpkTfuUeRecpReqInfo)
15324
15325    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
15326    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
15327       switch(param->type) {
15328          case TFU_RECP_REQ_PUCCH:
15329             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15330             break;
15331          case TFU_RECP_REQ_MSG3:
15332             CMCHKUNPK(cmUnpkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15333             break;
15334          case TFU_RECP_REQ_PUSCH:
15335             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15336             break;
15337          default :
15338             RETVALUE(RFAILED);
15339       }
15340    RETVALUE(ROK);
15341 }
15342
15343
15344 #endif /* ifndef TFU_UPGRADE */
15345 /*LAA: Packing and Unpacking*/
15346
15347 /***********************************************************
15348 *
15349 *     Func : cmPkTfuErrIndInfo
15350 *
15351 *
15352 *     Desc : This structure contains information that is passed as a part of
15353 *     the ERR indication sent from PHY to MAC.
15354 *
15355 *
15356 *     Ret  : S16
15357 *
15358 *     Notes:
15359 *
15360 *     File  : 
15361 *
15362 **********************************************************/
15363 #ifdef ANSI
15364 PRIVATE S16 cmPkTfuErrIndInfo
15365 (
15366 TfuErrIndInfo *param,
15367 Buffer *mBuf
15368 )
15369 #else
15370 PRIVATE S16 cmPkTfuErrIndInfo(param, mBuf)
15371 TfuErrIndInfo *param;
15372 Buffer *mBuf;
15373 #endif
15374 {
15375
15376    TRC3(cmPkTfuErrIndInfo)
15377
15378    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
15379    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
15380    RETVALUE(ROK);
15381 }
15382 /***********************************************************
15383 *
15384 *     Func : cmUnpkTfuErrIndInfo
15385 *
15386 *
15387 *     Desc : This structure contains information that is passed as a part of the ERR
15388  * indication sent from PHY to MAC.
15389 *
15390 *
15391 *     Ret  : S16
15392 *
15393 *     Notes:
15394 *
15395 *     File  : 
15396 *
15397 **********************************************************/
15398 #ifdef ANSI
15399 PRIVATE S16 cmUnpkTfuErrIndInfo
15400 (
15401 TfuErrIndInfo *param,
15402 Buffer *mBuf
15403 )
15404 #else
15405 PRIVATE S16 cmUnpkTfuErrIndInfo(param, mBuf)
15406 TfuErrIndInfo *param;
15407 Buffer *mBuf;
15408 #endif
15409 {
15410
15411    TRC3(cmUnpkTfuErrIndInfo)
15412
15413    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
15414    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
15415    RETVALUE(ROK);
15416 }
15417
15418 /***********************************************************
15419 *
15420 *     Func : cmPkTfuErrInd
15421 *
15422 *
15423  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15424  *      Currently invoked in the cases when the Unlicensed SCell transmission
15425  *      fails.
15426  *      This API contains the Cell and subframe information for which the
15427  *      transmission failed. 
15428  *           
15429  *  @param[in]  Pst                *pst
15430  *  @param[in]  SuId               suId 
15431  *  @param[in]  TfuErrIndInfo      *errIndInfo 
15432  *  @return  S16
15433  *      -# ROK 
15434  *      -# RFAILED 
15435 *
15436 *
15437 *     Ret  : S16
15438 *
15439 *     Notes:
15440 *
15441 *     File  : 
15442 *
15443 **********************************************************/
15444 #ifdef ANSI
15445 PUBLIC S16 cmPkTfuErrInd
15446 (
15447 Pst * pst,
15448 SuId suId,
15449 TfuErrIndInfo * errInd
15450 )
15451 #else
15452 PUBLIC S16 cmPkTfuErrInd(pst, suId, errInd)
15453 Pst * pst;
15454 SuId suId;
15455 TfuErrIndInfo * errInd;
15456 #endif
15457 {
15458    Buffer *mBuf = NULLP;
15459    TRC3(cmPkTfuErrInd)
15460
15461    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
15462 #if (ERRCLASS & ERRCLS_ADD_RES)
15463       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15464          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15465          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
15466 #endif
15467       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15468       RETVALUE(RFAILED);
15469    }
15470    if (pst->selector == TFU_SEL_LC) {
15471       if (cmPkTfuErrIndInfo(errInd, mBuf) != ROK) {
15472 #if (ERRCLASS & ERRCLS_ADD_RES)
15473          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15474             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15475             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
15476 #endif
15477          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15478          TFU_FREE_MSG(mBuf);
15479          RETVALUE(RFAILED);
15480       }
15481    }
15482    else if(pst->selector == TFU_SEL_LWLC)
15483    {
15484       if (cmPkPtr((PTR)errInd, mBuf) != ROK)
15485       {
15486 #if (ERRCLASS & ERRCLS_ADD_RES)
15487          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15488             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15489             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
15490 #endif
15491          
15492          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
15493          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15494          TFU_FREE_MSG(mBuf);
15495          RETVALUE(RFAILED);
15496       }
15497    }
15498
15499    if (SPkS16(suId, mBuf) != ROK) {
15500 #if (ERRCLASS & ERRCLS_ADD_RES)
15501       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15502          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15503          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
15504 #endif
15505       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15506       TFU_FREE_MSG(mBuf);
15507       RETVALUE(RFAILED);
15508    }
15509    if (pst->selector != TFU_SEL_LWLC) {
15510       if (SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo)) != ROK) {
15511 #if (ERRCLASS & ERRCLS_ADD_RES)
15512       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15513          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15514          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
15515 #endif
15516          TFU_FREE_MSG(mBuf);
15517          RETVALUE(RFAILED);
15518       }
15519    }
15520
15521    pst->event = (Event) EVTTFUERRIND;
15522    RETVALUE(SPstTsk(pst,mBuf));
15523 }
15524
15525 \f
15526 /***********************************************************
15527 *
15528 *     Func : cmUnpkTfuErrInd
15529 *
15530 *
15531  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15532  *      Currently invoked in the cases when the Unlicensed SCell transmission
15533  *      fails.
15534  *      This API contains the Cell and subframe information for which the
15535  *      transmission failed. 
15536  * @param pst Pointer to the post structure.
15537  * @param suId SAP ID of the service user.
15538  * @param errInd Pointer to the TfuErrIndInfo.
15539  * @return ROK/RFAILED
15540 *
15541 *
15542 *     Ret  : S16
15543 *
15544 *     Notes:
15545 *
15546 *     File  : 
15547 *
15548 **********************************************************/
15549 #ifdef ANSI
15550 PUBLIC S16 cmUnpkTfuErrInd
15551 (
15552 TfuErrInd func,
15553 Pst *pst,
15554 Buffer *mBuf
15555 )
15556 #else
15557 PUBLIC S16 cmUnpkTfuErrInd(func, pst, mBuf)
15558 TfuErrInd func;
15559 Pst *pst;
15560 Buffer *mBuf;
15561 #endif
15562 {
15563    SuId suId;
15564    TfuErrIndInfo *errInd;
15565    
15566    TRC3(cmUnpkTfuErrInd)
15567
15568    if (SUnpkS16(&suId, mBuf) != ROK) {
15569       TFU_FREE_MSG(mBuf);
15570 #if (ERRCLASS & ERRCLS_ADD_RES)
15571       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15572          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15573          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
15574 #endif
15575       RETVALUE(RFAILED);
15576    }
15577    if (pst->selector != TFU_SEL_LWLC) {
15578       if ((SGetSBuf(pst->region, pst->pool, (Data **)&errInd, sizeof(TfuErrIndInfo))) != ROK) {
15579 #if (ERRCLASS & ERRCLS_ADD_RES)
15580          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15581             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15582             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
15583 #endif
15584          TFU_FREE_MSG(mBuf);
15585          RETVALUE(RFAILED);
15586       }
15587    }
15588
15589    if (pst->selector == TFU_SEL_LC) 
15590    {
15591       if (cmUnpkTfuErrIndInfo(errInd, mBuf) != ROK) {
15592          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15593          TFU_FREE_MSG(mBuf);
15594 #if (ERRCLASS & ERRCLS_ADD_RES)
15595          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15596                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15597                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
15598 #endif
15599          RETVALUE(RFAILED);
15600       }
15601    }
15602    else if(pst->selector == TFU_SEL_LWLC)
15603    {
15604       if (cmUnpkPtr((PTR *)&errInd, mBuf) != ROK)
15605       {
15606 #if (ERRCLASS & ERRCLS_ADD_RES)
15607          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15608             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15609             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
15610 #endif
15611          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15612          TFU_FREE_MSG(mBuf);
15613          RETVALUE(RFAILED);
15614       }
15615    }
15616    TFU_FREE_MSG(mBuf);
15617    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
15618    (*func)(pst, suId, errInd);
15619    SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15620    RETVALUE(ROK);
15621
15622 }
15623 #endif /* if defined(LCTFU) */
15624
15625 /**********************************************************************
15626          End of file
15627  **********************************************************************/