MAC Clean-up [Issue-ID: ODUHIGH-212]
[o-du/l2.git] / src / cm / tfu.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18 \f
19
20 /************************************************************************
21  
22      Name:     LTE-MAC layer
23   
24      Type:     C source file
25   
26      Desc:     C source code for pack/unpack of TFU interface primitives. 
27   
28      File:     tfu.c 
29   
30 **********************************************************************/
31
32 /** @file tfu.c
33 @brief This file contains the packing/unpacking code for the TFU interface 
34        primitives.
35 */
36
37 /* header include files (.h) */
38 #include "common_def.h" 
39 #include "tfu.h"           /* RGU Interface defines */
40
41 /* header/extern include files (.x) */
42 #include "tfu.x"           /* RGU Interface includes */
43
44 #include "du_app_mac_inf.h"
45 //#include "mac_sch_interface.h"
46
47 #if (defined(LCTFU))
48
49 \f
50 /***********************************************************
51 *
52 *     Func : cmPkTfuBndReq
53 *
54 *
55 *     Desc : This API is used to send a Bind Request from MAC to PHY.
56  * @param pst Pointer to the post structure.
57  * @param suId SAP ID of the service user.
58  * @param spId SAP ID of the service provider.
59  * @return ROK/RFAILED
60 *
61 *
62 *     Ret  : S16
63 *
64 *     Notes:
65 *
66 *     File  : 
67 *
68 **********************************************************/
69 #ifdef ANSI
70 PUBLIC S16 cmPkTfuBndReq
71 (
72 Pst * pst,
73 SuId suId,
74 SpId spId
75 )
76 #else
77 PUBLIC S16 cmPkTfuBndReq(pst, suId, spId)
78 Pst * pst;
79 SuId suId;
80 SpId spId;
81 #endif
82 {
83    Buffer *mBuf = NULLP;
84    TRC3(cmPkTfuBndReq)
85
86    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
87 #if (ERRCLASS & ERRCLS_ADD_RES)
88       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
89          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
90          (ErrVal)ETFU001, (ErrVal)0, "Packing failed");
91 #endif
92       RETVALUE(RFAILED);
93    }
94    if (SPkS16(spId, mBuf) != ROK) {
95 #if (ERRCLASS & ERRCLS_ADD_RES)
96       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
97          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
98          (ErrVal)ETFU002, (ErrVal)0, "Packing failed");
99 #endif
100       TFU_FREE_MSG(mBuf);
101       RETVALUE(RFAILED);
102    }
103    if (SPkS16(suId, mBuf) != ROK) {
104 #if (ERRCLASS & ERRCLS_ADD_RES)
105       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
106          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
107          (ErrVal)ETFU003, (ErrVal)0, "Packing failed");
108 #endif
109       TFU_FREE_MSG(mBuf);
110       RETVALUE(RFAILED);
111    }
112    pst->event = (Event) EVTTFUBNDREQ;
113    RETVALUE(SPstTsk(pst,mBuf));
114 }
115
116 \f
117 /***********************************************************
118 *
119 *     Func : cmUnpkTfuBndReq
120 *
121 *
122 *     Desc : This API is used to send a Bind Request from MAC to PHY.
123  * @param pst Pointer to the post structure.
124  * @param suId SAP ID of the service user.
125  * @param spId SAP ID of the service provider.
126  * @return ROK/RFAILED
127 *
128 *
129 *     Ret  : S16
130 *
131 *     Notes:
132 *
133 *     File  : 
134 *
135 **********************************************************/
136 #ifdef ANSI
137 PUBLIC S16 cmUnpkTfuBndReq
138 (
139 TfuBndReq func,
140 Pst *pst,
141 Buffer *mBuf
142 )
143 #else
144 PUBLIC S16 cmUnpkTfuBndReq(func, pst, mBuf)
145 TfuBndReq func;
146 Pst *pst;
147 Buffer *mBuf;
148 #endif
149 {
150    SuId suId;
151    SpId spId;
152    
153    TRC3(cmUnpkTfuBndReq)
154
155    if (SUnpkS16(&suId, mBuf) != ROK) {
156       TFU_FREE_MSG(mBuf);
157 #if (ERRCLASS & ERRCLS_ADD_RES)
158       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
159          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
160          (ErrVal)ETFU004, (ErrVal)0, "Packing failed");
161 #endif
162       RETVALUE(RFAILED);
163    }
164    if (SUnpkS16(&spId, mBuf) != ROK) {
165       TFU_FREE_MSG(mBuf);
166 #if (ERRCLASS & ERRCLS_ADD_RES)
167       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
168          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
169          (ErrVal)ETFU005, (ErrVal)0, "Packing failed");
170 #endif
171       RETVALUE(RFAILED);
172    }
173    TFU_FREE_MSG(mBuf);
174    RETVALUE((*func)(pst, suId, spId));
175 }
176
177 \f
178 /***********************************************************
179 *
180 *     Func : cmPkTfuBndCfm
181 *
182 *
183 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
184  * @param pst Pointer to the post structure.
185  * @param suId SAP ID of the service user.
186  * @param status Status of the bind request.
187  * @return ROK/RFAILED
188 *
189 *
190 *     Ret  : S16
191 *
192 *     Notes:
193 *
194 *     File  : 
195 *
196 **********************************************************/
197 #ifdef ANSI
198 PUBLIC S16 cmPkTfuBndCfm
199 (
200 Pst * pst,
201 SuId suId,
202 U8 status
203 )
204 #else
205 PUBLIC S16 cmPkTfuBndCfm(pst, suId, status)
206 Pst * pst;
207 SuId suId;
208 U8 status;
209 #endif
210 {
211    Buffer *mBuf = NULLP;
212    TRC3(cmPkTfuBndCfm)
213
214    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
215 #if (ERRCLASS & ERRCLS_ADD_RES)
216       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
217          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
218          (ErrVal)ETFU006, (ErrVal)0, "Packing failed");
219 #endif
220       RETVALUE(RFAILED);
221    }
222    if (SPkU8(status, mBuf) != ROK) {
223 #if (ERRCLASS & ERRCLS_ADD_RES)
224       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
225          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
226          (ErrVal)ETFU007, (ErrVal)0, "Packing failed");
227 #endif
228       TFU_FREE_MSG(mBuf);
229       RETVALUE(RFAILED);
230    }
231    if (SPkS16(suId, mBuf) != ROK) {
232 #if (ERRCLASS & ERRCLS_ADD_RES)
233       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
234          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
235          (ErrVal)ETFU008, (ErrVal)0, "Packing failed");
236 #endif
237       TFU_FREE_MSG(mBuf);
238       RETVALUE(RFAILED);
239    }
240    pst->event = (Event) EVTTFUBNDCFM;
241    RETVALUE(SPstTsk(pst,mBuf));
242 }
243
244 \f
245 /***********************************************************
246 *
247 *     Func : cmUnpkTfuBndCfm
248 *
249 *
250 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
251  * @param pst Pointer to the post structure.
252  * @param suId SAP ID of the service user.
253  * @param status Status of the bind request.
254  * @return ROK/RFAILED
255 *
256 *
257 *     Ret  : S16
258 *
259 *     Notes:
260 *
261 *     File  : 
262 *
263 **********************************************************/
264 #ifdef ANSI
265 PUBLIC S16 cmUnpkTfuBndCfm
266 (
267 TfuBndCfm func,
268 Pst *pst,
269 Buffer *mBuf
270 )
271 #else
272 PUBLIC S16 cmUnpkTfuBndCfm(func, pst, mBuf)
273 TfuBndCfm func;
274 Pst *pst;
275 Buffer *mBuf;
276 #endif
277 {
278    SuId suId;
279    U8 status;
280    
281    TRC3(cmUnpkTfuBndCfm)
282
283    if (SUnpkS16(&suId, mBuf) != ROK) {
284       TFU_FREE_MSG(mBuf);
285 #if (ERRCLASS & ERRCLS_ADD_RES)
286       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
287          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
288          (ErrVal)ETFU009, (ErrVal)0, "Packing failed");
289 #endif
290       RETVALUE(RFAILED);
291    }
292    if (SUnpkU8(&status, mBuf) != ROK) {
293       TFU_FREE_MSG(mBuf);
294 #if (ERRCLASS & ERRCLS_ADD_RES)
295       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
296          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
297          (ErrVal)ETFU010, (ErrVal)0, "Packing failed");
298 #endif
299       RETVALUE(RFAILED);
300    }
301    TFU_FREE_MSG(mBuf);
302    RETVALUE((*func)(pst, suId, status));
303 }
304
305 \f
306 /***********************************************************
307 *
308 *     Func : cmPkTfuUbndReq
309 *
310 *
311 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
312  * @param pst Pointer to the post structure.
313  * @param suId SAP ID of the service provider.
314  * @param reason Reason for Unbind request.
315  * @return ROK/RFAILED
316 *
317 *
318 *     Ret  : S16
319 *
320 *     Notes:
321 *
322 *     File  : 
323 *
324 **********************************************************/
325 #ifdef ANSI
326 PUBLIC S16 cmPkTfuUbndReq
327 (
328 Pst * pst,
329 SpId spId,
330 Reason reason
331 )
332 #else
333 PUBLIC S16 cmPkTfuUbndReq(pst, spId, reason)
334 Pst * pst;
335 SpId spId;
336 Reason reason;
337 #endif
338 {
339    Buffer *mBuf = NULLP;
340    TRC3(cmPkTfuUbndReq)
341
342    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
343 #if (ERRCLASS & ERRCLS_ADD_RES)
344       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
345          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
346          (ErrVal)ETFU011, (ErrVal)0, "Packing failed");
347 #endif
348       RETVALUE(RFAILED);
349    }
350    if (SPkS16(reason, mBuf) != ROK) {
351 #if (ERRCLASS & ERRCLS_ADD_RES)
352       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
353          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
354          (ErrVal)ETFU012, (ErrVal)0, "Packing failed");
355 #endif
356       TFU_FREE_MSG(mBuf);
357       RETVALUE(RFAILED);
358    }
359    if (SPkS16(spId, mBuf) != ROK) {
360 #if (ERRCLASS & ERRCLS_ADD_RES)
361       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
362          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
363          (ErrVal)ETFU013, (ErrVal)0, "Packing failed");
364 #endif
365       TFU_FREE_MSG(mBuf);
366       RETVALUE(RFAILED);
367    }
368    pst->event = (Event) EVTTFUUBNDREQ;
369    RETVALUE(SPstTsk(pst,mBuf));
370 }
371
372 \f
373 /***********************************************************
374 *
375 *     Func : cmUnpkTfuUbndReq
376 *
377 *
378 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
379  * @param pst Pointer to the post structure.
380  * @param suId SAP ID of the service provider.
381  * @param reason Reason for Unbind request.
382  * @return ROK/RFAILED
383 *
384 *
385 *     Ret  : S16
386 *
387 *     Notes:
388 *
389 *     File  : 
390 *
391 **********************************************************/
392 #ifdef ANSI
393 PUBLIC S16 cmUnpkTfuUbndReq
394 (
395 TfuUbndReq func,
396 Pst *pst,
397 Buffer *mBuf
398 )
399 #else
400 PUBLIC S16 cmUnpkTfuUbndReq(func, pst, mBuf)
401 TfuUbndReq func;
402 Pst *pst;
403 Buffer *mBuf;
404 #endif
405 {
406    SpId spId;
407    Reason reason;
408    
409    TRC3(cmUnpkTfuUbndReq)
410
411    if (SUnpkS16(&spId, mBuf) != ROK) {
412       TFU_FREE_MSG(mBuf);
413 #if (ERRCLASS & ERRCLS_ADD_RES)
414       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
415          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
416          (ErrVal)ETFU014, (ErrVal)0, "Packing failed");
417 #endif
418       RETVALUE(RFAILED);
419    }
420    if (SUnpkS16(&reason, mBuf) != ROK) {
421       TFU_FREE_MSG(mBuf);
422 #if (ERRCLASS & ERRCLS_ADD_RES)
423       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
424          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
425          (ErrVal)ETFU015, (ErrVal)0, "Packing failed");
426 #endif
427       RETVALUE(RFAILED);
428    }
429    TFU_FREE_MSG(mBuf);
430    RETVALUE((*func)(pst, spId, reason));
431 }
432
433 \f
434 /***********************************************************
435 *
436 *     Func : cmPkTfuSchBndReq
437 *
438 *
439 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
440  * @param pst Pointer to the post structure.
441  * @param suId SAP ID of the service user.
442  * @param spId SAP ID of the service provider.
443  * @return ROK/RFAILED
444 *
445 *
446 *     Ret  : S16
447 *
448 *     Notes:
449 *
450 *     File  : 
451 *
452 **********************************************************/
453 #ifdef ANSI
454 PUBLIC S16 cmPkTfuSchBndReq
455 (
456 Pst * pst,
457 SuId suId,
458 SpId spId
459 )
460 #else
461 PUBLIC S16 cmPkTfuSchBndReq(pst, suId, spId)
462 Pst * pst;
463 SuId suId;
464 SpId spId;
465 #endif
466 {
467    Buffer *mBuf = NULLP;
468    TRC3(cmPkTfuSchBndReq)
469
470    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
471 #if (ERRCLASS & ERRCLS_ADD_RES)
472       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
473          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
474          (ErrVal)ETFU016, (ErrVal)0, "Packing failed");
475 #endif
476       RETVALUE(RFAILED);
477    }
478    if (SPkS16(spId, mBuf) != ROK) {
479 #if (ERRCLASS & ERRCLS_ADD_RES)
480       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
481          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
482          (ErrVal)ETFU017, (ErrVal)0, "Packing failed");
483 #endif
484       TFU_FREE_MSG(mBuf);
485       RETVALUE(RFAILED);
486    }
487    if (SPkS16(suId, mBuf) != ROK) {
488 #if (ERRCLASS & ERRCLS_ADD_RES)
489       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
490          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
491          (ErrVal)ETFU018, (ErrVal)0, "Packing failed");
492 #endif
493       TFU_FREE_MSG(mBuf);
494       RETVALUE(RFAILED);
495    }
496    pst->event = (Event) EVTTFUSCHBNDREQ;
497    RETVALUE(SPstTsk(pst,mBuf));
498 }
499
500 \f
501 /***********************************************************
502 *
503 *     Func : cmUnpkTfuSchBndReq
504 *
505 *
506 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
507  * @param pst Pointer to the post structure.
508  * @param suId SAP ID of the service user.
509  * @param spId SAP ID of the service provider.
510  * @return ROK/RFAILED
511 *
512 *
513 *     Ret  : S16
514 *
515 *     Notes:
516 *
517 *     File  : 
518 *
519 **********************************************************/
520 #ifdef ANSI
521 PUBLIC S16 cmUnpkTfuSchBndReq
522 (
523 TfuSchBndReq func,
524 Pst *pst,
525 Buffer *mBuf
526 )
527 #else
528 PUBLIC S16 cmUnpkTfuSchBndReq(func, pst, mBuf)
529 TfuSchBndReq func;
530 Pst *pst;
531 Buffer *mBuf;
532 #endif
533 {
534    SuId suId;
535    SpId spId;
536    
537    TRC3(cmUnpkTfuSchBndReq)
538
539    if (SUnpkS16(&suId, mBuf) != ROK) {
540       TFU_FREE_MSG(mBuf);
541 #if (ERRCLASS & ERRCLS_ADD_RES)
542       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
543          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
544          (ErrVal)ETFU019, (ErrVal)0, "Packing failed");
545 #endif
546       RETVALUE(RFAILED);
547    }
548    if (SUnpkS16(&spId, mBuf) != ROK) {
549       TFU_FREE_MSG(mBuf);
550 #if (ERRCLASS & ERRCLS_ADD_RES)
551       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
552          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
553          (ErrVal)ETFU020, (ErrVal)0, "Packing failed");
554 #endif
555       RETVALUE(RFAILED);
556    }
557    TFU_FREE_MSG(mBuf);
558    RETVALUE((*func)(pst, suId, spId));
559 }
560
561 \f
562 /***********************************************************
563 *
564 *     Func : cmPkTfuSchBndCfm
565 *
566 *
567 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
568  * @param pst Pointer to the post structure.
569  * @param suId SAP ID of the service user.
570  * @param status Status of the bind request.
571  * @return ROK/RFAILED
572 *
573 *
574 *     Ret  : S16
575 *
576 *     Notes:
577 *
578 *     File  : 
579 *
580 **********************************************************/
581 #ifdef ANSI
582 PUBLIC S16 cmPkTfuSchBndCfm
583 (
584 Pst * pst,
585 SuId suId,
586 U8 status
587 )
588 #else
589 PUBLIC S16 cmPkTfuSchBndCfm(pst, suId, status)
590 Pst * pst;
591 SuId suId;
592 U8 status;
593 #endif
594 {
595    Buffer *mBuf = NULLP;
596    TRC3(cmPkTfuSchBndCfm)
597
598    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
599 #if (ERRCLASS & ERRCLS_ADD_RES)
600       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
601          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
602          (ErrVal)ETFU021, (ErrVal)0, "Packing failed");
603 #endif
604       RETVALUE(RFAILED);
605    }
606    if (SPkU8(status, mBuf) != ROK) {
607 #if (ERRCLASS & ERRCLS_ADD_RES)
608       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
609          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
610          (ErrVal)ETFU022, (ErrVal)0, "Packing failed");
611 #endif
612       TFU_FREE_MSG(mBuf);
613       RETVALUE(RFAILED);
614    }
615    if (SPkS16(suId, mBuf) != ROK) {
616 #if (ERRCLASS & ERRCLS_ADD_RES)
617       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
618          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
619          (ErrVal)ETFU023, (ErrVal)0, "Packing failed");
620 #endif
621       TFU_FREE_MSG(mBuf);
622       RETVALUE(RFAILED);
623    }
624    pst->event = (Event) EVTTFUSCHBNDCFM;
625    RETVALUE(SPstTsk(pst,mBuf));
626 }
627
628 \f
629 /***********************************************************
630 *
631 *     Func : cmUnpkTfuSchBndCfm
632 *
633 *
634 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
635  * @param pst Pointer to the post structure.
636  * @param suId SAP ID of the service user.
637  * @param status Status of the bind request.
638  * @return ROK/RFAILED
639 *
640 *
641 *     Ret  : S16
642 *
643 *     Notes:
644 *
645 *     File  : 
646 *
647 **********************************************************/
648 #ifdef ANSI
649 PUBLIC S16 cmUnpkTfuSchBndCfm
650 (
651 TfuSchBndCfm func,
652 Pst *pst,
653 Buffer *mBuf
654 )
655 #else
656 PUBLIC S16 cmUnpkTfuSchBndCfm(func, pst, mBuf)
657 TfuSchBndCfm func;
658 Pst *pst;
659 Buffer *mBuf;
660 #endif
661 {
662    SuId suId;
663    U8 status;
664    
665    TRC3(cmUnpkTfuSchBndCfm)
666
667    if (SUnpkS16(&suId, mBuf) != ROK) {
668       TFU_FREE_MSG(mBuf);
669 #if (ERRCLASS & ERRCLS_ADD_RES)
670       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
671          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
672          (ErrVal)ETFU024, (ErrVal)0, "Packing failed");
673 #endif
674       RETVALUE(RFAILED);
675    }
676    if (SUnpkU8(&status, mBuf) != ROK) {
677       TFU_FREE_MSG(mBuf);
678 #if (ERRCLASS & ERRCLS_ADD_RES)
679       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
680          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
681          (ErrVal)ETFU025, (ErrVal)0, "Packing failed");
682 #endif
683       RETVALUE(RFAILED);
684    }
685    TFU_FREE_MSG(mBuf);
686    RETVALUE((*func)(pst, suId, status));
687 }
688
689 \f
690 /***********************************************************
691 *
692 *     Func : cmPkTfuSchUbndReq
693 *
694 *
695 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
696  * @param pst Pointer to the post structure.
697  * @param suId SAP ID of the service provider.
698  * @param reason Reason for Unbind request.
699  * @return ROK/RFAILED
700 *
701 *
702 *     Ret  : S16
703 *
704 *     Notes:
705 *
706 *     File  : 
707 *
708 **********************************************************/
709 #ifdef ANSI
710 PUBLIC S16 cmPkTfuSchUbndReq
711 (
712 Pst * pst,
713 SpId spId,
714 Reason reason
715 )
716 #else
717 PUBLIC S16 cmPkTfuSchUbndReq(pst, spId, reason)
718 Pst * pst;
719 SpId spId;
720 Reason reason;
721 #endif
722 {
723    Buffer *mBuf = NULLP;
724    TRC3(cmPkTfuSchUbndReq)
725
726    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
727 #if (ERRCLASS & ERRCLS_ADD_RES)
728       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
729          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
730          (ErrVal)ETFU026, (ErrVal)0, "Packing failed");
731 #endif
732       RETVALUE(RFAILED);
733    }
734    if (SPkS16(reason, mBuf) != ROK) {
735 #if (ERRCLASS & ERRCLS_ADD_RES)
736       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
737          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
738          (ErrVal)ETFU027, (ErrVal)0, "Packing failed");
739 #endif
740       TFU_FREE_MSG(mBuf);
741       RETVALUE(RFAILED);
742    }
743    if (SPkS16(spId, mBuf) != ROK) {
744 #if (ERRCLASS & ERRCLS_ADD_RES)
745       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
746          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
747          (ErrVal)ETFU028, (ErrVal)0, "Packing failed");
748 #endif
749       TFU_FREE_MSG(mBuf);
750       RETVALUE(RFAILED);
751    }
752    pst->event = (Event) EVTTFUSCHUBNDREQ;
753    RETVALUE(SPstTsk(pst,mBuf));
754 }
755
756 \f
757 /***********************************************************
758 *
759 *     Func : cmUnpkTfuSchUbndReq
760 *
761 *
762 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
763  * @param pst Pointer to the post structure.
764  * @param suId SAP ID of the service provider.
765  * @param reason Reason for Unbind request.
766  * @return ROK/RFAILED
767 *
768 *
769 *     Ret  : S16
770 *
771 *     Notes:
772 *
773 *     File  : 
774 *
775 **********************************************************/
776 #ifdef ANSI
777 PUBLIC S16 cmUnpkTfuSchUbndReq
778 (
779 TfuSchUbndReq func,
780 Pst *pst,
781 Buffer *mBuf
782 )
783 #else
784 PUBLIC S16 cmUnpkTfuSchUbndReq(func, pst, mBuf)
785 TfuSchUbndReq func;
786 Pst *pst;
787 Buffer *mBuf;
788 #endif
789 {
790    SpId spId;
791    Reason reason;
792    
793    TRC3(cmUnpkTfuSchUbndReq)
794
795    if (SUnpkS16(&spId, mBuf) != ROK) {
796       TFU_FREE_MSG(mBuf);
797 #if (ERRCLASS & ERRCLS_ADD_RES)
798       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
799          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
800          (ErrVal)ETFU029, (ErrVal)0, "Packing failed");
801 #endif
802       RETVALUE(RFAILED);
803    }
804    if (SUnpkS16(&reason, mBuf) != ROK) {
805       TFU_FREE_MSG(mBuf);
806 #if (ERRCLASS & ERRCLS_ADD_RES)
807       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
808          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
809          (ErrVal)ETFU030, (ErrVal)0, "Packing failed");
810 #endif
811       RETVALUE(RFAILED);
812    }
813    TFU_FREE_MSG(mBuf);
814    RETVALUE((*func)(pst, spId, reason));
815 }
816
817 \f
818 /***********************************************************
819 *
820 *     Func : cmPkTfuRaReqInd
821 *
822 *
823 *     Desc : This API is used to indication Random Access Request reception from
824  * PHY to Scheduler.
825  * @details This primitive is used by physical layer to indicate the reception
826  * of a Random Access Request from a set of UEs. The information passed consists
827  * of the RA-RNTI and the list of preambles received. 
828  * @param pst Pointer to the post structure.
829  * @param suId SAP ID of the service user.
830  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
831  * @return ROK/RFAILED
832 *
833 *
834 *     Ret  : S16
835 *
836 *     Notes:
837 *
838 *     File  : 
839 *
840 **********************************************************/
841 #ifdef ANSI
842 PUBLIC S16 cmPkTfuRaReqInd
843 (
844 Pst * pst,
845 SuId suId,
846 TfuRaReqIndInfo * raReqInd
847 )
848 #else
849 PUBLIC S16 cmPkTfuRaReqInd(pst, suId, raReqInd)
850 Pst * pst;
851 SuId suId;
852 TfuRaReqIndInfo * raReqInd;
853 #endif
854 {
855    Buffer *mBuf = NULLP;
856    TRC3(cmPkTfuRaReqInd)
857
858    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
859 #if (ERRCLASS & ERRCLS_ADD_RES)
860       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
861          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
862          (ErrVal)ETFU031, (ErrVal)0, "Packing failed");
863 #endif
864       TFU_FREE_MEM(raReqInd);
865       RETVALUE(RFAILED);
866    }
867    if (pst->selector == ODU_SELECTOR_LC) {
868       if (cmPkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
869 #if (ERRCLASS & ERRCLS_ADD_RES)
870          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
871             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
872             (ErrVal)ETFU032, (ErrVal)0, "Packing failed");
873 #endif
874          TFU_FREE_MEM(raReqInd);
875          TFU_FREE_MSG(mBuf);
876          RETVALUE(RFAILED);
877       }
878    }
879    else if(pst->selector == ODU_SELECTOR_LWLC)
880    {
881       if (cmPkPtr((PTR)raReqInd, mBuf) != ROK)
882       {
883 #if (ERRCLASS & ERRCLS_ADD_RES)
884          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
885             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
886             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
887 #endif
888          TFU_FREE_MEM(raReqInd);
889          TFU_FREE_MSG(mBuf);
890          RETVALUE(RFAILED);
891       }
892    }
893
894    if (SPkS16(suId, mBuf) != ROK) {
895 #if (ERRCLASS & ERRCLS_ADD_RES)
896       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
897          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
898          (ErrVal)ETFU033, (ErrVal)0, "Packing failed");
899 #endif
900       TFU_FREE_MEM(raReqInd);
901       TFU_FREE_MSG(mBuf);
902       RETVALUE(RFAILED);
903    }
904    if (pst->selector != ODU_SELECTOR_LWLC) {
905       TFU_FREE_MEM(raReqInd);
906    }
907
908    pst->event = (Event) EVTTFURAREQIND;
909    RETVALUE(SPstTsk(pst,mBuf));
910 }
911
912 \f
913 /***********************************************************
914 *
915 *     Func : cmUnpkTfuRaReqInd
916 *
917 *
918 *     Desc : This API is used to indication Random Access Request reception from
919  * PHY to Scheduler.
920  * @details This primitive is used by physical layer to indicate the reception
921  * of a Random Access Request from a set of UEs. The information passed consists
922  * of the RA-RNTI and the list of preambles received. 
923  * @param pst Pointer to the post structure.
924  * @param suId SAP ID of the service user.
925  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
926  * @return ROK/RFAILED
927 *
928 *
929 *     Ret  : S16
930 *
931 *     Notes:
932 *
933 *     File  : 
934 *
935 **********************************************************/
936 #ifdef ANSI
937 PUBLIC S16 cmUnpkTfuRaReqInd
938 (
939 TfuRaReqInd func,
940 Pst *pst,
941 Buffer *mBuf
942 )
943 #else
944 PUBLIC S16 cmUnpkTfuRaReqInd(func, pst, mBuf)
945 TfuRaReqInd func;
946 Pst *pst;
947 Buffer *mBuf;
948 #endif
949 {
950    SuId suId;
951    TfuRaReqIndInfo *raReqInd;
952    
953    TRC3(cmUnpkTfuRaReqInd)
954
955    if (SUnpkS16(&suId, mBuf) != ROK) {
956       TFU_FREE_MSG(mBuf);
957 #if (ERRCLASS & ERRCLS_ADD_RES)
958       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
959          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
960          (ErrVal)ETFU034, (ErrVal)0, "Packing failed");
961 #endif
962       RETVALUE(RFAILED);
963    }
964    if (pst->selector != ODU_SELECTOR_LWLC) {
965       Mem   sMem;
966       sMem.region = pst->region;
967       sMem.pool = pst->pool;
968       if ((cmAllocEvnt(sizeof(TfuRaReqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&raReqInd)) != ROK)            {
969 #if (ERRCLASS & ERRCLS_ADD_RES)
970          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
971             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
972             (ErrVal)ETFU035, (ErrVal)0, "Packing failed");
973 #endif
974          TFU_FREE_MSG(mBuf);
975          RETVALUE(RFAILED);
976       }
977    }
978
979
980    if (pst->selector == ODU_SELECTOR_LC) 
981    {
982       if (cmUnpkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
983          TFU_FREE_MEM(raReqInd);
984          TFU_FREE_MSG(mBuf);
985 #if (ERRCLASS & ERRCLS_ADD_RES)
986          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
987                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
988                (ErrVal)ETFU036, (ErrVal)0, "Packing failed");
989 #endif
990          RETVALUE(RFAILED);
991       }
992    }
993    else if(pst->selector == ODU_SELECTOR_LWLC)
994    {
995       if (cmUnpkPtr((PTR *)&raReqInd, mBuf) != ROK)
996       {
997 #if (ERRCLASS & ERRCLS_ADD_RES)
998          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
999             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1000             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1001 #endif
1002          TFU_FREE_MEM(raReqInd);
1003          TFU_FREE_MSG(mBuf);
1004          RETVALUE(RFAILED);
1005       }
1006    }
1007    TFU_FREE_MSG(mBuf);
1008    RETVALUE((*func)(pst, suId, raReqInd));
1009 }
1010
1011 \f
1012 /***********************************************************
1013 *
1014 *     Func : cmPkTfuRecpReq
1015 *
1016 *
1017 *     Desc : This primitive is sent from Scheduler to PHY.
1018  * @details This primitive provides PHY with all the information required by 
1019  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1020  * -# On PUCCH UE can transmit the following
1021  *    -# SR
1022  *    -# HARQ feedback
1023  *    -# CQI report
1024  *    -# HARQ + CQI
1025  *    -# HARQ + SR
1026  * -# On PUSCH UE can transmit the following
1027  *    -# Data
1028  *    -# Data + CQI
1029  *    -# Data + HARQ Feedback
1030  * This primitive carries all the information for the expected subframe for all
1031  * the UEs that have been scheduled to transmit.
1032  * @param pst Pointer to the post structure.
1033  * @param spId SAP ID of the service provider.
1034  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1035  * @return ROK/RFAILED
1036 *
1037 *
1038 *     Ret  : S16
1039 *
1040 *     Notes:
1041 *
1042 *     File  : 
1043 *
1044 **********************************************************/
1045 #ifdef ANSI
1046 PUBLIC S16 cmPkTfuRecpReq
1047 (
1048 Pst * pst,
1049 SpId spId,
1050 TfuRecpReqInfo * recpReq
1051 )
1052 #else
1053 PUBLIC S16 cmPkTfuRecpReq(pst, spId, recpReq)
1054 Pst * pst;
1055 SpId spId;
1056 TfuRecpReqInfo * recpReq;
1057 #endif
1058 {
1059    Buffer *mBuf = NULLP;
1060    TRC3(cmPkTfuRecpReq)
1061
1062    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1063 #if (ERRCLASS & ERRCLS_ADD_RES)
1064       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1065          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1066          (ErrVal)ETFU037, (ErrVal)0, "Packing failed");
1067 #endif
1068       TFU_FREE_MEM(recpReq);
1069       RETVALUE(RFAILED);
1070    }
1071    if (pst->selector == ODU_SELECTOR_LC) {
1072       if (cmPkTfuRecpReqInfo(recpReq, mBuf) != ROK) {
1073 #if (ERRCLASS & ERRCLS_ADD_RES)
1074          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1075             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1076             (ErrVal)ETFU038, (ErrVal)0, "Packing failed");
1077 #endif
1078          TFU_FREE_MEM(recpReq);
1079          TFU_FREE_MSG(mBuf);
1080          RETVALUE(RFAILED);
1081       }
1082    }
1083    else if(pst->selector == ODU_SELECTOR_LWLC)
1084    {
1085       if (cmPkPtr((PTR)recpReq, mBuf) != ROK)
1086       {
1087 #if (ERRCLASS & ERRCLS_ADD_RES)
1088          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1089             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1090             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1091 #endif
1092          TFU_FREE_MEM(recpReq);
1093          TFU_FREE_MSG(mBuf);
1094          RETVALUE(RFAILED);
1095       }
1096    }
1097
1098
1099    if (SPkS16(spId, mBuf) != ROK) {
1100 #if (ERRCLASS & ERRCLS_ADD_RES)
1101       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1102          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1103          (ErrVal)ETFU039, (ErrVal)0, "Packing failed");
1104 #endif
1105       TFU_FREE_MEM(recpReq);
1106       TFU_FREE_MSG(mBuf);
1107       RETVALUE(RFAILED);
1108    }
1109    if (pst->selector != ODU_SELECTOR_LWLC) {
1110       TFU_FREE_MEM(recpReq);
1111    }
1112
1113    pst->event = (Event) EVTTFURECPREQ;
1114    RETVALUE(SPstTsk(pst,mBuf));
1115 }
1116
1117 \f
1118 /***********************************************************
1119 *
1120 *     Func : cmUnpkTfuRecpReq
1121 *
1122 *
1123 *     Desc : This primitive is sent from Scheduler to PHY.
1124  * @details This primitive provides PHY with all the information required by 
1125  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1126  * -# On PUCCH UE can transmit the following
1127  *    -# SR
1128  *    -# HARQ feedback
1129  *    -# CQI report
1130  *    -# HARQ + CQI
1131  *    -# HARQ + SR
1132  * -# On PUSCH UE can transmit the following
1133  *    -# Data
1134  *    -# Data + CQI
1135  *    -# Data + HARQ Feedback
1136  * This primitive carries all the information for the expected subframe for all
1137  * the UEs that have been scheduled to transmit.
1138  * @param pst Pointer to the post structure.
1139  * @param spId SAP ID of the service provider.
1140  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1141  * @return ROK/RFAILED
1142 *
1143 *
1144 *     Ret  : S16
1145 *
1146 *     Notes:
1147 *
1148 *     File  : 
1149 *
1150 **********************************************************/
1151 #ifdef ANSI
1152 PUBLIC S16 cmUnpkTfuRecpReq
1153 (
1154 TfuRecpReq func,
1155 Pst *pst,
1156 Buffer *mBuf
1157 )
1158 #else
1159 PUBLIC S16 cmUnpkTfuRecpReq(func, pst, mBuf)
1160 TfuRecpReq func;
1161 Pst *pst;
1162 Buffer *mBuf;
1163 #endif
1164 {
1165    SpId spId;
1166    TfuRecpReqInfo *recpReq;
1167    
1168    TRC3(cmUnpkTfuRecpReq)
1169
1170    if (SUnpkS16(&spId, mBuf) != ROK) {
1171       TFU_FREE_MSG(mBuf);
1172 #if (ERRCLASS & ERRCLS_ADD_RES)
1173       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1174          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1175          (ErrVal)ETFU040, (ErrVal)0, "Packing failed");
1176 #endif
1177       RETVALUE(RFAILED);
1178    }
1179    if (pst->selector != ODU_SELECTOR_LWLC) {
1180       Mem   sMem;
1181       sMem.region = pst->region;
1182       sMem.pool = pst->pool;
1183       if ((cmAllocEvnt(sizeof(TfuRecpReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&recpReq)) != ROK)            {
1184 #if (ERRCLASS & ERRCLS_ADD_RES)
1185          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1186             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1187             (ErrVal)ETFU041, (ErrVal)0, "Packing failed");
1188 #endif
1189          TFU_FREE_MSG(mBuf);
1190          RETVALUE(RFAILED);
1191       }
1192    }
1193    else if(pst->selector == ODU_SELECTOR_LWLC)
1194    {
1195       if (cmUnpkPtr((PTR *)&recpReq, mBuf) != ROK)
1196       {
1197 #if (ERRCLASS & ERRCLS_ADD_RES)
1198          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1199             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1200             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1201 #endif
1202          TFU_FREE_MEM(recpReq);
1203          TFU_FREE_MSG(mBuf);
1204          RETVALUE(RFAILED);
1205       }
1206    }
1207
1208    if (pst->selector == ODU_SELECTOR_LC) 
1209    {
1210       if (cmUnpkTfuRecpReqInfo(recpReq, (Ptr)&recpReq->memCp, mBuf) != ROK) {
1211          TFU_FREE_MEM(recpReq);
1212          TFU_FREE_MSG(mBuf);
1213 #if (ERRCLASS & ERRCLS_ADD_RES)
1214          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1215                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1216                (ErrVal)ETFU042, (ErrVal)0, "Packing failed");
1217 #endif
1218          RETVALUE(RFAILED);
1219       }
1220    }
1221    else if(pst->selector == ODU_SELECTOR_LWLC)
1222    {
1223       if (cmUnpkPtr((PTR*)&recpReq, mBuf) != ROK)
1224       {
1225 #if (ERRCLASS & ERRCLS_ADD_RES)
1226          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1227             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1228             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1229 #endif
1230          TFU_FREE_MEM(recpReq);
1231          TFU_FREE_MSG(mBuf);
1232          RETVALUE(RFAILED);
1233       }
1234    }
1235
1236    TFU_FREE_MSG(mBuf);
1237    RETVALUE((*func)(pst, spId, recpReq));
1238 }
1239
1240 \f
1241 /***********************************************************
1242 *
1243 *     Func : cmPkTfuUlCqiInd
1244 *
1245 *
1246 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1247  * @details This primitive carries an estimate of the uplink Channel quality
1248  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1249  * quality i.e. the transmission from UE as calculated at the Physical layer at
1250  * the eNodeB. 
1251  * It carries a list of subband CQIs for each UE. 
1252  * @param pst Pointer to the post structure.
1253  * @param suId SAP ID of the service user.
1254  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1255  * @return ROK/RFAILED
1256 *
1257 *
1258 *     Ret  : S16
1259 *
1260 *     Notes:
1261 *
1262 *     File  : 
1263 *
1264 **********************************************************/
1265 #ifdef ANSI
1266 PUBLIC S16 cmPkTfuUlCqiInd
1267 (
1268 Pst * pst,
1269 SuId suId,
1270 TfuUlCqiIndInfo * ulCqiInd
1271 )
1272 #else
1273 PUBLIC S16 cmPkTfuUlCqiInd(pst, suId, ulCqiInd)
1274 Pst * pst;
1275 SuId suId;
1276 TfuUlCqiIndInfo * ulCqiInd;
1277 #endif
1278 {
1279    Buffer *mBuf = NULLP;
1280    TRC3(cmPkTfuUlCqiInd)
1281
1282    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1283 #if (ERRCLASS & ERRCLS_ADD_RES)
1284       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1285          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1286          (ErrVal)ETFU043, (ErrVal)0, "Packing failed");
1287 #endif
1288       TFU_FREE_MEM(ulCqiInd);
1289       RETVALUE(RFAILED);
1290    }
1291    if (pst->selector == ODU_SELECTOR_LC) {
1292       if (cmPkTfuUlCqiIndInfo(ulCqiInd, mBuf) != ROK) {
1293 #if (ERRCLASS & ERRCLS_ADD_RES)
1294          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1295             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1296             (ErrVal)ETFU044, (ErrVal)0, "Packing failed");
1297 #endif
1298          TFU_FREE_MEM(ulCqiInd);
1299          TFU_FREE_MSG(mBuf);
1300          RETVALUE(RFAILED);
1301       }
1302    }
1303    else if(pst->selector == ODU_SELECTOR_LWLC)
1304    {
1305       if (cmPkPtr((PTR)ulCqiInd, mBuf) != ROK)
1306       {
1307 #if (ERRCLASS & ERRCLS_ADD_RES)
1308          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1309             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1310             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1311 #endif
1312          TFU_FREE_MEM(ulCqiInd);
1313          TFU_FREE_MSG(mBuf);
1314          RETVALUE(RFAILED);
1315       }
1316    }
1317
1318    if (SPkS16(suId, mBuf) != ROK) {
1319 #if (ERRCLASS & ERRCLS_ADD_RES)
1320       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1321          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1322          (ErrVal)ETFU045, (ErrVal)0, "Packing failed");
1323 #endif
1324       TFU_FREE_MEM(ulCqiInd);
1325       TFU_FREE_MSG(mBuf);
1326       RETVALUE(RFAILED);
1327    }
1328    if (pst->selector != ODU_SELECTOR_LWLC) {
1329       TFU_FREE_MEM(ulCqiInd);
1330    }
1331
1332    pst->event = (Event) EVTTFUULCQIIND;
1333    RETVALUE(SPstTsk(pst,mBuf));
1334 }
1335
1336 \f
1337 /***********************************************************
1338 *
1339 *     Func : cmUnpkTfuUlCqiInd
1340 *
1341 *
1342 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1343  * @details This primitive carries an estimate of the uplink Channel quality
1344  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1345  * quality i.e. the transmission from UE as calculated at the Physical layer at
1346  * the eNodeB. 
1347  * It carries a list of subband CQIs for each UE. 
1348  * @param pst Pointer to the post structure.
1349  * @param suId SAP ID of the service user.
1350  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1351  * @return ROK/RFAILED
1352 *
1353 *
1354 *     Ret  : S16
1355 *
1356 *     Notes:
1357 *
1358 *     File  : 
1359 *
1360 **********************************************************/
1361 #ifdef ANSI
1362 PUBLIC S16 cmUnpkTfuUlCqiInd
1363 (
1364 TfuUlCqiInd func,
1365 Pst *pst,
1366 Buffer *mBuf
1367 )
1368 #else
1369 PUBLIC S16 cmUnpkTfuUlCqiInd(func, pst, mBuf)
1370 TfuUlCqiInd func;
1371 Pst *pst;
1372 Buffer *mBuf;
1373 #endif
1374 {
1375    SuId suId;
1376    TfuUlCqiIndInfo *ulCqiInd;
1377    
1378    TRC3(cmUnpkTfuUlCqiInd)
1379
1380    if (SUnpkS16(&suId, mBuf) != ROK) {
1381       TFU_FREE_MSG(mBuf);
1382 #if (ERRCLASS & ERRCLS_ADD_RES)
1383       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1384          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1385          (ErrVal)ETFU046, (ErrVal)0, "Packing failed");
1386 #endif
1387       RETVALUE(RFAILED);
1388    }
1389    if (pst->selector != ODU_SELECTOR_LWLC) {
1390       Mem   sMem;
1391       sMem.region = pst->region;
1392       sMem.pool = pst->pool;
1393       if ((cmAllocEvnt(sizeof(TfuUlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&ulCqiInd)) != ROK)            {
1394 #if (ERRCLASS & ERRCLS_ADD_RES)
1395          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1396             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1397             (ErrVal)ETFU047, (ErrVal)0, "Packing failed");
1398 #endif
1399          TFU_FREE_MSG(mBuf);
1400          RETVALUE(RFAILED);
1401       }
1402    }
1403
1404
1405    if (pst->selector == ODU_SELECTOR_LC) 
1406    {
1407       if (cmUnpkTfuUlCqiIndInfo(ulCqiInd, (Ptr)&ulCqiInd->memCp, mBuf) != ROK) {
1408          TFU_FREE_MEM(ulCqiInd);
1409          TFU_FREE_MSG(mBuf);
1410 #if (ERRCLASS & ERRCLS_ADD_RES)
1411          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1412                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1413                (ErrVal)ETFU048, (ErrVal)0, "Packing failed");
1414 #endif
1415          RETVALUE(RFAILED);
1416       }
1417    }
1418    else if(pst->selector == ODU_SELECTOR_LWLC)
1419    {
1420       if (cmUnpkPtr((PTR *)&ulCqiInd, mBuf) != ROK)
1421       {
1422 #if (ERRCLASS & ERRCLS_ADD_RES)
1423          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1424             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1425             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1426 #endif
1427          TFU_FREE_MEM(ulCqiInd);
1428          TFU_FREE_MSG(mBuf);
1429          RETVALUE(RFAILED);
1430       }
1431    }
1432    TFU_FREE_MSG(mBuf);
1433    RETVALUE((*func)(pst, suId, ulCqiInd));
1434 }
1435
1436 \f
1437 /***********************************************************
1438 *
1439 *     Func : cmPkTfuHqInd
1440 *
1441 *
1442 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1443  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1444  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1445  * sent. This feedback is utilized by MAC for further scheduling, for instance
1446  * it could schedule an adaptive retransmission of the same data. 
1447  * @param pst 
1448  * @param spId
1449  * @param tfuHqInd pointer to TfuHqIndInfo
1450  * @return
1451 *
1452 *
1453 *     Ret  : S16
1454 *
1455 *     Notes:
1456 *
1457 *     File  : 
1458 *
1459 **********************************************************/
1460 #ifdef ANSI
1461 PUBLIC S16 cmPkTfuHqInd
1462 (
1463 Pst * pst,
1464 SpId spId,
1465 TfuHqIndInfo * hqInd
1466 )
1467 #else
1468 PUBLIC S16 cmPkTfuHqInd(pst, spId, hqInd)
1469 Pst * pst;
1470 SpId spId;
1471 TfuHqIndInfo * hqInd;
1472 #endif
1473 {
1474    Buffer *mBuf = NULLP;
1475    TRC3(cmPkTfuHqInd)
1476
1477    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1478 #if (ERRCLASS & ERRCLS_ADD_RES)
1479       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1480          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1481          (ErrVal)ETFU049, (ErrVal)0, "Packing failed");
1482 #endif
1483       TFU_FREE_MEM(hqInd);
1484       RETVALUE(RFAILED);
1485    }
1486    if (pst->selector == ODU_SELECTOR_LC) {
1487       if (cmPkTfuHqIndInfo(hqInd, mBuf) != ROK) {
1488 #if (ERRCLASS & ERRCLS_ADD_RES)
1489          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1490             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1491             (ErrVal)ETFU050, (ErrVal)0, "Packing failed");
1492 #endif
1493          TFU_FREE_MEM(hqInd);
1494          TFU_FREE_MSG(mBuf);
1495          RETVALUE(RFAILED);
1496       }
1497    }
1498    else if(pst->selector == ODU_SELECTOR_LWLC)
1499    {
1500       if (cmPkPtr((PTR)hqInd, mBuf) != ROK)
1501       {
1502 #if (ERRCLASS & ERRCLS_ADD_RES)
1503          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1504             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1505             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1506 #endif
1507          TFU_FREE_MEM(hqInd);
1508          TFU_FREE_MSG(mBuf);
1509          RETVALUE(RFAILED);
1510       }
1511    }
1512
1513    if (SPkS16(spId, mBuf) != ROK) {
1514 #if (ERRCLASS & ERRCLS_ADD_RES)
1515       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1516          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1517          (ErrVal)ETFU051, (ErrVal)0, "Packing failed");
1518 #endif
1519       TFU_FREE_MEM(hqInd);
1520       TFU_FREE_MSG(mBuf);
1521       RETVALUE(RFAILED);
1522    }
1523    if (pst->selector != ODU_SELECTOR_LWLC) {
1524       TFU_FREE_MEM(hqInd);
1525    }
1526
1527    pst->event = (Event) EVTTFUHQIND;
1528    RETVALUE(SPstTsk(pst,mBuf));
1529 }
1530
1531 \f
1532 /***********************************************************
1533 *
1534 *     Func : cmUnpkTfuHqInd
1535 *
1536 *
1537 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1538  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1539  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1540  * sent. This feedback is utilized by MAC for further scheduling, for instance
1541  * it could schedule an adaptive retransmission of the same data. 
1542  * @param pst 
1543  * @param spId
1544  * @param tfuHqInd pointer to TfuHqIndInfo
1545  * @return
1546 *
1547 *
1548 *     Ret  : S16
1549 *
1550 *     Notes:
1551 *
1552 *     File  : 
1553 *
1554 **********************************************************/
1555 #ifdef ANSI
1556 PUBLIC S16 cmUnpkTfuHqInd
1557 (
1558 TfuHqInd func,
1559 Pst *pst,
1560 Buffer *mBuf
1561 )
1562 #else
1563 PUBLIC S16 cmUnpkTfuHqInd(func, pst, mBuf)
1564 TfuHqInd func;
1565 Pst *pst;
1566 Buffer *mBuf;
1567 #endif
1568 {
1569    SpId spId;
1570    TfuHqIndInfo *hqInd;
1571    
1572    TRC3(cmUnpkTfuHqInd)
1573
1574    if (SUnpkS16(&spId, mBuf) != ROK) {
1575       TFU_FREE_MSG(mBuf);
1576 #if (ERRCLASS & ERRCLS_ADD_RES)
1577       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1578          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1579          (ErrVal)ETFU052, (ErrVal)0, "Packing failed");
1580 #endif
1581       RETVALUE(RFAILED);
1582    }
1583    if (pst->selector != ODU_SELECTOR_LWLC) {
1584       Mem   sMem;
1585       sMem.region = pst->region;
1586       sMem.pool = pst->pool;
1587       if ((cmAllocEvnt(sizeof(TfuHqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&hqInd)) != ROK)            {
1588 #if (ERRCLASS & ERRCLS_ADD_RES)
1589          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1590             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1591             (ErrVal)ETFU053, (ErrVal)0, "Packing failed");
1592 #endif
1593          TFU_FREE_MSG(mBuf);
1594          RETVALUE(RFAILED);
1595       }
1596    }
1597
1598
1599    if (pst->selector == ODU_SELECTOR_LC) 
1600    {
1601       if (cmUnpkTfuHqIndInfo(hqInd, (Ptr)&hqInd->memCp, mBuf) != ROK) {
1602          TFU_FREE_MEM(hqInd);
1603          TFU_FREE_MSG(mBuf);
1604 #if (ERRCLASS & ERRCLS_ADD_RES)
1605          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1606                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1607                (ErrVal)ETFU054, (ErrVal)0, "Packing failed");
1608 #endif
1609          RETVALUE(RFAILED);
1610       }
1611    }
1612    else if(pst->selector == ODU_SELECTOR_LWLC)
1613    {
1614       if (cmUnpkPtr((PTR *)&hqInd, mBuf) != ROK)
1615       {
1616 #if (ERRCLASS & ERRCLS_ADD_RES)
1617          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1618             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1619             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1620 #endif
1621          TFU_FREE_MEM(hqInd);
1622          TFU_FREE_MSG(mBuf);
1623          RETVALUE(RFAILED);
1624       }
1625    }
1626    TFU_FREE_MSG(mBuf);
1627    RETVALUE((*func)(pst, spId, hqInd));
1628 }
1629
1630 \f
1631 /***********************************************************
1632 *
1633 *     Func : cmPkTfuSrInd
1634 *
1635 *
1636 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1637  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1638  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1639  * UEs received in the indicated subframe. 
1640  * @param pst 
1641  * @param spId
1642  * @param tfqSrInd pointer to TfuSrIndInfo
1643  * @return
1644 *
1645 *
1646 *     Ret  : S16
1647 *
1648 *     Notes:
1649 *
1650 *     File  : 
1651 *
1652 **********************************************************/
1653 #ifdef ANSI
1654 PUBLIC S16 cmPkTfuSrInd
1655 (
1656 Pst * pst,
1657 SpId spId,
1658 TfuSrIndInfo * srInd
1659 )
1660 #else
1661 PUBLIC S16 cmPkTfuSrInd(pst, spId, srInd)
1662 Pst * pst;
1663 SpId spId;
1664 TfuSrIndInfo * srInd;
1665 #endif
1666 {
1667    Buffer *mBuf = NULLP;
1668    TRC3(cmPkTfuSrInd)
1669
1670    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1671 #if (ERRCLASS & ERRCLS_ADD_RES)
1672       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1673          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1674          (ErrVal)ETFU055, (ErrVal)0, "Packing failed");
1675 #endif
1676       TFU_FREE_MEM(srInd);
1677       RETVALUE(RFAILED);
1678    }
1679    if (pst->selector == ODU_SELECTOR_LC) {
1680       if (cmPkTfuSrIndInfo(srInd, mBuf) != ROK) {
1681 #if (ERRCLASS & ERRCLS_ADD_RES)
1682          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1683             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1684             (ErrVal)ETFU056, (ErrVal)0, "Packing failed");
1685 #endif
1686          TFU_FREE_MEM(srInd);
1687          TFU_FREE_MSG(mBuf);
1688          RETVALUE(RFAILED);
1689       }
1690    }
1691    else if(pst->selector == ODU_SELECTOR_LWLC)
1692    {
1693       if (cmPkPtr((PTR)srInd, mBuf) != ROK)
1694       {
1695 #if (ERRCLASS & ERRCLS_ADD_RES)
1696          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1697             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1698             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1699 #endif
1700          TFU_FREE_MEM(srInd);
1701          TFU_FREE_MSG(mBuf);
1702          RETVALUE(RFAILED);
1703       }
1704    }
1705
1706    if (SPkS16(spId, mBuf) != ROK) {
1707 #if (ERRCLASS & ERRCLS_ADD_RES)
1708       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1709          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1710          (ErrVal)ETFU057, (ErrVal)0, "Packing failed");
1711 #endif
1712       TFU_FREE_MEM(srInd);
1713       TFU_FREE_MSG(mBuf);
1714       RETVALUE(RFAILED);
1715    }
1716    if (pst->selector != ODU_SELECTOR_LWLC) {
1717       TFU_FREE_MEM(srInd);
1718    }
1719
1720    pst->event = (Event) EVTTFUSRIND;
1721    RETVALUE(SPstTsk(pst,mBuf));
1722 }
1723
1724 \f
1725 /***********************************************************
1726 *
1727 *     Func : cmUnpkTfuSrInd
1728 *
1729 *
1730 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1731  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1732  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1733  * UEs received in the indicated subframe. 
1734  * @param pst 
1735  * @param spId
1736  * @param tfqSrInd pointer to TfuSrIndInfo
1737  * @return
1738 *
1739 *
1740 *     Ret  : S16
1741 *
1742 *     Notes:
1743 *
1744 *     File  : 
1745 *
1746 **********************************************************/
1747 #ifdef ANSI
1748 PUBLIC S16 cmUnpkTfuSrInd
1749 (
1750 TfuSrInd func,
1751 Pst *pst,
1752 Buffer *mBuf
1753 )
1754 #else
1755 PUBLIC S16 cmUnpkTfuSrInd(func, pst, mBuf)
1756 TfuSrInd func;
1757 Pst *pst;
1758 Buffer *mBuf;
1759 #endif
1760 {
1761    SpId spId;
1762    TfuSrIndInfo *srInd;
1763    
1764    TRC3(cmUnpkTfuSrInd)
1765
1766    if (SUnpkS16(&spId, mBuf) != ROK) {
1767       TFU_FREE_MSG(mBuf);
1768 #if (ERRCLASS & ERRCLS_ADD_RES)
1769       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1770          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1771          (ErrVal)ETFU058, (ErrVal)0, "Packing failed");
1772 #endif
1773       RETVALUE(RFAILED);
1774    }
1775    if (pst->selector != ODU_SELECTOR_LWLC) {
1776       Mem   sMem;
1777       sMem.region = pst->region;
1778       sMem.pool = pst->pool;
1779       if ((cmAllocEvnt(sizeof(TfuSrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srInd)) != ROK)            {
1780 #if (ERRCLASS & ERRCLS_ADD_RES)
1781          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1782             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1783             (ErrVal)ETFU059, (ErrVal)0, "Packing failed");
1784 #endif
1785          TFU_FREE_MSG(mBuf);
1786          RETVALUE(RFAILED);
1787       }
1788    }
1789
1790
1791    if (pst->selector == ODU_SELECTOR_LC) 
1792    {
1793       if (cmUnpkTfuSrIndInfo(srInd, (Ptr)&srInd->memCp, mBuf) != ROK) {
1794          TFU_FREE_MEM(srInd);
1795          TFU_FREE_MSG(mBuf);
1796 #if (ERRCLASS & ERRCLS_ADD_RES)
1797          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1798                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1799                (ErrVal)ETFU060, (ErrVal)0, "Packing failed");
1800 #endif
1801          RETVALUE(RFAILED);
1802       }
1803    }
1804    else if(pst->selector == ODU_SELECTOR_LWLC)
1805    {
1806       if (cmUnpkPtr((PTR *)&srInd, mBuf) != ROK)
1807       {
1808 #if (ERRCLASS & ERRCLS_ADD_RES)
1809          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1810             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1811             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1812 #endif
1813          TFU_FREE_MEM(srInd);
1814          TFU_FREE_MSG(mBuf);
1815          RETVALUE(RFAILED);
1816       }
1817    }
1818    TFU_FREE_MSG(mBuf);
1819    RETVALUE((*func)(pst, spId, srInd));
1820 }
1821
1822 \f
1823 /***********************************************************
1824 *
1825 *     Func : cmPkTfuDlCqiInd
1826 *
1827 *
1828 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1829  * Scheduler, also carries the RI.
1830  * @param pst Pointer to the post structure.
1831  * @param suId SAP ID of the service user.
1832  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1833  * @return ROK/RFAILED
1834 *
1835 *
1836 *     Ret  : S16
1837 *
1838 *     Notes:
1839 *
1840 *     File  : 
1841 *
1842 **********************************************************/
1843 #ifdef ANSI
1844 PUBLIC S16 cmPkTfuDlCqiInd
1845 (
1846 Pst * pst,
1847 SuId suId,
1848 TfuDlCqiIndInfo * dlCqiInd
1849 )
1850 #else
1851 PUBLIC S16 cmPkTfuDlCqiInd(pst, suId, dlCqiInd)
1852 Pst * pst;
1853 SuId suId;
1854 TfuDlCqiIndInfo * dlCqiInd;
1855 #endif
1856 {
1857    Buffer *mBuf = NULLP;
1858    TRC3(cmPkTfuDlCqiInd)
1859
1860    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1861 #if (ERRCLASS & ERRCLS_ADD_RES)
1862       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1863          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1864          (ErrVal)ETFU061, (ErrVal)0, "Packing failed");
1865 #endif
1866       TFU_FREE_MEM(dlCqiInd);
1867       RETVALUE(RFAILED);
1868    }
1869    if (pst->selector == ODU_SELECTOR_LC) {
1870       if (cmPkTfuDlCqiIndInfo(dlCqiInd, mBuf) != ROK) {
1871 #if (ERRCLASS & ERRCLS_ADD_RES)
1872          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1873             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1874             (ErrVal)ETFU062, (ErrVal)0, "Packing failed");
1875 #endif
1876          TFU_FREE_MEM(dlCqiInd);
1877          TFU_FREE_MSG(mBuf);
1878          RETVALUE(RFAILED);
1879       }
1880    }
1881    else if(pst->selector == ODU_SELECTOR_LWLC)
1882    {
1883       if (cmPkPtr((PTR)dlCqiInd, mBuf) != ROK)
1884       {
1885 #if (ERRCLASS & ERRCLS_ADD_RES)
1886          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1887             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1888             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1889 #endif
1890          TFU_FREE_MEM(dlCqiInd);
1891          TFU_FREE_MSG(mBuf);
1892          RETVALUE(RFAILED);
1893       }
1894    }
1895
1896    if (SPkS16(suId, mBuf) != ROK) {
1897 #if (ERRCLASS & ERRCLS_ADD_RES)
1898       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1899          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1900          (ErrVal)ETFU063, (ErrVal)0, "Packing failed");
1901 #endif
1902       TFU_FREE_MEM(dlCqiInd);
1903       TFU_FREE_MSG(mBuf);
1904       RETVALUE(RFAILED);
1905    }
1906    if (pst->selector != ODU_SELECTOR_LWLC) {
1907       TFU_FREE_MEM(dlCqiInd);
1908    }
1909    pst->event = (Event) EVTTFUDLCQIIND;
1910    RETVALUE(SPstTsk(pst,mBuf));
1911 }
1912
1913 \f
1914 /***********************************************************
1915 *
1916 *     Func : cmUnpkTfuDlCqiInd
1917 *
1918 *
1919 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1920  * Scheduler, also carries the RI.
1921  * @param pst Pointer to the post structure.
1922  * @param suId SAP ID of the service user.
1923  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1924  * @return ROK/RFAILED
1925 *
1926 *
1927 *     Ret  : S16
1928 *
1929 *     Notes:
1930 *
1931 *     File  : 
1932 *
1933 **********************************************************/
1934 #ifdef ANSI
1935 PUBLIC S16 cmUnpkTfuDlCqiInd
1936 (
1937 TfuDlCqiInd func,
1938 Pst *pst,
1939 Buffer *mBuf
1940 )
1941 #else
1942 PUBLIC S16 cmUnpkTfuDlCqiInd(func, pst, mBuf)
1943 TfuDlCqiInd func;
1944 Pst *pst;
1945 Buffer *mBuf;
1946 #endif
1947 {
1948    SuId suId;
1949    TfuDlCqiIndInfo *dlCqiInd;
1950    
1951    TRC3(cmUnpkTfuDlCqiInd)
1952
1953    if (SUnpkS16(&suId, mBuf) != ROK) {
1954       TFU_FREE_MSG(mBuf);
1955 #if (ERRCLASS & ERRCLS_ADD_RES)
1956       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1957          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1958          (ErrVal)ETFU064, (ErrVal)0, "Packing failed");
1959 #endif
1960       RETVALUE(RFAILED);
1961    }
1962    if (pst->selector != ODU_SELECTOR_LWLC) {
1963       Mem   sMem;
1964       sMem.region = pst->region;
1965       sMem.pool = pst->pool;
1966       if ((cmAllocEvnt(sizeof(TfuDlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&dlCqiInd)) != ROK)            {
1967 #if (ERRCLASS & ERRCLS_ADD_RES)
1968          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1969             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1970             (ErrVal)ETFU065, (ErrVal)0, "Packing failed");
1971 #endif
1972          TFU_FREE_MSG(mBuf);
1973          RETVALUE(RFAILED);
1974       }
1975    }
1976
1977
1978    if (pst->selector == ODU_SELECTOR_LC) 
1979    {
1980       if (cmUnpkTfuDlCqiIndInfo(dlCqiInd, (Ptr)&dlCqiInd->memCp, mBuf) != ROK) {
1981          TFU_FREE_MEM(dlCqiInd);
1982          TFU_FREE_MSG(mBuf);
1983 #if (ERRCLASS & ERRCLS_ADD_RES)
1984          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1985                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1986                (ErrVal)ETFU066, (ErrVal)0, "Packing failed");
1987 #endif
1988          RETVALUE(RFAILED);
1989       }
1990    }
1991    else if(pst->selector == ODU_SELECTOR_LWLC)
1992    {
1993       if (cmUnpkPtr((PTR *)&dlCqiInd, mBuf) != ROK)
1994       {
1995 #if (ERRCLASS & ERRCLS_ADD_RES)
1996          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1997             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1998             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1999 #endif
2000          TFU_FREE_MEM(dlCqiInd);
2001          TFU_FREE_MSG(mBuf);
2002          RETVALUE(RFAILED);
2003       }
2004    }
2005    TFU_FREE_MSG(mBuf);
2006    RETVALUE((*func)(pst, suId, dlCqiInd));
2007 }
2008
2009
2010 #ifdef TFU_UPGRADE
2011
2012 \f
2013 /***********************************************************
2014 *
2015 *     Func : cmPkTfuRawCqiInd
2016 *
2017 *
2018 *     Desc : This Primitive is used to convey the Raw CQI information 
2019  * transmitted by the UE.
2020  * @details Raw CQI report is the actual bits transmitted by the UE when
2021  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2022  * etc. shall be done by MAC.
2023  * 
2024  * @param pst Pointer to the post structure.
2025  * @param suId SAP ID of the service user.
2026  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2027  * @return ROK/RFAILED
2028 *
2029 *
2030 *     Ret  : S16
2031 *
2032 *     Notes:
2033 *
2034 *     File  : 
2035 *
2036 **********************************************************/
2037 #ifdef ANSI
2038 PUBLIC S16 cmPkTfuRawCqiInd
2039 (
2040 Pst * pst,
2041 SuId suId,
2042 TfuRawCqiIndInfo * rawCqiInd
2043 )
2044 #else
2045 PUBLIC S16 cmPkTfuRawCqiInd(pst, suId, rawCqiInd)
2046 Pst * pst;
2047 SuId suId;
2048 TfuRawCqiIndInfo * rawCqiInd;
2049 #endif
2050 {
2051    Buffer *mBuf = NULLP;
2052    TRC3(cmPkTfuRawCqiInd)
2053
2054    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2055 #if (ERRCLASS & ERRCLS_ADD_RES)
2056       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2057          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2058          (ErrVal)ETFU067, (ErrVal)0, "Packing failed");
2059 #endif
2060       TFU_FREE_MEM(rawCqiInd);
2061       RETVALUE(RFAILED);
2062    }
2063       cmPkTfuRawCqiIndInfo(rawCqiInd, mBuf);
2064    if (SPkS16(suId, mBuf) != ROK) {
2065 #if (ERRCLASS & ERRCLS_ADD_RES)
2066       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2067          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2068          (ErrVal)ETFU068, (ErrVal)0, "Packing failed");
2069 #endif
2070       TFU_FREE_MEM(rawCqiInd);
2071       TFU_FREE_MSG(mBuf);
2072       RETVALUE(RFAILED);
2073    }
2074    TFU_FREE_MEM(rawCqiInd);
2075    pst->event = (Event) EVTTFURAWCQIIND;
2076    RETVALUE(SPstTsk(pst,mBuf));
2077 }
2078
2079 \f
2080 /***********************************************************
2081 *
2082 *     Func : cmUnpkTfuRawCqiInd
2083 *
2084 *
2085 *     Desc : This Primitive is used to convey the Raw CQI information 
2086  * transmitted by the UE.
2087  * @details Raw CQI report is the actual bits transmitted by the UE when
2088  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2089  * etc. shall be done by MAC.
2090  * 
2091  * @param pst Pointer to the post structure.
2092  * @param suId SAP ID of the service user.
2093  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2094  * @return ROK/RFAILED
2095 *
2096 *
2097 *     Ret  : S16
2098 *
2099 *     Notes:
2100 *
2101 *     File  : 
2102 *
2103 **********************************************************/
2104 #ifdef ANSI
2105 PUBLIC S16 cmUnpkTfuRawCqiInd
2106 (
2107 TfuRawCqiInd func,
2108 Pst *pst,
2109 Buffer *mBuf
2110 )
2111 #else
2112 PUBLIC S16 cmUnpkTfuRawCqiInd(func, pst, mBuf)
2113 TfuRawCqiInd func;
2114 Pst *pst;
2115 Buffer *mBuf;
2116 #endif
2117 {
2118    SuId suId;
2119    TfuRawCqiIndInfo *rawCqiInd;
2120    
2121    TRC3(cmUnpkTfuRawCqiInd)
2122
2123    if (SUnpkS16(&suId, mBuf) != ROK) {
2124       TFU_FREE_MSG(mBuf);
2125 #if (ERRCLASS & ERRCLS_ADD_RES)
2126       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2127          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2128          (ErrVal)ETFU069, (ErrVal)0, "Packing failed");
2129 #endif
2130       RETVALUE(RFAILED);
2131    }
2132    {
2133       Mem   sMem;
2134       sMem.region = pst->region;
2135       sMem.pool = pst->pool;
2136       if ((cmAllocEvnt(sizeof(TfuRawCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&rawCqiInd)) != ROK)            {
2137 #if (ERRCLASS & ERRCLS_ADD_RES)
2138          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2139             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2140             (ErrVal)ETFU070, (ErrVal)0, "Packing failed");
2141 #endif
2142          TFU_FREE_MSG(mBuf);
2143          RETVALUE(RFAILED);
2144       }
2145    }
2146       cmUnpkTfuRawCqiIndInfo(rawCqiInd, (Ptr)&rawCqiInd->memCp, mBuf);
2147    TFU_FREE_MSG(mBuf);
2148    RETVALUE((*func)(pst, suId, rawCqiInd));
2149 }
2150
2151 \f
2152 /***********************************************************
2153 *
2154 *     Func : cmPkTfuSrsInd
2155 *
2156 *
2157 *     Desc : This Primitive is used to convey the information derived by the
2158  * physical layer from the SRS transmission from the UE.
2159  * @details This primitive carries information derived from the SRS transmission
2160  * from the UE. 
2161  * 
2162  * @param pst Pointer to the post structure.
2163  * @param suId SAP ID of the service user.
2164  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2165  * @return ROK/RFAILED
2166 *
2167 *
2168 *     Ret  : S16
2169 *
2170 *     Notes:
2171 *
2172 *     File  : 
2173 *
2174 **********************************************************/
2175 #ifdef ANSI
2176 PUBLIC S16 cmPkTfuSrsInd
2177 (
2178 Pst * pst,
2179 SuId suId,
2180 TfuSrsIndInfo * srsInd
2181 )
2182 #else
2183 PUBLIC S16 cmPkTfuSrsInd(pst, suId, srsInd)
2184 Pst * pst;
2185 SuId suId;
2186 TfuSrsIndInfo * srsInd;
2187 #endif
2188 {
2189    Buffer *mBuf = NULLP;
2190    TRC3(cmPkTfuSrsInd)
2191
2192    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2193 #if (ERRCLASS & ERRCLS_ADD_RES)
2194       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2195          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2196          (ErrVal)ETFU071, (ErrVal)0, "Packing failed");
2197 #endif
2198       TFU_FREE_MEM(srsInd);
2199       RETVALUE(RFAILED);
2200    }
2201       cmPkTfuSrsIndInfo(srsInd, mBuf);
2202    if (SPkS16(suId, mBuf) != ROK) {
2203 #if (ERRCLASS & ERRCLS_ADD_RES)
2204       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2205          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2206          (ErrVal)ETFU072, (ErrVal)0, "Packing failed");
2207 #endif
2208       TFU_FREE_MEM(srsInd);
2209       TFU_FREE_MSG(mBuf);
2210       RETVALUE(RFAILED);
2211    }
2212    TFU_FREE_MEM(srsInd);
2213    pst->event = (Event) EVTTFUSRSIND;
2214    RETVALUE(SPstTsk(pst,mBuf));
2215 }
2216
2217 \f
2218 /***********************************************************
2219 *
2220 *     Func : cmUnpkTfuSrsInd
2221 *
2222 *
2223 *     Desc : This Primitive is used to convey the information derived by the
2224  * physical layer from the SRS transmission from the UE.
2225  * @details This primitive carries information derived from the SRS transmission
2226  * from the UE. 
2227  * 
2228  * @param pst Pointer to the post structure.
2229  * @param suId SAP ID of the service user.
2230  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2231  * @return ROK/RFAILED
2232 *
2233 *
2234 *     Ret  : S16
2235 *
2236 *     Notes:
2237 *
2238 *     File  : 
2239 *
2240 **********************************************************/
2241 #ifdef ANSI
2242 PUBLIC S16 cmUnpkTfuSrsInd
2243 (
2244 TfuSrsInd func,
2245 Pst *pst,
2246 Buffer *mBuf
2247 )
2248 #else
2249 PUBLIC S16 cmUnpkTfuSrsInd(func, pst, mBuf)
2250 TfuSrsInd func;
2251 Pst *pst;
2252 Buffer *mBuf;
2253 #endif
2254 {
2255    SuId suId;
2256    TfuSrsIndInfo *srsInd;
2257    
2258    TRC3(cmUnpkTfuSrsInd)
2259
2260    if (SUnpkS16(&suId, mBuf) != ROK) {
2261       TFU_FREE_MSG(mBuf);
2262 #if (ERRCLASS & ERRCLS_ADD_RES)
2263       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2264          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2265          (ErrVal)ETFU073, (ErrVal)0, "Packing failed");
2266 #endif
2267       RETVALUE(RFAILED);
2268    }
2269    {
2270       Mem   sMem;
2271       sMem.region = pst->region;
2272       sMem.pool = pst->pool;
2273       if ((cmAllocEvnt(sizeof(TfuSrsIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srsInd)) != ROK)            {
2274 #if (ERRCLASS & ERRCLS_ADD_RES)
2275          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2276             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2277             (ErrVal)ETFU074, (ErrVal)0, "Packing failed");
2278 #endif
2279          TFU_FREE_MSG(mBuf);
2280          RETVALUE(RFAILED);
2281       }
2282    }
2283       cmUnpkTfuSrsIndInfo(srsInd, (Ptr)&srsInd->memCp, mBuf);
2284    TFU_FREE_MSG(mBuf);
2285    RETVALUE((*func)(pst, suId, srsInd));
2286 }
2287 #endif
2288
2289
2290 \f
2291 /***********************************************************
2292 *
2293 *     Func : cmPkTfuDatInd
2294 *
2295 *
2296 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2297  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2298  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2299  * is relayed to MAC using this primitive. 
2300  * @param pst 
2301  * @param spId
2302  * @param tfuDatInd pointer to TfuDatIndInfo
2303  * @return
2304 *
2305 *
2306 *     Ret  : S16
2307 *
2308 *     Notes:
2309 *
2310 *     File  : 
2311 *
2312 **********************************************************/
2313 #ifdef ANSI
2314 PUBLIC S16 cmPkTfuDatInd
2315 (
2316 Pst * pst,
2317 SpId spId,
2318 TfuDatIndInfo * datInd
2319 )
2320 #else
2321 PUBLIC S16 cmPkTfuDatInd(pst, spId, datInd)
2322 Pst * pst;
2323 SpId spId;
2324 TfuDatIndInfo * datInd;
2325 #endif
2326 {
2327    Buffer *mBuf = NULLP;
2328    TRC3(cmPkTfuDatInd)
2329
2330    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2331 #if (ERRCLASS & ERRCLS_ADD_RES)
2332       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2333          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2334          (ErrVal)ETFU075, (ErrVal)0, "Packing failed");
2335 #endif
2336       TFU_FREE_MEM(datInd);
2337       RETVALUE(RFAILED);
2338    }
2339    if (pst->selector == ODU_SELECTOR_LC) {
2340       if (cmPkTfuDatIndInfo(datInd, mBuf) != ROK) {
2341 #if (ERRCLASS & ERRCLS_ADD_RES)
2342          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2343             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2344             (ErrVal)ETFU076, (ErrVal)0, "Packing failed");
2345 #endif
2346          TFU_FREE_MEM(datInd);
2347          TFU_FREE_MSG(mBuf);
2348          RETVALUE(RFAILED);
2349       }
2350    }
2351    else if(pst->selector == ODU_SELECTOR_LWLC)
2352    {
2353       if(cmPkPtr((PTR)datInd, mBuf) != ROK)
2354       {
2355 #if (ERRCLASS & ERRCLS_ADD_RES)
2356          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2357                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2358                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2359 #endif
2360          TFU_FREE_MEM(datInd);
2361          TFU_FREE_MSG(mBuf);
2362          RETVALUE(RFAILED);
2363       }
2364    }
2365
2366    if (SPkS16(spId, mBuf) != ROK) {
2367 #if (ERRCLASS & ERRCLS_ADD_RES)
2368       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2369          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2370          (ErrVal)ETFU077, (ErrVal)0, "Packing failed");
2371 #endif
2372       TFU_FREE_MEM(datInd);
2373       TFU_FREE_MSG(mBuf);
2374       RETVALUE(RFAILED);
2375    }
2376    if (pst->selector != ODU_SELECTOR_LWLC) {
2377       TFU_FREE_MEM(datInd);
2378    }
2379
2380    pst->event = (Event) EVTTFUDATIND;
2381    RETVALUE(SPstTsk(pst,mBuf));
2382 }
2383
2384 \f
2385 /***********************************************************
2386 *
2387 *     Func : cmUnpkTfuDatInd
2388 *
2389 *
2390 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2391  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2392  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2393  * is relayed to MAC using this primitive. 
2394  * @param pst 
2395  * @param spId
2396  * @param tfuDatInd pointer to TfuDatIndInfo
2397  * @return
2398 *
2399 *
2400 *     Ret  : S16
2401 *
2402 *     Notes:
2403 *
2404 *     File  : 
2405 *
2406 **********************************************************/
2407 #ifdef ANSI
2408 PUBLIC S16 cmUnpkTfuDatInd
2409 (
2410 TfuDatInd func,
2411 Pst *pst,
2412 Buffer *mBuf
2413 )
2414 #else
2415 PUBLIC S16 cmUnpkTfuDatInd(func, pst, mBuf)
2416 TfuDatInd func;
2417 Pst *pst;
2418 Buffer *mBuf;
2419 #endif
2420 {
2421    SpId spId;
2422    TfuDatIndInfo *datInd;
2423    
2424    TRC3(cmUnpkTfuDatInd)
2425
2426    if (SUnpkS16(&spId, mBuf) != ROK) {
2427       TFU_FREE_MSG(mBuf);
2428 #if (ERRCLASS & ERRCLS_ADD_RES)
2429       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2430          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2431          (ErrVal)ETFU078, (ErrVal)0, "Packing failed");
2432 #endif
2433       RETVALUE(RFAILED);
2434    }
2435    if (pst->selector != ODU_SELECTOR_LWLC) {
2436       Mem   sMem;
2437       sMem.region = pst->region;
2438       sMem.pool = pst->pool;
2439       if ((cmAllocEvnt(sizeof(TfuDatIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&datInd)) != ROK)            {
2440 #if (ERRCLASS & ERRCLS_ADD_RES)
2441          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2442             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2443             (ErrVal)ETFU079, (ErrVal)0, "Packing failed");
2444 #endif
2445          TFU_FREE_MSG(mBuf);
2446          RETVALUE(RFAILED);
2447       }
2448    }
2449
2450
2451    if (pst->selector == ODU_SELECTOR_LC) 
2452    {
2453       if (cmUnpkTfuDatIndInfo(datInd, (Ptr)&datInd->memCp, mBuf) != ROK) {
2454          TFU_FREE_MEM(datInd);
2455          TFU_FREE_MSG(mBuf);
2456 #if (ERRCLASS & ERRCLS_ADD_RES)
2457          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2458                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2459                (ErrVal)ETFU080, (ErrVal)0, "Packing failed");
2460 #endif
2461          RETVALUE(RFAILED);
2462       }
2463    }
2464    else if(pst->selector == ODU_SELECTOR_LWLC)
2465    {
2466       if(cmUnpkPtr((PTR *)&datInd, mBuf) != ROK)
2467       {
2468 #if (ERRCLASS & ERRCLS_ADD_RES)
2469          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2470                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2471                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2472 #endif
2473          TFU_FREE_MEM(datInd);
2474          TFU_FREE_MSG(mBuf);
2475          RETVALUE(RFAILED);
2476       }
2477    }
2478    TFU_FREE_MSG(mBuf);
2479    RETVALUE((*func)(pst, spId, datInd));
2480 }
2481
2482 \f
2483 /***********************************************************
2484 *
2485 *     Func : cmPkTfuCrcInd
2486 *
2487 *
2488 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2489  * on the PUSCH Data was successful or not.
2490  * @details This primitive carries CRC indication for a list of UEs. This
2491  * is utilized in the scenario where MAC requested the reception of uplink data
2492  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2493  * failed. This CRC failure is indicated to MAC, which would utillize this
2494  * information for further scheduling. 
2495  * Physical layer would indicate failure or success for each PUSCH transmission.
2496  * @param pst Pointer to the post structure.
2497  * @param suId SAP ID of the service user.
2498  * @param crcInd Pointer to the TfuCrcIndInfo.
2499  * @return ROK/RFAILED
2500 *
2501 *
2502 *     Ret  : S16
2503 *
2504 *     Notes:
2505 *
2506 *     File  : 
2507 *
2508 **********************************************************/
2509 #ifdef ANSI
2510 PUBLIC S16 cmPkTfuCrcInd
2511 (
2512 Pst * pst,
2513 SuId suId,
2514 TfuCrcIndInfo * crcIndInfo
2515 )
2516 #else
2517 PUBLIC S16 cmPkTfuCrcInd(pst, suId, crcIndInfo)
2518 Pst * pst;
2519 SuId suId;
2520 TfuCrcIndInfo * crcIndInfo;
2521 #endif
2522 {
2523    Buffer *mBuf = NULLP;
2524    TRC3(cmPkTfuCrcInd)
2525
2526    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2527 #if (ERRCLASS & ERRCLS_ADD_RES)
2528       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2529          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2530          (ErrVal)ETFU081, (ErrVal)0, "Packing failed");
2531 #endif
2532       TFU_FREE_MEM(crcIndInfo);
2533       RETVALUE(RFAILED);
2534    }
2535    if (pst->selector == ODU_SELECTOR_LC) {
2536       if (cmPkTfuCrcIndInfo(crcIndInfo, mBuf) != ROK) {
2537 #if (ERRCLASS & ERRCLS_ADD_RES)
2538          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2539             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2540             (ErrVal)ETFU082, (ErrVal)0, "Packing failed");
2541 #endif
2542          TFU_FREE_MEM(crcIndInfo);
2543          TFU_FREE_MSG(mBuf);
2544          RETVALUE(RFAILED);
2545       }
2546    }
2547    else if(pst->selector == ODU_SELECTOR_LWLC)
2548    {
2549       if (cmPkPtr((PTR)crcIndInfo, mBuf) != ROK)
2550       {
2551 #if (ERRCLASS & ERRCLS_ADD_RES)
2552          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2553             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2554             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2555 #endif
2556          TFU_FREE_MEM(crcIndInfo);
2557          TFU_FREE_MSG(mBuf);
2558          RETVALUE(RFAILED);
2559       }
2560    }
2561
2562
2563    if (SPkS16(suId, mBuf) != ROK) {
2564 #if (ERRCLASS & ERRCLS_ADD_RES)
2565       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2566          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2567          (ErrVal)ETFU083, (ErrVal)0, "Packing failed");
2568 #endif
2569       TFU_FREE_MEM(crcIndInfo);
2570       TFU_FREE_MSG(mBuf);
2571       RETVALUE(RFAILED);
2572    }
2573    if (pst->selector != ODU_SELECTOR_LWLC) {
2574       TFU_FREE_MEM(crcIndInfo);
2575    }
2576
2577    pst->event = (Event) EVTTFUCRCIND;
2578    RETVALUE(SPstTsk(pst,mBuf));
2579 }
2580
2581 \f
2582 /***********************************************************
2583 *
2584 *     Func : cmUnpkTfuCrcInd
2585 *
2586 *
2587 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2588  * on the PUSCH Data was successful or not.
2589  * @details This primitive carries CRC indication for a list of UEs. This
2590  * is utilized in the scenario where MAC requested the reception of uplink data
2591  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2592  * failed. This CRC failure is indicated to MAC, which would utillize this
2593  * information for further scheduling. 
2594  * Physical layer would indicate failure or success for each PUSCH transmission.
2595  * @param pst Pointer to the post structure.
2596  * @param suId SAP ID of the service user.
2597  * @param crcInd Pointer to the TfuCrcIndInfo.
2598  * @return ROK/RFAILED
2599 *
2600 *
2601 *     Ret  : S16
2602 *
2603 *     Notes:
2604 *
2605 *     File  : 
2606 *
2607 **********************************************************/
2608 #ifdef ANSI
2609 PUBLIC S16 cmUnpkTfuCrcInd
2610 (
2611 TfuCrcInd func,
2612 Pst *pst,
2613 Buffer *mBuf
2614 )
2615 #else
2616 PUBLIC S16 cmUnpkTfuCrcInd(func, pst, mBuf)
2617 TfuCrcInd func;
2618 Pst *pst;
2619 Buffer *mBuf;
2620 #endif
2621 {
2622    SuId suId;
2623    TfuCrcIndInfo *crcIndInfo;
2624    
2625    TRC3(cmUnpkTfuCrcInd)
2626
2627    if (SUnpkS16(&suId, mBuf) != ROK) {
2628       TFU_FREE_MSG(mBuf);
2629 #if (ERRCLASS & ERRCLS_ADD_RES)
2630       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2631          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2632          (ErrVal)ETFU084, (ErrVal)0, "Packing failed");
2633 #endif
2634       RETVALUE(RFAILED);
2635    }
2636    if (pst->selector != ODU_SELECTOR_LWLC) {
2637       Mem   sMem;
2638       sMem.region = pst->region;
2639       sMem.pool = pst->pool;
2640       if ((cmAllocEvnt(sizeof(TfuCrcIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&crcIndInfo)) != ROK)            {
2641 #if (ERRCLASS & ERRCLS_ADD_RES)
2642          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2643             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2644             (ErrVal)ETFU085, (ErrVal)0, "Packing failed");
2645 #endif
2646          TFU_FREE_MSG(mBuf);
2647          RETVALUE(RFAILED);
2648       }
2649    }
2650
2651
2652    if (pst->selector == ODU_SELECTOR_LC) 
2653    {
2654       if (cmUnpkTfuCrcIndInfo(crcIndInfo, (Ptr)&crcIndInfo->memCp, mBuf) != ROK) {
2655          TFU_FREE_MEM(crcIndInfo);
2656          TFU_FREE_MSG(mBuf);
2657 #if (ERRCLASS & ERRCLS_ADD_RES)
2658          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2659                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2660                (ErrVal)ETFU086, (ErrVal)0, "Packing failed");
2661 #endif
2662          RETVALUE(RFAILED);
2663       }
2664    }
2665    else if(pst->selector == ODU_SELECTOR_LWLC)
2666    {
2667       if (cmUnpkPtr((PTR *)&crcIndInfo, mBuf) != ROK)
2668       {
2669 #if (ERRCLASS & ERRCLS_ADD_RES)
2670          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2671             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2672             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2673 #endif
2674          TFU_FREE_MEM(crcIndInfo);
2675          TFU_FREE_MSG(mBuf);
2676          RETVALUE(RFAILED);
2677       }
2678    }
2679    TFU_FREE_MSG(mBuf);
2680    RETVALUE((*func)(pst, suId, crcIndInfo));
2681 }
2682
2683 \f
2684 /***********************************************************
2685 *
2686 *     Func : cmPkTfuTimingAdvInd
2687 *
2688 *
2689 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2690  * @details This primitive carries timing advance information for a number of
2691  * UEs that may need timing advance. Timing advance information is an estimate
2692  * of the timing adjustment that a UE would need to apply in order to be
2693  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2694  * @param pst Pointer to the post structure.
2695  * @param suId SAP ID of the service user.
2696  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2697  * @return ROK/RFAILED
2698 *
2699 *
2700 *     Ret  : S16
2701 *
2702 *     Notes:
2703 *
2704 *     File  : 
2705 *
2706 **********************************************************/
2707 #ifdef ANSI
2708 PUBLIC S16 cmPkTfuTimingAdvInd
2709 (
2710 Pst * pst,
2711 SuId suId,
2712 TfuTimingAdvIndInfo * timingAdvInd
2713 )
2714 #else
2715 PUBLIC S16 cmPkTfuTimingAdvInd(pst, suId, timingAdvInd)
2716 Pst * pst;
2717 SuId suId;
2718 TfuTimingAdvIndInfo * timingAdvInd;
2719 #endif
2720 {
2721    Buffer *mBuf = NULLP;
2722    TRC3(cmPkTfuTimingAdvInd)
2723
2724    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2725 #if (ERRCLASS & ERRCLS_ADD_RES)
2726       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2727          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2728          (ErrVal)ETFU087, (ErrVal)0, "Packing failed");
2729 #endif
2730       TFU_FREE_MEM(timingAdvInd);
2731       RETVALUE(RFAILED);
2732    }
2733    if (pst->selector == ODU_SELECTOR_LC) {
2734       if (cmPkTfuTimingAdvIndInfo(timingAdvInd, mBuf) != ROK) {
2735 #if (ERRCLASS & ERRCLS_ADD_RES)
2736          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2737             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2738             (ErrVal)ETFU088, (ErrVal)0, "Packing failed");
2739 #endif
2740          TFU_FREE_MEM(timingAdvInd);
2741          TFU_FREE_MSG(mBuf);
2742          RETVALUE(RFAILED);
2743       }
2744    }
2745    else if(pst->selector == ODU_SELECTOR_LWLC)
2746    {
2747       if (cmPkPtr((PTR)timingAdvInd, mBuf) != ROK)
2748       {
2749 #if (ERRCLASS & ERRCLS_ADD_RES)
2750          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2751             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2752             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2753 #endif
2754          TFU_FREE_MEM(timingAdvInd);
2755          TFU_FREE_MSG(mBuf);
2756          RETVALUE(RFAILED);
2757       }
2758    }
2759
2760    if (SPkS16(suId, mBuf) != ROK) {
2761 #if (ERRCLASS & ERRCLS_ADD_RES)
2762       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2763          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2764          (ErrVal)ETFU089, (ErrVal)0, "Packing failed");
2765 #endif
2766       TFU_FREE_MEM(timingAdvInd);
2767       TFU_FREE_MSG(mBuf);
2768       RETVALUE(RFAILED);
2769    }
2770    if (pst->selector != ODU_SELECTOR_LWLC) {
2771       TFU_FREE_MEM(timingAdvInd);
2772    }
2773
2774    pst->event = (Event) EVTTFUTIMINGADVIND;
2775    RETVALUE(SPstTsk(pst,mBuf));
2776 }
2777
2778 \f
2779 /***********************************************************
2780 *
2781 *     Func : cmUnpkTfuTimingAdvInd
2782 *
2783 *
2784 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2785  * @details This primitive carries timing advance information for a number of
2786  * UEs that may need timing advance. Timing advance information is an estimate
2787  * of the timing adjustment that a UE would need to apply in order to be
2788  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2789  * @param pst Pointer to the post structure.
2790  * @param suId SAP ID of the service user.
2791  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2792  * @return ROK/RFAILED
2793 *
2794 *
2795 *     Ret  : S16
2796 *
2797 *     Notes:
2798 *
2799 *     File  : 
2800 *
2801 **********************************************************/
2802 #ifdef ANSI
2803 PUBLIC S16 cmUnpkTfuTimingAdvInd
2804 (
2805 TfuTimingAdvInd func,
2806 Pst *pst,
2807 Buffer *mBuf
2808 )
2809 #else
2810 PUBLIC S16 cmUnpkTfuTimingAdvInd(func, pst, mBuf)
2811 TfuTimingAdvInd func;
2812 Pst *pst;
2813 Buffer *mBuf;
2814 #endif
2815 {
2816    SuId suId;
2817    TfuTimingAdvIndInfo *timingAdvInd;
2818    
2819    TRC3(cmUnpkTfuTimingAdvInd)
2820
2821    if (SUnpkS16(&suId, mBuf) != ROK) {
2822       TFU_FREE_MSG(mBuf);
2823 #if (ERRCLASS & ERRCLS_ADD_RES)
2824       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2825          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2826          (ErrVal)ETFU090, (ErrVal)0, "Packing failed");
2827 #endif
2828       RETVALUE(RFAILED);
2829    }
2830    if (pst->selector != ODU_SELECTOR_LWLC) {
2831       Mem   sMem;
2832       sMem.region = pst->region;
2833       sMem.pool = pst->pool;
2834       if ((cmAllocEvnt(sizeof(TfuTimingAdvIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&timingAdvInd)) != ROK)            {
2835 #if (ERRCLASS & ERRCLS_ADD_RES)
2836          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2837             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2838             (ErrVal)ETFU091, (ErrVal)0, "Packing failed");
2839 #endif
2840          TFU_FREE_MSG(mBuf);
2841          RETVALUE(RFAILED);
2842       }
2843    }
2844
2845
2846    if (pst->selector == ODU_SELECTOR_LC) 
2847    {
2848       if (cmUnpkTfuTimingAdvIndInfo(timingAdvInd, (Ptr)&timingAdvInd->memCp, mBuf) != ROK) {
2849          TFU_FREE_MEM(timingAdvInd);
2850          TFU_FREE_MSG(mBuf);
2851 #if (ERRCLASS & ERRCLS_ADD_RES)
2852          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2853                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2854                (ErrVal)ETFU092, (ErrVal)0, "Packing failed");
2855 #endif
2856          RETVALUE(RFAILED);
2857       }
2858    }
2859    else if(pst->selector == ODU_SELECTOR_LWLC)
2860    {
2861       if (cmUnpkPtr((PTR *)&timingAdvInd, mBuf) != ROK)
2862       {
2863 #if (ERRCLASS & ERRCLS_ADD_RES)
2864          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2865             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2866             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2867 #endif
2868          TFU_FREE_MEM(timingAdvInd);
2869          TFU_FREE_MSG(mBuf);
2870          RETVALUE(RFAILED);
2871       }
2872    }
2873    TFU_FREE_MSG(mBuf);
2874    RETVALUE((*func)(pst, suId, timingAdvInd));
2875 }
2876
2877 \f
2878 /***********************************************************
2879 *
2880 *     Func : cmPkTfuDatReq
2881 *
2882 *
2883 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2884   * transmission. 
2885   * @details The data being sent in this primitive is meant to be transmitted on
2886   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2887   * layer processing, requisite control information is also sent along with the
2888   * data. 
2889   * @sa TfUiTfuCntrlReq
2890   * @param pst 
2891   * @param spId
2892   * @param tfuDatReq pointer to TfuDatReqInfo
2893   * @return
2894 *
2895 *
2896 *     Ret  : S16
2897 *
2898 *     Notes:
2899 *
2900 *     File  : 
2901 *
2902 **********************************************************/
2903 #ifdef ANSI
2904 PUBLIC S16 cmPkTfuDatReq
2905 (
2906 Pst * pst,
2907 SpId spId,
2908 TfuDatReqInfo * datReq
2909 )
2910 #else
2911 PUBLIC S16 cmPkTfuDatReq(pst, spId, datReq)
2912 Pst * pst;
2913 SpId spId;
2914 TfuDatReqInfo * datReq;
2915 #endif
2916 {
2917    Buffer *mBuf = NULLP;
2918    TRC3(cmPkTfuDatReq)
2919
2920    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2921 #if (ERRCLASS & ERRCLS_ADD_RES)
2922       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2923          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2924          (ErrVal)ETFU093, (ErrVal)0, "Packing failed");
2925 #endif
2926       TFU_FREE_MEM(datReq);
2927       RETVALUE(RFAILED);
2928    }
2929    if (pst->selector == ODU_SELECTOR_LC) {
2930       if (cmPkTfuDatReqInfo(datReq, mBuf) != ROK) {
2931 #if (ERRCLASS & ERRCLS_ADD_RES)
2932          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2933             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2934             (ErrVal)ETFU094, (ErrVal)0, "Packing failed");
2935 #endif
2936          TFU_FREE_MEM(datReq);
2937          TFU_FREE_MSG(mBuf);
2938          RETVALUE(RFAILED);
2939       }
2940    }
2941    else if(pst->selector == ODU_SELECTOR_LWLC)
2942    {
2943       if(cmPkPtr((PTR)datReq, mBuf) != ROK)
2944       {
2945 #if (ERRCLASS & ERRCLS_ADD_RES)
2946          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2947             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2948             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2949 #endif
2950          TFU_FREE_MEM(datReq);
2951          TFU_FREE_MSG(mBuf);
2952          RETVALUE(RFAILED);
2953       }
2954    }
2955
2956    if (SPkS16(spId, mBuf) != ROK) {
2957 #if (ERRCLASS & ERRCLS_ADD_RES)
2958       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2959          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2960          (ErrVal)ETFU095, (ErrVal)0, "Packing failed");
2961 #endif
2962       TFU_FREE_MEM(datReq);
2963       TFU_FREE_MSG(mBuf);
2964       RETVALUE(RFAILED);
2965    }
2966    if (pst->selector != ODU_SELECTOR_LWLC) {
2967       TFU_FREE_MEM(datReq);
2968    }
2969
2970    pst->event = (Event) EVTTFUDATREQ;
2971    RETVALUE(SPstTsk(pst,mBuf));
2972 }
2973
2974 \f
2975 /***********************************************************
2976 *
2977 *     Func : cmUnpkTfuDatReq
2978 *
2979 *
2980 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2981   * transmission. 
2982   * @details The data being sent in this primitive is meant to be transmitted on
2983   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2984   * layer processing, requisite control information is also sent along with the
2985   * data. 
2986   * @sa TfUiTfuCntrlReq
2987   * @param pst 
2988   * @param spId
2989   * @param tfuDatReq pointer to TfuDatReqInfo
2990   * @return
2991 *
2992 *
2993 *     Ret  : S16
2994 *
2995 *     Notes:
2996 *
2997 *     File  : 
2998 *
2999 **********************************************************/
3000 #ifdef ANSI
3001 PUBLIC S16 cmUnpkTfuDatReq
3002 (
3003 TfuDatReq func,
3004 Pst *pst,
3005 Buffer *mBuf
3006 )
3007 #else
3008 PUBLIC S16 cmUnpkTfuDatReq(func, pst, mBuf)
3009 TfuDatReq func;
3010 Pst *pst;
3011 Buffer *mBuf;
3012 #endif
3013 {
3014    SpId spId;
3015    TfuDatReqInfo *datReq;
3016    
3017    TRC3(cmUnpkTfuDatReq)
3018
3019    if (SUnpkS16(&spId, mBuf) != ROK) {
3020       TFU_FREE_MSG(mBuf);
3021 #if (ERRCLASS & ERRCLS_ADD_RES)
3022       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3023          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3024          (ErrVal)ETFU096, (ErrVal)0, "Packing failed");
3025 #endif
3026       RETVALUE(RFAILED);
3027    }
3028    if (pst->selector != ODU_SELECTOR_LWLC) {
3029       Mem   sMem;
3030       sMem.region = pst->region;
3031       sMem.pool = pst->pool;
3032       if ((cmAllocEvnt(sizeof(TfuDatReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&datReq)) != ROK)            {
3033 #if (ERRCLASS & ERRCLS_ADD_RES)
3034          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3035             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3036             (ErrVal)ETFU097, (ErrVal)0, "Packing failed");
3037 #endif
3038          TFU_FREE_MSG(mBuf);
3039          RETVALUE(RFAILED);
3040       }
3041    }
3042
3043
3044    if (pst->selector == ODU_SELECTOR_LC) 
3045    {
3046       if (cmUnpkTfuDatReqInfo(datReq, (Ptr)&datReq->memCp, mBuf) != ROK) {
3047          TFU_FREE_MEM(datReq);
3048          TFU_FREE_MSG(mBuf);
3049 #if (ERRCLASS & ERRCLS_ADD_RES)
3050          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3051                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3052                (ErrVal)ETFU098, (ErrVal)0, "Unpacking failed");
3053 #endif
3054          RETVALUE(RFAILED);
3055       }
3056    }
3057    else if (pst->selector == ODU_SELECTOR_LWLC)
3058    {
3059       if(cmUnpkPtr((PTR *)&datReq, mBuf) != ROK)
3060       {
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)ETFUXXX, (ErrVal)0, "LWLC Un-Packing failed");
3067 #endif
3068          RETVALUE(RFAILED);
3069       }
3070    }
3071    TFU_FREE_MSG(mBuf);
3072    RETVALUE((*func)(pst, spId, datReq));
3073 }
3074
3075 \f
3076 /***********************************************************
3077 *
3078 *     Func : cmPkTfuCntrlReq
3079 *
3080 *
3081 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3082   * all the control information
3083   * @details This primitive carries the information sent on the following
3084   * channels - 
3085   * -# PDCCH
3086   * -# PHICH
3087   * -# PCFICH
3088   * 
3089   * @param pst
3090   * @param spId
3091   * @param cntrlReq pointer to TfuCntrlReqInfo
3092   * @return ROK/RFAILED
3093 *
3094 *
3095 *     Ret  : S16
3096 *
3097 *     Notes:
3098 *
3099 *     File  : 
3100 *
3101 **********************************************************/
3102 #ifdef ANSI
3103 PUBLIC S16 cmPkTfuCntrlReq
3104 (
3105 Pst * pst,
3106 SpId spId,
3107 TfuCntrlReqInfo * cntrlReq
3108 )
3109 #else
3110 PUBLIC S16 cmPkTfuCntrlReq(pst, spId, cntrlReq)
3111 Pst * pst;
3112 SpId spId;
3113 TfuCntrlReqInfo * cntrlReq;
3114 #endif
3115 {
3116    Buffer *mBuf = NULLP;
3117    TRC3(cmPkTfuCntrlReq)
3118
3119    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3120 #if (ERRCLASS & ERRCLS_ADD_RES)
3121       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3122          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3123          (ErrVal)ETFU099, (ErrVal)0, "Packing failed");
3124 #endif
3125       TFU_FREE_MEM(cntrlReq);
3126       RETVALUE(RFAILED);
3127    }
3128    if (pst->selector == ODU_SELECTOR_LC) {
3129       if (cmPkTfuCntrlReqInfo(cntrlReq, mBuf) != ROK) {
3130 #if (ERRCLASS & ERRCLS_ADD_RES)
3131          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3132             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3133             (ErrVal)ETFU100, (ErrVal)0, "Packing failed");
3134 #endif
3135          TFU_FREE_MEM(cntrlReq);
3136          TFU_FREE_MSG(mBuf);
3137          RETVALUE(RFAILED);
3138       }
3139    }
3140    else if(pst->selector == ODU_SELECTOR_LWLC)
3141    {
3142       if (cmPkPtr((PTR)cntrlReq, mBuf) != ROK)
3143       {
3144 #if (ERRCLASS & ERRCLS_ADD_RES)
3145          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3146             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3147             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3148 #endif
3149          TFU_FREE_MEM(cntrlReq);
3150          TFU_FREE_MSG(mBuf);
3151          RETVALUE(RFAILED);
3152       }
3153    }
3154
3155
3156    if (SPkS16(spId, mBuf) != ROK) {
3157 #if (ERRCLASS & ERRCLS_ADD_RES)
3158       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3159          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3160          (ErrVal)ETFU101, (ErrVal)0, "Packing failed");
3161 #endif
3162       TFU_FREE_MEM(cntrlReq);
3163       TFU_FREE_MSG(mBuf);
3164       RETVALUE(RFAILED);
3165    }
3166    if (pst->selector != ODU_SELECTOR_LWLC) {
3167       TFU_FREE_MEM(cntrlReq);
3168    }
3169
3170    pst->event = (Event) EVTTFUCNTRLREQ;
3171    RETVALUE(SPstTsk(pst,mBuf));
3172 }
3173
3174 \f
3175 /***********************************************************
3176 *
3177 *     Func : cmUnpkTfuCntrlReq
3178 *
3179 *
3180 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3181   * all the control information
3182   * @details This primitive carries the information sent on the following
3183   * channels - 
3184   * -# PDCCH
3185   * -# PHICH
3186   * -# PCFICH
3187   * 
3188   * @param pst
3189   * @param spId
3190   * @param cntrlReq pointer to TfuCntrlReqInfo
3191   * @return ROK/RFAILED
3192 *
3193 *
3194 *     Ret  : S16
3195 *
3196 *     Notes:
3197 *
3198 *     File  : 
3199 *
3200 **********************************************************/
3201 #ifdef ANSI
3202 PUBLIC S16 cmUnpkTfuCntrlReq
3203 (
3204 TfuCntrlReq func,
3205 Pst *pst,
3206 Buffer *mBuf
3207 )
3208 #else
3209 PUBLIC S16 cmUnpkTfuCntrlReq(func, pst, mBuf)
3210 TfuCntrlReq func;
3211 Pst *pst;
3212 Buffer *mBuf;
3213 #endif
3214 {
3215    SpId spId;
3216    TfuCntrlReqInfo *cntrlReq;
3217    
3218    TRC3(cmUnpkTfuCntrlReq)
3219
3220    if (SUnpkS16(&spId, mBuf) != ROK) {
3221       TFU_FREE_MSG(mBuf);
3222 #if (ERRCLASS & ERRCLS_ADD_RES)
3223       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3224          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3225          (ErrVal)ETFU102, (ErrVal)0, "Packing failed");
3226 #endif
3227       RETVALUE(RFAILED);
3228    }
3229    if (pst->selector != ODU_SELECTOR_LWLC) {
3230       Mem   sMem;
3231       sMem.region = pst->region;
3232       sMem.pool = pst->pool;
3233       if ((cmAllocEvnt(sizeof(TfuCntrlReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&cntrlReq)) != ROK)            {
3234 #if (ERRCLASS & ERRCLS_ADD_RES)
3235          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3236             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3237             (ErrVal)ETFU103, (ErrVal)0, "Packing failed");
3238 #endif
3239          TFU_FREE_MSG(mBuf);
3240          RETVALUE(RFAILED);
3241       }
3242    }
3243
3244
3245    if (pst->selector == ODU_SELECTOR_LC) 
3246    {
3247       if (cmUnpkTfuCntrlReqInfo(cntrlReq, (Ptr)&cntrlReq->memCp, mBuf) != ROK) {
3248          TFU_FREE_MEM(cntrlReq);
3249          TFU_FREE_MSG(mBuf);
3250 #if (ERRCLASS & ERRCLS_ADD_RES)
3251          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3252                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3253                (ErrVal)ETFU104, (ErrVal)0, "Packing failed");
3254 #endif
3255          RETVALUE(RFAILED);
3256       }
3257    }
3258    else if(pst->selector == ODU_SELECTOR_LWLC)
3259    {
3260       if (cmUnpkPtr((PTR *)&cntrlReq, mBuf) != ROK)
3261       {
3262 #if (ERRCLASS & ERRCLS_ADD_RES)
3263          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3264             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3265             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3266 #endif
3267          TFU_FREE_MEM(cntrlReq);
3268          TFU_FREE_MSG(mBuf);
3269          RETVALUE(RFAILED);
3270       }
3271    }
3272    TFU_FREE_MSG(mBuf);
3273    RETVALUE((*func)(pst, spId, cntrlReq));
3274 }
3275
3276
3277 \f
3278 /***********************************************************
3279 *
3280 *     Func : cmPkTfuTtiInd
3281 *
3282 *
3283 *     Desc : This API is the TTI indication from PHY to MAC . 
3284  * @details This primitive provides the timing information (SFN and subframe)
3285  * which is currently running on the physical layer. 
3286  * @param pst Pointer to the post structure.
3287  * @param suId SAP ID of the service user.
3288  * @param ttiInd Pointer to the TfuTtiIndInfo.
3289  * @return ROK/RFAILED
3290 *
3291 *
3292 *     Ret  : S16
3293 *
3294 *     Notes:
3295 *
3296 *     File  : 
3297 *
3298 **********************************************************/
3299 #ifdef ANSI
3300 PUBLIC S16 cmPkTfuTtiInd
3301 (
3302 Pst * pst,
3303 SuId suId,
3304 TfuTtiIndInfo * ttiInd
3305 )
3306 #else
3307 PUBLIC S16 cmPkTfuTtiInd(pst, suId, ttiInd)
3308 Pst * pst;
3309 SuId suId;
3310 TfuTtiIndInfo * ttiInd;
3311 #endif
3312 {
3313    Buffer *mBuf = NULLP;
3314    TRC3(cmPkTfuTtiInd)
3315
3316    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3317 #if (ERRCLASS & ERRCLS_ADD_RES)
3318       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3319          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3320          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3321 #endif
3322       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3323       RETVALUE(RFAILED);
3324    }
3325    if (pst->selector == ODU_SELECTOR_LC) {
3326       if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3327 #if (ERRCLASS & ERRCLS_ADD_RES)
3328          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3329             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3330             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
3331 #endif
3332          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3333          TFU_FREE_MSG(mBuf);
3334          RETVALUE(RFAILED);
3335       }
3336    }
3337    else if(pst->selector == ODU_SELECTOR_LWLC)
3338    {
3339       if (cmPkPtr((PTR)ttiInd, mBuf) != ROK)
3340       {
3341 #if (ERRCLASS & ERRCLS_ADD_RES)
3342          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3343             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3344             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3345 #endif
3346          
3347          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
3348          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3349          TFU_FREE_MSG(mBuf);
3350          RETVALUE(RFAILED);
3351       }
3352    }
3353
3354    if (SPkS16(suId, mBuf) != ROK) {
3355 #if (ERRCLASS & ERRCLS_ADD_RES)
3356       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3357          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3358          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3359 #endif
3360       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3361       TFU_FREE_MSG(mBuf);
3362       RETVALUE(RFAILED);
3363    }
3364    if (pst->selector != ODU_SELECTOR_LWLC) {
3365       if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
3366 #if (ERRCLASS & ERRCLS_ADD_RES)
3367       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3368          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3369          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
3370 #endif
3371          TFU_FREE_MSG(mBuf);
3372          RETVALUE(RFAILED);
3373       }
3374    }
3375
3376    //pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
3377    RETVALUE(SPstTsk(pst,mBuf));
3378 }
3379
3380 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
3381 /***********************************************************
3382  *
3383  *     Func : cmPkTfuNonRtInd
3384  *
3385  *
3386  *     Desc : This API is the Non-Rt indication from CL to MAC . 
3387  * @param pst Pointer to the post structure.
3388  * @param suId SAP ID of the service user.
3389  * @return ROK/RFAILED
3390  *
3391  *
3392  *     Ret  : S16
3393  *
3394  *     Notes:
3395  *
3396  *     File  : 
3397  *
3398 **********************************************************/
3399 #ifdef ANSI
3400 PUBLIC S16 cmPkTfuNonRtInd
3401 (
3402 Pst * pst,
3403 SuId suId
3404 )
3405 #else
3406 PUBLIC S16 cmPkTfuNonRtInd(pst, suId)
3407 Pst * pst;
3408 SuId suId;
3409 #endif
3410 {
3411    Buffer *mBuf = NULLP;
3412    TRC3(cmPkTfuNonRtInd)
3413
3414    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3415 #if (ERRCLASS & ERRCLS_ADD_RES)
3416       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3417          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3418          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3419 #endif
3420       RETVALUE(RFAILED);
3421   }
3422   if (SPkS16(suId, mBuf) != ROK) {
3423 #if (ERRCLASS & ERRCLS_ADD_RES)
3424       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3425          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3426          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3427 #endif
3428       TFU_FREE_MSG(mBuf);
3429       RETVALUE(RFAILED);
3430   }
3431   pst->event = (Event) EVTTFUNONRTIND;
3432   RETVALUE(SPstTsk(pst,mBuf));
3433 }
3434
3435 /***********************************************************
3436 *
3437 *     Func : cmUnpkTfuNonRtInd
3438 *
3439 *
3440 *     Desc : This API is the Non Rt indication from PHY to MAC . 
3441 * @param pst Pointer to the post structure.
3442 * @param suId SAP ID of the service user.
3443 * @return ROK/RFAILED
3444 *
3445 *
3446 *     Ret  : S16
3447 *
3448 *     Notes:
3449 *
3450 *     File  : 
3451 *
3452 **********************************************************/
3453 #ifdef ANSI
3454 PUBLIC S16 cmUnpkTfuNonRtInd
3455 (
3456 TfuNonRtInd func,
3457 Pst *pst,
3458 Buffer *mBuf
3459 )
3460 #else
3461 PUBLIC S16 cmUnpkTfuNonRtInd(func, pst, mBuf)
3462 TfuNonRtInd func;
3463 Pst *pst;
3464 Buffer *mBuf;
3465 #endif
3466 {
3467    SuId suId;
3468    TRC3(cmUnpkTfuNonRtInd)
3469
3470    if (SUnpkS16(&suId, mBuf) != ROK) {
3471       TFU_FREE_MSG(mBuf);
3472 #if (ERRCLASS & ERRCLS_ADD_RES)
3473       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3474          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3475          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3476 #endif
3477       RETVALUE(RFAILED);
3478    }
3479    TFU_FREE_MSG(mBuf);
3480    RETVALUE((*func)(pst, suId));
3481 }
3482
3483 #endif
3484
3485 \f
3486 /***********************************************************
3487 *
3488 *     Func : cmPkTfuPucchDeltaPwr
3489 *
3490 *
3491 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3492  * Physical layer.
3493  * This information is utilized by Scheduler for power control. 
3494  * @param pst Pointer to the post structure.
3495  * @param suId SAP ID of the service user.
3496  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3497  * @return ROK/RFAILED
3498 *
3499 *
3500 *     Ret  : S16
3501 *
3502 *     Notes:
3503 *
3504 *     File  : 
3505 *
3506 **********************************************************/
3507 #ifdef ANSI
3508 PUBLIC S16 cmPkTfuPucchDeltaPwr
3509 (
3510 Pst * pst,
3511 SuId suId,
3512 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr
3513 )
3514 #else
3515 PUBLIC S16 cmPkTfuPucchDeltaPwr(pst, suId, pucchDeltaPwr)
3516 Pst * pst;
3517 SuId suId;
3518 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr;
3519 #endif
3520 {
3521    Buffer *mBuf = NULLP;
3522    TRC3(cmPkTfuPucchDeltaPwr)
3523
3524    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3525 #if (ERRCLASS & ERRCLS_ADD_RES)
3526       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3527          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3528          (ErrVal)ETFU119, (ErrVal)0, "Packing failed");
3529 #endif
3530       SPutSBuf(pst->region, pst->pool, (Data *)pucchDeltaPwr, sizeof(TfuPucchDeltaPwrIndInfo));
3531       RETVALUE(RFAILED);
3532    }
3533    if (pst->selector == ODU_SELECTOR_LC) {
3534       if (cmPkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, mBuf) != ROK) {
3535 #if (ERRCLASS & ERRCLS_ADD_RES)
3536          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3537             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3538             (ErrVal)ETFU120, (ErrVal)0, "Packing failed");
3539 #endif
3540          TFU_FREE_MEM(pucchDeltaPwr);
3541          TFU_FREE_MSG(mBuf);
3542          RETVALUE(RFAILED);
3543       }
3544    }
3545    else if(pst->selector == ODU_SELECTOR_LWLC)
3546    {
3547       if (cmPkPtr((PTR)pucchDeltaPwr, mBuf) != ROK)
3548       {
3549 #if (ERRCLASS & ERRCLS_ADD_RES)
3550          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3551             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3552             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3553 #endif
3554          TFU_FREE_MEM(pucchDeltaPwr);
3555          TFU_FREE_MSG(mBuf);
3556          RETVALUE(RFAILED);
3557       }
3558    }
3559
3560    if (SPkS16(suId, mBuf) != ROK) {
3561 #if (ERRCLASS & ERRCLS_ADD_RES)
3562       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3563          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3564          (ErrVal)ETFU121, (ErrVal)0, "Packing failed");
3565 #endif
3566       TFU_FREE_MEM(pucchDeltaPwr);
3567       TFU_FREE_MSG(mBuf);
3568       RETVALUE(RFAILED);
3569    }
3570    if (pst->selector != ODU_SELECTOR_LWLC) {
3571       TFU_FREE_MEM(pucchDeltaPwr);
3572    }
3573    pst->event = (Event) EVTTFUPUCCHDELPWR;
3574    RETVALUE(SPstTsk(pst,mBuf));
3575 }
3576
3577 \f
3578 /***********************************************************
3579 *
3580 *     Func : cmUnpkTfuPucchDeltaPwr
3581 *
3582 *
3583 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3584  * Physical layer.
3585  * This information is utilized by Scheduler for power control. 
3586  * @param pst Pointer to the post structure.
3587  * @param suId SAP ID of the service user.
3588  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3589  * @return ROK/RFAILED
3590 *
3591 *
3592 *     Ret  : S16
3593 *
3594 *     Notes:
3595 *
3596 *     File  : 
3597 *
3598 **********************************************************/
3599 #ifdef ANSI
3600 PUBLIC S16 cmUnpkTfuPucchDeltaPwr
3601 (
3602 TfuPucchDeltaPwrInd func,
3603 Pst *pst,
3604 Buffer *mBuf
3605 )
3606 #else
3607 PUBLIC S16 cmUnpkTfuPucchDeltaPwr(func, pst, mBuf)
3608 TfuPucchDeltaPwrInd func;
3609 Pst *pst;
3610 Buffer *mBuf;
3611 #endif
3612 {
3613    SuId suId;
3614    TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
3615    
3616    TRC3(cmUnpkTfuPucchDeltaPwr)
3617
3618    if (SUnpkS16(&suId, mBuf) != ROK) {
3619       TFU_FREE_MSG(mBuf);
3620 #if (ERRCLASS & ERRCLS_ADD_RES)
3621       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3622          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3623          (ErrVal)ETFU122, (ErrVal)0, "Packing failed");
3624 #endif
3625       RETVALUE(RFAILED);
3626    }
3627    if (pst->selector != ODU_SELECTOR_LWLC) {
3628       Mem   sMem;
3629       sMem.region = pst->region;
3630       sMem.pool = pst->pool;
3631       if ((cmAllocEvnt(sizeof(TfuPucchDeltaPwrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&pucchDeltaPwr)) != ROK)            {
3632 #if (ERRCLASS & ERRCLS_ADD_RES)
3633          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3634             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3635             (ErrVal)ETFU123, (ErrVal)0, "Packing failed");
3636 #endif
3637          TFU_FREE_MSG(mBuf);
3638          RETVALUE(RFAILED);
3639       }
3640    }
3641
3642    if (pst->selector == ODU_SELECTOR_LC) 
3643    {
3644       if (cmUnpkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, (Ptr)&pucchDeltaPwr->memCp, mBuf) != ROK) {
3645          TFU_FREE_MEM(pucchDeltaPwr);
3646          TFU_FREE_MSG(mBuf);
3647 #if (ERRCLASS & ERRCLS_ADD_RES)
3648          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3649                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3650                (ErrVal)ETFU124, (ErrVal)0, "Packing failed");
3651 #endif
3652          RETVALUE(RFAILED);
3653       }
3654    }
3655    else if(pst->selector == ODU_SELECTOR_LWLC)
3656    {
3657       if (cmUnpkPtr((PTR *)&pucchDeltaPwr, 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 un-Packing failed");
3663 #endif
3664          TFU_FREE_MEM(pucchDeltaPwr);
3665          TFU_FREE_MSG(mBuf);
3666          RETVALUE(RFAILED);
3667       }
3668    }
3669    TFU_FREE_MSG(mBuf);
3670    RETVALUE((*func)(pst, suId, pucchDeltaPwr));
3671 }
3672
3673 #ifdef TFU_5GTF
3674 \f
3675 /***********************************************************
3676 *
3677 *     Func : cmPkTfuRbAssignA1Val324
3678 *
3679 *
3680 *     Desc : This structure contains the information needed to convey  RIV value 324.
3681 *
3682 *
3683 *     Ret  : S16
3684 *
3685 *     Notes:
3686 *
3687 *     File  : 
3688 *
3689 **********************************************************/
3690 #ifdef ANSI
3691 PUBLIC S16 cmPkTfuRbAssignA1Val324
3692 (
3693 TfuRbAssignA1Val324 *param,
3694 Buffer *mBuf
3695 )
3696 #else
3697 PUBLIC S16 cmPkTfuRbAssignA1Val324(param, mBuf)
3698 TfuRbAssignA1Val324 *param;
3699 Buffer *mBuf;
3700 #endif
3701 {
3702
3703    TRC3(cmPkTfuRbAssignA1Val324)
3704
3705    CMCHKPK(SPkU8, param->ndi, mBuf);
3706    CMCHKPK(SPkU8, param->mcs, mBuf);
3707    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3708 #ifdef UL_ADPT_DBG   
3709    printf("cmPkTfuRbAssignA1Val324 param->ndi %d mcs %d param->hqProcId %d \n",param->ndi,param->mcs,param->hqProcId);
3710 #endif   
3711    RETVALUE(ROK);
3712 }
3713
3714 \f
3715 /***********************************************************
3716 *
3717 *     Func : cmPkTfuRbAssignB1Val324
3718 *
3719 *
3720 *     Desc : This structure contains the information needed to convey  RIV value 324.
3721 *
3722 *
3723 *     Ret  : S16
3724 *
3725 *     Notes:
3726 *
3727 *     File  : 
3728 *
3729 **********************************************************/
3730 #ifdef ANSI
3731 PUBLIC S16 cmPkTfuRbAssignB1Val324
3732 (
3733 TfuRbAssignB1Val324 *param,
3734 Buffer *mBuf
3735 )
3736 #else
3737 PUBLIC S16 cmPkTfuRbAssignB1Val324(param, mBuf)
3738 TfuRbAssignB1Val324 *param;
3739 Buffer *mBuf;
3740 #endif
3741 {
3742
3743    TRC3(cmPkTfuRbAssignB1Val324)
3744
3745    CMCHKPK(SPkU8, param->bmiHqAckNack, mBuf);
3746    CMCHKPK(SPkU8, param->RV, mBuf);
3747    CMCHKPK(SPkU8, param->ndi, mBuf);
3748    CMCHKPK(SPkU8, param->mcs, mBuf);
3749    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3750    RETVALUE(ROK);
3751 }
3752
3753 \f
3754 /***********************************************************
3755 *
3756 *     Func : cmPkTfuRbAssignVal326
3757 *
3758 *
3759 *     Desc : This structure contains the information needed to convey  RIV value 326.
3760 *
3761 *
3762 *     Ret  : S16
3763 *
3764 *     Notes:
3765 *
3766 *     File  : 
3767 *
3768 **********************************************************/
3769 #ifdef ANSI
3770 PUBLIC S16 cmPkTfuRbAssignVal326
3771 (
3772 TfuRbAssignVal326 *param,
3773 Buffer *mBuf
3774 )
3775 #else
3776 PUBLIC S16 cmPkTfuRbAssignVal326(param, mBuf)
3777 TfuRbAssignVal326 *param;
3778 Buffer *mBuf;
3779 #endif
3780 {
3781
3782    TRC3(cmPkTfuRbAssignVal326)
3783
3784    CMCHKPK(SPkU8, param->CyclicShiftInd, mBuf);
3785    CMCHKPK(SPkU8, param->OCCInd, mBuf);
3786    CMCHKPK(SPkU8, param->FreqBandIdx, mBuf);
3787    RETVALUE(ROK);
3788 }
3789
3790 \f
3791 /***********************************************************
3792 *
3793 *     Func : cmUnpkTfuRbAssignA1Val324
3794 *
3795 *
3796 *     Desc : This structure contains the information needed to convey  RIV value 324.
3797 *
3798 *
3799 *     Ret  : S16
3800 *
3801 *     Notes:
3802 *
3803 *     File  : 
3804 *
3805 **********************************************************/
3806 #ifdef ANSI
3807 PUBLIC S16 cmUnpkTfuRbAssignA1Val324
3808 (
3809 TfuRbAssignA1Val324 *param,
3810 Buffer *mBuf
3811 )
3812 #else
3813 PUBLIC S16 cmUnpkTfuRbAssignA1Val324(param, mBuf)
3814 TfuRbAssignA1Val324 *param;
3815 Buffer *mBuf;
3816 #endif
3817 {
3818
3819    TRC3(cmUnpkTfuRbAssignA1Val324)
3820
3821    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
3822    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
3823    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
3824    RETVALUE(ROK);
3825 }
3826
3827 \f
3828 /***********************************************************
3829 *
3830 *     Func : cmUnpkTfuRbAssignB1Val324
3831 *
3832 *
3833 *     Desc : This structure contains the information needed to convey  RIV value 324.
3834 *
3835 *
3836 *     Ret  : S16
3837 *
3838 *     Notes:
3839 *
3840 *     File  : 
3841 *
3842 **********************************************************/
3843 #ifdef ANSI
3844 PUBLIC S16 cmUnpkTfuRbAssignB1Val324
3845 (
3846 TfuRbAssignB1Val324 *param,
3847 Buffer *mBuf
3848 )
3849 #else
3850 PUBLIC S16 cmUnpkTfuRbAssignB1Val324(param, mBuf)
3851 TfuRbAssignB1Val324 *param;
3852 Buffer *mBuf;
3853 #endif
3854 {
3855
3856    TRC3(cmUnpkTfuRbAssignB1Val324)
3857
3858    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
3859    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
3860    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
3861    CMCHKUNPK(SUnpkU8, &param->RV, mBuf);
3862    CMCHKUNPK(SUnpkU8, &param->bmiHqAckNack, mBuf);
3863    RETVALUE(ROK);
3864 }
3865
3866 \f
3867 /***********************************************************
3868 *
3869 *     Func : cmUnpkTfuRbAssignVal326
3870 *
3871 *
3872 *     Desc : This structure contains the information needed to convey  RIV value 326.
3873 *
3874 *
3875 *     Ret  : S16
3876 *
3877 *     Notes:
3878 *
3879 *     File  : 
3880 *
3881 **********************************************************/
3882 #ifdef ANSI
3883 PUBLIC S16 cmUnpkTfuRbAssignVal326
3884 (
3885 TfuRbAssignVal326 *param,
3886 Buffer *mBuf
3887 )
3888 #else
3889 PUBLIC S16 cmUnpkTfuRbAssignVal326(param, mBuf)
3890 TfuRbAssignVal326 *param;
3891 Buffer *mBuf;
3892 #endif
3893 {
3894
3895    TRC3(cmUnpkTfuRbAssignVal326)
3896
3897    CMCHKUNPK(SUnpkU8, &param->FreqBandIdx, mBuf);
3898    CMCHKUNPK(SUnpkU8, &param->OCCInd, mBuf);
3899    CMCHKUNPK(SUnpkU8, &param->CyclicShiftInd, mBuf);
3900    RETVALUE(ROK);
3901 }
3902
3903
3904 \f
3905 /***********************************************************
3906 *
3907 *     Func : cmPkTfuDciFormatA1A2Info
3908 *
3909 *
3910 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
3911 *
3912 *
3913 *     Ret  : S16
3914 *
3915 *     Notes:
3916 *
3917 *     File  : 
3918 *
3919 **********************************************************/
3920 #ifdef ANSI
3921 PUBLIC S16 cmPkTfuDciFormatA1A2Info
3922 (
3923 TfuDciFormatA1Info *param,
3924 Buffer *mBuf
3925 )
3926 #else
3927 PUBLIC S16 cmPkTfuDciFormatA1A2Info(param, mBuf)
3928 TfuDciFormatA1Info *param;
3929 Buffer *mBuf;
3930 #endif
3931 {
3932
3933    TRC3(cmPkTfuDciFormatA1A2Info)
3934
3935    //printf("5GTF_DBG: cmPkTfuDciFormatA1Info() called by eNB\n");   
3936    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
3937    CMCHKPK(SPkU8, param->UL_PCRS, mBuf);
3938    CMCHKPK(SPkU8, param->PMI, mBuf);
3939    CMCHKPK(SPkU8, param->SCID, mBuf);
3940
3941    CMCHKPK(SPkU8, param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
3942    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
3943    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
3944    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
3945    CMCHKPK(SPkU8, param->uciOnxPUSCH, mBuf);
3946
3947    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
3948    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
3949    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
3950    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
3951    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
3952    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
3953
3954    if(param->RBAssign <= TFU_RIV_324)
3955    {
3956       CMCHKPK(cmPkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
3957    }
3958    else if (param->RBAssign == TFU_RIV_326)
3959    {
3960       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
3961    }
3962
3963    CMCHKPK(SPkU8, param->rv, mBuf);
3964    CMCHKPK(SPkU8, param->symbIdx, mBuf);
3965    CMCHKPK(SPkU8, param->beamIndex, mBuf);
3966    CMCHKPK(SPkU16, param->RBAssign, mBuf);
3967    CMCHKPK(SPkU8, param->xPUSCH_TxTiming, mBuf);
3968    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
3969    CMCHKPK(SPkU8, param->formatType, mBuf);
3970    RETVALUE(ROK);
3971 }
3972
3973 \f
3974 /***********************************************************
3975 *
3976 *     Func : cmPkTfuDciFormatB1B2Info
3977 *
3978 *
3979 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
3980 *
3981 *
3982 *     Ret  : S16
3983 *
3984 *     Notes:
3985 *
3986 *     File  : 
3987 *
3988 **********************************************************/
3989 #ifdef ANSI
3990 PUBLIC S16 cmPkTfuDciFormatB1B2Info
3991 (
3992 TfuDciFormatB1Info *param,
3993 Buffer *mBuf
3994 )
3995 #else
3996 PUBLIC S16 cmPkTfuDciFormatB1B2Info(param, mBuf)
3997 TfuDciFormatB1Info *param;
3998 Buffer *mBuf;
3999 #endif
4000 {
4001
4002    TRC3(cmPkTfuDciFormatB1B2Info)
4003
4004    CMCHKPK(SPkU8, param->DL_PCRS, mBuf);
4005    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4006    CMCHKPK(SPkU8, param->SCID, mBuf);
4007
4008    CMCHKPK(SPkU8, param->AntPorts_numLayers, mBuf);
4009    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4010    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4011    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4012    CMCHKPK(SPkU8, param->freqResIdx_xPUCCH, mBuf);
4013
4014    CMCHKPK(SPkU8, param->xPUCCH_TxTiming, mBuf);
4015
4016    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4017    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4018    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4019    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4020    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4021    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4022
4023    if(param->RBAssign <= TFU_RIV_324)
4024    {
4025       CMCHKPK(cmPkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4026    }
4027    else if (param->RBAssign == TFU_RIV_326)
4028    {
4029       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4030    }
4031   
4032    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4033    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4034    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4035    CMCHKPK(SPkU8, param->xPDSCHRange, mBuf);
4036    CMCHKPK(SPkU8, param->formatType, mBuf);
4037    RETVALUE(ROK);
4038 }
4039
4040
4041 \f
4042 /***********************************************************
4043 *
4044 *     Func : cmUnpkTfuDciFormatA1A2Info
4045 *
4046 *
4047 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4048 *
4049 *
4050 *     Ret  : S16
4051 *
4052 *     Notes:
4053 *
4054 *     File  : 
4055 *
4056 **********************************************************/
4057 #ifdef ANSI
4058 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info
4059 (
4060 TfuDciFormatA1Info *param,
4061 Buffer *mBuf
4062 )
4063 #else
4064 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info(param, mBuf)
4065 TfuDciFormatA1Info *param;
4066 Buffer *mBuf;
4067 #endif
4068 {
4069
4070    TRC3(cmUnpkTfuDciFormatA1A2Info)
4071
4072    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4073    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
4074    CMCHKUNPK(SUnpkU8, &param->xPUSCH_TxTiming, mBuf);
4075    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4076    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4077    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4078    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4079
4080    if(param->RBAssign <= TFU_RIV_324)
4081    {
4082       CMCHKUNPK(cmUnpkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4083    }
4084    else if(param->RBAssign == TFU_RIV_326)
4085    {
4086       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4087    }
4088
4089    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4090    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4091    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4092    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4093    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4094    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4095
4096    CMCHKUNPK(SUnpkU8, &param->uciOnxPUSCH, mBuf);
4097    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4098    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4099    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4100    CMCHKUNPK(SUnpkU8, &param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4101
4102    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4103    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
4104    CMCHKUNPK(SUnpkU8, &param->UL_PCRS, mBuf);
4105    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4106
4107    RETVALUE(ROK);
4108 }
4109
4110 \f
4111 /***********************************************************
4112 *
4113 *     Func : cmUnpkTfuDciFormatB1B2Info
4114 *
4115 *
4116 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4117 *
4118 *
4119 *     Ret  : S16
4120 *
4121 *     Notes:
4122 *
4123 *     File  : 
4124 *
4125 **********************************************************/
4126 #ifdef ANSI
4127 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info
4128 (
4129 TfuDciFormatB1Info *param,
4130 Buffer *mBuf
4131 )
4132 #else
4133 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info(param, mBuf)
4134 TfuDciFormatB1Info *param;
4135 Buffer *mBuf;
4136 #endif
4137 {
4138
4139    TRC3(cmUnpkTfuDciFormatB1B2Info)
4140
4141    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4142    CMCHKUNPK(SUnpkU8, &param->xPDSCHRange, mBuf);
4143    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4144    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4145    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4146
4147    if(param->RBAssign <= TFU_RIV_324)
4148    {
4149       CMCHKUNPK(cmUnpkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4150    }
4151    else if (param->RBAssign == TFU_RIV_326)
4152    {
4153       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4154    }
4155
4156    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4157    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4158    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4159    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4160    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4161    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4162
4163    CMCHKUNPK(SUnpkU8, &param->xPUCCH_TxTiming, mBuf);
4164    CMCHKUNPK(SUnpkU8, &param->freqResIdx_xPUCCH, mBuf);
4165    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4166    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4167    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4168    CMCHKUNPK(SUnpkU8, &param->AntPorts_numLayers, mBuf);
4169    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4170    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4171    CMCHKUNPK(SUnpkU8, &param->DL_PCRS, mBuf);
4172
4173    RETVALUE(ROK);
4174 }
4175
4176
4177 #endif /* TFU_5GTF */
4178
4179 \f
4180 /***********************************************************
4181 *
4182 *     Func : cmPkTfuDciFormat0Info
4183 *
4184 *
4185 *     Desc : This structure contains the information needed to convey DCI format 0.
4186 *
4187 *
4188 *     Ret  : S16
4189 *
4190 *     Notes:
4191 *
4192 *     File  : 
4193 *
4194 **********************************************************/
4195 #ifdef ANSI
4196 PUBLIC S16 cmPkTfuDciFormat0Info
4197 (
4198 TfuDciFormat0Info *param,
4199 Buffer *mBuf
4200 )
4201 #else
4202 PUBLIC S16 cmPkTfuDciFormat0Info(param, mBuf)
4203 TfuDciFormat0Info *param;
4204 Buffer *mBuf;
4205 #endif
4206 {
4207
4208    TRC3(cmPkTfuDciFormat0Info)
4209
4210    /* tfu_c_001.main_3: Adding pack for hqProcId */
4211    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4212    CMCHKPK(SPkU8, param->txAntenna, mBuf);
4213    CMCHKPK(SPkU8, param->numCqiBit, mBuf);
4214    CMCHKPK(SPkU8, param->cqiReq, mBuf);
4215    CMCHKPK(SPkU8, param->nDmrs, mBuf);
4216
4217 #ifdef TFU_TDD
4218    CMCHKPK(SPkU8, param->dai, mBuf);
4219    CMCHKPK(SPkU8, param->ulIdx, mBuf);
4220
4221 #endif
4222    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4223    CMCHKPK(SPkU8, param->ndi, mBuf);
4224    CMCHKPK(SPkU8, param->mcs, mBuf);
4225    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
4226 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
4227 #ifdef TFU_UPGRADE
4228    CMCHKPK(SPkU32, param->riv, mBuf);
4229 #endif
4230    CMCHKPK(SPkU8, param->numRb, mBuf);
4231    CMCHKPK(SPkU8, param->rbStart, mBuf);
4232    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
4233    RETVALUE(ROK);
4234 }
4235
4236
4237 \f
4238 /***********************************************************
4239 *
4240 *     Func : cmUnpkTfuDciFormat0Info
4241 *
4242 *
4243 *     Desc : This structure contains the information needed to convey DCI format 0.
4244 *
4245 *
4246 *     Ret  : S16
4247 *
4248 *     Notes:
4249 *
4250 *     File  : 
4251 *
4252 **********************************************************/
4253 #ifdef ANSI
4254 PUBLIC S16 cmUnpkTfuDciFormat0Info
4255 (
4256 TfuDciFormat0Info *param,
4257 Buffer *mBuf
4258 )
4259 #else
4260 PUBLIC S16 cmUnpkTfuDciFormat0Info(param, mBuf)
4261 TfuDciFormat0Info *param;
4262 Buffer *mBuf;
4263 #endif
4264 {
4265
4266    TRC3(cmUnpkTfuDciFormat0Info)
4267
4268    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
4269    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
4270    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
4271 #ifdef TFU_UPGRADE
4272    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4273 #endif /* TFU_UPGRADE */
4274    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
4275    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4276    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4277    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4278
4279 #ifdef TFU_TDD
4280    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
4281    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4282
4283 #endif
4284    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
4285    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
4286    CMCHKUNPK(SUnpkU8, &param->numCqiBit, mBuf);
4287    CMCHKUNPK(SUnpkU8, &param->txAntenna, mBuf);
4288    /* tfu_c_001.main_3: Adding unpack for hqProcId */
4289    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4290
4291    RETVALUE(ROK);
4292 }
4293
4294
4295 \f
4296 /***********************************************************
4297 *
4298 *     Func : cmPkTfuAllocMapOrRiv
4299 *
4300 *
4301 *     Desc : This Structure could either contain a resource allocation bit map OR a
4302  * RIV Value as defined in 213 - 7.1.6.
4303 *
4304 *
4305 *     Ret  : S16
4306 *
4307 *     Notes:
4308 *
4309 *     File  : 
4310 *
4311 **********************************************************/
4312 #ifdef ANSI
4313 PUBLIC S16 cmPkTfuAllocMapOrRiv
4314 (
4315 TfuAllocMapOrRiv *param,
4316 Buffer *mBuf
4317 )
4318 #else
4319 PUBLIC S16 cmPkTfuAllocMapOrRiv(param, mBuf)
4320 TfuAllocMapOrRiv *param;
4321 Buffer *mBuf;
4322 #endif
4323 {
4324
4325    S32 i;
4326    TRC3(cmPkTfuAllocMapOrRiv)
4327
4328       switch(param->type) {
4329       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4330 #ifdef TFU_RESMAP_CHANGE
4331          case UnKnown:
4332             CMCHKPK(cmPkTfuAllocMap, &param->u.allocMap, mBuf);
4333             break;
4334    
4335 #endif
4336    
4337       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4338 #ifndef TFU_RESMAP_CHANGE
4339          case TFU_ALLOC_TYPE_MAP:
4340             for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4341                CMCHKPK(SPkU8, param->u.resAllocMap[i], mBuf);
4342             }
4343             break;
4344    
4345 #endif
4346          case TFU_ALLOC_TYPE_RIV:
4347             CMCHKPK(SPkU32, param->u.riv, mBuf);
4348             break;
4349          default :
4350             RETVALUE(RFAILED);
4351       }
4352    CMCHKPK(SPkU32, param->type, mBuf);
4353    RETVALUE(ROK);
4354 }
4355
4356
4357 \f
4358 /***********************************************************
4359 *
4360 *     Func : cmUnpkTfuAllocMapOrRiv
4361 *
4362 *
4363 *     Desc : This Structure could either contain a resource allocation bit map OR a
4364  * RIV Value as defined in 213 - 7.1.6.
4365 *
4366 *
4367 *     Ret  : S16
4368 *
4369 *     Notes:
4370 *
4371 *     File  : 
4372 *
4373 **********************************************************/
4374 #ifdef ANSI
4375 PUBLIC S16 cmUnpkTfuAllocMapOrRiv
4376 (
4377 TfuAllocMapOrRiv *param,
4378 Buffer *mBuf
4379 )
4380 #else
4381 PUBLIC S16 cmUnpkTfuAllocMapOrRiv(param, mBuf)
4382 TfuAllocMapOrRiv *param;
4383 Buffer *mBuf;
4384 #endif
4385 {
4386
4387    S32 i;
4388    TRC3(cmUnpkTfuAllocMapOrRiv)
4389
4390    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
4391       switch(param->type) {
4392          case TFU_ALLOC_TYPE_RIV:
4393             CMCHKUNPK(SUnpkU32, &param->u.riv, mBuf);
4394             break;
4395    
4396       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4397 #ifndef TFU_RESMAP_CHANGE
4398          case TFU_ALLOC_TYPE_MAP:
4399             for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4400                CMCHKUNPK(SUnpkU8, &param->u.resAllocMap[i], mBuf);
4401             }
4402             break;
4403    
4404 #endif
4405    
4406       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4407 #ifdef TFU_RESMAP_CHANGE
4408          case UnKnown:
4409             CMCHKUNPK(cmUnpkTfuAllocMap, &param->u.allocMap, mBuf);
4410             break;
4411    
4412 #endif
4413          default :
4414             RETVALUE(RFAILED);
4415       }
4416    RETVALUE(ROK);
4417 }
4418
4419
4420 \f
4421 /***********************************************************
4422 *
4423 *     Func : cmPkTfuDciFormat1AllocInfo
4424 *
4425 *
4426 *     Desc : This structure contains only the allocation information, thats part
4427  * of DCI format 1. 
4428  * @details Allocation information also contains parameters necessary
4429  * for Physical layer to process Downlink Data. This structure accompanies the
4430  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4431  * @sa TfuDciFormat1Info
4432 *
4433 *
4434 *     Ret  : S16
4435 *
4436 *     Notes:
4437 *
4438 *     File  : 
4439 *
4440 **********************************************************/
4441 #ifdef ANSI
4442 PUBLIC S16 cmPkTfuDciFormat1AllocInfo
4443 (
4444 TfuDciFormat1AllocInfo *param,
4445 Buffer *mBuf
4446 )
4447 #else
4448 PUBLIC S16 cmPkTfuDciFormat1AllocInfo(param, mBuf)
4449 TfuDciFormat1AllocInfo *param;
4450 Buffer *mBuf;
4451 #endif
4452 {
4453
4454    S32 i;
4455    TRC3(cmPkTfuDciFormat1AllocInfo)
4456
4457    CMCHKPK(SPkU8, param->rv, mBuf);
4458    CMCHKPK(SPkU8, param->mcs, mBuf);
4459    CMCHKPK(SPkU8, param->ndi, mBuf);
4460    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4461    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4462       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4463    }
4464    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4465    RETVALUE(ROK);
4466 }
4467
4468
4469 \f
4470 /***********************************************************
4471 *
4472 *     Func : cmUnpkTfuDciFormat1AllocInfo
4473 *
4474 *
4475 *     Desc : This structure contains only the allocation information, thats part
4476  * of DCI format 1. 
4477  * @details Allocation information also contains parameters necessary
4478  * for Physical layer to process Downlink Data. This structure accompanies the
4479  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4480  * @sa TfuDciFormat1Info
4481 *
4482 *
4483 *     Ret  : S16
4484 *
4485 *     Notes:
4486 *
4487 *     File  : 
4488 *
4489 **********************************************************/
4490 #ifdef ANSI
4491 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo
4492 (
4493 TfuDciFormat1AllocInfo *param,
4494 Buffer *mBuf
4495 )
4496 #else
4497 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo(param, mBuf)
4498 TfuDciFormat1AllocInfo *param;
4499 Buffer *mBuf;
4500 #endif
4501 {
4502
4503    S32 i;
4504    TRC3(cmUnpkTfuDciFormat1AllocInfo)
4505
4506    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4507    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4508       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4509    }
4510    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4511    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4512    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4513    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4514    RETVALUE(ROK);
4515 }
4516
4517 \f
4518 /***********************************************************
4519 *
4520 *     Func : cmPkTfuDciFormat1Info
4521 *
4522 *
4523 *     Desc : This structure contains the information needed to convey DCI format 1.
4524  * @details Allocation information is separated from the other control
4525  * information carried in this format. This separation is needed as Data shall
4526  * also carry some control information, essentially allocation information,
4527  * along with it, in order to aid physical layer processing of the data.
4528 *
4529 *
4530 *     Ret  : S16
4531 *
4532 *     Notes:
4533 *
4534 *     File  : 
4535 *
4536 **********************************************************/
4537 #ifdef ANSI
4538 PUBLIC S16 cmPkTfuDciFormat1Info
4539 (
4540 TfuDciFormat1Info *param,
4541 Buffer *mBuf
4542 )
4543 #else
4544 PUBLIC S16 cmPkTfuDciFormat1Info(param, mBuf)
4545 TfuDciFormat1Info *param;
4546 Buffer *mBuf;
4547 #endif
4548 {
4549
4550    TRC3(cmPkTfuDciFormat1Info)
4551
4552    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4553
4554 #ifdef TFU_TDD
4555    CMCHKPK(SPkU8, param->dai, mBuf);
4556
4557 #endif
4558    CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4559    RETVALUE(ROK);
4560 }
4561
4562
4563 \f
4564 /***********************************************************
4565 *
4566 *     Func : cmUnpkTfuDciFormat1Info
4567 *
4568 *
4569 *     Desc : This structure contains the information needed to convey DCI format 1.
4570  * @details Allocation information is separated from the other control
4571  * information carried in this format. This separation is needed as Data shall
4572  * also carry some control information, essentially allocation information,
4573  * along with it, in order to aid physical layer processing of the data.
4574 *
4575 *
4576 *     Ret  : S16
4577 *
4578 *     Notes:
4579 *
4580 *     File  : 
4581 *
4582 **********************************************************/
4583 #ifdef ANSI
4584 PUBLIC S16 cmUnpkTfuDciFormat1Info
4585 (
4586 TfuDciFormat1Info *param,
4587 Buffer *mBuf
4588 )
4589 #else
4590 PUBLIC S16 cmUnpkTfuDciFormat1Info(param, mBuf)
4591 TfuDciFormat1Info *param;
4592 Buffer *mBuf;
4593 #endif
4594 {
4595
4596    TRC3(cmUnpkTfuDciFormat1Info)
4597
4598    CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4599
4600 #ifdef TFU_TDD
4601    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4602
4603 #endif
4604    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4605    RETVALUE(ROK);
4606 }
4607
4608
4609 \f
4610 /***********************************************************
4611 *
4612 *     Func : cmPkTfuDciFormat2AAllocInfo
4613 *
4614 *
4615 *     Desc : This structure contains only the allocation information, that is part
4616   * of DCI format 2A. 
4617   * @details Allocation information also contains parameters necessary
4618   * for Physical layer to process Downlink data. This structure accompanies the
4619   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4620   * @sa TfuDciFormat2AInfo
4621 *
4622 *
4623 *     Ret  : S16
4624 *
4625 *     Notes:
4626 *
4627 *     File  : 
4628 *
4629 **********************************************************/
4630 #ifdef ANSI
4631 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo
4632 (
4633 TfuDciFormat2AAllocInfo *param,
4634 Buffer *mBuf
4635 )
4636 #else
4637 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo(param, mBuf)
4638 TfuDciFormat2AAllocInfo *param;
4639 Buffer *mBuf;
4640 #endif
4641 {
4642
4643    S32 i;
4644    TRC3(cmPkTfuDciFormat2AAllocInfo)
4645
4646    CMCHKPK(SPkU8, param->transSwap, mBuf);
4647    CMCHKPK(SPkU8, param->precoding, mBuf);
4648
4649    for (i=1; i >= 0; i--) {
4650       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4651    }
4652
4653    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4654    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4655       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4656    }
4657
4658    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4659
4660    RETVALUE(ROK);
4661 }
4662
4663
4664 \f
4665 /***********************************************************
4666 *
4667 *     Func : cmUnpkTfuDciFormat2AAllocInfo
4668 *
4669 *
4670 *     Desc : This structure contains only the allocation information, that is part
4671   * of DCI format 2A. 
4672   * @details Allocation information also contains parameters necessary
4673   * for Physical layer to process Downlink data. This structure accompanies the
4674   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4675   * @sa TfuDciFormat2AInfo
4676 *
4677 *
4678 *     Ret  : S16
4679 *
4680 *     Notes:
4681 *
4682 *     File  : 
4683 *
4684 **********************************************************/
4685 #ifdef ANSI
4686 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo
4687 (
4688 TfuDciFormat2AAllocInfo *param,
4689 Buffer *mBuf
4690 )
4691 #else
4692 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo(param, mBuf)
4693 TfuDciFormat2AAllocInfo *param;
4694 Buffer *mBuf;
4695 #endif
4696 {
4697
4698    S32 i;
4699    TRC3(cmUnpkTfuDciFormat2AAllocInfo)
4700
4701
4702 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4703 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4704    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4705
4706
4707 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4708 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4709    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4710       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4711    }
4712    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4713
4714 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4715 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4716
4717 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4718 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4719    for (i=0; i<=1; i++) {
4720       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4721    }
4722
4723    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
4724    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
4725    RETVALUE(ROK);
4726 }
4727
4728 #ifdef EMTC_ENABLE
4729 /***********************************************************
4730 *
4731 *     Func : cmPkTfuDciFormat6AAllocInfo
4732 *
4733 *
4734 *     Desc : This structure contains only the allocation information, that is part
4735   * of DCI format 6-1A. 
4736   * @details Allocation information also contains parameters necessary
4737   * for Physical layer to process Downlink data. This structure accompanies the
4738   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4739   * @sa TfuDciFormat61aInfo
4740 *
4741 *
4742 *     Ret  : S16
4743 *
4744 *     Notes:
4745 *
4746 *     File  : 
4747 *
4748 **********************************************************/
4749 #ifdef ANSI
4750 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo
4751 (
4752 TfuDciFormat61AllocInfo *param,
4753 Buffer *mBuf
4754 )
4755 #else
4756 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo(param, mBuf)
4757 TfuDciFormat61AllocInfo *param;
4758 Buffer *mBuf;
4759 #endif
4760 {
4761
4762    TRC3(cmPkTfuDciFormat6AAllocInfo)
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    CMCHKPK(SPkU32, param->riv, mBuf);
4769
4770    RETVALUE(ROK);
4771 }
4772
4773
4774 \f
4775 /***********************************************************
4776 *
4777 *     Func : cmUnpkTfuDciFormat6AAllocInfo
4778 *
4779 *
4780 *     Desc : This structure contains only the allocation information, that is part
4781   * of DCI format 6-1A. 
4782   * @details Allocation information also contains parameters necessary
4783   * for Physical layer to process Downlink data. This structure accompanies the
4784   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4785   * @sa TfuDciFormat61aInfo
4786 *
4787 *
4788 *     Ret  : S16
4789 *
4790 *     Notes:
4791 *
4792 *     File  : 
4793 *
4794 **********************************************************/
4795 #ifdef ANSI
4796 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo
4797 (
4798 TfuDciFormat61AllocInfo *param,
4799 Buffer *mBuf
4800 )
4801 #else
4802 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo(param, mBuf)
4803 TfuDciFormat61AllocInfo *param;
4804 Buffer *mBuf;
4805 #endif
4806 {
4807
4808    TRC3(cmUnpkTfuDciFormat6AAllocInfo)
4809
4810    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4811    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4812    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4813    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4814    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4815    printf("In cmUnpkTfuDciFormat6AAllocInfo :: Passed \n");
4816    RETVALUE(ROK);
4817 }
4818 #endif
4819
4820
4821 \f
4822 /***********************************************************
4823 *
4824 *     Func : cmPkTfuDciFormat2AInfo
4825 *
4826 *
4827 *     Desc : This structure contains the information carried by DCI format 2A. 
4828  * @details It carries the allocation information and other control information.
4829 *
4830 *
4831 *     Ret  : S16
4832 *
4833 *     Notes:
4834 *
4835 *     File  : 
4836 *
4837 **********************************************************/
4838 #ifdef ANSI
4839 PUBLIC S16 cmPkTfuDciFormat2AInfo
4840 (
4841 TfuDciFormat2AInfo *param,
4842 Buffer *mBuf
4843 )
4844 #else
4845 PUBLIC S16 cmPkTfuDciFormat2AInfo(param, mBuf)
4846 TfuDciFormat2AInfo *param;
4847 Buffer *mBuf;
4848 #endif
4849 {
4850
4851    TRC3(cmPkTfuDciFormat2AInfo)
4852
4853    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4854
4855 #ifdef TFU_TDD
4856    CMCHKPK(SPkU8, param->dai, mBuf);
4857
4858 #endif
4859    CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
4860    RETVALUE(ROK);
4861 }
4862
4863
4864 \f
4865 /***********************************************************
4866 *
4867 *     Func : cmUnpkTfuDciFormat2AInfo
4868 *
4869 *
4870 *     Desc : This structure contains the information carried by DCI format 2A. 
4871  * @details It carries the allocation information and other control information.
4872 *
4873 *
4874 *     Ret  : S16
4875 *
4876 *     Notes:
4877 *
4878 *     File  : 
4879 *
4880 **********************************************************/
4881 #ifdef ANSI
4882 PUBLIC S16 cmUnpkTfuDciFormat2AInfo
4883 (
4884 TfuDciFormat2AInfo *param,
4885 Buffer *mBuf
4886 )
4887 #else
4888 PUBLIC S16 cmUnpkTfuDciFormat2AInfo(param, mBuf)
4889 TfuDciFormat2AInfo *param;
4890 Buffer *mBuf;
4891 #endif
4892 {
4893
4894    TRC3(cmUnpkTfuDciFormat2AInfo)
4895
4896    CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
4897
4898 #ifdef TFU_TDD
4899    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4900
4901 #endif
4902    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4903    RETVALUE(ROK);
4904 }
4905
4906
4907 \f
4908 /***********************************************************
4909 *
4910 *     Func : cmPkTfuDciFormat2AllocInfo
4911 *
4912 *
4913 *     Desc : This structure contains only the allocation information, that is part
4914   * of DCI format 2. 
4915   * @details Allocation information also contains parameters necessary
4916   * for Physical layer to process Downlink data. This structure accompanies the
4917   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4918   * @sa TfuDciFormat2Info
4919 *
4920 *
4921 *     Ret  : S16
4922 *
4923 *     Notes:
4924 *
4925 *     File  : 
4926 *
4927 **********************************************************/
4928 #ifdef ANSI
4929 PUBLIC S16 cmPkTfuDciFormat2AllocInfo
4930 (
4931 TfuDciFormat2AllocInfo *param,
4932 Buffer *mBuf
4933 )
4934 #else
4935 PUBLIC S16 cmPkTfuDciFormat2AllocInfo(param, mBuf)
4936 TfuDciFormat2AllocInfo *param;
4937 Buffer *mBuf;
4938 #endif
4939 {
4940
4941    S32 i;
4942    TRC3(cmPkTfuDciFormat2AllocInfo)
4943
4944
4945 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4946 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4947    for (i=1; i >= 0; i--) {
4948       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4949    }
4950    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4951
4952    CMCHKPK(SPkU8, param->precoding, mBuf);
4953    CMCHKPK(SPkU8, param->transSwap, mBuf);
4954
4955 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4956 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4957
4958 #ifdef TFU_TDD
4959    CMCHKPK(SPkU8, param->dai, mBuf);
4960
4961 #endif
4962    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4963       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4964    }
4965
4966 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4967 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4968
4969 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4970 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4971    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4972
4973    RETVALUE(ROK);
4974 }
4975
4976
4977 \f
4978 /***********************************************************
4979 *
4980 *     Func : cmUnpkTfuDciFormat2AllocInfo
4981 *
4982 *
4983 *     Desc : This structure contains only the allocation information, that is part
4984   * of DCI format 2. 
4985   * @details Allocation information also contains parameters necessary
4986   * for Physical layer to process Downlink data. This structure accompanies the
4987   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4988   * @sa TfuDciFormat2Info
4989 *
4990 *
4991 *     Ret  : S16
4992 *
4993 *     Notes:
4994 *
4995 *     File  : 
4996 *
4997 **********************************************************/
4998 #ifdef ANSI
4999 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo
5000 (
5001 TfuDciFormat2AllocInfo *param,
5002 Buffer *mBuf
5003 )
5004 #else
5005 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo(param, mBuf)
5006 TfuDciFormat2AllocInfo *param;
5007 Buffer *mBuf;
5008 #endif
5009 {
5010
5011    S32 i;
5012    TRC3(cmUnpkTfuDciFormat2AllocInfo)
5013
5014
5015 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5016 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5017    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
5018
5019
5020 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5021 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5022    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
5023       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
5024    }
5025
5026 #ifdef TFU_TDD
5027    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5028
5029 #endif
5030
5031 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5032 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5033    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
5034    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
5035
5036 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5037 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5038    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5039    for (i=0; i<=1; i++) {
5040       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5041    }
5042
5043    RETVALUE(ROK);
5044 }
5045
5046
5047 \f
5048 /***********************************************************
5049 *
5050 *     Func : cmPkTfuDciFormat2Info
5051 *
5052 *
5053 *     Desc : This structure contains the information carried by DCI format 2.
5054  * @details Allocation information is separated from the other control
5055  * information carried in this format. This separation is needed as Data must
5056  * also carry some control information, essentially, allocation information
5057  * along with it, in order to aid physical layer processing of the data.
5058 *
5059 *
5060 *     Ret  : S16
5061 *
5062 *     Notes:
5063 *
5064 *     File  : 
5065 *
5066 **********************************************************/
5067 #ifdef ANSI
5068 PUBLIC S16 cmPkTfuDciFormat2Info
5069 (
5070 TfuDciFormat2Info *param,
5071 Buffer *mBuf
5072 )
5073 #else
5074 PUBLIC S16 cmPkTfuDciFormat2Info(param, mBuf)
5075 TfuDciFormat2Info *param;
5076 Buffer *mBuf;
5077 #endif
5078 {
5079
5080    TRC3(cmPkTfuDciFormat2Info)
5081
5082
5083 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5084 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5085
5086 #ifdef TFU_TDD
5087    CMCHKPK(SPkU8, param->dai, mBuf);
5088
5089 #endif
5090
5091    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5092
5093 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5094 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5095    CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5096    RETVALUE(ROK);
5097 }
5098
5099
5100 \f
5101 /***********************************************************
5102 *
5103 *     Func : cmUnpkTfuDciFormat2Info
5104 *
5105 *
5106 *     Desc : This structure contains the information carried by DCI format 2.
5107  * @details Allocation information is separated from the other control
5108  * information carried in this format. This separation is needed as Data must
5109  * also carry some control information, essentially, allocation information
5110  * along with it, in order to aid physical layer processing of the data.
5111 *
5112 *
5113 *     Ret  : S16
5114 *
5115 *     Notes:
5116 *
5117 *     File  : 
5118 *
5119 **********************************************************/
5120 #ifdef ANSI
5121 PUBLIC S16 cmUnpkTfuDciFormat2Info
5122 (
5123 TfuDciFormat2Info *param,
5124 Buffer *mBuf
5125 )
5126 #else
5127 PUBLIC S16 cmUnpkTfuDciFormat2Info(param, mBuf)
5128 TfuDciFormat2Info *param;
5129 Buffer *mBuf;
5130 #endif
5131 {
5132
5133    TRC3(cmUnpkTfuDciFormat2Info)
5134
5135    CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5136
5137 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5138 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5139    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5140
5141 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5142 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5143
5144 #ifdef TFU_TDD
5145    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5146
5147 #endif
5148
5149    RETVALUE(ROK);
5150 }
5151
5152
5153 \f
5154 /***********************************************************
5155 *
5156 *     Func : cmPkTfuDciFormat3Info
5157 *
5158 *
5159 *     Desc : This structure contains the information carried in DCI format 3.
5160 *
5161 *
5162 *     Ret  : S16
5163 *
5164 *     Notes:
5165 *
5166 *     File  : 
5167 *
5168 **********************************************************/
5169 #ifdef ANSI
5170 PUBLIC S16 cmPkTfuDciFormat3Info
5171 (
5172 TfuDciFormat3Info *param,
5173 Buffer *mBuf
5174 )
5175 #else
5176 PUBLIC S16 cmPkTfuDciFormat3Info(param, mBuf)
5177 TfuDciFormat3Info *param;
5178 Buffer *mBuf;
5179 #endif
5180 {
5181
5182    S32 i;
5183    TRC3(cmPkTfuDciFormat3Info)
5184
5185    CMCHKPK(SPkU8, param->isPucch, mBuf);
5186    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5187       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5188    }
5189    RETVALUE(ROK);
5190 }
5191
5192
5193 \f
5194 /***********************************************************
5195 *
5196 *     Func : cmUnpkTfuDciFormat3Info
5197 *
5198 *
5199 *     Desc : This structure contains the information carried in DCI format 3.
5200 *
5201 *
5202 *     Ret  : S16
5203 *
5204 *     Notes:
5205 *
5206 *     File  : 
5207 *
5208 **********************************************************/
5209 #ifdef ANSI
5210 PUBLIC S16 cmUnpkTfuDciFormat3Info
5211 (
5212 TfuDciFormat3Info *param,
5213 Buffer *mBuf
5214 )
5215 #else
5216 PUBLIC S16 cmUnpkTfuDciFormat3Info(param, mBuf)
5217 TfuDciFormat3Info *param;
5218 Buffer *mBuf;
5219 #endif
5220 {
5221
5222    S32 i;
5223    TRC3(cmUnpkTfuDciFormat3Info)
5224
5225    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5226       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5227    }
5228    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5229    RETVALUE(ROK);
5230 }
5231
5232
5233 \f
5234 /***********************************************************
5235 *
5236 *     Func : cmPkTfuDciFormat3AInfo
5237 *
5238 *
5239 *     Desc : This structure contains the information carried by DCI format 3A.
5240 *
5241 *
5242 *     Ret  : S16
5243 *
5244 *     Notes:
5245 *
5246 *     File  : 
5247 *
5248 **********************************************************/
5249 #ifdef ANSI
5250 PUBLIC S16 cmPkTfuDciFormat3AInfo
5251 (
5252 TfuDciFormat3AInfo *param,
5253 Buffer *mBuf
5254 )
5255 #else
5256 PUBLIC S16 cmPkTfuDciFormat3AInfo(param, mBuf)
5257 TfuDciFormat3AInfo *param;
5258 Buffer *mBuf;
5259 #endif
5260 {
5261
5262    S32 i;
5263    TRC3(cmPkTfuDciFormat3AInfo)
5264    CMCHKPK(SPkU8, param->isPucch, mBuf);
5265    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5266       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5267    }
5268    RETVALUE(ROK);
5269 }
5270
5271
5272 \f
5273 /***********************************************************
5274 *
5275 *     Func : cmUnpkTfuDciFormat3AInfo
5276 *
5277 *
5278 *     Desc : This structure contains the information carried by DCI format 3A.
5279 *
5280 *
5281 *     Ret  : S16
5282 *
5283 *     Notes:
5284 *
5285 *     File  : 
5286 *
5287 **********************************************************/
5288 #ifdef ANSI
5289 PUBLIC S16 cmUnpkTfuDciFormat3AInfo
5290 (
5291 TfuDciFormat3AInfo *param,
5292 Buffer *mBuf
5293 )
5294 #else
5295 PUBLIC S16 cmUnpkTfuDciFormat3AInfo(param, mBuf)
5296 TfuDciFormat3AInfo *param;
5297 Buffer *mBuf;
5298 #endif
5299 {
5300
5301    S32 i;
5302    TRC3(cmUnpkTfuDciFormat3AInfo)
5303
5304    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5305       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5306    }
5307    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5308    RETVALUE(ROK);
5309 }
5310
5311 #ifdef EMTC_ENABLE
5312
5313
5314 /***********************************************************
5315 *
5316 *     Func : cmPkTfuDciFormat60aInfo 
5317 *
5318 *
5319 *     Desc : This structure contains the information that is carried in DCI
5320   * format 6-0A
5321 *
5322 *
5323 *     Ret  : S16
5324 *
5325 *     Notes:
5326 *
5327 *     File  :
5328 *
5329 ************************************************************/
5330
5331 #ifdef ANSI
5332 PRIVATE S16 cmPkTfuDciFormat60aInfo
5333 (
5334 TfuDciFormat60aInfo *param,
5335 Buffer *mBuf
5336 )
5337 #else
5338 PRIVATE S16 cmPkTfuDciFormat60aInfo(param, mBuf)
5339 TfuDciFormat60aInfo *param;
5340 Buffer *mBuf;
5341 #endif
5342 {
5343
5344    TRC3(cmPkTfuDciFormat60aInfo)
5345
5346    CMCHKPK(SPkU8, param->dciRep, mBuf);
5347    CMCHKPK(SPkU8, param->isSrs, mBuf);
5348    CMCHKPK(SPkU8, param->cqiReq, mBuf);
5349 #ifdef TFU_TDD
5350    CMCHKPK(SPkU8, param->dai, mBuf);
5351    CMCHKPK(SPkU8, param->ulIdx, mBuf);
5352 #endif
5353    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5354    CMCHKPK(SPkU8, param->rv, mBuf);
5355    CMCHKPK(SPkU8, param->ndi, mBuf);
5356    CMCHKPK(SPkU8, param->hqProcId, mBuf);
5357    CMCHKPK(SPkU8, param->rep, mBuf);
5358    CMCHKPK(SPkU8, param->mcs, mBuf);
5359    CMCHKPK(SPkU32, param->riv, mBuf);
5360    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5361    RETVALUE(ROK);
5362 }
5363 /***********************************************************
5364 *
5365 *     Func : cmPkTfuPdcchOrderInfoEmtc
5366 *
5367 *
5368 *     Desc : This structure contains the information that is carried in DCI
5369   * format 6-1A in the case of a PDCCH order.
5370 *
5371 *
5372 *     Ret  : S16
5373 *
5374 *     Notes:
5375 *
5376 *     File  : 
5377 *
5378 **********************************************************/
5379 #ifdef ANSI
5380 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc
5381 (
5382 TfuPdcchOrderInfoEmtc *param,
5383 Buffer *mBuf
5384 )
5385 #else
5386 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc(param, mBuf)
5387 TfuPdcchOrderInfoEmtc *param;
5388 Buffer *mBuf;
5389 #endif
5390 {
5391
5392    TRC3(cmPkTfuPdcchOrderInfoEmtc)
5393
5394    CMCHKPK(SPkU8, param->ceLevel, mBuf);
5395    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
5396    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
5397    CMCHKPK(SPkU32, param->riv, mBuf);
5398    RETVALUE(ROK);
5399 }
5400
5401 /***********************************************************
5402 *
5403 *     Func : cmPkTfudciformat61aPdsch
5404 *
5405 *
5406 *     Desc : This structure contains the information carried in DCI format 6-1A
5407   * when it is NOT used for a PDCCH order.
5408 *
5409 *
5410 *     Ret  : S16
5411 *
5412 *     Notes:
5413 *
5414 *     File  : 
5415 *
5416 **********************************************************/
5417 #ifdef ANSI
5418 PRIVATE S16 cmPkTfudciformat61aPdsch
5419 (
5420 Tfudciformat61aPdsch *param,
5421 Buffer *mBuf
5422 )
5423 #else
5424 PRIVATE S16 cmPkTfudciformat61aPdsch(param, mBuf)
5425 Tfudciformat61aPdsch *param;
5426 Buffer *mBuf;
5427 #endif
5428 {
5429
5430    TRC3(cmPkTfudciformat61aPdsch)
5431
5432    CMCHKPK(SPkU8, param->isTBMsg4, mBuf);
5433    CMCHKPK(SPkU8, param->dciRep, mBuf);
5434    CMCHKPK(SPkU8, param->harqAckOffst, mBuf);
5435    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
5436    CMCHKPK(SPkU8, param->tPmi, mBuf);
5437    CMCHKPK(SPkU8, param->isSrs, mBuf);
5438    CMCHKPK(SPkU8, param->antPortAndScrId, mBuf);
5439
5440 #ifdef TFU_TDD
5441    CMCHKPK(SPkU8, param->dai, mBuf);
5442 #endif
5443    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5444    CMCHKPK(SPkU8, param->rep, mBuf);
5445    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5446    CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
5447    RETVALUE(ROK);
5448 }
5449
5450
5451 /***********************************************************
5452 *
5453 *     Func : cmPkTfuDciFormat61aInfo
5454 *
5455 *
5456 *     Desc : This structure contains the information needed to convey DCI format 6-1A.
5457  * @details Format can possibly carry PDSCH allocation or information needed for
5458  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
5459  * sync with eNodeB.
5460 *
5461 *
5462 *     Ret  : S16
5463 *
5464 *     Notes:
5465 *
5466 *     File  : 
5467 *
5468 **********************************************************/
5469 #ifdef ANSI
5470 PUBLIC S16 cmPkTfuDciFormat61aInfo
5471 (
5472 TfuDciFormat61aInfo *param,
5473 Buffer *mBuf
5474 )
5475 #else
5476 PUBLIC S16 cmPkTfuDciFormat61aInfo(param, mBuf)
5477 TfuDciFormat61aInfo *param;
5478 Buffer *mBuf;
5479 #endif
5480 {
5481
5482    TRC3(cmPkTfuDciFormat61aInfo)
5483
5484    switch(param->isPdcchOrder) {
5485       case FALSE:
5486          CMCHKPK(cmPkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5487          break;
5488       case TRUE:
5489          CMCHKPK(cmPkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5490          break;
5491       default :
5492          RETVALUE(RFAILED);
5493       }
5494    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
5495
5496    RETVALUE(ROK);
5497 }
5498
5499 /***********************************************************
5500 *
5501 *     Func : cmUnpkTfuDciFormat60aInfo
5502 *
5503 *
5504 *     Desc : This structure contains the information that is carried in DCI
5505   * format 6-0A.
5506 *
5507 *
5508 *     Ret  : S16
5509 *
5510 *     Notes:
5511 *
5512 *     File  : 
5513 *
5514 * **********************************************************/
5515
5516 #ifdef ANSI
5517 PRIVATE S16 cmUnpkTfuDciFormat60aInfo 
5518 (
5519 TfuDciFormat60aInfo *param,
5520 Buffer *mBuf
5521 )
5522 #else
5523 PRIVATE S16 cmUnpkTfuDciFormat60aInfo(param, mBuf)
5524 TfuDciFormat60aInfo *param;
5525 Buffer *mBuf;
5526 #endif
5527 {
5528
5529    TRC3(cmUnpkTfuDciFormat60aInfo)
5530
5531    printf("In cmUnpkTfuDciFormat60aInfo :: Entry \n");
5532    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
5533    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5534    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5535    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
5536    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
5537    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5538    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5539    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5540 #ifdef TFU_TDD
5541    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
5542    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5543 #endif
5544    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
5545    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
5546    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
5547    printf("In cmUnpkTfuDciFormat60aInfo :: Exit \n");
5548    RETVALUE(ROK);
5549 }
5550 /***********************************************************
5551 *
5552 *     Func : cmUnpkTfuPdcchOrderInfoEmtc
5553 *
5554 *
5555 *     Desc : This structure contains the information that is carried in DCI
5556   * format 6-1A in the case of a PDCCH order.
5557 *
5558 *
5559 *     Ret  : S16
5560 *
5561 *     Notes:
5562 *
5563 *     File  : 
5564 *
5565 **********************************************************/
5566 #ifdef ANSI
5567 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc
5568 (
5569 TfuPdcchOrderInfoEmtc *param,
5570 Buffer *mBuf
5571 )
5572 #else
5573 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc(param, mBuf)
5574 TfuPdcchOrderInfoEmtc *param;
5575 Buffer *mBuf;
5576 #endif
5577 {
5578
5579    TRC3(cmUnpkTfuPdcchOrderInfoEmtc)
5580
5581    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Entry \n");
5582    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5583    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
5584    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
5585    CMCHKUNPK(SUnpkU8, &param->ceLevel, mBuf);
5586    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Passed \n");
5587    RETVALUE(ROK);
5588 }
5589
5590 /***********************************************************
5591 *
5592 *     Func : cmUnpkTfuDciFormat61aInfo
5593 *
5594 *
5595 *     Desc : This structure contains the information carried by DCI format 6-1A.
5596 *
5597 *
5598 *     Ret  : S16
5599 *
5600 *     Notes:
5601 *
5602 *     File  : 
5603 *
5604 **********************************************************/
5605 #ifdef ANSI
5606 PUBLIC S16 cmUnpkTfuDciFormat61aInfo
5607 (
5608 TfuDciFormat61aInfo *param,
5609 Buffer *mBuf
5610 )
5611 #else
5612 PUBLIC S16 cmUnpkTfuDciFormat61aInfo(param, mBuf)
5613 TfuDciFormat61aInfo *param;
5614 Buffer *mBuf;
5615 #endif
5616 {
5617
5618    TRC3(cmUnpkTfuDciFormat61aInfo)
5619
5620    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
5621    printf("1. cmUnpkTfuDciFormat61aInfo ::  isPdcchOrder %d \n", param->isPdcchOrder); 
5622    switch(param->isPdcchOrder) {
5623       case TRUE:
5624          CMCHKUNPK(cmUnpkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5625          break;
5626       case FALSE:
5627          CMCHKUNPK(cmUnpkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5628          break;
5629       default :
5630          RETVALUE(RFAILED);
5631       }
5632    RETVALUE(ROK);
5633 }
5634 #endif
5635 \f
5636 /***********************************************************
5637 *
5638 *     Func : cmPkTfuDciFormat1dAllocInfo
5639 *
5640 *
5641 *     Desc : This structure contains only the allocation information, thats part
5642   * of DCI format 1D. 
5643   * @details Allocation information also contains parameters necessary
5644   * for Physical layer to process Downlink Data. This structure accompanies the
5645   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5646   * @sa TfuDciFormat1dInfo
5647 *
5648 *
5649 *     Ret  : S16
5650 *
5651 *     Notes:
5652 *
5653 *     File  : 
5654 *
5655 **********************************************************/
5656 #ifdef ANSI
5657 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo
5658 (
5659 TfuDciFormat1dAllocInfo *param,
5660 Buffer *mBuf
5661 )
5662 #else
5663 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo(param, mBuf)
5664 TfuDciFormat1dAllocInfo *param;
5665 Buffer *mBuf;
5666 #endif
5667 {
5668
5669    TRC3(cmPkTfuDciFormat1dAllocInfo)
5670
5671    CMCHKPK(SPkU8, param->tPmi, mBuf);
5672    CMCHKPK(SPkU8, param->rv, mBuf);
5673    CMCHKPK(SPkU8, param->mcs, mBuf);
5674    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5675    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5676    CMCHKPK(SPkU8, param->isLocal, mBuf);
5677    RETVALUE(ROK);
5678 }
5679
5680
5681 \f
5682 /***********************************************************
5683 *
5684 *     Func : cmUnpkTfuDciFormat1dAllocInfo
5685 *
5686 *
5687 *     Desc : This structure contains only the allocation information, thats part
5688   * of DCI format 1D. 
5689   * @details Allocation information also contains parameters necessary
5690   * for Physical layer to process Downlink Data. This structure accompanies the
5691   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5692   * @sa TfuDciFormat1dInfo
5693 *
5694 *
5695 *     Ret  : S16
5696 *
5697 *     Notes:
5698 *
5699 *     File  : 
5700 *
5701 **********************************************************/
5702 #ifdef ANSI
5703 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo
5704 (
5705 TfuDciFormat1dAllocInfo *param,
5706 Buffer *mBuf
5707 )
5708 #else
5709 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo(param, mBuf)
5710 TfuDciFormat1dAllocInfo *param;
5711 Buffer *mBuf;
5712 #endif
5713 {
5714
5715    TRC3(cmUnpkTfuDciFormat1dAllocInfo)
5716
5717    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
5718    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
5719    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5720    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5721    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5722    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
5723    RETVALUE(ROK);
5724 }
5725
5726
5727 \f
5728 /***********************************************************
5729 *
5730 *     Func : cmPkTfuDciFormat1dInfo
5731 *
5732 *
5733 *     Desc : This structure contains the information carried by DCI format 1D.
5734  * @details Allocation information is separated from the other control
5735  * information carried in this format. This separation is needed as Data shall
5736  * also carry some control information, essentially allocation information,
5737  * along with it, in order to aid physical layer processing of the data.
5738 *
5739 *
5740 *     Ret  : S16
5741 *
5742 *     Notes:
5743 *
5744 *     File  : 
5745 *
5746 **********************************************************/
5747 #ifdef ANSI
5748 PUBLIC S16 cmPkTfuDciFormat1dInfo
5749 (
5750 TfuDciFormat1dInfo *param,
5751 Buffer *mBuf
5752 )
5753 #else
5754 PUBLIC S16 cmPkTfuDciFormat1dInfo(param, mBuf)
5755 TfuDciFormat1dInfo *param;
5756 Buffer *mBuf;
5757 #endif
5758 {
5759
5760    TRC3(cmPkTfuDciFormat1dInfo)
5761
5762    CMCHKPK(SPkU8, param->dlPwrOffset, mBuf);
5763
5764 #ifdef TFU_TDD
5765    CMCHKPK(SPkU8, param->dai, mBuf);
5766
5767 #endif
5768    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5769    CMCHKPK(SPkU8, param->ndi, mBuf);
5770    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5771    CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5772    RETVALUE(ROK);
5773 }
5774
5775
5776 \f
5777 /***********************************************************
5778 *
5779 *     Func : cmUnpkTfuDciFormat1dInfo
5780 *
5781 *
5782 *     Desc : This structure contains the information carried by DCI format 1D.
5783  * @details Allocation information is separated from the other control
5784  * information carried in this format. This separation is needed as Data shall
5785  * also carry some control information, essentially allocation information,
5786  * along with it, in order to aid physical layer processing of the data.
5787 *
5788 *
5789 *     Ret  : S16
5790 *
5791 *     Notes:
5792 *
5793 *     File  : 
5794 *
5795 **********************************************************/
5796 #ifdef ANSI
5797 PUBLIC S16 cmUnpkTfuDciFormat1dInfo
5798 (
5799 TfuDciFormat1dInfo *param,
5800 Buffer *mBuf
5801 )
5802 #else
5803 PUBLIC S16 cmUnpkTfuDciFormat1dInfo(param, mBuf)
5804 TfuDciFormat1dInfo *param;
5805 Buffer *mBuf;
5806 #endif
5807 {
5808
5809    TRC3(cmUnpkTfuDciFormat1dInfo)
5810
5811    CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5812    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5813    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5814    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5815
5816 #ifdef TFU_TDD
5817    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5818
5819 #endif
5820    CMCHKUNPK(SUnpkU8, &param->dlPwrOffset, mBuf);
5821    RETVALUE(ROK);
5822 }
5823
5824
5825 \f
5826 /***********************************************************
5827 *
5828 *     Func : cmPkTfuDciFormat1cInfo
5829 *
5830 *
5831 *     Desc : This structure contains only the allocation information, thats part
5832   * of DCI format 1C. 
5833   * @details Allocation information also contains parameters necessary
5834   * for Physical layer to process Downlink Data. This structure accompanies the
5835   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5836   * @sa TfuDciFormat1CInfo
5837 *
5838 *
5839 *     Ret  : S16
5840 *
5841 *     Notes:
5842 *
5843 *     File  : 
5844 *
5845 **********************************************************/
5846 #ifdef ANSI
5847 PUBLIC S16 cmPkTfuDciFormat1cInfo
5848 (
5849 TfuDciFormat1cInfo *param,
5850 Buffer *mBuf
5851 )
5852 #else
5853 PUBLIC S16 cmPkTfuDciFormat1cInfo(param, mBuf)
5854 TfuDciFormat1cInfo *param;
5855 Buffer *mBuf;
5856 #endif
5857 {
5858
5859    TRC3(cmPkTfuDciFormat1cInfo)
5860
5861    CMCHKPK(SPkU8, param->iTbs, mBuf);
5862    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5863    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5864    RETVALUE(ROK);
5865 }
5866
5867
5868 \f
5869 /***********************************************************
5870 *
5871 *     Func : cmUnpkTfuDciFormat1cInfo
5872 *
5873 *
5874 *     Desc : This structure contains only the allocation information, thats part
5875   * of DCI format 1C. 
5876   * @details Allocation information also contains parameters necessary
5877   * for Physical layer to process Downlink Data. This structure accompanies the
5878   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5879   * @sa TfuDciFormat1CInfo
5880 *
5881 *
5882 *     Ret  : S16
5883 *
5884 *     Notes:
5885 *
5886 *     File  : 
5887 *
5888 **********************************************************/
5889 #ifdef ANSI
5890 PUBLIC S16 cmUnpkTfuDciFormat1cInfo
5891 (
5892 TfuDciFormat1cInfo *param,
5893 Buffer *mBuf
5894 )
5895 #else
5896 PUBLIC S16 cmUnpkTfuDciFormat1cInfo(param, mBuf)
5897 TfuDciFormat1cInfo *param;
5898 Buffer *mBuf;
5899 #endif
5900 {
5901
5902    TRC3(cmUnpkTfuDciFormat1cInfo)
5903
5904    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
5905    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5906    CMCHKUNPK(SUnpkU8, &param->iTbs, mBuf);
5907    RETVALUE(ROK);
5908 }
5909
5910
5911 \f
5912 /***********************************************************
5913 *
5914 *     Func : cmPkTfuDciFormat1bAllocInfo
5915 *
5916 *
5917 *     Desc : This structure contains only the allocation information, thats part
5918   * of DCI format 1 B. 
5919   * @details Allocation information also contains parameters necessary
5920   * for Physical layer to process Downlink Data. This structure accompanies the
5921   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5922   * @sa TfuDciFormat1BInfo
5923 *
5924 *
5925 *     Ret  : S16
5926 *
5927 *     Notes:
5928 *
5929 *     File  : 
5930 *
5931 **********************************************************/
5932 #ifdef ANSI
5933 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo
5934 (
5935 TfuDciFormat1bAllocInfo *param,
5936 Buffer *mBuf
5937 )
5938 #else
5939 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo(param, mBuf)
5940 TfuDciFormat1bAllocInfo *param;
5941 Buffer *mBuf;
5942 #endif
5943 {
5944
5945    TRC3(cmPkTfuDciFormat1bAllocInfo)
5946
5947    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
5948    CMCHKPK(SPkU8, param->tPmi, mBuf);
5949    CMCHKPK(SPkU8, param->ndi, mBuf);
5950    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5951    CMCHKPK(SPkU8, param->rv, mBuf);
5952    CMCHKPK(SPkU8, param->mcs, mBuf);
5953    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5954    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5955    CMCHKPK(SPkU8, param->isLocal, mBuf);
5956    RETVALUE(ROK);
5957 }
5958
5959
5960 \f
5961 /***********************************************************
5962 *
5963 *     Func : cmUnpkTfuDciFormat1bAllocInfo
5964 *
5965 *
5966 *     Desc : This structure contains only the allocation information, thats part
5967   * of DCI format 1 B. 
5968   * @details Allocation information also contains parameters necessary
5969   * for Physical layer to process Downlink Data. This structure accompanies the
5970   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5971   * @sa TfuDciFormat1BInfo
5972 *
5973 *
5974 *     Ret  : S16
5975 *
5976 *     Notes:
5977 *
5978 *     File  : 
5979 *
5980 **********************************************************/
5981 #ifdef ANSI
5982 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo
5983 (
5984 TfuDciFormat1bAllocInfo *param,
5985 Buffer *mBuf
5986 )
5987 #else
5988 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo(param, mBuf)
5989 TfuDciFormat1bAllocInfo *param;
5990 Buffer *mBuf;
5991 #endif
5992 {
5993
5994    TRC3(cmUnpkTfuDciFormat1bAllocInfo)
5995
5996    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
5997    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
5998    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5999    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6000    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6001    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6002    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6003    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6004    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6005    RETVALUE(ROK);
6006 }
6007
6008
6009 \f
6010 /***********************************************************
6011 *
6012 *     Func : cmPkTfuPdcchOrderInfo
6013 *
6014 *
6015 *     Desc : This structure contains the information that is carried in DCI
6016   * format 1A in the case of a PDCCH order.
6017 *
6018 *
6019 *     Ret  : S16
6020 *
6021 *     Notes:
6022 *
6023 *     File  : 
6024 *
6025 **********************************************************/
6026 #ifdef ANSI
6027 PUBLIC S16 cmPkTfuPdcchOrderInfo
6028 (
6029 TfuPdcchOrderInfo *param,
6030 Buffer *mBuf
6031 )
6032 #else
6033 PUBLIC S16 cmPkTfuPdcchOrderInfo(param, mBuf)
6034 TfuPdcchOrderInfo *param;
6035 Buffer *mBuf;
6036 #endif
6037 {
6038
6039    TRC3(cmPkTfuPdcchOrderInfo)
6040
6041    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
6042    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
6043    RETVALUE(ROK);
6044 }
6045
6046
6047 \f
6048 /***********************************************************
6049 *
6050 *     Func : cmUnpkTfuPdcchOrderInfo
6051 *
6052 *
6053 *     Desc : This structure contains the information that is carried in DCI
6054   * format 1A in the case of a PDCCH order.
6055 *
6056 *
6057 *     Ret  : S16
6058 *
6059 *     Notes:
6060 *
6061 *     File  : 
6062 *
6063 **********************************************************/
6064 #ifdef ANSI
6065 PUBLIC S16 cmUnpkTfuPdcchOrderInfo
6066 (
6067 TfuPdcchOrderInfo *param,
6068 Buffer *mBuf
6069 )
6070 #else
6071 PUBLIC S16 cmUnpkTfuPdcchOrderInfo(param, mBuf)
6072 TfuPdcchOrderInfo *param;
6073 Buffer *mBuf;
6074 #endif
6075 {
6076
6077    TRC3(cmUnpkTfuPdcchOrderInfo)
6078
6079    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
6080    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
6081    RETVALUE(ROK);
6082 }
6083
6084
6085 \f
6086 /***********************************************************
6087 *
6088 *     Func : cmPkTfuDciFormat1aAllocInfo
6089 *
6090 *
6091 *     Desc : This structure contains only the allocation information, thats part
6092   * of DCI format 1A. 
6093   * @details Allocation information also contains parameters necessary
6094   * for Physical layer to process Downlink Data. This structure accompanies the
6095   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6096   * @sa TfuDciFormat1AInfo
6097 *
6098 *
6099 *     Ret  : S16
6100 *
6101 *     Notes:
6102 *
6103 *     File  : 
6104 *
6105 **********************************************************/
6106 #ifdef ANSI
6107 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo
6108 (
6109 TfuDciFormat1aAllocInfo *param,
6110 Buffer *mBuf
6111 )
6112 #else
6113 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo(param, mBuf)
6114 TfuDciFormat1aAllocInfo *param;
6115 Buffer *mBuf;
6116 #endif
6117 {
6118
6119    TRC3(cmPkTfuDciFormat1aAllocInfo)
6120
6121    CMCHKPK(SPkU8, param->ndi, mBuf);
6122    CMCHKPK(cmPkTknU8, &param->harqProcId, mBuf);
6123    CMCHKPK(SPkU8, param->rv, mBuf);
6124    CMCHKPK(SPkU8, param->mcs, mBuf);
6125    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6126    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6127    CMCHKPK(SPkU8, param->isLocal, mBuf);
6128    RETVALUE(ROK);
6129 }
6130
6131
6132 \f
6133 /***********************************************************
6134 *
6135 *     Func : cmUnpkTfuDciFormat1aAllocInfo
6136 *
6137 *
6138 *     Desc : This structure contains only the allocation information, thats part
6139   * of DCI format 1A. 
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 TfuDciFormat1AInfo
6144 *
6145 *
6146 *     Ret  : S16
6147 *
6148 *     Notes:
6149 *
6150 *     File  : 
6151 *
6152 **********************************************************/
6153 #ifdef ANSI
6154 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo
6155 (
6156 TfuDciFormat1aAllocInfo *param,
6157 Buffer *mBuf
6158 )
6159 #else
6160 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo(param, mBuf)
6161 TfuDciFormat1aAllocInfo *param;
6162 Buffer *mBuf;
6163 #endif
6164 {
6165
6166    TRC3(cmUnpkTfuDciFormat1aAllocInfo)
6167
6168    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6169    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6170    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6171    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6172    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6173    CMCHKUNPK(cmUnpkTknU8, &param->harqProcId, mBuf);
6174    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6175    RETVALUE(ROK);
6176 }
6177
6178
6179 \f
6180 /***********************************************************
6181 *
6182 *     Func : cmPkTfudciformat1aPdsch
6183 *
6184 *
6185 *     Desc : This structure contains the information carried in DCI format 1A
6186   * when it is NOT used for a PDCCH order.
6187 *
6188 *
6189 *     Ret  : S16
6190 *
6191 *     Notes:
6192 *
6193 *     File  : 
6194 *
6195 **********************************************************/
6196 #ifdef ANSI
6197 PUBLIC S16 cmPkTfudciformat1aPdsch
6198 (
6199 Tfudciformat1aPdsch *param,
6200 Buffer *mBuf
6201 )
6202 #else
6203 PUBLIC S16 cmPkTfudciformat1aPdsch(param, mBuf)
6204 Tfudciformat1aPdsch *param;
6205 Buffer *mBuf;
6206 #endif
6207 {
6208
6209    TRC3(cmPkTfudciformat1aPdsch)
6210
6211    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6212
6213 #ifdef TFU_TDD
6214    CMCHKPK(cmPkTknU8, &param->dai, mBuf);
6215
6216 #endif
6217    CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6218    RETVALUE(ROK);
6219 }
6220
6221
6222 \f
6223 /***********************************************************
6224 *
6225 *     Func : cmUnpkTfudciformat1aPdsch
6226 *
6227 *
6228 *     Desc : This structure contains the information carried in DCI format 1A
6229   * when it is NOT used for a PDCCH order.
6230 *
6231 *
6232 *     Ret  : S16
6233 *
6234 *     Notes:
6235 *
6236 *     File  : 
6237 *
6238 **********************************************************/
6239 #ifdef ANSI
6240 PUBLIC S16 cmUnpkTfudciformat1aPdsch
6241 (
6242 Tfudciformat1aPdsch *param,
6243 Buffer *mBuf
6244 )
6245 #else
6246 PUBLIC S16 cmUnpkTfudciformat1aPdsch(param, mBuf)
6247 Tfudciformat1aPdsch *param;
6248 Buffer *mBuf;
6249 #endif
6250 {
6251
6252    TRC3(cmUnpkTfudciformat1aPdsch)
6253
6254    CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6255
6256 #ifdef TFU_TDD
6257    CMCHKUNPK(cmUnpkTknU8, &param->dai, mBuf);
6258
6259 #endif
6260    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6261    RETVALUE(ROK);
6262 }
6263
6264 #ifdef EMTC_ENABLE
6265
6266 \f
6267 /***********************************************************
6268 *
6269 *     Func : cmUnpkTfudciformat61aPdsch
6270 *
6271 *
6272 *     Desc : This structure contains the information carried in DCI format 6-1A
6273   * when it is NOT used for a PDCCH order.
6274 *
6275 *
6276 *     Ret  : S16
6277 *
6278 *     Notes:
6279 *
6280 *     File  : 
6281 *
6282 **********************************************************/
6283 #ifdef ANSI
6284 PUBLIC S16 cmUnpkTfudciformat61aPdsch
6285 (
6286 Tfudciformat61aPdsch *param,
6287 Buffer *mBuf
6288 )
6289 #else
6290 PUBLIC S16 cmUnpkTfudciformat61aPdsch(param, mBuf)
6291 Tfudciformat61aPdsch *param;
6292 Buffer *mBuf;
6293 #endif
6294 {
6295
6296    TRC3(cmUnpkTfudciformat61aPdsch)
6297
6298    printf("1. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6299    CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
6300    printf("2. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6301    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
6302    printf("3. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6303    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
6304    printf("4. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6305    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6306    printf("5. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6307 #ifdef TFU_TDD
6308    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6309    printf("6. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6310 #endif
6311    CMCHKUNPK(SUnpkU8, &param->antPortAndScrId, mBuf);
6312    printf("7. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6313    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
6314    printf("8. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6315    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6316    printf("9. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6317    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6318    printf("10. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6319    CMCHKUNPK(SUnpkU8, &param->harqAckOffst, mBuf);
6320    printf("11. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6321    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
6322    printf("12. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6323    CMCHKUNPK(SUnpkU8, &param->isTBMsg4, mBuf);
6324    printf("1. cmUnpkTfudciformat61aPdsch ::  Passed \n"); 
6325    RETVALUE(ROK);
6326 }
6327 /***********************************************************
6328  *
6329  *     Func : cmUnpkTfuDirectIndication
6330  *
6331  *
6332  *     Desc : This structure contains the information that is carried in DCI
6333  *       format 6-2 in the case of a Direct information indication.
6334  *
6335  *
6336  *     Ret  : S16
6337  *
6338  *     Notes:
6339  *
6340  *     File  : 
6341  *
6342  **********************************************************/
6343 #ifdef ANSI
6344 PRIVATE S16 cmUnpkTfuDirectIndication
6345 (
6346  TfuDirectIndication *param,
6347  Buffer *mBuf
6348  )
6349 #else
6350 PRIVATE S16 cmUnpkTfuDirectIndication(param, mBuf)
6351    TfuDirectIndication *param;
6352    Buffer *mBuf;
6353 #endif
6354 {
6355
6356    TRC3(cmUnpkTfuDirectIndication)
6357    CMCHKUNPK(SUnpkU8, &param->directInd, mBuf);
6358
6359
6360
6361    RETVALUE(ROK);
6362 }
6363 /***********************************************************
6364  *
6365  *     Func : cmUnpkTfuDciFormat62AllocInfo
6366  *
6367  *
6368  *     Desc : This structure contains only the allocation information, that is part
6369  * of DCI format 6-2. 
6370  * @details Allocation information also contains parameters necessary
6371  * for Physical layer to process Downlink data. This structure accompanies the
6372  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6373  * @sa TfuDciFormat62Info
6374  *
6375  *
6376  *     Ret  : S16
6377  *
6378  *     Notes:
6379  *
6380  *     File  : 
6381  *
6382  **********************************************************/
6383 #ifdef ANSI
6384 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo
6385 (
6386  TfuDciFormat62AllocInfo *param,
6387  Buffer *mBuf
6388  )
6389 #else
6390 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo(param, mBuf)
6391    TfuDciFormat62AllocInfo *param;
6392    Buffer *mBuf;
6393 #endif
6394 {
6395    TRC3(cmUnpkTfuDciFormat62AllocInfo)
6396    CMCHKUNPK(SUnpkU8, &param->riv, mBuf);
6397    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6398    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6399
6400    RETVALUE(ROK);
6401 }
6402
6403 /***********************************************************
6404  *
6405  *     Func : cmUnpkTfudciformat62Pdsch
6406  *
6407  *
6408  *     Desc : This structure contains the information carried in DCI format 6-2
6409  *            when It is used for Paging message.
6410  *
6411  *
6412  *     Ret  : S16
6413  *
6414  *     Notes:
6415  *
6416  *     File  : 
6417  *
6418  **********************************************************/
6419 #ifdef ANSI
6420 PRIVATE S16 cmUnpkTfudciformat62Pdsch
6421 (
6422  Tfudciformat62Pdsch *param,
6423  Buffer *mBuf
6424  )
6425 #else
6426 PRIVATE S16 cmUnpkTfudciformat62Pdsch(param, mBuf)
6427    Tfudciformat62Pdsch *param;
6428    Buffer *mBuf;
6429 #endif
6430 {
6431
6432    TRC3(cmUnpkTfudciformat62Pdsch)
6433
6434
6435    CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6436    CMCHKUNPK(SUnpkU8, &param->repNum, mBuf);
6437    CMCHKUNPK(SUnpkU8, &param->dciSubRepNum, mBuf);
6438    RETVALUE(ROK);
6439 }
6440
6441
6442 /***********************************************************
6443  *
6444  *     Func : cmUnpkTfuDciFormat62Info
6445  *
6446  *
6447  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6448  *     @details Format can possibly carry PDSCH allocation or information needed for
6449  *     a Direct information Indication.
6450  * 
6451  *
6452  *
6453  *     Ret  : S16
6454  *
6455  *     Notes:
6456  *
6457  *     File  : 
6458  *
6459  **********************************************************/
6460 #ifdef ANSI
6461 PUBLIC S16 cmUnpkTfuDciFormat62Info
6462 (
6463  TfuDciFormat62Info *param,
6464  Buffer *mBuf
6465  )
6466 #else
6467 PUBLIC S16 cmUnpkTfuDciFormat62Info(param, mBuf)
6468    TfuDciFormat62Info *param;
6469    Buffer *mBuf;
6470 #endif
6471 {
6472
6473    TRC3(cmUnpkTfuDciFormat62Info)
6474       CMCHKUNPK(SUnpkU8, &param->isPaging, mBuf);
6475    switch(param->isPaging) {
6476       case FALSE:
6477          CMCHKUNPK(cmUnpkTfuDirectIndication, &param->t.directIndication, mBuf);
6478          break;
6479       case TRUE:
6480          CMCHKUNPK(cmUnpkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6481          break;
6482       default :
6483          RETVALUE(RFAILED);
6484    }
6485
6486
6487    RETVALUE(ROK);
6488 }
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501 /***********************************************************
6502  *
6503  *     Func : cmPkTfuDirectIndication
6504  *
6505  *
6506  *     Desc : This structure contains the information that is carried in DCI
6507  *       format 6-2 in the case of a Direct information indication.
6508  *
6509  *
6510  *     Ret  : S16
6511  *
6512  *     Notes:
6513  *
6514  *     File  : 
6515  *
6516  **********************************************************/
6517 #ifdef ANSI
6518 PRIVATE S16 cmPkTfuDirectIndication
6519 (
6520  TfuDirectIndication *param,
6521  Buffer *mBuf
6522  )
6523 #else
6524 PRIVATE S16 cmPkTfuDirectIndication(param, mBuf)
6525    TfuDirectIndication *param;
6526    Buffer *mBuf;
6527 #endif
6528 {
6529
6530    TRC3(cmPkTfuDirectIndication)
6531    CMCHKPK(SPkU8, param->directInd, mBuf);
6532
6533
6534    RETVALUE(ROK);
6535 }
6536
6537
6538
6539 /***********************************************************
6540  *
6541  *     Func : cmPkTfuDciFormat62AllocInfo
6542  *
6543  *
6544  *     Desc : This structure contains only the allocation information, that is part
6545  * of DCI format 6-2. 
6546  * @details Allocation information also contains parameters necessary
6547  * for Physical layer to process Downlink data. This structure accompanies the
6548  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6549  * @sa TfuDciFormat62Info
6550  *
6551  *
6552  *     Ret  : S16
6553  *
6554  *     Notes:
6555  *
6556  *     File  : 
6557  *
6558  **********************************************************/
6559 #ifdef ANSI
6560 PUBLIC S16 cmPkTfuDciFormat62AllocInfo
6561 (
6562  TfuDciFormat62AllocInfo *param,
6563  Buffer *mBuf
6564  )
6565 #else
6566 PUBLIC S16 cmPkTfuDciFormat62AllocInfo(param, mBuf)
6567    TfuDciFormat62AllocInfo *param;
6568    Buffer *mBuf;
6569 #endif
6570 {
6571
6572    TRC3(cmPkTfuDciFormat6AAllocInfo)
6573
6574    CMCHKPK(SPkU8, param->rv, mBuf);
6575    CMCHKPK(SPkU8, param->mcs, mBuf);
6576    CMCHKPK(SPkU8, param->riv, mBuf);
6577
6578    RETVALUE(ROK);
6579 }
6580
6581
6582
6583 /***********************************************************
6584  *
6585  *     Func : cmPkTfudciformat62Pdsch
6586  *
6587  *
6588  *     Desc : This structure contains the information carried in DCI format 6-2
6589  *            when It is used for Paging message.
6590  *
6591  *
6592  *     Ret  : S16
6593  *
6594  *     Notes:
6595  *
6596  *     File  : 
6597  *
6598  **********************************************************/
6599 #ifdef ANSI
6600 PRIVATE S16 cmPkTfudciformat62Pdsch
6601 (
6602  Tfudciformat62Pdsch *param,
6603  Buffer *mBuf
6604  )
6605 #else
6606 PRIVATE S16 cmPkTfudciformat62Pdsch(param, mBuf)
6607    Tfudciformat62Pdsch *param;
6608    Buffer *mBuf;
6609 #endif
6610 {
6611
6612    TRC3(cmPkTfudciformat62Pdsch)
6613    CMCHKPK(SPkU8, param->dciSubRepNum, mBuf);
6614    CMCHKPK(SPkU8, param->repNum, mBuf);
6615    CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6616    RETVALUE(ROK);
6617 }
6618
6619
6620
6621
6622 /***********************************************************
6623  *
6624  *     Func : cmPkTfuDciFormat62Info
6625  *
6626  *
6627  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6628  *      @details Format can possibly carry PDSCH allocation or information needed for
6629  *      a Direct information Indication.
6630  * 
6631  *
6632  *
6633  *     Ret  : S16
6634  *
6635  *     Notes:
6636  *
6637  *     File  : 
6638  *
6639  **********************************************************/
6640 #ifdef ANSI
6641 PUBLIC S16 cmPkTfuDciFormat62Info
6642 (
6643  TfuDciFormat62Info *param,
6644  Buffer *mBuf
6645  )
6646 #else
6647 PUBLIC S16 cmPkTfuDciFormat62Info(param, mBuf)
6648    TfuDciFormat62Info *param;
6649    Buffer *mBuf;
6650 #endif
6651 {
6652
6653    TRC3(cmPkTfuDciFormat62Info)
6654
6655       switch(param->isPaging) {
6656          case TRUE:
6657             CMCHKPK(cmPkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6658             break;
6659          case FALSE:
6660             CMCHKPK(cmPkTfuDirectIndication, &param->t.directIndication, mBuf);
6661             break;
6662          default :
6663             RETVALUE(RFAILED);
6664       }
6665    CMCHKPK(SPkU8, param->isPaging, mBuf);
6666
6667    RETVALUE(ROK);
6668 }
6669
6670
6671
6672
6673
6674
6675 #endif
6676
6677 \f
6678 /***********************************************************
6679 *
6680 *     Func : cmPkTfuDciFormat1aInfo
6681 *
6682 *
6683 *     Desc : This structure contains the information needed to convey DCI format 1A.
6684  * @details Format can possibly carry PDSCH allocation or information needed for
6685  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6686  * sync with eNodeB.
6687 *
6688 *
6689 *     Ret  : S16
6690 *
6691 *     Notes:
6692 *
6693 *     File  : 
6694 *
6695 **********************************************************/
6696 #ifdef ANSI
6697 PUBLIC S16 cmPkTfuDciFormat1aInfo
6698 (
6699 TfuDciFormat1aInfo *param,
6700 Buffer *mBuf
6701 )
6702 #else
6703 PUBLIC S16 cmPkTfuDciFormat1aInfo(param, mBuf)
6704 TfuDciFormat1aInfo *param;
6705 Buffer *mBuf;
6706 #endif
6707 {
6708
6709    TRC3(cmPkTfuDciFormat1aInfo)
6710
6711    switch(param->isPdcchOrder) {
6712       case FALSE:
6713          CMCHKPK(cmPkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6714          break;
6715       case TRUE:
6716          CMCHKPK(cmPkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6717          break;
6718       default :
6719          RETVALUE(RFAILED);
6720       }
6721    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
6722
6723    RETVALUE(ROK);
6724 }
6725
6726
6727 \f
6728 /***********************************************************
6729 *
6730 *     Func : cmUnpkTfuDciFormat1aInfo
6731 *
6732 *
6733 *     Desc : This structure contains the information needed to convey DCI format 1A.
6734  * @details Format can possibly carry PDSCH allocation or information needed for
6735  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6736  * sync with eNodeB.
6737 *
6738 *
6739 *     Ret  : S16
6740 *
6741 *     Notes:
6742 *
6743 *     File  : 
6744 *
6745 **********************************************************/
6746 #ifdef ANSI
6747 PUBLIC S16 cmUnpkTfuDciFormat1aInfo
6748 (
6749 TfuDciFormat1aInfo *param,
6750 Buffer *mBuf
6751 )
6752 #else
6753 PUBLIC S16 cmUnpkTfuDciFormat1aInfo(param, mBuf)
6754 TfuDciFormat1aInfo *param;
6755 Buffer *mBuf;
6756 #endif
6757 {
6758
6759    TRC3(cmUnpkTfuDciFormat1aInfo)
6760
6761    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
6762    switch(param->isPdcchOrder) {
6763       case TRUE:
6764          CMCHKUNPK(cmUnpkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6765          break;
6766       case FALSE:
6767          CMCHKUNPK(cmUnpkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6768          break;
6769       default :
6770          RETVALUE(RFAILED);
6771       }
6772    RETVALUE(ROK);
6773 }
6774
6775
6776 \f
6777 /***********************************************************
6778 *
6779 *     Func : cmPkTfuDciFormat1bInfo
6780 *
6781 *
6782 *     Desc : This structure contains the information needed to convey DCI format 1A.
6783  * @details Allocation information is separated from the other control
6784  * information carried in this format. This separation is needed as Data shall
6785  * also carry some control information, essentially allocation information,
6786  * along with it, in order to aid physical layer processing of the data.
6787 *
6788 *
6789 *     Ret  : S16
6790 *
6791 *     Notes:
6792 *
6793 *     File  : 
6794 *
6795 **********************************************************/
6796 #ifdef ANSI
6797 PUBLIC S16 cmPkTfuDciFormat1bInfo
6798 (
6799 TfuDciFormat1bInfo *param,
6800 Buffer *mBuf
6801 )
6802 #else
6803 PUBLIC S16 cmPkTfuDciFormat1bInfo(param, mBuf)
6804 TfuDciFormat1bInfo *param;
6805 Buffer *mBuf;
6806 #endif
6807 {
6808
6809    TRC3(cmPkTfuDciFormat1bInfo)
6810
6811    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6812
6813 #ifdef TFU_TDD
6814    CMCHKPK(SPkU8, param->dai, mBuf);
6815
6816 #endif
6817    CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
6818    RETVALUE(ROK);
6819 }
6820
6821
6822 \f
6823 /***********************************************************
6824 *
6825 *     Func : cmUnpkTfuDciFormat1bInfo
6826 *
6827 *
6828 *     Desc : This structure contains the information needed to convey DCI format 1A.
6829  * @details Allocation information is separated from the other control
6830  * information carried in this format. This separation is needed as Data shall
6831  * also carry some control information, essentially allocation information,
6832  * along with it, in order to aid physical layer processing of the data.
6833 *
6834 *
6835 *     Ret  : S16
6836 *
6837 *     Notes:
6838 *
6839 *     File  : 
6840 *
6841 **********************************************************/
6842 #ifdef ANSI
6843 PUBLIC S16 cmUnpkTfuDciFormat1bInfo
6844 (
6845 TfuDciFormat1bInfo *param,
6846 Buffer *mBuf
6847 )
6848 #else
6849 PUBLIC S16 cmUnpkTfuDciFormat1bInfo(param, mBuf)
6850 TfuDciFormat1bInfo *param;
6851 Buffer *mBuf;
6852 #endif
6853 {
6854
6855    TRC3(cmUnpkTfuDciFormat1bInfo)
6856
6857    CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
6858
6859 #ifdef TFU_TDD
6860    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6861
6862 #endif
6863    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6864    RETVALUE(ROK);
6865 }
6866
6867
6868 \f
6869 /***********************************************************
6870 *
6871 *     Func : cmPkTfuDciInfo
6872 *
6873 *
6874 *     Desc : This structure contains the information needed to convey the possible DCI
6875  * formats. The following are the supported formats - 
6876  * -# Format 0    - used for PUSCH scheduling
6877  * -# Format 1    - used for PDSCH scheduling
6878  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
6879  *                   intitiated by a PDCCH order.
6880  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
6881  *                   information.
6882  * -# Format 1C   - used for very compact scheduling of PDSCH.
6883  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
6884  *                   information with power offset.
6885  * -# Format 2    - used for PDSCH Scheduling
6886  * -# Format 2A   - used for PDSCH Scheduling
6887  * -# Format 3    - used for power control 
6888  * -# Format 3A   - used for power control
6889 *
6890 *
6891 *     Ret  : S16
6892 *
6893 *     Notes:
6894 *
6895 *     File  : 
6896 *
6897 **********************************************************/
6898 #ifdef ANSI
6899 PUBLIC S16 cmPkTfuDciInfo
6900 (
6901 TfuDciInfo *param,
6902 Buffer *mBuf
6903 )
6904 #else
6905 PUBLIC S16 cmPkTfuDciInfo(param, mBuf)
6906 TfuDciInfo *param;
6907 Buffer *mBuf;
6908 #endif
6909 {
6910
6911    TRC3(cmPkTfuDciInfo)
6912
6913       switch(param->dciFormat) {
6914 #ifdef TFU_5GTF
6915          case TFU_DCI_FORMAT_B1:
6916             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
6917             break;
6918          case TFU_DCI_FORMAT_B2:
6919             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
6920             break;
6921          case TFU_DCI_FORMAT_A1:
6922             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
6923             break;
6924          case TFU_DCI_FORMAT_A2:
6925             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
6926             break;
6927 #endif
6928 #ifdef EMTC_ENABLE            
6929          case TFU_DCI_FORMAT_6_2:
6930             CMCHKPK(cmPkTfuDciFormat62Info, &param->u.format62Info, mBuf);
6931             break;
6932          case TFU_DCI_FORMAT_6_1A:
6933             CMCHKPK(cmPkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
6934             break;
6935          case TFU_DCI_FORMAT_6_0A:
6936             CMCHKPK(cmPkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
6937             break;
6938 #endif            
6939          case TFU_DCI_FORMAT_3A:
6940             CMCHKPK(cmPkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
6941             break;
6942          case TFU_DCI_FORMAT_3:
6943             CMCHKPK(cmPkTfuDciFormat3Info, &param->u.format3Info, mBuf);
6944             break;
6945          case TFU_DCI_FORMAT_2A:
6946             CMCHKPK(cmPkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
6947             break;
6948          case TFU_DCI_FORMAT_2:
6949             CMCHKPK(cmPkTfuDciFormat2Info, &param->u.format2Info, mBuf);
6950             break;
6951          case TFU_DCI_FORMAT_1D:
6952             CMCHKPK(cmPkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
6953             break;
6954          case TFU_DCI_FORMAT_1C:
6955             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
6956             break;
6957          case TFU_DCI_FORMAT_1B:
6958             CMCHKPK(cmPkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
6959             break;
6960          case TFU_DCI_FORMAT_1A:
6961             CMCHKPK(cmPkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
6962             break;
6963          case TFU_DCI_FORMAT_1:
6964             CMCHKPK(cmPkTfuDciFormat1Info, &param->u.format1Info, mBuf);
6965             break;
6966          case TFU_DCI_FORMAT_0:
6967             CMCHKPK(cmPkTfuDciFormat0Info, &param->u.format0Info, mBuf);
6968             break;
6969          default :
6970             RETVALUE(RFAILED);
6971       }
6972    CMCHKPK(SPkU32, param->dciFormat, mBuf);
6973    RETVALUE(ROK);
6974 }
6975
6976
6977 \f
6978 /***********************************************************
6979 *
6980 *     Func : cmUnpkTfuDciInfo
6981 *
6982 *
6983 *     Desc : This structure contains the information needed to convey the possible DCI
6984  * formats. The following are the supported formats - 
6985  * -# Format 0    - used for PUSCH scheduling
6986  * -# Format 1    - used for PDSCH scheduling
6987  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
6988  *                   intitiated by a PDCCH order.
6989  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
6990  *                   information.
6991  * -# Format 1C   - used for very compact scheduling of PDSCH.
6992  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
6993  *                   information with power offset.
6994  * -# Format 2    - used for PDSCH Scheduling
6995  * -# Format 2A   - used for PDSCH Scheduling
6996  * -# Format 3    - used for power control 
6997  * -# Format 3A   - used for power control
6998 *
6999 *
7000 *     Ret  : S16
7001 *
7002 *     Notes:
7003 *
7004 *     File  : 
7005 *
7006 **********************************************************/
7007 #ifdef ANSI
7008 PUBLIC S16 cmUnpkTfuDciInfo
7009 (
7010 TfuDciInfo *param,
7011 Buffer *mBuf
7012 )
7013 #else
7014 PUBLIC S16 cmUnpkTfuDciInfo(param, mBuf)
7015 TfuDciInfo *param;
7016 Buffer *mBuf;
7017 #endif
7018 {
7019
7020    TRC3(cmUnpkTfuDciInfo)
7021
7022
7023    CMCHKUNPK(SUnpkU32, (U32 *)&param->dciFormat, mBuf);
7024       switch(param->dciFormat) {
7025          case TFU_DCI_FORMAT_0:
7026             CMCHKUNPK(cmUnpkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7027             break;
7028          case TFU_DCI_FORMAT_1:
7029             CMCHKUNPK(cmUnpkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7030             break;
7031          case TFU_DCI_FORMAT_1A:
7032             CMCHKUNPK(cmUnpkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7033             break;
7034          case TFU_DCI_FORMAT_1B:
7035             CMCHKUNPK(cmUnpkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7036             break;
7037          case TFU_DCI_FORMAT_1C:
7038             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7039             break;
7040          case TFU_DCI_FORMAT_1D:
7041             CMCHKUNPK(cmUnpkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7042             break;
7043          case TFU_DCI_FORMAT_2:
7044             CMCHKUNPK(cmUnpkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7045             break;
7046          case TFU_DCI_FORMAT_2A:
7047             CMCHKUNPK(cmUnpkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7048             break;
7049          case TFU_DCI_FORMAT_3:
7050             CMCHKUNPK(cmUnpkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7051             break;
7052          case TFU_DCI_FORMAT_3A:
7053             CMCHKUNPK(cmUnpkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7054             break;
7055 #ifdef EMTC_ENABLE            
7056          case TFU_DCI_FORMAT_6_0A:
7057             CMCHKUNPK(cmUnpkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7058             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7059             break;
7060          case TFU_DCI_FORMAT_6_1A:
7061             CMCHKUNPK(cmUnpkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7062             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7063             break;
7064          case TFU_DCI_FORMAT_6_2:
7065             CMCHKUNPK(cmUnpkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7066             break;
7067
7068 #endif            
7069 #ifdef TFU_5GTF
7070          case TFU_DCI_FORMAT_A1:
7071             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7072             break;
7073                         case TFU_DCI_FORMAT_A2:
7074             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7075             break;
7076          case TFU_DCI_FORMAT_B1:
7077             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7078             break;
7079                         case TFU_DCI_FORMAT_B2:
7080             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7081             break;
7082 #endif
7083          default :
7084             RETVALUE(RFAILED);
7085       }
7086    RETVALUE(ROK);
7087 }
7088
7089
7090 \f
7091 /***********************************************************
7092 *
7093 *     Func : cmPkTfuSubbandInfo
7094 *
7095 *
7096 *     Desc : This structure contains the information needed to convey the start and size
7097  * of the subband in the CQI report.
7098 *
7099 *
7100 *     Ret  : S16
7101 *
7102 *     Notes:
7103 *
7104 *     File  : 
7105 *
7106 **********************************************************/
7107 #ifdef ANSI
7108 PUBLIC S16 cmPkTfuSubbandInfo
7109 (
7110 TfuSubbandInfo *param,
7111 Buffer *mBuf
7112 )
7113 #else
7114 PUBLIC S16 cmPkTfuSubbandInfo(param, mBuf)
7115 TfuSubbandInfo *param;
7116 Buffer *mBuf;
7117 #endif
7118 {
7119
7120    TRC3(cmPkTfuSubbandInfo)
7121
7122    CMCHKPK(SPkU8, param->numRb, mBuf);
7123    CMCHKPK(SPkU8, param->rbStart, mBuf);
7124    RETVALUE(ROK);
7125 }
7126
7127
7128 \f
7129 /***********************************************************
7130 *
7131 *     Func : cmUnpkTfuSubbandInfo
7132 *
7133 *
7134 *     Desc : This structure contains the information needed to convey the start and size
7135  * of the subband in the CQI report.
7136 *
7137 *
7138 *     Ret  : S16
7139 *
7140 *     Notes:
7141 *
7142 *     File  : 
7143 *
7144 **********************************************************/
7145 #ifdef ANSI
7146 PUBLIC S16 cmUnpkTfuSubbandInfo
7147 (
7148 TfuSubbandInfo *param,
7149 Buffer *mBuf
7150 )
7151 #else
7152 PUBLIC S16 cmUnpkTfuSubbandInfo(param, mBuf)
7153 TfuSubbandInfo *param;
7154 Buffer *mBuf;
7155 #endif
7156 {
7157
7158    TRC3(cmUnpkTfuSubbandInfo)
7159
7160    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
7161    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
7162    RETVALUE(ROK);
7163 }
7164
7165
7166
7167 \f
7168 /***********************************************************
7169 *
7170 *     Func : cmPkTfuSubbandCqiInfo
7171 *
7172 *
7173 *     Desc : This structure is used to convey the subbannd CQI reported.
7174 *
7175 *
7176 *     Ret  : S16
7177 *
7178 *     Notes:
7179 *
7180 *     File  : 
7181 *
7182 **********************************************************/
7183 #ifdef ANSI
7184 PUBLIC S16 cmPkTfuSubbandCqiInfo
7185 (
7186 TfuSubbandCqiInfo *param,
7187 Buffer *mBuf
7188 )
7189 #else
7190 PUBLIC S16 cmPkTfuSubbandCqiInfo(param, mBuf)
7191 TfuSubbandCqiInfo *param;
7192 Buffer *mBuf;
7193 #endif
7194 {
7195
7196    TRC3(cmPkTfuSubbandCqiInfo)
7197
7198    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
7199    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
7200    RETVALUE(ROK);
7201 }
7202
7203
7204 \f
7205 /***********************************************************
7206 *
7207 *     Func : cmUnpkTfuSubbandCqiInfo
7208 *
7209 *
7210 *     Desc : This structure is used to convey the subbannd CQI reported.
7211 *
7212 *
7213 *     Ret  : S16
7214 *
7215 *     Notes:
7216 *
7217 *     File  : 
7218 *
7219 **********************************************************/
7220 #ifdef ANSI
7221 PUBLIC S16 cmUnpkTfuSubbandCqiInfo
7222 (
7223 TfuSubbandCqiInfo *param,
7224 Buffer *mBuf
7225 )
7226 #else
7227 PUBLIC S16 cmUnpkTfuSubbandCqiInfo(param, mBuf)
7228 TfuSubbandCqiInfo *param;
7229 Buffer *mBuf;
7230 #endif
7231 {
7232
7233    TRC3(cmUnpkTfuSubbandCqiInfo)
7234
7235    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
7236    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
7237    RETVALUE(ROK);
7238 }
7239
7240
7241 \f
7242 /***********************************************************
7243 *
7244 *     Func : cmPkTfuPdcchCceInfo
7245 *
7246 *
7247 *     Desc : This structure conveys the CCE information.
7248 *
7249 *
7250 *     Ret  : S16
7251 *
7252 *     Notes:
7253 *
7254 *     File  : 
7255 *
7256 **********************************************************/
7257 #ifdef ANSI
7258 PUBLIC S16 cmPkTfuPdcchCceInfo
7259 (
7260 TfuPdcchCceInfo *param,
7261 Buffer *mBuf
7262 )
7263 #else
7264 PUBLIC S16 cmPkTfuPdcchCceInfo(param, mBuf)
7265 TfuPdcchCceInfo *param;
7266 Buffer *mBuf;
7267 #endif
7268 {
7269
7270    TRC3(cmPkTfuPdcchCceInfo)
7271
7272    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
7273    CMCHKPK(SPkU8, param->cceIdx, mBuf);
7274    RETVALUE(ROK);
7275 }
7276
7277
7278 \f
7279 /***********************************************************
7280 *
7281 *     Func : cmUnpkTfuPdcchCceInfo
7282 *
7283 *
7284 *     Desc : This structure conveys the CCE information.
7285 *
7286 *
7287 *     Ret  : S16
7288 *
7289 *     Notes:
7290 *
7291 *     File  : 
7292 *
7293 **********************************************************/
7294 #ifdef ANSI
7295 PUBLIC S16 cmUnpkTfuPdcchCceInfo
7296 (
7297 TfuPdcchCceInfo *param,
7298 Buffer *mBuf
7299 )
7300 #else
7301 PUBLIC S16 cmUnpkTfuPdcchCceInfo(param, mBuf)
7302 TfuPdcchCceInfo *param;
7303 Buffer *mBuf;
7304 #endif
7305 {
7306
7307    TRC3(cmUnpkTfuPdcchCceInfo)
7308
7309    CMCHKUNPK(SUnpkU8, &param->cceIdx, mBuf);
7310    CMCHKUNPK(cmUnpkLteAggrLvl,(U32 *)&param->aggrLvl, mBuf);
7311    RETVALUE(ROK);
7312 }
7313
7314
7315 \f
7316 /***********************************************************
7317 *
7318 *     Func : cmPkTfuCqiPucchMode10
7319 *
7320 *
7321 *     Desc : This structure maps to the CQI mode 10. The report could either
7322   * convey a Rank index or a wideband CQI.
7323 *
7324 *
7325 *     Ret  : S16
7326 *
7327 *     Notes:
7328 *
7329 *     File  : 
7330 *
7331 **********************************************************/
7332 #ifdef ANSI
7333 PUBLIC S16 cmPkTfuCqiPucchMode10
7334 (
7335 TfuCqiPucchMode10 *param,
7336 Buffer *mBuf
7337 )
7338 #else
7339 PUBLIC S16 cmPkTfuCqiPucchMode10(param, mBuf)
7340 TfuCqiPucchMode10 *param;
7341 Buffer *mBuf;
7342 #endif
7343 {
7344
7345    TRC3(cmPkTfuCqiPucchMode10)
7346
7347       switch(param->type) {
7348          case TFU_RPT_CQI:
7349             CMCHKPK(SPkU8, param->u.cqi, mBuf);
7350             break;
7351          case TFU_RPT_RI:
7352             CMCHKPK(SPkU8, param->u.ri, mBuf);
7353             break;
7354          default :
7355             RETVALUE(RFAILED);
7356       }
7357    CMCHKPK(SPkU32, param->type, mBuf);
7358    RETVALUE(ROK);
7359 }
7360
7361
7362 \f
7363 /***********************************************************
7364 *
7365 *     Func : cmUnpkTfuCqiPucchMode10
7366 *
7367 *
7368 *     Desc : This structure maps to the CQI mode 10. The report could either
7369   * convey a Rank index or a wideband CQI.
7370 *
7371 *
7372 *     Ret  : S16
7373 *
7374 *     Notes:
7375 *
7376 *     File  : 
7377 *
7378 **********************************************************/
7379 #ifdef ANSI
7380 PUBLIC S16 cmUnpkTfuCqiPucchMode10
7381 (
7382 TfuCqiPucchMode10 *param,
7383 Buffer *mBuf
7384 )
7385 #else
7386 PUBLIC S16 cmUnpkTfuCqiPucchMode10(param, mBuf)
7387 TfuCqiPucchMode10 *param;
7388 Buffer *mBuf;
7389 #endif
7390 {
7391
7392    TRC3(cmUnpkTfuCqiPucchMode10)
7393
7394    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7395       switch(param->type) {
7396          case TFU_RPT_RI:
7397             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7398             break;
7399          case TFU_RPT_CQI:
7400             CMCHKUNPK(SUnpkU8, &param->u.cqi, mBuf);
7401             break;
7402          default :
7403             RETVALUE(RFAILED);
7404       }
7405    RETVALUE(ROK);
7406 }
7407
7408
7409 \f
7410 /***********************************************************
7411 *
7412 *     Func : cmPkTfuCqiMode11Cqi
7413 *
7414 *
7415 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7416   * wideband differential CQI.
7417 *
7418 *
7419 *     Ret  : S16
7420 *
7421 *     Notes:
7422 *
7423 *     File  : 
7424 *
7425 **********************************************************/
7426 #ifdef ANSI
7427 PUBLIC S16 cmPkTfuCqiMode11Cqi
7428 (
7429 TfuCqiMode11Cqi *param,
7430 Buffer *mBuf
7431 )
7432 #else
7433 PUBLIC S16 cmPkTfuCqiMode11Cqi(param, mBuf)
7434 TfuCqiMode11Cqi *param;
7435 Buffer *mBuf;
7436 #endif
7437 {
7438
7439    TRC3(cmPkTfuCqiMode11Cqi)
7440
7441    CMCHKPK(cmPkTknU8, &param->wideDiffCqi, mBuf);
7442    CMCHKPK(SPkU8, param->pmi, mBuf);
7443    CMCHKPK(SPkU8, param->cqi, mBuf);
7444    RETVALUE(ROK);
7445 }
7446
7447
7448 \f
7449 /***********************************************************
7450 *
7451 *     Func : cmUnpkTfuCqiMode11Cqi
7452 *
7453 *
7454 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7455   * wideband differential CQI.
7456 *
7457 *
7458 *     Ret  : S16
7459 *
7460 *     Notes:
7461 *
7462 *     File  : 
7463 *
7464 **********************************************************/
7465 #ifdef ANSI
7466 PUBLIC S16 cmUnpkTfuCqiMode11Cqi
7467 (
7468 TfuCqiMode11Cqi *param,
7469 Buffer *mBuf
7470 )
7471 #else
7472 PUBLIC S16 cmUnpkTfuCqiMode11Cqi(param, mBuf)
7473 TfuCqiMode11Cqi *param;
7474 Buffer *mBuf;
7475 #endif
7476 {
7477
7478    TRC3(cmUnpkTfuCqiMode11Cqi)
7479
7480    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7481    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
7482    CMCHKUNPK(cmUnpkTknU8, &param->wideDiffCqi, mBuf);
7483    RETVALUE(ROK);
7484 }
7485
7486
7487 \f
7488 /***********************************************************
7489 *
7490 *     Func : cmPkTfuCqiPucchMode11
7491 *
7492 *
7493 *     Desc : This structure maps to the CQI mode 11. The report could either
7494   * convey a Rank index or a CQI report.
7495 *
7496 *
7497 *     Ret  : S16
7498 *
7499 *     Notes:
7500 *
7501 *     File  : 
7502 *
7503 **********************************************************/
7504 #ifdef ANSI
7505 PUBLIC S16 cmPkTfuCqiPucchMode11
7506 (
7507 TfuCqiPucchMode11 *param,
7508 Buffer *mBuf
7509 )
7510 #else
7511 PUBLIC S16 cmPkTfuCqiPucchMode11(param, mBuf)
7512 TfuCqiPucchMode11 *param;
7513 Buffer *mBuf;
7514 #endif
7515 {
7516
7517    TRC3(cmPkTfuCqiPucchMode11)
7518
7519       switch(param->type) {
7520          case TFU_RPT_CQI:
7521             CMCHKPK(cmPkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7522             break;
7523          case TFU_RPT_RI:
7524             CMCHKPK(SPkU8, param->u.ri, mBuf);
7525             break;
7526          default :
7527             RETVALUE(RFAILED);
7528       }
7529    CMCHKPK(SPkU32, param->type, mBuf);
7530    RETVALUE(ROK);
7531 }
7532
7533
7534 \f
7535 /***********************************************************
7536 *
7537 *     Func : cmUnpkTfuCqiPucchMode11
7538 *
7539 *
7540 *     Desc : This structure maps to the CQI mode 11. The report could either
7541   * convey a Rank index or a CQI report.
7542 *
7543 *
7544 *     Ret  : S16
7545 *
7546 *     Notes:
7547 *
7548 *     File  : 
7549 *
7550 **********************************************************/
7551 #ifdef ANSI
7552 PUBLIC S16 cmUnpkTfuCqiPucchMode11
7553 (
7554 TfuCqiPucchMode11 *param,
7555 Buffer *mBuf
7556 )
7557 #else
7558 PUBLIC S16 cmUnpkTfuCqiPucchMode11(param, mBuf)
7559 TfuCqiPucchMode11 *param;
7560 Buffer *mBuf;
7561 #endif
7562 {
7563
7564    TRC3(cmUnpkTfuCqiPucchMode11)
7565
7566    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7567       switch(param->type) {
7568          case TFU_RPT_RI:
7569             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7570             break;
7571          case TFU_RPT_CQI:
7572             CMCHKUNPK(cmUnpkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7573             break;
7574          default :
7575             RETVALUE(RFAILED);
7576       }
7577    RETVALUE(ROK);
7578 }
7579
7580
7581 \f
7582 /***********************************************************
7583 *
7584 *     Func : cmPkTfuCqiMode20SubCqi
7585 *
7586 *
7587 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7588 *
7589 *
7590 *     Ret  : S16
7591 *
7592 *     Notes:
7593 *
7594 *     File  : 
7595 *
7596 **********************************************************/
7597 #ifdef ANSI
7598 PUBLIC S16 cmPkTfuCqiMode20SubCqi
7599 (
7600 TfuCqiMode20SubCqi *param,
7601 Buffer *mBuf
7602 )
7603 #else
7604 PUBLIC S16 cmPkTfuCqiMode20SubCqi(param, mBuf)
7605 TfuCqiMode20SubCqi *param;
7606 Buffer *mBuf;
7607 #endif
7608 {
7609
7610    TRC3(cmPkTfuCqiMode20SubCqi)
7611
7612    CMCHKPK(SPkU8, param->l, mBuf);
7613    CMCHKPK(SPkU8, param->cqi, mBuf);
7614    RETVALUE(ROK);
7615 }
7616
7617
7618 \f
7619 /***********************************************************
7620 *
7621 *     Func : cmUnpkTfuCqiMode20SubCqi
7622 *
7623 *
7624 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7625 *
7626 *
7627 *     Ret  : S16
7628 *
7629 *     Notes:
7630 *
7631 *     File  : 
7632 *
7633 **********************************************************/
7634 #ifdef ANSI
7635 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi
7636 (
7637 TfuCqiMode20SubCqi *param,
7638 Buffer *mBuf
7639 )
7640 #else
7641 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi(param, mBuf)
7642 TfuCqiMode20SubCqi *param;
7643 Buffer *mBuf;
7644 #endif
7645 {
7646
7647    TRC3(cmUnpkTfuCqiMode20SubCqi)
7648
7649    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7650    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
7651    RETVALUE(ROK);
7652 }
7653
7654
7655 \f
7656 /***********************************************************
7657 *
7658 *     Func : cmPkTfuCqiMode20Cqi
7659 *
7660 *
7661 *     Desc : This structure contains Mode20 CQI report. It could either be a
7662   * wideband CQI or a sub-band CQI.
7663 *
7664 *
7665 *     Ret  : S16
7666 *
7667 *     Notes:
7668 *
7669 *     File  : 
7670 *
7671 **********************************************************/
7672 #ifdef ANSI
7673 PUBLIC S16 cmPkTfuCqiMode20Cqi
7674 (
7675 TfuCqiMode20Cqi *param,
7676 Buffer *mBuf
7677 )
7678 #else
7679 PUBLIC S16 cmPkTfuCqiMode20Cqi(param, mBuf)
7680 TfuCqiMode20Cqi *param;
7681 Buffer *mBuf;
7682 #endif
7683 {
7684
7685    TRC3(cmPkTfuCqiMode20Cqi)
7686
7687       switch(param->isWideband) {
7688          case FALSE:
7689             CMCHKPK(cmPkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7690             break;
7691          case TRUE:
7692             CMCHKPK(SPkU8, param->u.wideCqi, mBuf);
7693             break;
7694          default :
7695             RETVALUE(RFAILED);
7696       }
7697    CMCHKPK(SPkU8, param->isWideband, mBuf);
7698    RETVALUE(ROK);
7699 }
7700
7701
7702 \f
7703 /***********************************************************
7704 *
7705 *     Func : cmUnpkTfuCqiMode20Cqi
7706 *
7707 *
7708 *     Desc : This structure contains Mode20 CQI report. It could either be a
7709   * wideband CQI or a sub-band CQI.
7710 *
7711 *
7712 *     Ret  : S16
7713 *
7714 *     Notes:
7715 *
7716 *     File  : 
7717 *
7718 **********************************************************/
7719 #ifdef ANSI
7720 PUBLIC S16 cmUnpkTfuCqiMode20Cqi
7721 (
7722 TfuCqiMode20Cqi *param,
7723 Buffer *mBuf
7724 )
7725 #else
7726 PUBLIC S16 cmUnpkTfuCqiMode20Cqi(param, mBuf)
7727 TfuCqiMode20Cqi *param;
7728 Buffer *mBuf;
7729 #endif
7730 {
7731
7732    TRC3(cmUnpkTfuCqiMode20Cqi)
7733
7734    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
7735       switch(param->isWideband) {
7736          case TRUE:
7737             CMCHKUNPK(SUnpkU8, &param->u.wideCqi, mBuf);
7738             break;
7739          case FALSE:
7740             CMCHKUNPK(cmUnpkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7741             break;
7742          default :
7743             RETVALUE(RFAILED);
7744       }
7745    RETVALUE(ROK);
7746 }
7747
7748
7749 \f
7750 /***********************************************************
7751 *
7752 *     Func : cmPkTfuCqiPucchMode20
7753 *
7754 *
7755 *     Desc : This structure maps to CQI mode 20. The report either contains a
7756   * Rank Index or a CQI report.
7757 *
7758 *
7759 *     Ret  : S16
7760 *
7761 *     Notes:
7762 *
7763 *     File  : 
7764 *
7765 **********************************************************/
7766 #ifdef ANSI
7767 PUBLIC S16 cmPkTfuCqiPucchMode20
7768 (
7769 TfuCqiPucchMode20 *param,
7770 Buffer *mBuf
7771 )
7772 #else
7773 PUBLIC S16 cmPkTfuCqiPucchMode20(param, mBuf)
7774 TfuCqiPucchMode20 *param;
7775 Buffer *mBuf;
7776 #endif
7777 {
7778
7779    TRC3(cmPkTfuCqiPucchMode20)
7780
7781       switch(param->type) {
7782          case TFU_RPT_CQI:
7783             CMCHKPK(cmPkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7784             break;
7785          case TFU_RPT_RI:
7786             CMCHKPK(SPkU8, param->u.ri, mBuf);
7787             break;
7788          default :
7789             RETVALUE(RFAILED);
7790       }
7791    CMCHKPK(SPkU32, param->type, mBuf);
7792    RETVALUE(ROK);
7793 }
7794
7795
7796 \f
7797 /***********************************************************
7798 *
7799 *     Func : cmUnpkTfuCqiPucchMode20
7800 *
7801 *
7802 *     Desc : This structure maps to CQI mode 20. The report either contains a
7803   * Rank Index or a CQI report.
7804 *
7805 *
7806 *     Ret  : S16
7807 *
7808 *     Notes:
7809 *
7810 *     File  : 
7811 *
7812 **********************************************************/
7813 #ifdef ANSI
7814 PUBLIC S16 cmUnpkTfuCqiPucchMode20
7815 (
7816 TfuCqiPucchMode20 *param,
7817 Buffer *mBuf
7818 )
7819 #else
7820 PUBLIC S16 cmUnpkTfuCqiPucchMode20(param, mBuf)
7821 TfuCqiPucchMode20 *param;
7822 Buffer *mBuf;
7823 #endif
7824 {
7825
7826    TRC3(cmUnpkTfuCqiPucchMode20)
7827
7828    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7829       switch(param->type) {
7830          case TFU_RPT_RI:
7831             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7832             break;
7833          case TFU_RPT_CQI:
7834             CMCHKUNPK(cmUnpkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7835             break;
7836          default :
7837             RETVALUE(RFAILED);
7838       }
7839    RETVALUE(ROK);
7840 }
7841
7842
7843 \f
7844 /***********************************************************
7845 *
7846 *     Func : cmPkTfuCqiMode21SubCqi
7847 *
7848 *
7849 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
7850   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
7851 *
7852 *
7853 *     Ret  : S16
7854 *
7855 *     Notes:
7856 *
7857 *     File  : 
7858 *
7859 **********************************************************/
7860 #ifdef ANSI
7861 PUBLIC S16 cmPkTfuCqiMode21SubCqi
7862 (
7863 TfuCqiMode21SubCqi *param,
7864 Buffer *mBuf
7865 )
7866 #else
7867 PUBLIC S16 cmPkTfuCqiMode21SubCqi(param, mBuf)
7868 TfuCqiMode21SubCqi *param;
7869 Buffer *mBuf;
7870 #endif
7871 {
7872
7873    TRC3(cmPkTfuCqiMode21SubCqi)
7874
7875    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
7876    CMCHKPK(SPkU8, param->l, mBuf);
7877    CMCHKPK(SPkU8, param->cqi, mBuf);
7878    RETVALUE(ROK);
7879 }
7880
7881
7882 \f
7883 /***********************************************************
7884 *
7885 *     Func : cmUnpkTfuCqiMode21SubCqi
7886 *
7887 *
7888 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
7889   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
7890 *
7891 *
7892 *     Ret  : S16
7893 *
7894 *     Notes:
7895 *
7896 *     File  : 
7897 *
7898 **********************************************************/
7899 #ifdef ANSI
7900 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi
7901 (
7902 TfuCqiMode21SubCqi *param,
7903 Buffer *mBuf
7904 )
7905 #else
7906 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi(param, mBuf)
7907 TfuCqiMode21SubCqi *param;
7908 Buffer *mBuf;
7909 #endif
7910 {
7911
7912    TRC3(cmUnpkTfuCqiMode21SubCqi)
7913
7914    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7915    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
7916    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
7917    RETVALUE(ROK);
7918 }
7919
7920
7921 \f
7922 /***********************************************************
7923 *
7924 *     Func : cmPkTfuCqiMode21WideCqi
7925 *
7926 *
7927 *     Desc : This structure contains the wideband CQI report for mode 2-1.
7928   * It carries a wideband CQI, PMI and optionally a differential CQI.
7929 *
7930 *
7931 *     Ret  : S16
7932 *
7933 *     Notes:
7934 *
7935 *     File  : 
7936 *
7937 **********************************************************/
7938 #ifdef ANSI
7939 PUBLIC S16 cmPkTfuCqiMode21WideCqi
7940 (
7941 TfuCqiMode21WideCqi *param,
7942 Buffer *mBuf
7943 )
7944 #else
7945 PUBLIC S16 cmPkTfuCqiMode21WideCqi(param, mBuf)
7946 TfuCqiMode21WideCqi *param;
7947 Buffer *mBuf;
7948 #endif
7949 {
7950
7951    TRC3(cmPkTfuCqiMode21WideCqi)
7952
7953    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
7954    CMCHKPK(SPkU8, param->pmi, mBuf);
7955    CMCHKPK(SPkU8, param->cqi, mBuf);
7956    RETVALUE(ROK);
7957 }
7958
7959
7960 \f
7961 /***********************************************************
7962 *
7963 *     Func : cmUnpkTfuCqiMode21WideCqi
7964 *
7965 *
7966 *     Desc : This structure contains the wideband CQI report for mode 2-1.
7967   * It carries a wideband CQI, PMI and optionally a differential CQI.
7968 *
7969 *
7970 *     Ret  : S16
7971 *
7972 *     Notes:
7973 *
7974 *     File  : 
7975 *
7976 **********************************************************/
7977 #ifdef ANSI
7978 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi
7979 (
7980 TfuCqiMode21WideCqi *param,
7981 Buffer *mBuf
7982 )
7983 #else
7984 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi(param, mBuf)
7985 TfuCqiMode21WideCqi *param;
7986 Buffer *mBuf;
7987 #endif
7988 {
7989
7990    TRC3(cmUnpkTfuCqiMode21WideCqi)
7991
7992    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7993    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
7994    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
7995    RETVALUE(ROK);
7996 }
7997
7998
7999 \f
8000 /***********************************************************
8001 *
8002 *     Func : cmPkTfuCqiMode21Cqi
8003 *
8004 *
8005 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8006   * could either be wideband or sub-band.
8007 *
8008 *
8009 *     Ret  : S16
8010 *
8011 *     Notes:
8012 *
8013 *     File  : 
8014 *
8015 **********************************************************/
8016 #ifdef ANSI
8017 PUBLIC S16 cmPkTfuCqiMode21Cqi
8018 (
8019 TfuCqiMode21Cqi *param,
8020 Buffer *mBuf
8021 )
8022 #else
8023 PUBLIC S16 cmPkTfuCqiMode21Cqi(param, mBuf)
8024 TfuCqiMode21Cqi *param;
8025 Buffer *mBuf;
8026 #endif
8027 {
8028
8029    TRC3(cmPkTfuCqiMode21Cqi)
8030
8031       switch(param->isWideband) {
8032          case FALSE:
8033             CMCHKPK(cmPkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8034             break;
8035          case TRUE:
8036             CMCHKPK(cmPkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8037             break;
8038          default :
8039             RETVALUE(RFAILED);
8040       }
8041    CMCHKPK(SPkU8, param->isWideband, mBuf);
8042    RETVALUE(ROK);
8043 }
8044
8045
8046 \f
8047 /***********************************************************
8048 *
8049 *     Func : cmUnpkTfuCqiMode21Cqi
8050 *
8051 *
8052 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8053   * could either be wideband or sub-band.
8054 *
8055 *
8056 *     Ret  : S16
8057 *
8058 *     Notes:
8059 *
8060 *     File  : 
8061 *
8062 **********************************************************/
8063 #ifdef ANSI
8064 PUBLIC S16 cmUnpkTfuCqiMode21Cqi
8065 (
8066 TfuCqiMode21Cqi *param,
8067 Buffer *mBuf
8068 )
8069 #else
8070 PUBLIC S16 cmUnpkTfuCqiMode21Cqi(param, mBuf)
8071 TfuCqiMode21Cqi *param;
8072 Buffer *mBuf;
8073 #endif
8074 {
8075
8076    TRC3(cmUnpkTfuCqiMode21Cqi)
8077
8078    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
8079       switch(param->isWideband) {
8080          case TRUE:
8081             CMCHKUNPK(cmUnpkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8082             break;
8083          case FALSE:
8084             CMCHKUNPK(cmUnpkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8085             break;
8086          default :
8087             RETVALUE(RFAILED);
8088       }
8089    RETVALUE(ROK);
8090 }
8091
8092
8093 \f
8094 /***********************************************************
8095 *
8096 *     Func : cmPkTfuCqiPucchMode21
8097 *
8098 *
8099 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8100   * conveys a Rank Indicator or a CQI report.
8101 *
8102 *
8103 *     Ret  : S16
8104 *
8105 *     Notes:
8106 *
8107 *     File  : 
8108 *
8109 **********************************************************/
8110 #ifdef ANSI
8111 PUBLIC S16 cmPkTfuCqiPucchMode21
8112 (
8113 TfuCqiPucchMode21 *param,
8114 Buffer *mBuf
8115 )
8116 #else
8117 PUBLIC S16 cmPkTfuCqiPucchMode21(param, mBuf)
8118 TfuCqiPucchMode21 *param;
8119 Buffer *mBuf;
8120 #endif
8121 {
8122
8123    TRC3(cmPkTfuCqiPucchMode21)
8124
8125       switch(param->type) {
8126          case TFU_RPT_CQI:
8127             CMCHKPK(cmPkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8128             break;
8129          case TFU_RPT_RI:
8130             CMCHKPK(SPkU8, param->u.ri, mBuf);
8131             break;
8132          default :
8133             RETVALUE(RFAILED);
8134       }
8135    CMCHKPK(SPkU32, param->type, mBuf);
8136    RETVALUE(ROK);
8137 }
8138
8139
8140 \f
8141 /***********************************************************
8142 *
8143 *     Func : cmUnpkTfuCqiPucchMode21
8144 *
8145 *
8146 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8147   * conveys a Rank Indicator or a CQI report.
8148 *
8149 *
8150 *     Ret  : S16
8151 *
8152 *     Notes:
8153 *
8154 *     File  : 
8155 *
8156 **********************************************************/
8157 #ifdef ANSI
8158 PUBLIC S16 cmUnpkTfuCqiPucchMode21
8159 (
8160 TfuCqiPucchMode21 *param,
8161 Buffer *mBuf
8162 )
8163 #else
8164 PUBLIC S16 cmUnpkTfuCqiPucchMode21(param, mBuf)
8165 TfuCqiPucchMode21 *param;
8166 Buffer *mBuf;
8167 #endif
8168 {
8169
8170    TRC3(cmUnpkTfuCqiPucchMode21)
8171
8172    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8173       switch(param->type) {
8174          case TFU_RPT_RI:
8175             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8176             break;
8177          case TFU_RPT_CQI:
8178             CMCHKUNPK(cmUnpkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8179             break;
8180          default :
8181             RETVALUE(RFAILED);
8182       }
8183    RETVALUE(ROK);
8184 }
8185
8186
8187 \f
8188 /***********************************************************
8189 *
8190 *     Func : cmPkTfuDlCqiPucch
8191 *
8192 *
8193 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8194 *
8195 *
8196 *     Ret  : S16
8197 *
8198 *     Notes:
8199 *
8200 *     File  : 
8201 *
8202 **********************************************************/
8203 #ifdef ANSI
8204 PUBLIC S16 cmPkTfuDlCqiPucch
8205 (
8206 TfuDlCqiPucch *param,
8207 Buffer *mBuf
8208 )
8209 #else
8210 PUBLIC S16 cmPkTfuDlCqiPucch(param, mBuf)
8211 TfuDlCqiPucch *param;
8212 Buffer *mBuf;
8213 #endif
8214 {
8215
8216    TRC3(cmPkTfuDlCqiPucch)
8217
8218       switch(param->mode) {
8219          case TFU_PUCCH_CQI_MODE21:
8220             CMCHKPK(cmPkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8221             break;
8222          case TFU_PUCCH_CQI_MODE20:
8223             CMCHKPK(cmPkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8224             break;
8225          case TFU_PUCCH_CQI_MODE11:
8226             CMCHKPK(cmPkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8227             break;
8228          case TFU_PUCCH_CQI_MODE10:
8229             CMCHKPK(cmPkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8230             break;
8231          default :
8232             RETVALUE(RFAILED);
8233       }
8234    CMCHKPK(SPkU32, param->mode, mBuf);
8235    CMCHKPK(SPkU8, param->cellIdx, mBuf);
8236    RETVALUE(ROK);
8237 }
8238
8239
8240 \f
8241 /***********************************************************
8242 *
8243 *     Func : cmUnpkTfuDlCqiPucch
8244 *
8245 *
8246 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8247 *
8248 *
8249 *     Ret  : S16
8250 *
8251 *     Notes:
8252 *
8253 *     File  : 
8254 *
8255 **********************************************************/
8256 #ifdef ANSI
8257 PUBLIC S16 cmUnpkTfuDlCqiPucch
8258 (
8259 TfuDlCqiPucch *param,
8260 Buffer *mBuf
8261 )
8262 #else
8263 PUBLIC S16 cmUnpkTfuDlCqiPucch(param, mBuf)
8264 TfuDlCqiPucch *param;
8265 Buffer *mBuf;
8266 #endif
8267 {
8268
8269    TRC3(cmUnpkTfuDlCqiPucch)
8270
8271    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
8272    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
8273       switch(param->mode) {
8274          case TFU_PUCCH_CQI_MODE10:
8275             CMCHKUNPK(cmUnpkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8276             break;
8277          case TFU_PUCCH_CQI_MODE11:
8278             CMCHKUNPK(cmUnpkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8279             break;
8280          case TFU_PUCCH_CQI_MODE20:
8281             CMCHKUNPK(cmUnpkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8282             break;
8283          case TFU_PUCCH_CQI_MODE21:
8284             CMCHKUNPK(cmUnpkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8285             break;
8286          default :
8287             RETVALUE(RFAILED);
8288       }
8289    RETVALUE(ROK);
8290 }
8291
8292
8293 \f
8294 /***********************************************************
8295 *
8296 *     Func : cmPkTfuSubbandMode12
8297 *
8298 *
8299 *     Desc : This structure carries subband information and PMI, in the CQI
8300   * reporting format 1-2.
8301 *
8302 *
8303 *     Ret  : S16
8304 *
8305 *     Notes:
8306 *
8307 *     File  : 
8308 *
8309 **********************************************************/
8310 #ifdef ANSI
8311 PUBLIC S16 cmPkTfuSubbandMode12
8312 (
8313 TfuSubbandMode12 *param,
8314 Buffer *mBuf
8315 )
8316 #else
8317 PUBLIC S16 cmPkTfuSubbandMode12(param, mBuf)
8318 TfuSubbandMode12 *param;
8319 Buffer *mBuf;
8320 #endif
8321 {
8322
8323    TRC3(cmPkTfuSubbandMode12)
8324
8325    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8326    CMCHKPK(SPkU8, param->pmi, mBuf);
8327    RETVALUE(ROK);
8328 }
8329
8330
8331 \f
8332 /***********************************************************
8333 *
8334 *     Func : cmUnpkTfuSubbandMode12
8335 *
8336 *
8337 *     Desc : This structure carries subband information and PMI, in the CQI
8338   * reporting format 1-2.
8339 *
8340 *
8341 *     Ret  : S16
8342 *
8343 *     Notes:
8344 *
8345 *     File  : 
8346 *
8347 **********************************************************/
8348 #ifdef ANSI
8349 PUBLIC S16 cmUnpkTfuSubbandMode12
8350 (
8351 TfuSubbandMode12 *param,
8352 Buffer *mBuf
8353 )
8354 #else
8355 PUBLIC S16 cmUnpkTfuSubbandMode12(param, mBuf)
8356 TfuSubbandMode12 *param;
8357 Buffer *mBuf;
8358 #endif
8359 {
8360
8361    TRC3(cmUnpkTfuSubbandMode12)
8362
8363    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8364    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8365    RETVALUE(ROK);
8366 }
8367
8368
8369 \f
8370 /***********************************************************
8371 *
8372 *     Func : cmPkTfuCqiPuschMode12
8373 *
8374 *
8375 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8376  * over PUSCH.
8377 *
8378 *
8379 *     Ret  : S16
8380 *
8381 *     Notes:
8382 *
8383 *     File  : 
8384 *
8385 **********************************************************/
8386 #ifdef ANSI
8387 PUBLIC S16 cmPkTfuCqiPuschMode12
8388 (
8389 TfuCqiPuschMode12 *param,
8390 Buffer *mBuf
8391 )
8392 #else
8393 PUBLIC S16 cmPkTfuCqiPuschMode12(param, mBuf)
8394 TfuCqiPuschMode12 *param;
8395 Buffer *mBuf;
8396 #endif
8397 {
8398
8399    S32 i;
8400    TRC3(cmPkTfuCqiPuschMode12)
8401
8402    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8403       CMCHKPK(cmPkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8404    }
8405    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8406       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
8407    }
8408    CMCHKPK(SPkU8, param->numSubband, mBuf);
8409    RETVALUE(ROK);
8410 }
8411
8412
8413 \f
8414 /***********************************************************
8415 *
8416 *     Func : cmUnpkTfuCqiPuschMode12
8417 *
8418 *
8419 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8420  * over PUSCH.
8421 *
8422 *
8423 *     Ret  : S16
8424 *
8425 *     Notes:
8426 *
8427 *     File  : 
8428 *
8429 **********************************************************/
8430 #ifdef ANSI
8431 PUBLIC S16 cmUnpkTfuCqiPuschMode12
8432 (
8433 TfuCqiPuschMode12 *param,
8434 Buffer *mBuf
8435 )
8436 #else
8437 PUBLIC S16 cmUnpkTfuCqiPuschMode12(param, mBuf)
8438 TfuCqiPuschMode12 *param;
8439 Buffer *mBuf;
8440 #endif
8441 {
8442
8443    S32 i;
8444    TRC3(cmUnpkTfuCqiPuschMode12)
8445
8446    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8447    for (i=0; i<TFU_MAX_TB; i++) {
8448       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
8449    }
8450    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8451       CMCHKUNPK(cmUnpkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8452    }
8453    RETVALUE(ROK);
8454 }
8455
8456
8457 \f
8458 /***********************************************************
8459 *
8460 *     Func : cmPkTfuCqiPuschMode20
8461 *
8462 *
8463 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8464  * over PUSCH. This mode is for UE selected sub-band feedback.
8465 *
8466 *
8467 *     Ret  : S16
8468 *
8469 *     Notes:
8470 *
8471 *     File  : 
8472 *
8473 **********************************************************/
8474 #ifdef ANSI
8475 PUBLIC S16 cmPkTfuCqiPuschMode20
8476 (
8477 TfuCqiPuschMode20 *param,
8478 Buffer *mBuf
8479 )
8480 #else
8481 PUBLIC S16 cmPkTfuCqiPuschMode20(param, mBuf)
8482 TfuCqiPuschMode20 *param;
8483 Buffer *mBuf;
8484 #endif
8485 {
8486
8487    S32 i;
8488    TRC3(cmPkTfuCqiPuschMode20)
8489
8490    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8491       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8492    }
8493    CMCHKPK(SPkU8, param->numSubband, mBuf);
8494    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8495    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
8496    RETVALUE(ROK);
8497 }
8498
8499
8500 \f
8501 /***********************************************************
8502 *
8503 *     Func : cmUnpkTfuCqiPuschMode20
8504 *
8505 *
8506 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8507  * over PUSCH. This mode is for UE selected sub-band feedback.
8508 *
8509 *
8510 *     Ret  : S16
8511 *
8512 *     Notes:
8513 *
8514 *     File  : 
8515 *
8516 **********************************************************/
8517 #ifdef ANSI
8518 PUBLIC S16 cmUnpkTfuCqiPuschMode20
8519 (
8520 TfuCqiPuschMode20 *param,
8521 Buffer *mBuf
8522 )
8523 #else
8524 PUBLIC S16 cmUnpkTfuCqiPuschMode20(param, mBuf)
8525 TfuCqiPuschMode20 *param;
8526 Buffer *mBuf;
8527 #endif
8528 {
8529
8530    S32 i;
8531    TRC3(cmUnpkTfuCqiPuschMode20)
8532
8533    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
8534    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8535    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8536    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8537       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8538    }
8539    RETVALUE(ROK);
8540 }
8541
8542 \f
8543 /***********************************************************
8544 *
8545 *     Func : cmPkTfuCqiPuschMode22
8546 *
8547 *
8548 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8549  * over PUSCH.
8550 *
8551 *
8552 *     Ret  : S16
8553 *
8554 *     Notes:
8555 *
8556 *     File  : 
8557 *
8558 **********************************************************/
8559 #ifdef ANSI
8560 PUBLIC S16 cmPkTfuCqiPuschMode22
8561 (
8562 TfuCqiPuschMode22 *param,
8563 Buffer *mBuf
8564 )
8565 #else
8566 PUBLIC S16 cmPkTfuCqiPuschMode22(param, mBuf)
8567 TfuCqiPuschMode22 *param;
8568 Buffer *mBuf;
8569 #endif
8570 {
8571
8572    S32 i;
8573    TRC3(cmPkTfuCqiPuschMode22)
8574
8575
8576    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8577       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8578    }
8579
8580    CMCHKPK(SPkU8, param->numSubband, mBuf);
8581    CMCHKPK(SPkU8, param->wideBandPmi, mBuf);
8582    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8583       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
8584    }
8585    CMCHKPK(SPkU8, param->pmi, mBuf);
8586    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8587       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8588    }
8589    RETVALUE(ROK);
8590 }
8591
8592
8593 \f
8594 /***********************************************************
8595 *
8596 *     Func : cmUnpkTfuCqiPuschMode22
8597 *
8598 *
8599 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8600  * over PUSCH.
8601 *
8602 *
8603 *     Ret  : S16
8604 *
8605 *     Notes:
8606 *
8607 *     File  : 
8608 *
8609 **********************************************************/
8610 #ifdef ANSI
8611 PUBLIC S16 cmUnpkTfuCqiPuschMode22
8612 (
8613 TfuCqiPuschMode22 *param,
8614 Buffer *mBuf
8615 )
8616 #else
8617 PUBLIC S16 cmUnpkTfuCqiPuschMode22(param, mBuf)
8618 TfuCqiPuschMode22 *param;
8619 Buffer *mBuf;
8620 #endif
8621 {
8622
8623    S32 i;
8624    TRC3(cmUnpkTfuCqiPuschMode22)
8625
8626    for (i=0; i<TFU_MAX_TB; i++) {
8627       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8628    }
8629    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8630    for (i=0; i<TFU_MAX_TB; i++) {
8631       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
8632    }
8633    CMCHKUNPK(SUnpkU8, &param->wideBandPmi, mBuf);
8634    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8635
8636    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8637       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8638    }
8639
8640    RETVALUE(ROK);
8641 }
8642
8643
8644 #ifdef ANSI
8645 PUBLIC S16 cmPkTfuSubbandMode30
8646 (
8647 TfuSubbandMode30 *param,
8648 Buffer *mBuf
8649 )
8650 #else
8651 PUBLIC S16 cmPkTfuSubbandMode30(param, mBuf)
8652 TfuSubbandMode30 *param;
8653 Buffer *mBuf;
8654 #endif
8655 {
8656
8657    TRC3(cmPkTfuSubbandMode30)
8658
8659    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8660    CMCHKPK(SPkU8, param->cqi, mBuf);
8661    RETVALUE(ROK);
8662 }
8663
8664
8665 #ifdef ANSI
8666 PUBLIC S16 cmUnpkTfuSubbandMode30
8667 (
8668 TfuSubbandMode30 *param,
8669 Buffer *mBuf
8670 )
8671 #else
8672 PUBLIC S16 cmUnpkTfuSubbandMode30(param, mBuf)
8673 TfuSubbandMode30 *param;
8674 Buffer *mBuf;
8675 #endif
8676 {
8677
8678    TRC3(cmUnpkTfuSubbandMode30)
8679
8680    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8681    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8682    RETVALUE(ROK);
8683 }
8684
8685
8686 \f
8687 /***********************************************************
8688 *
8689 *     Func : cmPkTfuCqiPuschMode30
8690 *
8691 *
8692 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8693  * received over PUSCH.
8694 *
8695 *
8696 *     Ret  : S16
8697 *
8698 *     Notes:
8699 *
8700 *     File  : 
8701 *
8702 **********************************************************/
8703 #ifdef ANSI
8704 PUBLIC S16 cmPkTfuCqiPuschMode30
8705 (
8706 TfuCqiPuschMode30 *param,
8707 Buffer *mBuf
8708 )
8709 #else
8710 PUBLIC S16 cmPkTfuCqiPuschMode30(param, mBuf)
8711 TfuCqiPuschMode30 *param;
8712 Buffer *mBuf;
8713 #endif
8714 {
8715
8716    S32 i;
8717    TRC3(cmPkTfuCqiPuschMode30)
8718
8719    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8720       CMCHKPK(cmPkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8721    }
8722    CMCHKPK(SPkU8, param->numSubband, mBuf);
8723    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8724    RETVALUE(ROK);
8725 }
8726
8727
8728 \f
8729 /***********************************************************
8730 *
8731 *     Func : cmUnpkTfuCqiPuschMode30
8732 *
8733 *
8734 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8735  * received over PUSCH.
8736 *
8737 *
8738 *     Ret  : S16
8739 *
8740 *     Notes:
8741 *
8742 *     File  : 
8743 *
8744 **********************************************************/
8745 #ifdef ANSI
8746 PUBLIC S16 cmUnpkTfuCqiPuschMode30
8747 (
8748 TfuCqiPuschMode30 *param,
8749 Buffer *mBuf
8750 )
8751 #else
8752 PUBLIC S16 cmUnpkTfuCqiPuschMode30(param, mBuf)
8753 TfuCqiPuschMode30 *param;
8754 Buffer *mBuf;
8755 #endif
8756 {
8757
8758    S32 i;
8759    TRC3(cmUnpkTfuCqiPuschMode30)
8760
8761    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8762    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8763    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8764       CMCHKUNPK(cmUnpkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8765    }
8766    RETVALUE(ROK);
8767 }
8768
8769
8770 #ifdef ANSI
8771 PUBLIC S16 cmPkTfuSubbandMode31
8772 (
8773 TfuSubbandMode31 *param,
8774 Buffer *mBuf
8775 )
8776 #else
8777 PUBLIC S16 cmPkTfuSubbandMode31(param, mBuf)
8778 TfuSubbandMode31 *param;
8779 Buffer *mBuf;
8780 #endif
8781 {
8782
8783    S32 i;
8784    TRC3(cmPkTfuSubbandMode31)
8785
8786    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8787    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8788       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8789    }
8790    RETVALUE(ROK);
8791 }
8792
8793
8794 #ifdef ANSI
8795 PUBLIC S16 cmUnpkTfuSubbandMode31
8796 (
8797 TfuSubbandMode31 *param,
8798 Buffer *mBuf
8799 )
8800 #else
8801 PUBLIC S16 cmUnpkTfuSubbandMode31(param, mBuf)
8802 TfuSubbandMode31 *param;
8803 Buffer *mBuf;
8804 #endif
8805 {
8806
8807    S32 i;
8808    TRC3(cmUnpkTfuSubbandMode31)
8809
8810    for (i=0; i<TFU_MAX_TB; i++) {
8811       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8812    }
8813    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8814    RETVALUE(ROK);
8815 }
8816
8817
8818 \f
8819 /***********************************************************
8820 *
8821 *     Func : cmPkTfuCqiPuschMode31
8822 *
8823 *
8824 *     Desc : This structure conveys information present in CQI reporting mode 3-1
8825  * received over PUSCH.
8826 *
8827 *
8828 *     Ret  : S16
8829 *
8830 *     Notes:
8831 *
8832 *     File  : 
8833 *
8834 **********************************************************/
8835 #ifdef ANSI
8836 PUBLIC S16 cmPkTfuCqiPuschMode31
8837 (
8838 TfuCqiPuschMode31 *param,
8839 Buffer *mBuf
8840 )
8841 #else
8842 PUBLIC S16 cmPkTfuCqiPuschMode31(param, mBuf)
8843 TfuCqiPuschMode31 *param;
8844 Buffer *mBuf;
8845 #endif
8846 {
8847
8848    S32 i;
8849    TRC3(cmPkTfuCqiPuschMode31)
8850
8851
8852 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8853 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8854
8855 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8856 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8857    for (i=param->numSubband-1; i >= 0; i--) {
8858       CMCHKPK(cmPkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
8859    }
8860
8861    CMCHKPK(SPkU8, param->numSubband, mBuf);
8862    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8863       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
8864    }
8865    CMCHKPK(SPkU8, param->pmi, mBuf);
8866    RETVALUE(ROK);
8867 }
8868
8869
8870 \f
8871 /***********************************************************
8872 *
8873 *     Func : cmUnpkTfuCqiPuschMode31
8874 *
8875 *
8876 *     Desc : This structure conveys information present in CQI reporting mode 3-1
8877  * received over PUSCH.
8878 *
8879 *
8880 *     Ret  : S16
8881 *
8882 *     Notes:
8883 *
8884 *     File  : 
8885 *
8886 **********************************************************/
8887 #ifdef ANSI
8888 PUBLIC S16 cmUnpkTfuCqiPuschMode31
8889 (
8890 TfuCqiPuschMode31 *param,
8891 Buffer *mBuf
8892 )
8893 #else
8894 PUBLIC S16 cmUnpkTfuCqiPuschMode31(param, mBuf)
8895 TfuCqiPuschMode31 *param;
8896 Buffer *mBuf;
8897 #endif
8898 {
8899
8900    S32 i;
8901    TRC3(cmUnpkTfuCqiPuschMode31)
8902
8903    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8904    for (i=0; i<TFU_MAX_TB; i++) {
8905       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
8906    }
8907    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8908
8909 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8910 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8911    for (i=0; i<param->numSubband; i++) {
8912       CMCHKUNPK(cmUnpkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
8913    }
8914
8915
8916 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
8917 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
8918
8919    RETVALUE(ROK);
8920 }
8921
8922
8923 \f
8924 /***********************************************************
8925 *
8926 *     Func : cmPkTfuDlCqiPusch
8927 *
8928 *
8929 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
8930  * CQI) received over PUSCH.
8931 *
8932 *
8933 *     Ret  : S16
8934 *
8935 *     Notes:
8936 *
8937 *     File  : 
8938 *
8939 **********************************************************/
8940 #ifdef ANSI
8941 PUBLIC S16 cmPkTfuDlCqiPusch
8942 (
8943 TfuDlCqiPusch *param,
8944 Buffer *mBuf
8945 )
8946 #else
8947 PUBLIC S16 cmPkTfuDlCqiPusch(param, mBuf)
8948 TfuDlCqiPusch *param;
8949 Buffer *mBuf;
8950 #endif
8951 {
8952
8953    TRC3(cmPkTfuDlCqiPusch)
8954
8955       switch(param->mode) {
8956          case TFU_PUSCH_CQI_MODE_31:
8957             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
8958             break;
8959          case TFU_PUSCH_CQI_MODE_30:
8960             CMCHKPK(cmPkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
8961             break;
8962          case TFU_PUSCH_CQI_MODE_22:
8963             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
8964             break;
8965          case TFU_PUSCH_CQI_MODE_20:
8966             CMCHKPK(cmPkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
8967             break;
8968          case TFU_PUSCH_CQI_MODE_12:
8969             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
8970             break;
8971          default :
8972             RETVALUE(RFAILED);
8973       }
8974
8975    CMCHKPK(cmPkTknU8, &param->ri, mBuf);
8976    CMCHKPK(SPkU32, param->mode, mBuf);
8977
8978    CMCHKPK(SPkU8, param->cellIdx, mBuf);
8979    RETVALUE(ROK);
8980 }
8981
8982
8983 \f
8984 /***********************************************************
8985 *
8986 *     Func : cmUnpkTfuDlCqiPusch
8987 *
8988 *
8989 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
8990  * CQI) received over PUSCH.
8991 *
8992 *
8993 *     Ret  : S16
8994 *
8995 *     Notes:
8996 *
8997 *     File  : 
8998 *
8999 **********************************************************/
9000 #ifdef ANSI
9001 PUBLIC S16 cmUnpkTfuDlCqiPusch
9002 (
9003 TfuDlCqiPusch *param,
9004 Buffer *mBuf
9005 )
9006 #else
9007 PUBLIC S16 cmUnpkTfuDlCqiPusch(param, mBuf)
9008 TfuDlCqiPusch *param;
9009 Buffer *mBuf;
9010 #endif
9011 {
9012
9013    TRC3(cmUnpkTfuDlCqiPusch)
9014
9015    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
9016    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
9017    CMCHKUNPK(cmUnpkTknU8, &param->ri, mBuf);
9018    switch(param->mode) {
9019       case TFU_PUSCH_CQI_MODE_12:
9020          CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9021          break;
9022       case TFU_PUSCH_CQI_MODE_20:
9023          CMCHKUNPK(cmUnpkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9024          break;
9025       case TFU_PUSCH_CQI_MODE_22:
9026          CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9027          break;
9028       case TFU_PUSCH_CQI_MODE_30:
9029          CMCHKUNPK(cmUnpkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9030          break;
9031       case TFU_PUSCH_CQI_MODE_31:
9032          CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9033          break;
9034       default :
9035          RETVALUE(RFAILED);
9036    }
9037    RETVALUE(ROK);
9038 }
9039
9040 \f
9041 /***********************************************************
9042 *
9043 *     Func : cmPkTfuDlCqiInfo
9044 *
9045 *
9046 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9047 *
9048 *
9049 *     Ret  : S16
9050 *
9051 *     Notes:
9052 *
9053 *     File  : 
9054 *
9055 **********************************************************/
9056 #ifdef ANSI
9057 PUBLIC S16 cmPkTfuDlCqiInfo
9058 (
9059 U8 selector,
9060 TfuDlCqiInfo *param,
9061 Buffer *mBuf
9062 )
9063 #else
9064 PUBLIC S16 cmPkTfuDlCqiInfo(selector, param, mBuf)
9065 U8 selector;
9066 TfuDlCqiInfo *param;
9067 Buffer *mBuf;
9068 #endif
9069 {
9070    U32 idx;
9071
9072    TRC3(cmPkTfuDlCqiInfo)
9073
9074    switch(selector) {
9075       case FALSE:
9076          for (idx = 0; idx < param->pusch.numOfCells; idx++)
9077          {
9078             CMCHKPK(cmPkTfuDlCqiPusch, &param->pusch.puschCqi[idx], mBuf);
9079          }
9080          CMCHKPK(SPkU8, param->pusch.numOfCells, mBuf);
9081          break;
9082       case TRUE:
9083          CMCHKPK(cmPkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9084          break;
9085       default :
9086          RETVALUE(RFAILED);
9087    }
9088    RETVALUE(ROK);
9089 }
9090
9091
9092 \f
9093 /***********************************************************
9094 *
9095 *     Func : cmUnpkTfuDlCqiInfo
9096 *
9097 *
9098 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9099 *
9100 *
9101 *     Ret  : S16
9102 *
9103 *     Notes:
9104 *
9105 *     File  : 
9106 *
9107 **********************************************************/
9108 #ifdef ANSI
9109 PUBLIC S16 cmUnpkTfuDlCqiInfo
9110 (
9111 U8 selector,
9112 TfuDlCqiInfo *param,
9113 Buffer *mBuf
9114 )
9115 #else
9116 PUBLIC S16 cmUnpkTfuDlCqiInfo(selector, param, mBuf)
9117 U8 selector;
9118 TfuDlCqiInfo *param;
9119 Buffer *mBuf;
9120 #endif
9121 {
9122
9123    U8 idx;
9124    TRC3(cmUnpkTfuDlCqiInfo)
9125
9126    switch(selector) {
9127       case TRUE:
9128          CMCHKUNPK(cmUnpkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9129          break;
9130       case FALSE:
9131          CMCHKUNPK(SUnpkU8, &param->pusch.numOfCells, mBuf);
9132          for (idx = param->pusch.numOfCells; idx > 0; idx--)
9133          {
9134             CMCHKUNPK(cmUnpkTfuDlCqiPusch, &param->pusch.puschCqi[idx-1], mBuf);
9135          }
9136          break;
9137       default :
9138          RETVALUE(RFAILED);
9139    }
9140    RETVALUE(ROK);
9141 }
9142
9143
9144 \f
9145 /***********************************************************
9146 *
9147 *     Func : cmPkTfuRecpReqInfo
9148 *
9149 *
9150 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9151  * needed by PHY to decode the following 
9152  * 1. DATA on PUSCH
9153  * 2. HARQ Feedback on PUCCH
9154  * 3. CQI Report 
9155  * 4. RI Report
9156  * 5. SR Indications.
9157  * This structure carries the reception information for all the scheduled UE.
9158 *
9159 *
9160 *     Ret  : S16
9161 *
9162 *     Notes:
9163 *
9164 *     File  : 
9165 *
9166 **********************************************************/
9167 #ifdef ANSI
9168 PUBLIC S16 cmPkTfuRecpReqInfo
9169 (
9170 TfuRecpReqInfo *param,
9171 Buffer *mBuf
9172 )
9173 #else
9174 PUBLIC S16 cmPkTfuRecpReqInfo(param, mBuf)
9175 TfuRecpReqInfo *param;
9176 Buffer *mBuf;
9177 #endif
9178 {
9179    CmLList *node;
9180    U32 count;
9181    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9182
9183    TRC3(cmPkTfuRecpReqInfo)
9184
9185    /*ccpu00116923 - ADD - SRS present support*/
9186    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9187 #ifdef TFU_UPGRADE
9188    CMCHKPK(SPkU8, param->srsPres, mBuf);
9189 #endif
9190    count = param->ueRecpReqLst.count;
9191    node = param->ueRecpReqLst.last;
9192    while (node) {
9193       tfuUeRecpReqInfo = (TfuUeRecpReqInfo *)node->node;
9194       node=node->prev;
9195       CMCHKPK(cmPkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9196       cmLListDelFrm(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9197       tfuUeRecpReqInfo->lnk.node = (PTR)NULLP;
9198    }
9199    CMCHKPK(SPkU32, count, mBuf);
9200    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
9201    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9202    RETVALUE(ROK);
9203 }
9204
9205
9206 \f
9207 /***********************************************************
9208 *
9209 *     Func : cmUnpkTfuRecpReqInfo
9210 *
9211 *
9212 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9213  * needed by PHY to decode the following 
9214  * 1. DATA on PUSCH
9215  * 2. HARQ Feedback on PUCCH
9216  * 3. CQI Report 
9217  * 4. RI Report
9218  * 5. SR Indications.
9219  * This structure carries the reception information for all the scheduled UE.
9220 *
9221 *
9222 *     Ret  : S16
9223 *
9224 *     Notes:
9225 *
9226 *     File  : 
9227 *
9228 **********************************************************/
9229 #ifdef ANSI
9230 PUBLIC S16 cmUnpkTfuRecpReqInfo
9231 (
9232 TfuRecpReqInfo *param,
9233 Ptr memCp,
9234 Buffer *mBuf
9235 )
9236 #else
9237 PUBLIC S16 cmUnpkTfuRecpReqInfo(param, memCp, mBuf)
9238 TfuRecpReqInfo *param;
9239 Ptr memCp;
9240 Buffer *mBuf;
9241 #endif
9242 {
9243
9244    U32 count, loopCnt;
9245    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9246
9247    TRC3(cmUnpkTfuRecpReqInfo)
9248
9249    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9250    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
9251    cmLListInit(&param->ueRecpReqLst);
9252    CMCHKUNPK(SUnpkU32, &count, mBuf);
9253    for (loopCnt=0; loopCnt<count; loopCnt++) {
9254       cmGetMem((Ptr)memCp, sizeof(*tfuUeRecpReqInfo), (Ptr *)&tfuUeRecpReqInfo);
9255       CMCHKUNPK(cmUnpkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9256       cmLListAdd2Tail(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9257       tfuUeRecpReqInfo->lnk.node = (PTR)tfuUeRecpReqInfo;
9258    }
9259    /*ccpu00116923 - ADD - SRS present support*/
9260    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9261 #ifdef TFU_UPGRADE
9262    CMCHKUNPK(SUnpkU8, &param->srsPres, mBuf);
9263 #endif
9264    RETVALUE(ROK);
9265 }
9266
9267
9268 \f
9269 /***********************************************************
9270 *
9271 *     Func : cmPkTfuPdcchInfo
9272 *
9273 *
9274 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9275   * formats. This information is associated with an RNTI.
9276 *
9277 *
9278 *     Ret  : S16
9279 *
9280 *     Notes:
9281 *
9282 *     File  : 
9283 *
9284 **********************************************************/
9285 #ifdef ANSI
9286 PUBLIC S16 cmPkTfuPdcchInfo
9287 (
9288 TfuPdcchInfo *param,
9289 Buffer *mBuf
9290 )
9291 #else
9292 PUBLIC S16 cmPkTfuPdcchInfo(param, mBuf)
9293 TfuPdcchInfo *param;
9294 Buffer *mBuf;
9295 #endif
9296 {
9297
9298    TRC3(cmPkTfuPdcchInfo)
9299 #ifdef TFU_5GTF
9300    CMCHKPK(SPkU8, param->grpId, mBuf);
9301    CMCHKPK(SPkU8, param->sccIdx, mBuf);
9302    CMCHKPK(SPkU8, param->sectorId, mBuf);
9303 #endif /* TFU_5GTF */
9304    CMCHKPK(cmPkTfuDciInfo, &param->dci, mBuf);
9305    CMCHKPK(SPkU8, param->dciNumOfBits, mBuf);
9306    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
9307    CMCHKPK(SPkU16, param->nCce, mBuf);
9308 #ifdef LTEMAC_SPS
9309    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9310    CMCHKPK(SPkU8, param->isSpsRnti, mBuf);
9311 #endif
9312    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9313    RETVALUE(ROK);
9314 }
9315
9316
9317 \f
9318 /***********************************************************
9319 *
9320 *     Func : cmUnpkTfuPdcchInfo
9321 *
9322 *
9323 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9324   * formats. This information is associated with an RNTI.
9325 *
9326 *
9327 *     Ret  : S16
9328 *
9329 *     Notes:
9330 *
9331 *     File  : 
9332 *
9333 **********************************************************/
9334 #ifdef ANSI
9335 PUBLIC S16 cmUnpkTfuPdcchInfo
9336 (
9337 TfuPdcchInfo *param,
9338 Buffer *mBuf
9339 )
9340 #else
9341 PUBLIC S16 cmUnpkTfuPdcchInfo(param, mBuf)
9342 TfuPdcchInfo *param;
9343 Buffer *mBuf;
9344 #endif
9345 {
9346
9347    TRC3(cmUnpkTfuPdcchInfo)
9348
9349    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9350 #ifdef LTEMAC_SPS
9351    CMCHKUNPK(SUnpkU8, &param->isSpsRnti, mBuf);
9352    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9353 #endif
9354    CMCHKUNPK(SUnpkU16, &param->nCce, mBuf);
9355    CMCHKUNPK(cmUnpkLteAggrLvl, (U32*)&param->aggrLvl, mBuf);
9356    CMCHKUNPK(SUnpkU8, &param->dciNumOfBits, mBuf);
9357    CMCHKUNPK(cmUnpkTfuDciInfo, &param->dci, mBuf);
9358 #ifdef TFU_5GTF 
9359    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
9360    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
9361    CMCHKUNPK(SUnpkU8, &param->grpId, mBuf);
9362 #endif /* TFU_5GTF */
9363    RETVALUE(ROK);
9364 }
9365
9366
9367 \f
9368 /***********************************************************
9369 *
9370 *     Func : cmPkTfuPhichInfo
9371 *
9372 *
9373 *     Desc : This structure contains one PHICH information. In order to locate the
9374  * resources to be used for PHICH the following information is provided along
9375  * with the feedback -
9376  * -# rbStart
9377  * -# nDmrs
9378 *
9379 *
9380 *     Ret  : S16
9381 *
9382 *     Notes:
9383 *
9384 *     File  : 
9385 *
9386 **********************************************************/
9387 #ifdef ANSI
9388 PUBLIC S16 cmPkTfuPhichInfo
9389 (
9390 TfuPhichInfo *param,
9391 Buffer *mBuf
9392 )
9393 #else
9394 PUBLIC S16 cmPkTfuPhichInfo(param, mBuf)
9395 TfuPhichInfo *param;
9396 Buffer *mBuf;
9397 #endif
9398 {
9399
9400    TRC3(cmPkTfuPhichInfo)
9401 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9402 #ifdef TFU_UPGRADE
9403    CMCHKPK(SPkU16, param->txPower, mBuf);
9404 #endif
9405 #ifdef TFU_TDD
9406    CMCHKPK(SPkU8, param->iPhich, mBuf);
9407 #endif
9408    CMCHKPK(SPkU8, param->isAck, mBuf);
9409    CMCHKPK(SPkU8, param->nDmrs, mBuf);
9410    CMCHKPK(SPkU8, param->rbStart, mBuf);
9411    RETVALUE(ROK);
9412 }
9413
9414
9415 \f
9416 /***********************************************************
9417 *
9418 *     Func : cmUnpkTfuPhichInfo
9419 *
9420 *
9421 *     Desc : This structure contains one PHICH information. In order to locate the
9422  * resources to be used for PHICH the following information is provided along
9423  * with the feedback -
9424  * -# rbStart
9425  * -# nDmrs
9426 *
9427 *
9428 *     Ret  : S16
9429 *
9430 *     Notes:
9431 *
9432 *     File  : 
9433 *
9434 **********************************************************/
9435 #ifdef ANSI
9436 PUBLIC S16 cmUnpkTfuPhichInfo
9437 (
9438 TfuPhichInfo *param,
9439 Buffer *mBuf
9440 )
9441 #else
9442 PUBLIC S16 cmUnpkTfuPhichInfo(param, mBuf)
9443 TfuPhichInfo *param;
9444 Buffer *mBuf;
9445 #endif
9446 {
9447
9448    TRC3(cmUnpkTfuPhichInfo)
9449
9450    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
9451    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
9452    CMCHKUNPK(SUnpkU8, &param->isAck, mBuf);
9453 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9454 #ifdef TFU_TDD
9455    CMCHKUNPK(SUnpkU8, &param->iPhich, mBuf);
9456 #endif
9457 #ifdef TFU_UPGRADE   
9458    CMCHKUNPK(SUnpkU16, &param->txPower, mBuf);
9459 #endif
9460    RETVALUE(ROK);
9461 }
9462
9463
9464 \f
9465 /***********************************************************
9466 *
9467 *     Func : cmPkTfuCntrlReqInfo
9468 *
9469 *
9470 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9471  * control information to be sent to the UE. 
9472  * -# PDCCH  Physical Downlink Control Channel
9473  * -# PHICH  Physical HARQ Indicator Channel
9474  * -# PCFICH Physical Control Format Indicator Channel
9475 *
9476 *
9477 *     Ret  : S16
9478 *
9479 *     Notes:
9480 *
9481 *     File  : 
9482 *
9483 **********************************************************/
9484 #ifdef ANSI
9485 PUBLIC S16 cmPkTfuCntrlReqInfo
9486 (
9487 TfuCntrlReqInfo *param,
9488 Buffer *mBuf
9489 )
9490 #else
9491 PUBLIC S16 cmPkTfuCntrlReqInfo(param, mBuf)
9492 TfuCntrlReqInfo *param;
9493 Buffer *mBuf;
9494 #endif
9495 {
9496
9497    TfuPdcchInfo   *tfuPdcchInfo;
9498    TfuPhichInfo *tfuPhichInfo;
9499    CmLList *node;
9500    U32 count;
9501
9502    TRC3(cmPkTfuCntrlReqInfo)
9503 #ifdef EMTC_ENABLE
9504    count = param->dlMpdcchLst.count;
9505    node = param->dlMpdcchLst.last;
9506    while (node) {
9507       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9508       node=node->prev;
9509       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9510       cmLListDelFrm(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9511       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9512    }
9513    CMCHKPK(SPkU32, count, mBuf);
9514    count = param->ulMpdcchLst.count;
9515    node = param->ulMpdcchLst.last;
9516    while (node) {
9517       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9518       node=node->prev;
9519       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9520       cmLListDelFrm(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9521       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9522    }
9523    CMCHKPK(SPkU32, count, mBuf);
9524 #endif      
9525 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9526    CMCHKPK(cmPkBool, param->isSPSOcc, mBuf);
9527 #endif
9528    count = param->phichLst.count;
9529    node = param->phichLst.last;
9530    while (node) {
9531       tfuPhichInfo = (TfuPhichInfo *)node->node;
9532       node=node->prev;
9533       CMCHKPK(cmPkTfuPhichInfo, tfuPhichInfo, mBuf);
9534       cmLListDelFrm(&param->phichLst, &tfuPhichInfo->lnk);
9535       tfuPhichInfo->lnk.node = (PTR)NULLP;
9536    }
9537    CMCHKPK(SPkU32, count, mBuf);
9538    count = param->dlPdcchLst.count;
9539    node = param->dlPdcchLst.last;
9540    while (node) {
9541       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9542       node=node->prev;
9543       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9544       cmLListDelFrm(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9545       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9546    }
9547    CMCHKPK(SPkU32, count, mBuf);
9548    count = param->ulPdcchLst.count;
9549    node = param->ulPdcchLst.last;
9550    while (node) {
9551       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9552       node=node->prev;
9553 #ifdef UL_ADPT_DBG      
9554       printf("ulPdcchLst count %d  time[ %d %d] \n",count,param->ulTiming.sfn,param->ulTiming.subframe);
9555 #endif
9556       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9557       cmLListDelFrm(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9558       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9559    }
9560    CMCHKPK(SPkU32, count, mBuf);
9561    CMCHKPK(SPkU8, param->cfi, mBuf);
9562    CMCHKPK(cmPkLteTimingInfo, &param->dlTiming, mBuf);
9563    CMCHKPK(cmPkLteTimingInfo, &param->ulTiming, mBuf);
9564    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9565    RETVALUE(ROK);
9566 }
9567
9568
9569 \f
9570 /***********************************************************
9571 *
9572 *     Func : cmUnpkTfuCntrlReqInfo
9573 *
9574 *
9575 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9576  * control information to be sent to the UE. 
9577  * -# PDCCH  Physical Downlink Control Channel
9578  * -# PHICH  Physical HARQ Indicator Channel
9579  * -# PCFICH Physical Control Format Indicator Channel
9580 *
9581 *
9582 *     Ret  : S16
9583 *
9584 *     Notes:
9585 *
9586 *     File  : 
9587 *
9588 **********************************************************/
9589 #ifdef ANSI
9590 PUBLIC S16 cmUnpkTfuCntrlReqInfo
9591 (
9592 TfuCntrlReqInfo *param,
9593 Ptr memCp,
9594 Buffer *mBuf
9595 )
9596 #else
9597 PUBLIC S16 cmUnpkTfuCntrlReqInfo(param, memCp, mBuf)
9598 TfuCntrlReqInfo *param;
9599 Ptr memCp;
9600 Buffer *mBuf;
9601 #endif
9602 {
9603
9604    TfuPdcchInfo *tfuPdcchInfo;
9605    U32 count, loopCnt;
9606    TfuPhichInfo *tfuPhichInfo;
9607
9608    TRC3(cmUnpkTfuCntrlReqInfo)
9609
9610    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9611    CMCHKUNPK(cmUnpkLteTimingInfo, &param->ulTiming, mBuf);
9612    CMCHKUNPK(cmUnpkLteTimingInfo, &param->dlTiming, mBuf);
9613    CMCHKUNPK(SUnpkU8, &param->cfi, mBuf);
9614    cmLListInit(&param->ulPdcchLst);
9615    CMCHKUNPK(SUnpkU32, &count, mBuf);
9616    for (loopCnt=0; loopCnt<count; loopCnt++) {
9617       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9618       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9619       cmLListAdd2Tail(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9620       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9621    }
9622    cmLListInit(&param->dlPdcchLst);
9623    CMCHKUNPK(SUnpkU32, &count, mBuf);
9624    for (loopCnt=0; loopCnt<count; loopCnt++) {
9625       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9626       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9627       cmLListAdd2Tail(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9628       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9629    }
9630    cmLListInit(&param->phichLst);
9631    CMCHKUNPK(SUnpkU32, &count, mBuf);
9632    for (loopCnt=0; loopCnt<count; loopCnt++) {
9633       cmGetMem((Ptr)memCp, sizeof(*tfuPhichInfo), (Ptr *)&tfuPhichInfo);
9634       CMCHKUNPK(cmUnpkTfuPhichInfo, tfuPhichInfo, mBuf);
9635       cmLListAdd2Tail(&param->phichLst, &tfuPhichInfo->lnk);
9636       tfuPhichInfo->lnk.node = (PTR)tfuPhichInfo;
9637    }
9638
9639 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9640    CMCHKUNPK(cmUnpkBool, &param->isSPSOcc, mBuf);
9641 #endif
9642 #ifdef EMTC_ENABLE   
9643    cmLListInit(&param->ulMpdcchLst);
9644    CMCHKUNPK(SUnpkU32, &count, mBuf);
9645    for (loopCnt=0; loopCnt<count; loopCnt++) {
9646       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9647       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9648       cmLListAdd2Tail(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9649       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9650    }
9651    cmLListInit(&param->dlMpdcchLst);
9652    CMCHKUNPK(SUnpkU32, &count, mBuf);
9653    printf("4. cmUnpkTfuCntrlReqInfo :: count %ld \n", count); 
9654    for (loopCnt=0; loopCnt<count; loopCnt++) {
9655       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9656       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9657       cmLListAdd2Tail(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9658       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9659       printf("5. cmUnpkTfuCntrlReqInfo :: Failed \n"); 
9660    }
9661 #endif  
9662    RETVALUE(ROK);
9663 }
9664
9665
9666 \f
9667 /***********************************************************
9668 *
9669 *     Func : cmPkTfuPdschDciInfo
9670 *
9671 *
9672 *     Desc : This structure Carries the control information that would be needed
9673   * by the Physical layer to process the data to be sent on PDSCH.
9674 *
9675 *
9676 *     Ret  : S16
9677 *
9678 *     Notes:
9679 *
9680 *     File  : 
9681 *
9682 **********************************************************/
9683 #ifdef ANSI
9684 PUBLIC S16 cmPkTfuPdschDciInfo
9685 (
9686 TfuPdschDciInfo *param,
9687 Buffer *mBuf
9688 )
9689 #else
9690 PUBLIC S16 cmPkTfuPdschDciInfo(param, mBuf)
9691 TfuPdschDciInfo *param;
9692 Buffer *mBuf;
9693 #endif
9694 {
9695
9696    TRC3(cmPkTfuPdschDciInfo)
9697
9698       switch(param->format) {
9699 #ifdef TFU_5GTF
9700          case TFU_DCI_FORMAT_B1:
9701             /* 
9702             if (param->u.formatB1Info.RBAssign <= 324)
9703             {
9704                printf("DCI Format: [B1] RBAssign: [%d] MCS: [%d]", 
9705                      param->u.formatB1Info.RBAssign, 
9706                      param->u.formatB1Info.u.rbAssignB1Val324.mcs);
9707             } 
9708             */
9709             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9710             break;
9711          case TFU_DCI_FORMAT_B2:
9712             /* 
9713             if (param->u.formatB2Info.RBAssign <= 324)
9714             {
9715                printf("DCI Format: [B2] RBAssign: [%d] MCS: [%d]", 
9716                      param->u.formatB2Info.RBAssign, 
9717                      param->u.formatB2Info.u.rbAssignB1Val324.mcs);
9718             } 
9719             */
9720             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9721             break;
9722          case TFU_DCI_FORMAT_A1:
9723             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9724             break;
9725          case TFU_DCI_FORMAT_A2:
9726             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9727             break;
9728 #endif
9729 #ifdef EMTC_ENABLE            
9730          case TFU_DCI_FORMAT_6_2:
9731              CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9732          break;
9733          case TFU_DCI_FORMAT_6_1A:
9734             CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9735             break;
9736 #endif            
9737          case TFU_DCI_FORMAT_2A:
9738             CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9739             break;
9740          case TFU_DCI_FORMAT_2:
9741             CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9742             break;
9743          case TFU_DCI_FORMAT_1D:
9744             CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9745             break;
9746          case TFU_DCI_FORMAT_1C:
9747             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9748             break;
9749          case TFU_DCI_FORMAT_1B:
9750             CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9751             break;
9752          case TFU_DCI_FORMAT_1A:
9753             CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9754             break;
9755          case TFU_DCI_FORMAT_1:
9756             CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9757             break;
9758          default :
9759             RETVALUE(RFAILED);
9760       }
9761    CMCHKPK(SPkU32, param->format, mBuf);
9762    RETVALUE(ROK);
9763 }
9764
9765
9766 \f
9767 /***********************************************************
9768 *
9769 *     Func : cmUnpkTfuPdschDciInfo
9770 *
9771 *
9772 *     Desc : This structure Carries the control information that would be needed
9773   * by the Physical layer to process the data to be sent on PDSCH.
9774 *
9775 *
9776 *     Ret  : S16
9777 *
9778 *     Notes:
9779 *
9780 *     File  : 
9781 *
9782 **********************************************************/
9783 #ifdef ANSI
9784 PUBLIC S16 cmUnpkTfuPdschDciInfo
9785 (
9786 TfuPdschDciInfo *param,
9787 Buffer *mBuf
9788 )
9789 #else
9790 PUBLIC S16 cmUnpkTfuPdschDciInfo(param, mBuf)
9791 TfuPdschDciInfo *param;
9792 Buffer *mBuf;
9793 #endif
9794 {
9795
9796    TRC3(cmUnpkTfuPdschDciInfo)
9797
9798    CMCHKUNPK(SUnpkU32, (U32 *)&param->format, mBuf);
9799       switch(param->format) {
9800          case TFU_DCI_FORMAT_1:
9801             CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9802             break;
9803          case TFU_DCI_FORMAT_1A:
9804             CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9805             break;
9806          case TFU_DCI_FORMAT_1B:
9807             CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9808             break;
9809          case TFU_DCI_FORMAT_1C:
9810             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9811             break;
9812          case TFU_DCI_FORMAT_1D:
9813             CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9814             break;
9815          case TFU_DCI_FORMAT_2:
9816             CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9817             break;
9818          case TFU_DCI_FORMAT_2A:
9819             CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9820             break;
9821 #ifdef EMTC_ENABLE            
9822          case TFU_DCI_FORMAT_6_1A:
9823             CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9824             break;
9825          case TFU_DCI_FORMAT_6_2:
9826             CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9827             break;
9828 #endif   
9829 #ifdef TFU_5GTF
9830          case TFU_DCI_FORMAT_A1:
9831             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9832             break;
9833                         case TFU_DCI_FORMAT_A2:
9834             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9835             break;
9836          case TFU_DCI_FORMAT_B1:
9837             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9838             break;
9839                         case TFU_DCI_FORMAT_B2:
9840             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9841             break;
9842 #endif
9843          default :
9844             RETVALUE(RFAILED);
9845       }
9846    RETVALUE(ROK);
9847 }
9848 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9849 #ifdef TFU_UPGRADE
9850 /***********************************************************
9851 *
9852 *     Func : cmPkTfuBfVectorInfo
9853 *
9854 *
9855 *     Desc : This structure conveys the BeamForming Vector 
9856 *               Information that hold relevance to Tx Mode 7
9857 *
9858 *
9859 *     Ret  : S16
9860 *
9861 *     Notes:
9862 *
9863 *     File  : 
9864 *
9865 **********************************************************/
9866 #ifdef ANSI
9867 PUBLIC S16 cmPkTfuBfVectorInfo
9868 (
9869 TfuBfVectorInfo *param,
9870 Buffer *mBuf
9871 )
9872 #else
9873 PUBLIC S16 cmPkTfuBfVectorInfo(param, mBuf)
9874 TfuBfVectorInfo *param;
9875 Buffer *mBuf;
9876 #endif
9877 {
9878    S32 idx, idx2;
9879    TRC3(cmPkTfuBfVectorInfo)
9880    for(idx=TFU_MAX_DL_SUBBAND-1;idx>=0; idx--)
9881    {
9882       for (idx2=param->numPhyAnt -1; idx2 >= 0; idx2--) {
9883       CMCHKPK(SPkU16, param->bfValue[idx2], mBuf);}
9884       CMCHKPK(SPkU8, param->numPhyAnt, mBuf);
9885       CMCHKPK(SPkU8, param->sbIndex, mBuf);
9886    }
9887    RETVALUE(ROK);
9888 }
9889
9890 /***********************************************************
9891 *
9892 *     Func : cmUnpkTfuBfVectorInfo
9893 *
9894 *
9895 *     Desc : This structure conveys the BeamForming Vector 
9896 *               Information that hold relevance to Tx Mode 7
9897 *
9898 *
9899 *     Ret  : S16
9900 *
9901 *     Notes:
9902 *
9903 *     File  : 
9904 *
9905 **********************************************************/
9906 #ifdef ANSI
9907 PUBLIC S16 cmUnpkTfuBfVectorInfo
9908 (
9909    TfuBfVectorInfo *param,
9910    Buffer *mBuf
9911 )
9912 #else
9913 PUBLIC S16 cmUnpkTfuBfVectorInfo(param, mBuf)
9914  TfuBfVectorInfo *param;
9915  Buffer *mBuf;
9916 #endif
9917 {
9918    S32 idx, idx2;
9919    TRC3(cmUnpkTfuBfVectorInfo)
9920     for(idx=0;idx<TFU_MAX_DL_SUBBAND; idx++)
9921    {
9922       CMCHKUNPK(SUnpkU8, &param->sbIndex, mBuf);
9923       CMCHKUNPK(SUnpkU8, &param->numPhyAnt, mBuf);
9924       for (idx2=0; idx2 <param->numPhyAnt; idx2++) {
9925       CMCHKUNPK(SUnpkU16, &param->bfValue[idx2], mBuf);}
9926    }
9927   
9928    RETVALUE(ROK);
9929 }
9930 #endif 
9931 \f
9932 /***********************************************************
9933 *
9934 *     Func : cmPkTfuDatReqPduInfo
9935 *
9936 *
9937 *     Desc : Pack Function for Tfu Dat Req PDU.
9938 *
9939 *
9940 *     Ret  : S16
9941 *
9942 *     Notes:
9943 *
9944 *     File  : 
9945 *
9946 **********************************************************/
9947 #ifdef ANSI
9948 PUBLIC S16 cmPkTfuDatReqPduInfo
9949 (
9950 TfuDatReqPduInfo *param,
9951 Buffer *mBuf
9952 )
9953 #else
9954 PUBLIC S16 cmPkTfuDatReqPduInfo(param, mBuf)
9955 TfuDatReqPduInfo *param;
9956 Buffer *mBuf;
9957 #endif
9958 {
9959
9960    S32 i;
9961    U8  tbMask = 0;
9962 #ifdef L2_OPTMZ
9963    U32 lchIdx, pduIdx;
9964 #endif
9965
9966    TRC3(cmPkTfuDatReqPduInfo)
9967
9968    /* LTE_ADV_FLAG_REMOVED_START */
9969    CMCHKPK(SPkU8, param->isEnbSFR, mBuf);
9970    /* LTE_ADV_FLAG_REMOVED_END */
9971
9972    /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9973 #ifdef TFU_UPGRADE 
9974    CMCHKPK(SPkU16, param->txPwrOffset, mBuf);
9975    if(param->transMode == TFU_UE_TM_7)
9976    {
9977       CMCHKPK(cmPkTfuBfVectorInfo, param->bfVector, mBuf);
9978       CMCHKPK(SPkU8, param->numBfVectors, mBuf);
9979       CMCHKPK(SPkU8, param->numBfPrbPerSb, mBuf);
9980    }
9981    CMCHKPK(SPkU8, param->deltaPowOffIdx, mBuf);
9982    /* LTE_ADV_FLAG_REMOVED_START */
9983    CMCHKPK(SPkU8, param->pa, mBuf);
9984    /* LTE_ADV_FLAG_REMOVED_END */
9985    CMCHKPK(SPkU8, param->numLayers, mBuf);
9986 #endif
9987    CMCHKPK(cmPkBool, param->isTApres, mBuf);
9988    CMCHKPK(cmPkTknU32, &param->doa, mBuf);
9989    CMCHKPK(SPkU32, param->transMode, mBuf);
9990    CMCHKPK(cmPkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
9991    CMCHKPK(SPkU8, param->puschRptUsd, mBuf);
9992    for (i = 0; i < TFU_MAX_TB; i++)
9993    {
9994 #ifndef L2_OPTMZ
9995      if (param->mBuf[i] != NULLP)
9996      {
9997         tbMask = tbMask | (1 << i);
9998      }
9999 #else /* L2_OPTMZ */
10000      for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10001      {
10002         for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10003               pduIdx++)
10004         {
10005            if (param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] != NULLP)
10006            {
10007               tbMask = tbMask | (1 << i);
10008            }
10009         }
10010      }
10011 #endif /* L2_OPTMZ */
10012    }
10013    /* tfu_c_001.main_2: Packing should consider nmbOfTBs.*/
10014    for (i=TFU_MAX_TB - 1; i >= 0; i--) {
10015 #ifndef L2_OPTMZ
10016       if (param->mBuf[i] != NULLP)
10017       {
10018          CMCHKPK(cmPkBuffer, &param->mBuf[i], mBuf);
10019       }
10020 #else
10021      // CMCHKPK(cmPkBuffer, &param->tbInfo[i].macPad, mBuf);
10022       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10023       {
10024          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10025                pduIdx++)
10026          {
10027             CMCHKPK(cmPkBuffer, &param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx],
10028                   mBuf);
10029
10030          }
10031          CMCHKPK(SPkU32, param->tbInfo[i].lchInfo[lchIdx].numPdu, mBuf);
10032       }
10033       CMCHKPK(SPkU32, param->tbInfo[i].numLch, mBuf);
10034       CMCHKPK(SPkU32, param->tbInfo[i].padSize, mBuf);
10035       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macCes, mBuf);
10036       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macHdr, mBuf);
10037       CMCHKPK(cmPkMsgLen, param->tbInfo[i].tbSize, mBuf);
10038       CMCHKPK(cmPkBool, param->tbInfo[i].tbPres, mBuf);
10039 #endif
10040    }
10041    CMCHKPK(SPkU8, tbMask, mBuf);
10042    CMCHKPK(SPkU8, param->nmbOfTBs, mBuf);
10043    CMCHKPK(cmPkTfuPdschDciInfo, &param->dciInfo, mBuf);
10044    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10045    RETVALUE(ROK);
10046 }
10047
10048
10049 \f
10050 /***********************************************************
10051 *
10052 *     Func : cmUnpkTfuDatReqPduInfo
10053 *
10054 *
10055 *     Desc : UnPack function for Tfu Dat req pdu .
10056 *
10057 *
10058 *     Ret  : S16
10059 *
10060 *     Notes:
10061 *
10062 *     File  : 
10063 *
10064 **********************************************************/
10065 #ifdef ANSI
10066 PUBLIC S16 cmUnpkTfuDatReqPduInfo
10067 (
10068 TfuDatReqPduInfo *param,
10069 Buffer *mBuf
10070 )
10071 #else
10072 PUBLIC S16 cmUnpkTfuDatReqPduInfo(param, mBuf)
10073 TfuDatReqPduInfo *param;
10074 Buffer *mBuf;
10075 #endif
10076 {
10077
10078    U8 i;
10079    U8  tbMask = 0;
10080 #ifdef L2_OPTMZ
10081    U32 lchIdx, pduIdx;
10082 #endif
10083    TRC3(cmUnpkTfuDatReqPduInfo)
10084
10085    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10086    CMCHKUNPK(cmUnpkTfuPdschDciInfo, &param->dciInfo, mBuf);
10087    CMCHKUNPK(SUnpkU8, &param->nmbOfTBs, mBuf);
10088
10089    CMCHKUNPK(SUnpkU8, &tbMask, mBuf);
10090    for (i=0; i<TFU_MAX_TB; i++) {
10091 #ifndef L2_OPTMZ
10092       if (tbMask & (1<<i))
10093       {
10094          CMCHKUNPK(cmUnpkBuffer, &param->mBuf[i], mBuf);
10095       }
10096       else
10097       {
10098          param->mBuf[i] = NULLP;
10099       }
10100 #else /* L2_OPTMZ*/
10101       CMCHKUNPK(cmUnpkBool, &param->tbInfo[i].tbPres, mBuf);
10102       CMCHKUNPK(cmUnpkMsgLen, &param->tbInfo[i].tbSize, mBuf);
10103       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macHdr, mBuf);
10104       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macCes, mBuf);
10105       CMCHKUNPK(SUnpkU32, &param->tbInfo[i].padSize, mBuf);
10106       CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].numLch, mBuf);
10107       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10108       {
10109          CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].lchInfo[lchIdx].numPdu,
10110                mBuf);
10111          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10112                pduIdx++)
10113          {
10114             if (tbMask & (1<<i))
10115             {
10116                CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].lchInfo[lchIdx].\
10117                      mBuf[pduIdx], mBuf);
10118             }
10119             else
10120             {
10121                param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] = NULLP;
10122             }
10123          }
10124       }
10125       //CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macPad, mBuf);
10126 #endif /* L2_OPTMZ*/
10127    }
10128
10129    CMCHKUNPK(SUnpkU8, &param->puschRptUsd, mBuf);
10130    CMCHKUNPK(cmUnpkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10131    CMCHKUNPK(SUnpkU32, (U32 *)&param->transMode, mBuf);
10132    CMCHKUNPK(cmUnpkTknU32, &param->doa, mBuf);
10133    CMCHKUNPK(cmUnpkBool, &param->isTApres, mBuf);
10134 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10135 #ifdef TFU_UPGRADE
10136    CMCHKUNPK(SUnpkU8, &param->numLayers, mBuf);
10137    /* LTE_ADV_FLAG_REMOVED_START */
10138    CMCHKUNPK(SUnpkU8, &param->pa, mBuf);
10139    /* LTE_ADV_FLAG_REMOVED_END */
10140    CMCHKUNPK(SUnpkU8, &param->deltaPowOffIdx, mBuf);
10141    if(param->transMode == TFU_UE_TM_7)
10142    {
10143       CMCHKUNPK(SUnpkU8, &param->numBfPrbPerSb, mBuf);
10144       CMCHKUNPK(SUnpkU8, &param->numBfVectors, mBuf);
10145       CMCHKUNPK(cmUnpkTfuBfVectorInfo, param->bfVector, mBuf);
10146    }
10147    CMCHKUNPK(SUnpkU16, &param->txPwrOffset, mBuf);
10148 #endif
10149
10150    /* LTE_ADV_FLAG_REMOVED_START */
10151    CMCHKUNPK(SUnpkU8, &param->isEnbSFR, mBuf);
10152    /* LTE_ADV_FLAG_REMOVED_END */
10153
10154    RETVALUE(ROK);
10155 }
10156
10157
10158 \f
10159 /***********************************************************
10160 *
10161 *     Func : cmPkTfuDatReqInfo
10162 *
10163 *
10164 *     Desc : This structure contains the Data PDUs 
10165  * @details This structure contains Data meant to be sent on both PBCH and
10166  * PDSCH. Control information necessary for processing of the data is sent along
10167  * with the Data.
10168 *
10169 *
10170 *     Ret  : S16
10171 *
10172 *     Notes:
10173 *
10174 *     File  : 
10175 *
10176 **********************************************************/
10177 #ifdef ANSI
10178 PUBLIC S16 cmPkTfuDatReqInfo
10179 (
10180 TfuDatReqInfo *param,
10181 Buffer *mBuf
10182 )
10183 #else
10184 PUBLIC S16 cmPkTfuDatReqInfo(param, mBuf)
10185 TfuDatReqInfo *param;
10186 Buffer *mBuf;
10187 #endif
10188 {
10189
10190    CmLList *node;
10191    U32 count;
10192    TfuDatReqPduInfo *tfuDatReqPduInfo;
10193
10194    TRC3(cmPkTfuDatReqInfo)
10195
10196    count = param->pdus.count;
10197    node = param->pdus.last;
10198    while (node) {
10199       tfuDatReqPduInfo = (TfuDatReqPduInfo *)node->node;
10200       node=node->prev;
10201       CMCHKPK(cmPkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10202       cmLListDelFrm(&param->pdus, &tfuDatReqPduInfo->lnk);
10203       tfuDatReqPduInfo->lnk.node = (PTR)NULLP;
10204    }
10205    CMCHKPK(SPkU32, count, mBuf);
10206    CMCHKPK(cmPkTknBuf, &param->bchDat, mBuf);
10207    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10208    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10209    RETVALUE(ROK);
10210 }
10211
10212
10213 \f
10214 /***********************************************************
10215 *
10216 *     Func : cmUnpkTfuDatReqInfo
10217 *
10218 *
10219 *     Desc : This structure contains the Data PDUs 
10220  * @details This structure contains Data meant to be sent on both PBCH and
10221  * PDSCH. Control information necessary for processing of the data is sent along
10222  * with the Data.
10223 *
10224 *
10225 *     Ret  : S16
10226 *
10227 *     Notes:
10228 *
10229 *     File  : 
10230 *
10231 **********************************************************/
10232 #ifdef ANSI
10233 PUBLIC S16 cmUnpkTfuDatReqInfo
10234 (
10235 TfuDatReqInfo *param,
10236 Ptr memCp,
10237 Buffer *mBuf
10238 )
10239 #else
10240 PUBLIC S16 cmUnpkTfuDatReqInfo(param, memCp, mBuf)
10241 TfuDatReqInfo *param;
10242 Ptr memCp;
10243 Buffer *mBuf;
10244 #endif
10245 {
10246
10247    U32 count, loopCnt;
10248    TfuDatReqPduInfo *tfuDatReqPduInfo;
10249
10250    TRC3(cmUnpkTfuDatReqInfo)
10251
10252    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10253    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10254    CMCHKUNPK(cmUnpkTknBuf, &param->bchDat, &mBuf);
10255    cmLListInit(&param->pdus);
10256    CMCHKUNPK(SUnpkU32, &count, mBuf);
10257    for (loopCnt=0; loopCnt<count; loopCnt++) {
10258       cmGetMem((Ptr)memCp, sizeof(*tfuDatReqPduInfo), (Ptr *)&tfuDatReqPduInfo);
10259       CMCHKUNPK(cmUnpkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10260       cmLListAdd2Tail(&param->pdus, &tfuDatReqPduInfo->lnk);
10261       tfuDatReqPduInfo->lnk.node = (PTR)tfuDatReqPduInfo;
10262    }
10263    RETVALUE(ROK);
10264 }
10265
10266
10267 \f
10268 /***********************************************************
10269 *
10270 *     Func : cmPkTfuDatInfo
10271 *
10272 *
10273 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10274 *
10275 *
10276 *     Ret  : S16
10277 *
10278 *     Notes:
10279 *
10280 *     File  : 
10281 *
10282 **********************************************************/
10283 #ifdef ANSI
10284 PUBLIC S16 cmPkTfuDatInfo
10285 (
10286 TfuDatInfo *param,
10287 Buffer *mBuf
10288 )
10289 #else
10290 PUBLIC S16 cmPkTfuDatInfo(param, mBuf)
10291 TfuDatInfo *param;
10292 Buffer *mBuf;
10293 #endif
10294 {
10295
10296    TRC3(cmPkTfuDatInfo)
10297
10298    CMCHKPK(cmPkBuffer, &param->mBuf, mBuf);
10299    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10300    RETVALUE(ROK);
10301 }
10302
10303
10304 \f
10305 /***********************************************************
10306 *
10307 *     Func : cmUnpkTfuDatInfo
10308 *
10309 *
10310 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10311 *
10312 *
10313 *     Ret  : S16
10314 *
10315 *     Notes:
10316 *
10317 *     File  : 
10318 *
10319 **********************************************************/
10320 #ifdef ANSI
10321 PUBLIC S16 cmUnpkTfuDatInfo
10322 (
10323 TfuDatInfo *param,
10324 Buffer *mBuf
10325 )
10326 #else
10327 PUBLIC S16 cmUnpkTfuDatInfo(param, mBuf)
10328 TfuDatInfo *param;
10329 Buffer *mBuf;
10330 #endif
10331 {
10332
10333    TRC3(cmUnpkTfuDatInfo)
10334
10335    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10336    CMCHKUNPK(cmUnpkBuffer, &param->mBuf, mBuf);
10337    RETVALUE(ROK);
10338 }
10339
10340
10341 \f
10342 /***********************************************************
10343 *
10344 *     Func : cmPkTfuDatIndInfo
10345 *
10346 *
10347 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10348  * @details All the PDUs received by Physical layer in one subframe are clubbed
10349  * together into a single data structure and sent to MAC for processing.
10350 *
10351 *
10352 *     Ret  : S16
10353 *
10354 *     Notes:
10355 *
10356 *     File  : 
10357 *
10358 **********************************************************/
10359 #ifdef ANSI
10360 PUBLIC S16 cmPkTfuDatIndInfo
10361 (
10362 TfuDatIndInfo *param,
10363 Buffer *mBuf
10364 )
10365 #else
10366 PUBLIC S16 cmPkTfuDatIndInfo(param, mBuf)
10367 TfuDatIndInfo *param;
10368 Buffer *mBuf;
10369 #endif
10370 {
10371
10372    CmLList *node;
10373    U32 count;
10374    TfuDatInfo *tfuDatInfo;
10375
10376    TRC3(cmPkTfuDatIndInfo)
10377
10378 #ifdef TFU_5GTF
10379    CMCHKPK(SPkU8, param->sccIdx, mBuf);
10380    CMCHKPK(SPkU8, param->sectorId, mBuf);
10381 #endif /* TFU_5GTF */
10382    count = param->datIndLst.count;
10383    node = param->datIndLst.last;
10384    while (node) {
10385       tfuDatInfo = (TfuDatInfo *)node->node;
10386       node=node->prev;
10387       CMCHKPK(cmPkTfuDatInfo, tfuDatInfo, mBuf);
10388       cmLListDelFrm(&param->datIndLst, &tfuDatInfo->lnk);
10389       tfuDatInfo->lnk.node = (PTR)NULLP;
10390    }
10391    CMCHKPK(SPkU32, count, mBuf);
10392    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10393    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10394    RETVALUE(ROK);
10395 }
10396
10397
10398 \f
10399 /***********************************************************
10400 *
10401 *     Func : cmUnpkTfuDatIndInfo
10402 *
10403 *
10404 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10405  * @details All the PDUs received by Physical layer in one subframe are clubbed
10406  * together into a single data structure and sent to MAC for processing.
10407 *
10408 *
10409 *     Ret  : S16
10410 *
10411 *     Notes:
10412 *
10413 *     File  : 
10414 *
10415 **********************************************************/
10416 #ifdef ANSI
10417 PUBLIC S16 cmUnpkTfuDatIndInfo
10418 (
10419 TfuDatIndInfo *param,
10420 Ptr memCp,
10421 Buffer *mBuf
10422 )
10423 #else
10424 PUBLIC S16 cmUnpkTfuDatIndInfo(param, memCp, mBuf)
10425 TfuDatIndInfo *param;
10426 Ptr memCp;
10427 Buffer *mBuf;
10428 #endif
10429 {
10430
10431    U32 count, loopCnt;
10432    TfuDatInfo *tfuDatInfo;
10433
10434    TRC3(cmUnpkTfuDatIndInfo)
10435
10436    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10437    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10438    cmLListInit(&param->datIndLst);
10439    CMCHKUNPK(SUnpkU32, &count, mBuf);
10440    for (loopCnt=0; loopCnt<count; loopCnt++) {
10441       cmGetMem((Ptr)memCp, sizeof(*tfuDatInfo), (Ptr *)&tfuDatInfo);
10442       CMCHKUNPK(cmUnpkTfuDatInfo, tfuDatInfo, mBuf);
10443       cmLListAdd2Tail(&param->datIndLst, &tfuDatInfo->lnk);
10444       tfuDatInfo->lnk.node = (PTR)tfuDatInfo;
10445    }
10446 #ifdef TFU_5GTF
10447    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
10448    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
10449 #endif /* TFU_5GTF */
10450    RETVALUE(ROK);
10451 }
10452
10453
10454 \f
10455 /***********************************************************
10456 *
10457 *     Func : cmPkTfuSrInfo
10458 *
10459 *
10460 *     Desc : This structure contains the SR indication for a UE, identified by
10461   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10462   * calculated by the physical layer, and is used by the scheduler for Power
10463   * control of the UE.
10464 *
10465 *
10466 *     Ret  : S16
10467 *
10468 *     Notes:
10469 *
10470 *     File  : 
10471 *
10472 **********************************************************/
10473 #ifdef ANSI
10474 PUBLIC S16 cmPkTfuSrInfo
10475 (
10476 TfuSrInfo *param,
10477 Buffer *mBuf
10478 )
10479 #else
10480 PUBLIC S16 cmPkTfuSrInfo(param, mBuf)
10481 TfuSrInfo *param;
10482 Buffer *mBuf;
10483 #endif
10484 {
10485
10486    TRC3(cmPkTfuSrInfo)
10487
10488    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10489    RETVALUE(ROK);
10490 }
10491
10492
10493 \f
10494 /***********************************************************
10495 *
10496 *     Func : cmUnpkTfuSrInfo
10497 *
10498 *
10499 *     Desc : This structure contains the SR indication for a UE, identified by
10500   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10501   * calculated by the physical layer, and is used by the scheduler for Power
10502   * control of the UE.
10503 *
10504 *
10505 *     Ret  : S16
10506 *
10507 *     Notes:
10508 *
10509 *     File  : 
10510 *
10511 **********************************************************/
10512 #ifdef ANSI
10513 PUBLIC S16 cmUnpkTfuSrInfo
10514 (
10515 TfuSrInfo *param,
10516 Buffer *mBuf
10517 )
10518 #else
10519 PUBLIC S16 cmUnpkTfuSrInfo(param, mBuf)
10520 TfuSrInfo *param;
10521 Buffer *mBuf;
10522 #endif
10523 {
10524
10525    TRC3(cmUnpkTfuSrInfo)
10526
10527    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10528    RETVALUE(ROK);
10529 }
10530
10531
10532 \f
10533 /***********************************************************
10534 *
10535 *     Func : cmPkTfuSrIndInfo
10536 *
10537 *
10538 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10539   * received in a subframe.
10540 *
10541 *
10542 *     Ret  : S16
10543 *
10544 *     Notes:
10545 *
10546 *     File  : 
10547 *
10548 **********************************************************/
10549 #ifdef ANSI
10550 PUBLIC S16 cmPkTfuSrIndInfo
10551 (
10552 TfuSrIndInfo *param,
10553 Buffer *mBuf
10554 )
10555 #else
10556 PUBLIC S16 cmPkTfuSrIndInfo(param, mBuf)
10557 TfuSrIndInfo *param;
10558 Buffer *mBuf;
10559 #endif
10560 {
10561
10562    CmLList *node;
10563    U32 count;
10564    TfuSrInfo *tfuSrInfo;
10565
10566    TRC3(cmPkTfuSrIndInfo)
10567
10568    count = param->srLst.count;
10569    node = param->srLst.last;
10570    while (node) {
10571       tfuSrInfo = (TfuSrInfo *)node->node;
10572       node=node->prev;
10573       CMCHKPK(cmPkTfuSrInfo, tfuSrInfo, mBuf);
10574       cmLListDelFrm(&param->srLst, &tfuSrInfo->lnk);
10575       tfuSrInfo->lnk.node = (PTR)NULLP;
10576    }
10577    CMCHKPK(SPkU32, count, mBuf);
10578    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10579    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10580    RETVALUE(ROK);
10581 }
10582
10583
10584 \f
10585 /***********************************************************
10586 *
10587 *     Func : cmUnpkTfuSrIndInfo
10588 *
10589 *
10590 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10591   * received in a subframe.
10592 *
10593 *
10594 *     Ret  : S16
10595 *
10596 *     Notes:
10597 *
10598 *     File  : 
10599 *
10600 **********************************************************/
10601 #ifdef ANSI
10602 PUBLIC S16 cmUnpkTfuSrIndInfo
10603 (
10604 TfuSrIndInfo *param,
10605 Ptr memCp,
10606 Buffer *mBuf
10607 )
10608 #else
10609 PUBLIC S16 cmUnpkTfuSrIndInfo(param, memCp, mBuf)
10610 TfuSrIndInfo *param;
10611 Ptr memCp;
10612 Buffer *mBuf;
10613 #endif
10614 {
10615
10616    U32 count, loopCnt;
10617    TfuSrInfo *tfuSrInfo;
10618
10619    TRC3(cmUnpkTfuSrIndInfo)
10620
10621    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10622    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10623    cmLListInit(&param->srLst);
10624    CMCHKUNPK(SUnpkU32, &count, mBuf);
10625    for (loopCnt=0; loopCnt<count; loopCnt++) {
10626       cmGetMem((Ptr)memCp, sizeof(*tfuSrInfo), (Ptr *)&tfuSrInfo);
10627       CMCHKUNPK(cmUnpkTfuSrInfo, tfuSrInfo, mBuf);
10628       cmLListAdd2Tail(&param->srLst, &tfuSrInfo->lnk);
10629       tfuSrInfo->lnk.node = (PTR)tfuSrInfo;
10630    }
10631    RETVALUE(ROK);
10632 }
10633
10634 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10635 /***********************************************************
10636 *
10637 *     Func : cmPkTfuHqInfo
10638 *
10639 *
10640 *     Desc : This structure contains the HARQ feedback for a single UE. 
10641   * @details RNTI is present to identify the UE. 
10642   * For FDD a single feedback is present. 
10643   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10644 *
10645 *
10646 *     Ret  : S16
10647 *
10648 *     Notes:
10649 *
10650 *     File  : 
10651 *
10652 **********************************************************/
10653 #ifdef ANSI
10654 PUBLIC S16 cmPkTfuHqInfo
10655 (
10656 TfuHqInfo *param,
10657 Buffer *mBuf
10658 )
10659 #else
10660 PUBLIC S16 cmPkTfuHqInfo(param, mBuf)
10661 TfuHqInfo *param;
10662 Buffer *mBuf;
10663 #endif
10664 {
10665
10666    S32 i;
10667    TRC3(cmPkTfuHqInfo)
10668
10669    CMCHKPK(SPkU8, param->isPusch, mBuf);
10670    for (i=TFU_MAX_HARQ_FDBKS-1; i >= 0; i--) {
10671       CMCHKPK(SPkU32, param->isAck[i], mBuf);
10672    }
10673 #ifdef TFU_TDD        
10674    CMCHKPK(SPkU8, param->M, mBuf);
10675 #endif/*TFU_TDD*/
10676    CMCHKPK(SPkU8, param->noOfTbs, mBuf);
10677 /* ACC-TDD ccpu00130520 */
10678    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
10679    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10680    RETVALUE(ROK);
10681 }
10682
10683 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10684 /***********************************************************
10685 *
10686 *     Func : cmUnpkTfuHqInfo
10687 *
10688 *
10689 *     Desc : This structure contains the HARQ feedback for a single UE. 
10690   * @details RNTI is present to identify the UE. 
10691   * For FDD a single feedback is present. 
10692   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10693 *
10694 *
10695 *     Ret  : S16
10696 *
10697 *     Notes:
10698 *
10699 *     File  : 
10700 *
10701 **********************************************************/
10702 #ifdef ANSI
10703 PUBLIC S16 cmUnpkTfuHqInfo
10704 (
10705 TfuHqInfo *param,
10706 Buffer *mBuf
10707 )
10708 #else
10709 PUBLIC S16 cmUnpkTfuHqInfo(param, mBuf)
10710 TfuHqInfo *param;
10711 Buffer *mBuf;
10712 #endif
10713 {
10714    S32 i;
10715    TRC3(cmUnpkTfuHqInfo)
10716
10717    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10718 /* ACC-TDD ccpu00130520 */
10719    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
10720    CMCHKUNPK(SUnpkU8, &param->noOfTbs, mBuf);
10721 #ifdef TFU_TDD
10722    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
10723 #endif
10724    for (i=0; i<TFU_MAX_HARQ_FDBKS; i++) {
10725       CMCHKUNPK(SUnpkU32, (U32 *)&param->isAck[i], mBuf);
10726    }
10727    CMCHKUNPK(SUnpkU8, &param->isPusch, mBuf);
10728    RETVALUE(ROK);
10729 }
10730
10731
10732
10733
10734 \f
10735 /***********************************************************
10736 *
10737 *     Func : cmPkTfuHqIndInfo
10738 *
10739 *
10740 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10741   * @details All the HARQ feedback received in the subframe are clubbed together
10742   * in this data structure and given to the scheduler for processing.
10743 *
10744 *
10745 *     Ret  : S16
10746 *
10747 *     Notes:
10748 *
10749 *     File  : 
10750 *
10751 **********************************************************/
10752 #ifdef ANSI
10753 PUBLIC S16 cmPkTfuHqIndInfo
10754 (
10755 TfuHqIndInfo *param,
10756 Buffer *mBuf
10757 )
10758 #else
10759 PUBLIC S16 cmPkTfuHqIndInfo(param, mBuf)
10760 TfuHqIndInfo *param;
10761 Buffer *mBuf;
10762 #endif
10763 {
10764
10765    CmLList *node;
10766    U32 count;
10767    TfuHqInfo *tfuHqInfo;
10768
10769    TRC3(cmPkTfuHqIndInfo)
10770
10771    count = param->hqIndLst.count;
10772    node = param->hqIndLst.last;
10773    while (node) {
10774       tfuHqInfo = (TfuHqInfo *)node->node;
10775       node=node->prev;
10776       CMCHKPK(cmPkTfuHqInfo, tfuHqInfo, mBuf);
10777       cmLListDelFrm(&param->hqIndLst, &tfuHqInfo->lnk);
10778       tfuHqInfo->lnk.node = (PTR)NULLP;
10779    }
10780    CMCHKPK(SPkU32, count, mBuf);
10781    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10782    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10783    RETVALUE(ROK);
10784 }
10785
10786
10787 \f
10788 /***********************************************************
10789 *
10790 *     Func : cmUnpkTfuHqIndInfo
10791 *
10792 *
10793 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10794   * @details All the HARQ feedback received in the subframe are clubbed together
10795   * in this data structure and given to the scheduler for processing.
10796 *
10797 *
10798 *     Ret  : S16
10799 *
10800 *     Notes:
10801 *
10802 *     File  : 
10803 *
10804 **********************************************************/
10805 #ifdef ANSI
10806 PUBLIC S16 cmUnpkTfuHqIndInfo
10807 (
10808 TfuHqIndInfo *param,
10809 Ptr memCp,
10810 Buffer *mBuf
10811 )
10812 #else
10813 PUBLIC S16 cmUnpkTfuHqIndInfo(param, memCp, mBuf)
10814 TfuHqIndInfo *param;
10815 Ptr memCp;
10816 Buffer *mBuf;
10817 #endif
10818 {
10819
10820    U32 count, loopCnt;
10821    TfuHqInfo *tfuHqInfo;
10822
10823    TRC3(cmUnpkTfuHqIndInfo)
10824
10825    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10826    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10827    cmLListInit(&param->hqIndLst);
10828    CMCHKUNPK(SUnpkU32, &count, mBuf);
10829    for (loopCnt=0; loopCnt<count; loopCnt++) {
10830       cmGetMem((Ptr)memCp, sizeof(*tfuHqInfo), (Ptr *)&tfuHqInfo);
10831       CMCHKUNPK(cmUnpkTfuHqInfo, tfuHqInfo, mBuf);
10832       cmLListAdd2Tail(&param->hqIndLst, &tfuHqInfo->lnk);
10833       tfuHqInfo->lnk.node = (PTR)tfuHqInfo;
10834    }
10835    RETVALUE(ROK);
10836 }
10837
10838
10839 \f
10840 /***********************************************************
10841 *
10842 *     Func : cmPkTfuUlCqiInfo
10843 *
10844 *
10845 *     Desc : This structure conveys the Uplink CQI information for a single subband.
10846 *
10847 *
10848 *     Ret  : S16
10849 *
10850 *     Notes:
10851 *
10852 *     File  : 
10853 *
10854 **********************************************************/
10855 #ifdef ANSI
10856 PUBLIC S16 cmPkTfuUlCqiInfo
10857 (
10858 TfuUlCqiInfo *param,
10859 Buffer *mBuf
10860 )
10861 #else
10862 PUBLIC S16 cmPkTfuUlCqiInfo(param, mBuf)
10863 TfuUlCqiInfo *param;
10864 Buffer *mBuf;
10865 #endif
10866 {
10867
10868    TRC3(cmPkTfuUlCqiInfo)
10869
10870    CMCHKPK(cmPkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
10871    RETVALUE(ROK);
10872 }
10873
10874
10875 \f
10876 /***********************************************************
10877 *
10878 *     Func : cmUnpkTfuUlCqiInfo
10879 *
10880 *
10881 *     Desc : This structure conveys the Uplink CQI information for a single subband.
10882 *
10883 *
10884 *     Ret  : S16
10885 *
10886 *     Notes:
10887 *
10888 *     File  : 
10889 *
10890 **********************************************************/
10891 #ifdef ANSI
10892 PUBLIC S16 cmUnpkTfuUlCqiInfo
10893 (
10894 TfuUlCqiInfo *param,
10895 Buffer *mBuf
10896 )
10897 #else
10898 PUBLIC S16 cmUnpkTfuUlCqiInfo(param, mBuf)
10899 TfuUlCqiInfo *param;
10900 Buffer *mBuf;
10901 #endif
10902 {
10903
10904    TRC3(cmUnpkTfuUlCqiInfo)
10905
10906    CMCHKUNPK(cmUnpkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
10907    RETVALUE(ROK);
10908 }
10909
10910
10911 \f
10912 /***********************************************************
10913 *
10914 *     Func : cmPkTfuUlCqiRpt
10915 *
10916 *
10917 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
10918   * @details The report could be wideband CQI or subBand CQI or both.
10919 *
10920 *
10921 *     Ret  : S16
10922 *
10923 *     Notes:
10924 *
10925 *     File  : 
10926 *
10927 **********************************************************/
10928 #ifdef ANSI
10929 PUBLIC S16 cmPkTfuUlCqiRpt
10930 (
10931 TfuUlCqiRpt *param,
10932 Buffer *mBuf
10933 )
10934 #else
10935 PUBLIC S16 cmPkTfuUlCqiRpt(param, mBuf)
10936 TfuUlCqiRpt *param;
10937 Buffer *mBuf;
10938 #endif
10939 {
10940
10941    S32 i;
10942    TRC3(cmPkTfuUlCqiRpt)
10943
10944    for (i=TFU_MAX_UL_SUBBAND-1; i >= 0; i--) {
10945       CMCHKPK(cmPkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
10946    }
10947    CMCHKPK(SPkU8, param->numSubband, mBuf);
10948    CMCHKPK(SPkU8, param->wideCqi, mBuf);
10949    CMCHKPK(SPkU8, param->isTxPort0, mBuf);
10950    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10951    RETVALUE(ROK);
10952 }
10953
10954
10955 \f
10956 /***********************************************************
10957 *
10958 *     Func : cmUnpkTfuUlCqiRpt
10959 *
10960 *
10961 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
10962   * @details The report could be wideband CQI or subBand CQI or both.
10963 *
10964 *
10965 *     Ret  : S16
10966 *
10967 *     Notes:
10968 *
10969 *     File  : 
10970 *
10971 **********************************************************/
10972 #ifdef ANSI
10973 PUBLIC S16 cmUnpkTfuUlCqiRpt
10974 (
10975 TfuUlCqiRpt *param,
10976 Buffer *mBuf
10977 )
10978 #else
10979 PUBLIC S16 cmUnpkTfuUlCqiRpt(param, mBuf)
10980 TfuUlCqiRpt *param;
10981 Buffer *mBuf;
10982 #endif
10983 {
10984
10985    S32 i;
10986    TRC3(cmUnpkTfuUlCqiRpt)
10987
10988    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10989    CMCHKUNPK(SUnpkU8, &param->isTxPort0, mBuf);
10990    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
10991    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
10992    for (i=0; i<TFU_MAX_UL_SUBBAND; i++) {
10993       CMCHKUNPK(cmUnpkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
10994    }
10995    RETVALUE(ROK);
10996 }
10997
10998
10999 \f
11000 /***********************************************************
11001 *
11002 *     Func : cmPkTfuUlCqiIndInfo
11003 *
11004 *
11005 *     Desc : This structure conveys the Uplink CQI information.
11006  * @details Uplink CQI is calculated by the physical layer, and is this
11007  * information is provided to the scheduler. 
11008  * This data structure clubs together the UL CQI estimates for all the UEs that
11009  * have been scheduled in the subframe for uplink transmission.
11010 *
11011 *
11012 *     Ret  : S16
11013 *
11014 *     Notes:
11015 *
11016 *     File  : 
11017 *
11018 **********************************************************/
11019 #ifdef ANSI
11020 PUBLIC S16 cmPkTfuUlCqiIndInfo
11021 (
11022 TfuUlCqiIndInfo *param,
11023 Buffer *mBuf
11024 )
11025 #else
11026 PUBLIC S16 cmPkTfuUlCqiIndInfo(param, mBuf)
11027 TfuUlCqiIndInfo *param;
11028 Buffer *mBuf;
11029 #endif
11030 {
11031
11032    CmLList *node;
11033    U32 count;
11034    TfuUlCqiRpt *tfuUlCqiRpt;
11035
11036    TRC3(cmPkTfuUlCqiIndInfo)
11037
11038    count = param->ulCqiRpt.count;
11039    node = param->ulCqiRpt.last;
11040    while (node) {
11041       tfuUlCqiRpt = (TfuUlCqiRpt *)node->node;
11042       node=node->prev;
11043       CMCHKPK(cmPkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11044       cmLListDelFrm(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11045       tfuUlCqiRpt->lnk.node = (PTR)NULLP;
11046    }
11047    CMCHKPK(SPkU32, count, mBuf);
11048    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11049    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11050    RETVALUE(ROK);
11051 }
11052
11053
11054 \f
11055 /***********************************************************
11056 *
11057 *     Func : cmUnpkTfuUlCqiIndInfo
11058 *
11059 *
11060 *     Desc : This structure conveys the Uplink CQI information.
11061  * @details Uplink CQI is calculated by the physical layer, and is this
11062  * information is provided to the scheduler. 
11063  * This data structure clubs together the UL CQI estimates for all the UEs that
11064  * have been scheduled in the subframe for uplink transmission.
11065 *
11066 *
11067 *     Ret  : S16
11068 *
11069 *     Notes:
11070 *
11071 *     File  : 
11072 *
11073 **********************************************************/
11074 #ifdef ANSI
11075 PUBLIC S16 cmUnpkTfuUlCqiIndInfo
11076 (
11077 TfuUlCqiIndInfo *param,
11078 Ptr memCp,
11079 Buffer *mBuf
11080 )
11081 #else
11082 PUBLIC S16 cmUnpkTfuUlCqiIndInfo(param, memCp, mBuf)
11083 TfuUlCqiIndInfo *param;
11084 Ptr memCp;
11085 Buffer *mBuf;
11086 #endif
11087 {
11088
11089    U32 count, loopCnt;
11090    TfuUlCqiRpt *tfuUlCqiRpt;
11091
11092    TRC3(cmUnpkTfuUlCqiIndInfo)
11093
11094    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11095    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11096    cmLListInit(&param->ulCqiRpt);
11097    CMCHKUNPK(SUnpkU32, &count, mBuf);
11098    for (loopCnt=0; loopCnt<count; loopCnt++) {
11099       cmGetMem((Ptr)memCp, sizeof(*tfuUlCqiRpt), (Ptr *)&tfuUlCqiRpt);
11100       CMCHKUNPK(cmUnpkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11101       cmLListAdd2Tail(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11102       tfuUlCqiRpt->lnk.node = (PTR)tfuUlCqiRpt;
11103    }
11104    RETVALUE(ROK);
11105 }
11106
11107
11108
11109 \f
11110 /***********************************************************
11111 *
11112 *     Func : cmPkTfuDlCqiRpt
11113 *
11114 *
11115 *     Desc : This structure contains the DL CQI report for a single UE. 
11116   * @details The report could either be reported on PUCCH or PUSCH, a flag
11117   * conveys this information.
11118 *
11119 *
11120 *     Ret  : S16
11121 *
11122 *     Notes:
11123 *
11124 *     File  : 
11125 *
11126 **********************************************************/
11127 #ifdef ANSI
11128 PUBLIC S16 cmPkTfuDlCqiRpt
11129 (
11130 TfuDlCqiRpt *param,
11131 Buffer *mBuf
11132 )
11133 #else
11134 PUBLIC S16 cmPkTfuDlCqiRpt(param, mBuf)
11135 TfuDlCqiRpt *param;
11136 Buffer *mBuf;
11137 #endif
11138 {
11139
11140    TRC3(cmPkTfuDlCqiRpt)
11141
11142       if (cmPkTfuDlCqiInfo(param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11143          RETVALUE(RFAILED);
11144    CMCHKPK(SPkU8, param->isPucchInfo, mBuf);
11145    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11146    RETVALUE(ROK);
11147 }
11148
11149
11150 \f
11151 /***********************************************************
11152 *
11153 *     Func : cmUnpkTfuDlCqiRpt
11154 *
11155 *
11156 *     Desc : This structure contains the DL CQI report for a single UE. 
11157   * @details The report could either be reported on PUCCH or PUSCH, a flag
11158   * conveys this information.
11159 *
11160 *
11161 *     Ret  : S16
11162 *
11163 *     Notes:
11164 *
11165 *     File  : 
11166 *
11167 **********************************************************/
11168 #ifdef ANSI
11169 PUBLIC S16 cmUnpkTfuDlCqiRpt
11170 (
11171 TfuDlCqiRpt *param,
11172 Buffer *mBuf
11173 )
11174 #else
11175 PUBLIC S16 cmUnpkTfuDlCqiRpt(param, mBuf)
11176 TfuDlCqiRpt *param;
11177 Buffer *mBuf;
11178 #endif
11179 {
11180
11181    TRC3(cmUnpkTfuDlCqiRpt)
11182
11183    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11184    CMCHKUNPK(SUnpkU8, &param->isPucchInfo, mBuf);
11185    if (cmUnpkTfuDlCqiInfo (param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11186       RETVALUE(RFAILED);
11187    RETVALUE(ROK);
11188 }
11189
11190
11191 \f
11192 /***********************************************************
11193 *
11194 *     Func : cmPkTfuDlCqiIndInfo
11195 *
11196 *
11197 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11198  * UEs. 
11199  * @details This structure clubs together DL CQI reports for a number of UEs.
11200 *
11201 *
11202 *     Ret  : S16
11203 *
11204 *     Notes:
11205 *
11206 *     File  : 
11207 *
11208 **********************************************************/
11209 #ifdef ANSI
11210 PUBLIC S16 cmPkTfuDlCqiIndInfo
11211 (
11212 TfuDlCqiIndInfo *param,
11213 Buffer *mBuf
11214 )
11215 #else
11216 PUBLIC S16 cmPkTfuDlCqiIndInfo(param, mBuf)
11217 TfuDlCqiIndInfo *param;
11218 Buffer *mBuf;
11219 #endif
11220 {
11221
11222    CmLList *node;
11223    U32 count;
11224    TfuDlCqiRpt *tfuDlCqiRpt;
11225
11226    TRC3(cmPkTfuDlCqiIndInfo)
11227
11228    count = param->dlCqiRptsLst.count;
11229    node = param->dlCqiRptsLst.last;
11230    while (node) {
11231       tfuDlCqiRpt = (TfuDlCqiRpt *)node->node;
11232       node=node->prev;
11233       CMCHKPK(cmPkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11234       cmLListDelFrm(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11235       tfuDlCqiRpt->lnk.node = (PTR)NULLP;
11236    }
11237    CMCHKPK(SPkU32, count, mBuf);
11238    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11239    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11240    RETVALUE(ROK);
11241 }
11242
11243
11244 \f
11245 /***********************************************************
11246 *
11247 *     Func : cmUnpkTfuDlCqiIndInfo
11248 *
11249 *
11250 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11251  * UEs. 
11252  * @details This structure clubs together DL CQI reports for a number of UEs.
11253 *
11254 *
11255 *     Ret  : S16
11256 *
11257 *     Notes:
11258 *
11259 *     File  : 
11260 *
11261 **********************************************************/
11262 #ifdef ANSI
11263 PUBLIC S16 cmUnpkTfuDlCqiIndInfo
11264 (
11265 TfuDlCqiIndInfo *param,
11266 Ptr memCp,
11267 Buffer *mBuf
11268 )
11269 #else
11270 PUBLIC S16 cmUnpkTfuDlCqiIndInfo(param, memCp, mBuf)
11271 TfuDlCqiIndInfo *param;
11272 Ptr memCp;
11273 Buffer *mBuf;
11274 #endif
11275 {
11276
11277    U32 count, loopCnt;
11278    TfuDlCqiRpt *tfuDlCqiRpt;
11279
11280    TRC3(cmUnpkTfuDlCqiIndInfo)
11281
11282    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11283    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11284    cmLListInit(&param->dlCqiRptsLst);
11285    CMCHKUNPK(SUnpkU32, &count, mBuf);
11286    for (loopCnt=0; loopCnt<count; loopCnt++) {
11287       cmGetMem((Ptr)memCp, sizeof(*tfuDlCqiRpt), (Ptr *)&tfuDlCqiRpt);
11288       CMCHKUNPK(cmUnpkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11289       cmLListAdd2Tail(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11290       tfuDlCqiRpt->lnk.node = (PTR)tfuDlCqiRpt;
11291    }
11292    RETVALUE(ROK);
11293 }
11294
11295
11296 \f
11297 /***********************************************************
11298 *
11299 *     Func : cmPkTfuCrcInfo
11300 *
11301 *
11302 *     Desc : This structure contains the CRC indication for a single
11303   * UE.
11304 *
11305 *
11306 *     Ret  : S16
11307 *
11308 *     Notes:
11309 *
11310 *     File  : 
11311 *
11312 **********************************************************/
11313 #ifdef ANSI
11314 PUBLIC S16 cmPkTfuCrcInfo
11315 (
11316 TfuCrcInfo *param,
11317 Buffer *mBuf
11318 )
11319 #else
11320 PUBLIC S16 cmPkTfuCrcInfo(param, mBuf)
11321 TfuCrcInfo *param;
11322 Buffer *mBuf;
11323 #endif
11324 {
11325
11326    TRC3(cmPkTfuCrcInfo)
11327
11328    CMCHKPK(cmPkTknU8, &param->rv, mBuf);
11329    CMCHKPK(SPkU8, param->isFailure, mBuf);
11330    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11331    RETVALUE(ROK);
11332 }
11333
11334
11335 \f
11336 /***********************************************************
11337 *
11338 *     Func : cmUnpkTfuCrcInfo
11339 *
11340 *
11341 *     Desc : This structure contains the CRC indication for a single
11342   * UE.
11343 *
11344 *
11345 *     Ret  : S16
11346 *
11347 *     Notes:
11348 *
11349 *     File  : 
11350 *
11351 **********************************************************/
11352 #ifdef ANSI
11353 PUBLIC S16 cmUnpkTfuCrcInfo
11354 (
11355 TfuCrcInfo *param,
11356 Buffer *mBuf
11357 )
11358 #else
11359 PUBLIC S16 cmUnpkTfuCrcInfo(param, mBuf)
11360 TfuCrcInfo *param;
11361 Buffer *mBuf;
11362 #endif
11363 {
11364
11365    TRC3(cmUnpkTfuCrcInfo)
11366
11367    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11368    CMCHKUNPK(SUnpkU8, &param->isFailure, mBuf);
11369    CMCHKUNPK(cmUnpkTknU8, &param->rv, mBuf);
11370    RETVALUE(ROK);
11371 }
11372
11373
11374 \f
11375 /***********************************************************
11376 *
11377 *     Func : cmPkTfuCrcIndInfo
11378 *
11379 *
11380 *     Desc : This structure contains information that is passed as a part of the
11381  * CRC Indication from PHY to MAC.
11382  * @details This structure clubs together all the CRC indications for
11383  * a single subframe and conveys this information to the scheduler.
11384 *
11385 *
11386 *     Ret  : S16
11387 *
11388 *     Notes:
11389 *
11390 *     File  : 
11391 *
11392 **********************************************************/
11393 #ifdef ANSI
11394 PUBLIC S16 cmPkTfuCrcIndInfo
11395 (
11396 TfuCrcIndInfo *param,
11397 Buffer *mBuf
11398 )
11399 #else
11400 PUBLIC S16 cmPkTfuCrcIndInfo(param, mBuf)
11401 TfuCrcIndInfo *param;
11402 Buffer *mBuf;
11403 #endif
11404 {
11405
11406    CmLList *node;
11407    U32 count;
11408    TfuCrcInfo *tfuCrcIndInfo;
11409
11410    TRC3(cmPkTfuCrcIndInfo)
11411
11412 #ifdef TFU_5GTF
11413    CMCHKPK(SPkU8, param->sccIdx, mBuf);
11414    CMCHKPK(SPkU8, param->sectorId, mBuf);
11415 #endif /* TFU_5GTF */
11416    count = param->crcLst.count;
11417    node = param->crcLst.last;
11418    while (node) {
11419       tfuCrcIndInfo = (TfuCrcInfo *)node->node;
11420       node=node->prev;
11421       CMCHKPK(cmPkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11422       cmLListDelFrm(&param->crcLst, &tfuCrcIndInfo->lnk);
11423       tfuCrcIndInfo->lnk.node = (PTR)NULLP;
11424    }
11425    CMCHKPK(SPkU32, count, mBuf);
11426    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11427    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11428    RETVALUE(ROK);
11429 }
11430
11431
11432 \f
11433 /***********************************************************
11434 *
11435 *     Func : cmUnpkTfuCrcIndInfo
11436 *
11437 *
11438 *     Desc : This structure contains information that is passed as a part of the
11439  * CRC Indication from PHY to MAC.
11440  * @details This structure clubs together all the CRC indications for
11441  * a single subframe and conveys this information to the scheduler.
11442 *
11443 *
11444 *     Ret  : S16
11445 *
11446 *     Notes:
11447 *
11448 *     File  : 
11449 *
11450 **********************************************************/
11451 #ifdef ANSI
11452 PUBLIC S16 cmUnpkTfuCrcIndInfo
11453 (
11454 TfuCrcIndInfo *param,
11455 Ptr memCp,
11456 Buffer *mBuf
11457 )
11458 #else
11459 PUBLIC S16 cmUnpkTfuCrcIndInfo(param, memCp, mBuf)
11460 TfuCrcIndInfo *param;
11461 Ptr memCp;
11462 Buffer *mBuf;
11463 #endif
11464 {
11465
11466    U32 count, loopCnt;
11467    TfuCrcInfo *tfuCrcIndInfo;
11468
11469    TRC3(cmUnpkTfuCrcIndInfo)
11470
11471    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11472    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11473    cmLListInit(&param->crcLst);
11474    CMCHKUNPK(SUnpkU32, &count, mBuf);
11475    for (loopCnt=0; loopCnt<count; loopCnt++) {
11476       cmGetMem((Ptr)memCp, sizeof(*tfuCrcIndInfo), (Ptr *)&tfuCrcIndInfo);
11477       CMCHKUNPK(cmUnpkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11478       cmLListAdd2Tail(&param->crcLst, &tfuCrcIndInfo->lnk);
11479       tfuCrcIndInfo->lnk.node = (PTR)tfuCrcIndInfo;
11480    }
11481 #ifdef TFU_5GTF
11482    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
11483    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
11484 #endif /* TFU_5GTF */
11485    RETVALUE(ROK);
11486 }
11487
11488
11489 \f
11490 /***********************************************************
11491 *
11492 *     Func : cmPkTfuTimingAdvInfo
11493 *
11494 *
11495 *     Desc : This structure contains the timing advance information for a single
11496   * UE.
11497 *
11498 *
11499 *     Ret  : S16
11500 *
11501 *     Notes:
11502 *
11503 *     File  : 
11504 *
11505 **********************************************************/
11506 #ifdef ANSI
11507 PUBLIC S16 cmPkTfuTimingAdvInfo
11508 (
11509 TfuTimingAdvInfo *param,
11510 Buffer *mBuf
11511 )
11512 #else
11513 PUBLIC S16 cmPkTfuTimingAdvInfo(param, mBuf)
11514 TfuTimingAdvInfo *param;
11515 Buffer *mBuf;
11516 #endif
11517 {
11518
11519    TRC3(cmPkTfuTimingAdvInfo)
11520
11521    CMCHKPK(SPkU8, param->timingAdv, mBuf);
11522    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11523    RETVALUE(ROK);
11524 }
11525
11526
11527 \f
11528 /***********************************************************
11529 *
11530 *     Func : cmUnpkTfuTimingAdvInfo
11531 *
11532 *
11533 *     Desc : This structure contains the timing advance information for a single
11534   * UE.
11535 *
11536 *
11537 *     Ret  : S16
11538 *
11539 *     Notes:
11540 *
11541 *     File  : 
11542 *
11543 **********************************************************/
11544 #ifdef ANSI
11545 PUBLIC S16 cmUnpkTfuTimingAdvInfo
11546 (
11547 TfuTimingAdvInfo *param,
11548 Buffer *mBuf
11549 )
11550 #else
11551 PUBLIC S16 cmUnpkTfuTimingAdvInfo(param, mBuf)
11552 TfuTimingAdvInfo *param;
11553 Buffer *mBuf;
11554 #endif
11555 {
11556
11557    TRC3(cmUnpkTfuTimingAdvInfo)
11558
11559    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11560    CMCHKUNPK(SUnpkU8, &param->timingAdv, mBuf);
11561    RETVALUE(ROK);
11562 }
11563
11564
11565 \f
11566 /***********************************************************
11567 *
11568 *     Func : cmPkTfuTimingAdvIndInfo
11569 *
11570 *
11571 *     Desc : This structure contains information that is passed as part of the Timing
11572  * Advance indication from PHY to MAC.
11573  * @details This structure clubs together timing advances for a number of UEs.
11574 *
11575 *
11576 *     Ret  : S16
11577 *
11578 *     Notes:
11579 *
11580 *     File  : 
11581 *
11582 **********************************************************/
11583 #ifdef ANSI
11584 PUBLIC S16 cmPkTfuTimingAdvIndInfo
11585 (
11586 TfuTimingAdvIndInfo *param,
11587 Buffer *mBuf
11588 )
11589 #else
11590 PUBLIC S16 cmPkTfuTimingAdvIndInfo(param, mBuf)
11591 TfuTimingAdvIndInfo *param;
11592 Buffer *mBuf;
11593 #endif
11594 {
11595
11596    CmLList *node;
11597    U32 count;
11598    TfuTimingAdvInfo *tfuTimingAdvInfo;
11599
11600    TRC3(cmPkTfuTimingAdvIndInfo)
11601
11602    count = param->timingAdvLst.count;
11603    node = param->timingAdvLst.last;
11604    while (node) {
11605       tfuTimingAdvInfo = (TfuTimingAdvInfo *)node->node;
11606       node=node->prev;
11607       CMCHKPK(cmPkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11608       cmLListDelFrm(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11609       tfuTimingAdvInfo->lnk.node = (PTR)NULLP;
11610    }
11611    CMCHKPK(SPkU32, count, mBuf);
11612    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11613    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11614    RETVALUE(ROK);
11615 }
11616
11617
11618 \f
11619 /***********************************************************
11620 *
11621 *     Func : cmUnpkTfuTimingAdvIndInfo
11622 *
11623 *
11624 *     Desc : This structure contains information that is passed as part of the Timing
11625  * Advance indication from PHY to MAC.
11626  * @details This structure clubs together timing advances for a number of UEs.
11627 *
11628 *
11629 *     Ret  : S16
11630 *
11631 *     Notes:
11632 *
11633 *     File  : 
11634 *
11635 **********************************************************/
11636 #ifdef ANSI
11637 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo
11638 (
11639 TfuTimingAdvIndInfo *param,
11640 Ptr memCp,
11641 Buffer *mBuf
11642 )
11643 #else
11644 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo(param, memCp, mBuf)
11645 TfuTimingAdvIndInfo *param;
11646 Ptr memCp;
11647 Buffer *mBuf;
11648 #endif
11649 {
11650
11651    U32 count, loopCnt;
11652    TfuTimingAdvInfo *tfuTimingAdvInfo;
11653
11654    TRC3(cmUnpkTfuTimingAdvIndInfo)
11655
11656    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11657    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11658    cmLListInit(&param->timingAdvLst);
11659    CMCHKUNPK(SUnpkU32, &count, mBuf);
11660    for (loopCnt=0; loopCnt<count; loopCnt++) {
11661       cmGetMem((Ptr)memCp, sizeof(*tfuTimingAdvInfo), (Ptr *)&tfuTimingAdvInfo);
11662       CMCHKUNPK(cmUnpkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11663       cmLListAdd2Tail(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11664       tfuTimingAdvInfo->lnk.node = (PTR)tfuTimingAdvInfo;
11665    }
11666    RETVALUE(ROK);
11667 }
11668
11669 /*CA dev Start*/
11670 /***********************************************************
11671 *
11672 *     Func : cmPkTfuTtiCellInfo
11673 *
11674 *
11675 *     Desc : This structure contains information that is 
11676 *     passed as a part of the TTI indication sent 
11677 *     from CL to MAC and SCH
11678 *
11679 *
11680 *     Ret  : S16
11681 *
11682 *     Notes:
11683 *
11684 *     File  : 
11685 *
11686 **********************************************************/
11687 #ifdef ANSI
11688 PUBLIC S16 cmPkTfuTtiCellInfo
11689 (
11690 TfuTtiCellInfo *param,
11691 Buffer *mBuf
11692 )
11693 #else
11694 PUBLIC S16 cmPkTfuTtiCellInfo(param, mBuf)
11695 TfuTtiCellInfo *param;
11696 Buffer *mBuf;
11697 #endif
11698 {
11699
11700    TRC3(cmPkTfuTtiCellInfo)
11701
11702    CMCHKPK(SPkU8, param->ulBlankSf, mBuf);
11703    CMCHKPK(SPkU8, param->dlBlankSf, mBuf);
11704    CMCHKPK(SPkU8, param->schTickDelta, mBuf);
11705    CMCHKPK(cmPkBool, param->isDummyTti, mBuf);
11706    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11707    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11708    RETVALUE(ROK);
11709 }
11710 /*CA dev End*/
11711 \f
11712 /***********************************************************
11713 *
11714 *     Func : cmPkTfuTtiIndInfo
11715 *
11716 *
11717 *     Desc : This structure contains information that is passed as a part of the TTI
11718  * indication sent from PHY to MAC.
11719 *
11720 *
11721 *     Ret  : S16
11722 *
11723 *     Notes:
11724 *
11725 *     File  : 
11726 *
11727 **********************************************************/
11728 #ifdef ANSI
11729 PUBLIC S16 cmPkTfuTtiIndInfo
11730 (
11731 TfuTtiIndInfo *param,
11732 Buffer *mBuf
11733 )
11734 #else
11735 PUBLIC S16 cmPkTfuTtiIndInfo(param, mBuf)
11736 TfuTtiIndInfo *param;
11737 Buffer *mBuf;
11738 #endif
11739 {
11740
11741    S32 i;
11742    TRC3(cmPkTfuTtiIndInfo)
11743
11744    /*CA dev Start*/
11745    for (i=(param->numCells-1); i >= 0; i--) {
11746          CMCHKPK(cmPkTfuTtiCellInfo, &param->cells[i], mBuf);
11747       }
11748    CMCHKPK(SPkU8, param->numCells, mBuf);
11749    /*CA dev End*/
11750    RETVALUE(ROK);
11751 }
11752
11753 /* CA dev Start */
11754 /***********************************************************
11755 *
11756 *     Func : cmUnpkTfuTtiCellInfo
11757 *
11758 *
11759 *     Desc : This structure contains information that is 
11760 *     passed as a part of the TTI indication sent 
11761 *     from CL to MAC and SCH
11762 *
11763 *
11764 *     Ret  : S16
11765 *
11766 *     Notes:
11767 *
11768 *     File  : 
11769 *
11770 **********************************************************/
11771 #ifdef ANSI
11772 PUBLIC S16 cmUnpkTfuTtiCellInfo
11773 (
11774 TfuTtiCellInfo *param,
11775 Buffer *mBuf
11776 )
11777 #else
11778 PUBLIC S16 cmUnpkTfuTtiCellInfo(param, mBuf)
11779 TfuTtiCellInfo *param;
11780 Buffer *mBuf;
11781 #endif
11782 {
11783
11784    TRC3(cmUnpkTfuTtiCellInfo)
11785
11786    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11787    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11788    CMCHKUNPK(cmUnpkBool, &param->isDummyTti, mBuf);
11789    CMCHKUNPK(SUnpkU8, &param->schTickDelta, mBuf);
11790    CMCHKUNPK(SUnpkU8, &param->dlBlankSf, mBuf);
11791    CMCHKUNPK(SUnpkU8, &param->ulBlankSf, mBuf);
11792    RETVALUE(ROK);
11793 }
11794 /* CA dev End */
11795
11796 \f
11797 /***********************************************************
11798 *
11799 *     Func : cmPkTfuRaReqInfo
11800 *
11801 *
11802 *     Desc : This structure contains the information for a single Random Access Request.
11803  * @details The information present in this structure is for a single preamble.
11804  * Associated with each preamble are fields that the physical layer calculates
11805  * based on the reception of the Random Access Request. These are the following
11806  * -# Timing Advance
11807  * -# TPC
11808  * -# CQI (optional).
11809 *
11810 *
11811 *     Ret  : S16
11812 *
11813 *     Notes:
11814 *
11815 *     File  : 
11816 *
11817 **********************************************************/
11818 #ifdef ANSI
11819 PUBLIC S16 cmPkTfuRaReqInfo
11820 (
11821 TfuRaReqInfo *param,
11822 Buffer *mBuf
11823 )
11824 #else
11825 PUBLIC S16 cmPkTfuRaReqInfo(param, mBuf)
11826 TfuRaReqInfo *param;
11827 Buffer *mBuf;
11828 #endif
11829 {
11830
11831    TRC3(cmPkTfuRaReqInfo)
11832
11833    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
11834    CMCHKPK(SPkU8, param->cqiPres, mBuf);
11835    CMCHKPK(SPkU8, param->tpc, mBuf);
11836    CMCHKPK(SPkU16, param->ta, mBuf);
11837    CMCHKPK(SPkU8, param->rapId, mBuf);
11838    RETVALUE(ROK);
11839 }
11840
11841
11842 \f
11843 /***********************************************************
11844 *
11845 *     Func : cmUnpkTfuRaReqInfo
11846 *
11847 *
11848 *     Desc : This structure contains the information for a single Random Access Request.
11849  * @details The information present in this structure is for a single preamble.
11850  * Associated with each preamble are fields that the physical layer calculates
11851  * based on the reception of the Random Access Request. These are the following
11852  * -# Timing Advance
11853  * -# TPC
11854  * -# CQI (optional).
11855 *
11856 *
11857 *     Ret  : S16
11858 *
11859 *     Notes:
11860 *
11861 *     File  : 
11862 *
11863 **********************************************************/
11864 #ifdef ANSI
11865 PUBLIC S16 cmUnpkTfuRaReqInfo
11866 (
11867 TfuRaReqInfo *param,
11868 Buffer *mBuf
11869 )
11870 #else
11871 PUBLIC S16 cmUnpkTfuRaReqInfo(param, mBuf)
11872 TfuRaReqInfo *param;
11873 Buffer *mBuf;
11874 #endif
11875 {
11876
11877    TRC3(cmUnpkTfuRaReqInfo)
11878
11879    CMCHKUNPK(SUnpkU8, &param->rapId, mBuf);
11880    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
11881    CMCHKUNPK(SUnpkU8, &param->tpc, mBuf);
11882    CMCHKUNPK(SUnpkU8, &param->cqiPres, mBuf);
11883    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
11884    RETVALUE(ROK);
11885 }
11886
11887
11888 \f
11889 /***********************************************************
11890 *
11891 *     Func : cmPkTfuRachInfo
11892 *
11893 *
11894 *     Desc : This structure contains RACH request information for a single
11895   * RA-RNTI.
11896 *
11897 *
11898 *     Ret  : S16
11899 *
11900 *     Notes:
11901 *
11902 *     File  : 
11903 *
11904 **********************************************************/
11905 #ifdef ANSI
11906 PUBLIC S16 cmPkTfuRachInfo
11907 (
11908  CmMemListCp   memCp,
11909 TfuRachInfo *param,
11910 Buffer *mBuf
11911 )
11912 #else
11913 PUBLIC S16 cmPkTfuRachInfo(memCp, param, mBuf)
11914  CmMemListCp   memCp;
11915 TfuRachInfo *param;
11916 Buffer *mBuf;
11917 #endif
11918 {
11919
11920    S32 i;
11921    TRC3(cmPkTfuRachInfo)
11922
11923    for (i= (param->numRaReqInfo - 1); i >= 0; i--) {
11924       CMCHKPK(cmPkTfuRaReqInfo, &(param->raReqInfoArr[i]), mBuf);
11925    }
11926 #ifdef PRACH_5GTF 
11927    CMCHKPK(SPkU16, param->nPwrFactor, mBuf);
11928    CMCHKPK(SPkU8, param->nPRACHSymbIndex, mBuf);
11929    CMCHKPK(SPkU8, param->nf1Value, mBuf);
11930    CMCHKPK(SPkU8, param->nCyclicShift, mBuf);
11931    CMCHKPK(SPkU8, param->nRootSeq, mBuf);
11932    CMCHKPK(SPkU8, param->nPRACHConfiguration, mBuf);
11933    CMCHKPK(SPkU8, param->nPreambleFormat, mBuf);
11934 #endif
11935    CMCHKPK(SPkU8, param->numRaReqInfo, mBuf);
11936    CMCHKPK(cmPkLteRnti, param->raRnti, mBuf);
11937    RETVALUE(ROK);
11938 }
11939
11940
11941 \f
11942 /***********************************************************
11943 *
11944 *     Func : cmUnpkTfuRachInfo
11945 *
11946 *
11947 *     Desc : This structure contains RACH request information for a single
11948   * RA-RNTI.
11949 *
11950 *
11951 *     Ret  : S16
11952 *
11953 *     Notes:
11954 *
11955 *     File  : 
11956 *
11957 **********************************************************/
11958 #ifdef ANSI
11959 PUBLIC S16 cmUnpkTfuRachInfo
11960 (
11961 CmMemListCp   memCp,
11962 TfuRachInfo *param,
11963 Buffer *mBuf
11964 )
11965 #else
11966 PUBLIC S16 cmUnpkTfuRachInfo(memCp, param, mBuf)
11967 CmMemListCp   memCp;
11968 TfuRachInfo *param;
11969 Buffer *mBuf;
11970 #endif
11971 {
11972
11973    S32 i;
11974    TRC3(cmUnpkTfuRachInfo)
11975
11976    CMCHKUNPK(cmUnpkLteRnti, &param->raRnti, mBuf);
11977    CMCHKUNPK(SUnpkU8, &param->numRaReqInfo, mBuf);
11978 #ifdef PRACH_5GTF 
11979    CMCHKUNPK(SPkU8, param->nPreambleFormat, mBuf);
11980    CMCHKUNPK(SPkU8, param->nPRACHConfiguration, mBuf);
11981    CMCHKUNPK(SPkU8, param->nRootSeq, mBuf);
11982    CMCHKUNPK(SPkU8, param->nCyclicShift, mBuf);
11983    CMCHKUNPK(SPkU8, param->nf1Value, mBuf);
11984    CMCHKUNPK(SPkU8, param->nPRACHSymbIndex, mBuf);
11985    CMCHKUNPK(SPkU16, param->nPwrFactor, mBuf);
11986 #endif
11987    if (cmGetMem (&(memCp), (sizeof(TfuRaReqInfo) * param->numRaReqInfo), 
11988             (Ptr *)&param->raReqInfoArr) != ROK)
11989    {
11990       RETVALUE(RFAILED);
11991    }
11992    for (i=0; i<param->numRaReqInfo; i++) {
11993       CMCHKUNPK(cmUnpkTfuRaReqInfo, &param->raReqInfoArr[i], mBuf);
11994    }
11995    RETVALUE(ROK);
11996 }
11997
11998
11999 \f
12000 /***********************************************************
12001 *
12002 *     Func : cmPkTfuRaReqIndInfo
12003 *
12004 *
12005 *     Desc : This structure contains the list of Random Access Requests received in a
12006  * single TTI.
12007  * @details Random Access Request is associated with a RA-RNTI, which remains
12008  * common for all the Random access requests within a subframe. This structure
12009  * thus carries the RA-RNTI and a list of Random Access Request information.
12010  * This information consists of the following 
12011  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12012  * UE.
12013  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12014  * needs to be uplink synchronized. This value is calculated by physical layer. 
12015  * -# tpc - this is the power control command that the physical layer calculates
12016  * from the received RA request. This value is transmitted in the RA Response
12017  * sent out by MAC.
12018  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12019  * physical layer. This aids MAC in the scheduling of this UE.
12020 *
12021 *
12022 *     Ret  : S16
12023 *
12024 *     Notes:
12025 *
12026 *     File  : 
12027 *
12028 **********************************************************/
12029 #ifdef ANSI
12030 PUBLIC S16 cmPkTfuRaReqIndInfo
12031 (
12032 TfuRaReqIndInfo *param,
12033 Buffer *mBuf
12034 )
12035 #else
12036 PUBLIC S16 cmPkTfuRaReqIndInfo(param, mBuf)
12037 TfuRaReqIndInfo *param;
12038 Buffer *mBuf;
12039 #endif
12040 {
12041
12042    S32 i;
12043    TRC3(cmPkTfuRaReqIndInfo)
12044
12045    for (i= (param->nmbOfRaRnti-1); i >= 0; i--) 
12046    {
12047       if (ROK != cmPkTfuRachInfo(param->memCp, 
12048                &(param->rachInfoArr[i]), mBuf))
12049       {
12050          RETVALUE(RFAILED);
12051       }
12052    }
12053    CMCHKPK(SPkU8, param->nmbOfRaRnti, mBuf);
12054    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12055    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12056    RETVALUE(ROK);
12057 }
12058
12059
12060 \f
12061 /***********************************************************
12062 *
12063 *     Func : cmUnpkTfuRaReqIndInfo
12064 *
12065 *
12066 *     Desc : This structure contains the list of Random Access Requests received in a
12067  * single TTI.
12068  * @details Random Access Request is associated with a RA-RNTI, which remains
12069  * common for all the Random access requests within a subframe. This structure
12070  * thus carries the RA-RNTI and a list of Random Access Request information.
12071  * This information consists of the following 
12072  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12073  * UE.
12074  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12075  * needs to be uplink synchronized. This value is calculated by physical layer. 
12076  * -# tpc - this is the power control command that the physical layer calculates
12077  * from the received RA request. This value is transmitted in the RA Response
12078  * sent out by MAC.
12079  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12080  * physical layer. This aids MAC in the scheduling of this UE.
12081 *
12082 *
12083 *     Ret  : S16
12084 *
12085 *     Notes:
12086 *
12087 *     File  : 
12088 *
12089 **********************************************************/
12090 #ifdef ANSI
12091 PUBLIC S16 cmUnpkTfuRaReqIndInfo
12092 (
12093 TfuRaReqIndInfo *param,
12094 Buffer *mBuf
12095 )
12096 #else
12097 PUBLIC S16 cmUnpkTfuRaReqIndInfo(param, mBuf)
12098 TfuRaReqIndInfo *param;
12099 Buffer *mBuf;
12100 #endif
12101 {
12102
12103    S32 i;
12104    TRC3(cmUnpkTfuRaReqIndInfo)
12105
12106    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12107    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12108    CMCHKUNPK(SUnpkU8, &param->nmbOfRaRnti, mBuf);
12109    if (cmGetMem (&(param->memCp), (sizeof(TfuRachInfo) * param->nmbOfRaRnti), 
12110             (Ptr *)&param->rachInfoArr) != ROK)
12111    {
12112       RETVALUE(RFAILED);
12113    }
12114    for (i=0; i<param->nmbOfRaRnti; i++) 
12115    {
12116       if (ROK != cmUnpkTfuRachInfo(param->memCp, &param->rachInfoArr[i], mBuf))
12117       {
12118          RETVALUE(RFAILED);
12119       }
12120    }
12121    RETVALUE(ROK);
12122 }
12123
12124
12125 \f
12126 /***********************************************************
12127 *
12128 *     Func : cmPkTfuPucchDeltaPwr
12129 *
12130 *
12131 *     Desc : This structure contains PUCCH Delta power for a single UE.
12132 *
12133 *
12134 *     Ret  : S16
12135 *
12136 *     Notes:
12137 *
12138 *     File  : 
12139 *
12140 **********************************************************/
12141 #ifdef ANSI
12142 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo
12143 (
12144 TfuPucchDeltaPwr *param,
12145 Buffer *mBuf
12146 )
12147 #else
12148 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo(param, mBuf)
12149 TfuPucchDeltaPwr *param;
12150 Buffer *mBuf;
12151 #endif
12152 {
12153
12154    TRC3(cmPkTfuPucchDeltaPwrInfo)
12155
12156    CMCHKPK(SPkS8, param->pucchDeltaPwr, mBuf);
12157    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12158    RETVALUE(ROK);
12159 }
12160
12161
12162 \f
12163 /***********************************************************
12164 *
12165 *     Func : cmUnpkTfuPucchDeltaPwr
12166 *
12167 *
12168 *     Desc : This structure contains PUCCH Delta power for a single UE.
12169 *
12170 *
12171 *     Ret  : S16
12172 *
12173 *     Notes:
12174 *
12175 *     File  : 
12176 *
12177 **********************************************************/
12178 #ifdef ANSI
12179 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo
12180 (
12181 TfuPucchDeltaPwr *param,
12182 Buffer *mBuf
12183 )
12184 #else
12185 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo(param, mBuf)
12186 TfuPucchDeltaPwr *param;
12187 Buffer *mBuf;
12188 #endif
12189 {
12190
12191    TRC3(cmUnpkTfuPucchDeltaPwrInfo)
12192
12193    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12194    CMCHKUNPK(SUnpkS8, &param->pucchDeltaPwr, mBuf);
12195    RETVALUE(ROK);
12196 }
12197
12198
12199 \f
12200 /***********************************************************
12201 *
12202 *     Func : cmPkTfuPucchDeltaPwrIndInfo
12203 *
12204 *
12205 *     Desc : This structure contains information that is passed as a part of the
12206  * PUCCH Delta power indication from PHY to SCH.
12207  * @details This structure clubs together PUCCH Delta power values for a number
12208  * of UEs.
12209 *
12210 *
12211 *     Ret  : S16
12212 *
12213 *     Notes:
12214 *
12215 *     File  : 
12216 *
12217 **********************************************************/
12218 #ifdef ANSI
12219 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo
12220 (
12221 TfuPucchDeltaPwrIndInfo *param,
12222 Buffer *mBuf
12223 )
12224 #else
12225 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo(param, mBuf)
12226 TfuPucchDeltaPwrIndInfo *param;
12227 Buffer *mBuf;
12228 #endif
12229 {
12230
12231    CmLList *node;
12232    U32 count;
12233    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12234
12235    TRC3(cmPkTfuPucchDeltaPwrIndInfo)
12236
12237    count = param->pucchDeltaPwrLst.count;
12238    node = param->pucchDeltaPwrLst.last;
12239    while (node) {
12240       tfuPucchDeltaPwr = (TfuPucchDeltaPwr *)node->node;
12241       node=node->prev;
12242       CMCHKPK(cmPkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12243       cmLListDelFrm(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12244       tfuPucchDeltaPwr->lnk.node = (PTR)NULLP;
12245    }
12246    CMCHKPK(SPkU32, count, mBuf);
12247    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12248    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12249    RETVALUE(ROK);
12250 }
12251
12252
12253 \f
12254 /***********************************************************
12255 *
12256 *     Func : cmUnpkTfuPucchDeltaPwrIndInfo
12257 *
12258 *
12259 *     Desc : This structure contains information that is passed as a part of the
12260  * PUCCH Delta power indication from PHY to SCH.
12261  * @details This structure clubs together PUCCH Delta power values for a number
12262  * of UEs.
12263 *
12264 *
12265 *     Ret  : S16
12266 *
12267 *     Notes:
12268 *
12269 *     File  : 
12270 *
12271 **********************************************************/
12272 #ifdef ANSI
12273 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo
12274 (
12275 TfuPucchDeltaPwrIndInfo *param,
12276 Ptr memCp,
12277 Buffer *mBuf
12278 )
12279 #else
12280 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo(param, memCp, mBuf)
12281 TfuPucchDeltaPwrIndInfo *param;
12282 Ptr memCp;
12283 Buffer *mBuf;
12284 #endif
12285 {
12286
12287    U32 count, loopCnt;
12288    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12289
12290    TRC3(cmUnpkTfuPucchDeltaPwrIndInfo)
12291
12292    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12293    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12294    cmLListInit(&param->pucchDeltaPwrLst);
12295    CMCHKUNPK(SUnpkU32, &count, mBuf);
12296    for (loopCnt=0; loopCnt<count; loopCnt++) {
12297       cmGetMem((Ptr)memCp, sizeof(*tfuPucchDeltaPwr), (Ptr *)&tfuPucchDeltaPwr);
12298       CMCHKUNPK(cmUnpkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12299       cmLListAdd2Tail(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12300       tfuPucchDeltaPwr->lnk.node = (PTR)tfuPucchDeltaPwr;
12301    }
12302    RETVALUE(ROK);
12303 }
12304
12305 #ifdef ANSI
12306 PUBLIC S16 cmPkBuffer
12307 (
12308 Buffer **param,
12309 Buffer *mBuf
12310 )
12311 #else
12312 PUBLIC S16 cmPkBuffer(param, mBuf)
12313 Buffer **param;
12314 Buffer *mBuf;
12315 #endif
12316 {
12317    MsgLen msgLen=0;
12318    TRC3(cmPkBuffer)
12319    if (SFndLenMsg(*param, &msgLen) != ROK)
12320       RETVALUE(RFAILED);
12321    if (SCatMsg(mBuf, *param, M1M2) != ROK)
12322       RETVALUE(RFAILED);
12323    TFU_FREE_MSG(*param);
12324    *param = NULLP;
12325    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
12326    RETVALUE(ROK);
12327 }
12328 #ifdef ANSI
12329 PUBLIC S16 cmUnpkBuffer
12330 (
12331 Buffer **param,
12332 Buffer *mBuf
12333 )
12334 #else
12335 PUBLIC S16 cmUnpkBuffer(param, mBuf)
12336 Buffer **param;
12337 Buffer *mBuf;
12338 #endif
12339 {
12340    MsgLen msgLen=0, totalMsgLen=0;
12341    TRC3(cmUnpkBuffer)
12342    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
12343    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
12344       RETVALUE(RFAILED);
12345    if (SSegMsg(mBuf, totalMsgLen-msgLen, param) != ROK)
12346       RETVALUE(RFAILED);
12347    RETVALUE(ROK);
12348 }
12349
12350
12351 /***********************************************************
12352 *
12353 *     Func : cmPkTfuDoaInd
12354 *
12355 *
12356 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12357  * identifier for one or more UEs.
12358  * It carries a DOA for each UE. 
12359  * @param pst Pointer to the post structure.
12360  * @param suId SAP ID of the service user.
12361  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12362  * @return ROK/RFAILED
12363 *
12364 *
12365 *     Ret  : S16
12366 *
12367 *     Notes:
12368 *
12369 *     File  : 
12370 *
12371 **********************************************************/
12372 #ifdef ANSI
12373 PUBLIC S16 cmPkTfuDoaInd
12374 (
12375 Pst * pst,
12376 SuId suId,
12377 TfuDoaIndInfo * doaInd
12378 )
12379 #else
12380 PUBLIC S16 cmPkTfuDoaInd(pst, suId, doaInd)
12381 Pst * pst;
12382 SuId suId;
12383 TfuDoaIndInfo * doaInd;
12384 #endif
12385 {
12386    Buffer *mBuf = NULLP;
12387    TRC3(cmPkTfuDoaInd)
12388
12389    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
12390 #if (ERRCLASS & ERRCLS_ADD_RES)
12391       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12392          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12393          (ErrVal)ETFU125, (ErrVal)0, "Packing failed");
12394 #endif
12395       SPutSBuf(pst->region, pst->pool, (Data *)doaInd, sizeof(TfuDoaIndInfo));
12396       RETVALUE(RFAILED);
12397    }
12398       cmPkTfuDoaIndInfo(doaInd, mBuf);
12399    if (SPkS16(suId, mBuf) != ROK) {
12400 #if (ERRCLASS & ERRCLS_ADD_RES)
12401       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12402          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12403          (ErrVal)ETFU126, (ErrVal)0, "Packing failed");
12404 #endif
12405       TFU_FREE_MEM(doaInd);
12406       TFU_FREE_MSG(mBuf);
12407       RETVALUE(RFAILED);
12408    }
12409    TFU_FREE_MEM(doaInd);
12410    pst->event = (Event) EVTTFUDOAIND;
12411    RETVALUE(SPstTsk(pst,mBuf));
12412 }
12413
12414 \f
12415 /***********************************************************
12416 *
12417 *     Func : cmUnpkTfuDoaInd
12418 *
12419 *
12420 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12421  * identifier for one or more UEs.
12422  * It carries a DOA for each UE. 
12423  * @param pst Pointer to the post structure.
12424  * @param suId SAP ID of the service user.
12425  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12426  * @return ROK/RFAILED
12427 *
12428 *
12429 *     Ret  : S16
12430 *
12431 *     Notes:
12432 *
12433 *     File  : 
12434 *
12435 **********************************************************/
12436 #ifdef ANSI
12437 PUBLIC S16 cmUnpkTfuDoaInd
12438 (
12439 TfuDoaInd func,
12440 Pst *pst,
12441 Buffer *mBuf
12442 )
12443 #else
12444 PUBLIC S16 cmUnpkTfuDoaInd(func, pst, mBuf)
12445 TfuDoaInd func;
12446 Pst *pst;
12447 Buffer *mBuf;
12448 #endif
12449 {
12450    SuId suId;
12451    TfuDoaIndInfo *doaInd;
12452    
12453    TRC3(cmUnpkTfuDoaInd)
12454
12455    if (SUnpkS16(&suId, mBuf) != ROK) {
12456       TFU_FREE_MSG(mBuf);
12457 #if (ERRCLASS & ERRCLS_ADD_RES)
12458       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12459          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12460          (ErrVal)ETFU127, (ErrVal)0, "Packing failed");
12461 #endif
12462       RETVALUE(RFAILED);
12463    }
12464    {
12465       Mem   sMem;
12466       sMem.region = pst->region;
12467       sMem.pool = pst->pool;
12468       if ((cmAllocEvnt(sizeof(TfuDoaIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&doaInd)) != ROK)            {
12469 #if (ERRCLASS & ERRCLS_ADD_RES)
12470          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12471             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12472             (ErrVal)ETFU128, (ErrVal)0, "Packing failed");
12473 #endif
12474          TFU_FREE_MSG(mBuf);
12475          RETVALUE(RFAILED);
12476       }
12477    }
12478    
12479       cmUnpkTfuDoaIndInfo(doaInd, (Ptr)&doaInd->memCp, mBuf);
12480    TFU_FREE_MSG(mBuf);
12481    RETVALUE((*func)(pst, suId, doaInd));
12482 }
12483
12484
12485 \f
12486 /***********************************************************
12487 *
12488 *     Func : cmPkTfuDciFormatTbInfo
12489 *
12490 *
12491 *     Desc : This structure contains the TB level DCI signalling
12492   * parameters in case of DCI formats 2 and 2A
12493 *
12494 *
12495 *     Ret  : S16
12496 *
12497 *     Notes:
12498 *
12499 *     File  : 
12500 *
12501 **********************************************************/
12502 #ifdef ANSI
12503 PUBLIC S16 cmPkTfuDciFormatTbInfo
12504 (
12505 TfuDciFormatTbInfo *param,
12506 Buffer *mBuf
12507 )
12508 #else
12509 PUBLIC S16 cmPkTfuDciFormatTbInfo(param, mBuf)
12510 TfuDciFormatTbInfo *param;
12511 Buffer *mBuf;
12512 #endif
12513 {
12514
12515    TRC3(cmPkTfuDciFormatTbInfo)
12516
12517    CMCHKPK(SPkU8, param->mcs, mBuf);
12518    CMCHKPK(SPkU8, param->rv, mBuf);
12519    CMCHKPK(SPkU8, param->ndi, mBuf);
12520    RETVALUE(ROK);
12521 }
12522
12523
12524 \f
12525 /***********************************************************
12526 *
12527 *     Func : cmUnpkTfuDciFormatTbInfo
12528 *
12529 *
12530 *     Desc : This structure contains the TB level DCI signalling
12531   * parameters in case of DCI formats 2 and 2A
12532 *
12533 *
12534 *     Ret  : S16
12535 *
12536 *     Notes:
12537 *
12538 *     File  : 
12539 *
12540 **********************************************************/
12541 #ifdef ANSI
12542 PUBLIC S16 cmUnpkTfuDciFormatTbInfo
12543 (
12544 TfuDciFormatTbInfo *param,
12545 Buffer *mBuf
12546 )
12547 #else
12548 PUBLIC S16 cmUnpkTfuDciFormatTbInfo(param, mBuf)
12549 TfuDciFormatTbInfo *param;
12550 Buffer *mBuf;
12551 #endif
12552 {
12553
12554    TRC3(cmUnpkTfuDciFormatTbInfo)
12555
12556    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
12557    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
12558    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
12559    RETVALUE(ROK);
12560 }
12561
12562
12563 \f
12564 /***********************************************************
12565 *
12566 *     Func : cmPkTfuSubbandDlCqiInfo
12567 *
12568 *
12569 *     Desc : This structure is used to convey the subbannd CQI reported.
12570 *
12571 *
12572 *     Ret  : S16
12573 *
12574 *     Notes:
12575 *
12576 *     File  : 
12577 *
12578 **********************************************************/
12579 #ifdef ANSI
12580 PUBLIC S16 cmPkTfuSubbandDlCqiInfo
12581 (
12582 TfuSubbandDlCqiInfo *param,
12583 Buffer *mBuf
12584 )
12585 #else
12586 PUBLIC S16 cmPkTfuSubbandDlCqiInfo(param, mBuf)
12587 TfuSubbandDlCqiInfo *param;
12588 Buffer *mBuf;
12589 #endif
12590 {
12591
12592    S32 i;
12593    TRC3(cmPkTfuSubbandDlCqiInfo)
12594
12595    for (i=TFU_MAX_TB-1; i >= 0; i--) {
12596       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
12597    }
12598    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
12599    RETVALUE(ROK);
12600 }
12601
12602
12603 \f
12604 /***********************************************************
12605 *
12606 *     Func : cmUnpkTfuSubbandDlCqiInfo
12607 *
12608 *
12609 *     Desc : This structure is used to convey the subbannd CQI reported.
12610 *
12611 *
12612 *     Ret  : S16
12613 *
12614 *     Notes:
12615 *
12616 *     File  : 
12617 *
12618 **********************************************************/
12619 #ifdef ANSI
12620 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo
12621 (
12622 TfuSubbandDlCqiInfo *param,
12623 Buffer *mBuf
12624 )
12625 #else
12626 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo(param, mBuf)
12627 TfuSubbandDlCqiInfo *param;
12628 Buffer *mBuf;
12629 #endif
12630 {
12631
12632    S32 i;
12633    TRC3(cmUnpkTfuSubbandDlCqiInfo)
12634
12635    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
12636    for (i=0; i<TFU_MAX_TB; i++) {
12637       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
12638    }
12639    RETVALUE(ROK);
12640 }
12641
12642 /***********************************************************
12643 *
12644 *     Func : cmPkTfuDlCqiPuschInfo
12645 *
12646 *
12647 *     Desc : This structure conveys explicitly the PMI information in case
12648  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12649 *
12650 *
12651 *     Ret  : S16
12652 *
12653 *     Notes:
12654 *
12655 *     File  : 
12656 *
12657 **********************************************************/
12658 #ifdef ANSI
12659 PUBLIC S16 cmPkTfuDlCqiPuschInfo
12660 (
12661 TfuDlCqiPuschInfo *param,
12662 Buffer *mBuf
12663 )
12664 #else
12665 PUBLIC S16 cmPkTfuDlCqiPuschInfo(param, mBuf)
12666 TfuDlCqiPuschInfo *param;
12667 Buffer *mBuf;
12668 #endif
12669 {
12670
12671    TRC3(cmPkTfuDlCqiPuschInfo)
12672
12673       switch(param->mode) {
12674          case TFU_PUSCH_CQI_MODE_31:
12675             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12676             break;
12677          case TFU_PUSCH_CQI_MODE_22:
12678             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12679             break;
12680          case TFU_PUSCH_CQI_MODE_12:
12681             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12682             break;
12683          default :
12684             RETVALUE(RFAILED);
12685       }
12686    CMCHKPK(SPkU32, param->mode, mBuf);
12687    RETVALUE(ROK);
12688 }
12689
12690
12691 \f
12692 /***********************************************************
12693 *
12694 *     Func : cmUnpkTfuDlCqiPuschInfo
12695 *
12696 *
12697 *     Desc : This structure conveys explicitly the PMI information in case
12698  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12699 *
12700 *
12701 *     Ret  : S16
12702 *
12703 *     Notes:
12704 *
12705 *     File  : 
12706 *
12707 **********************************************************/
12708 #ifdef ANSI
12709 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo
12710 (
12711 TfuDlCqiPuschInfo *param,
12712 Buffer *mBuf
12713 )
12714 #else
12715 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo(param, mBuf)
12716 TfuDlCqiPuschInfo *param;
12717 Buffer *mBuf;
12718 #endif
12719 {
12720
12721    TRC3(cmUnpkTfuDlCqiPuschInfo)
12722
12723    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
12724       switch(param->mode) {
12725          case TFU_PUSCH_CQI_MODE_12:
12726             CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12727             break;
12728          case TFU_PUSCH_CQI_MODE_22:
12729             CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12730             break;
12731          case TFU_PUSCH_CQI_MODE_31:
12732             CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12733             break;
12734          default :
12735             RETVALUE(RFAILED);
12736       }
12737    RETVALUE(ROK);
12738 }
12739 \f
12740 /***********************************************************
12741 *
12742 *     Func : cmPkTfuDoaRpt
12743 *
12744 *
12745 *     Desc : This structure contains the DOA estimated by the physical layer. 
12746   * @details DOA for a given UE.
12747 *
12748 *
12749 *     Ret  : S16
12750 *
12751 *     Notes:
12752 *
12753 *     File  : 
12754 *
12755 **********************************************************/
12756 #ifdef ANSI
12757 PUBLIC S16 cmPkTfuDoaRpt
12758 (
12759 TfuDoaRpt *param,
12760 Buffer *mBuf
12761 )
12762 #else
12763 PUBLIC S16 cmPkTfuDoaRpt(param, mBuf)
12764 TfuDoaRpt *param;
12765 Buffer *mBuf;
12766 #endif
12767 {
12768
12769    TRC3(cmPkTfuDoaRpt)
12770
12771    CMCHKPK(SPkU32, param->doa, mBuf);
12772    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12773    RETVALUE(ROK);
12774 }
12775
12776
12777 \f
12778 /***********************************************************
12779 *
12780 *     Func : cmUnpkTfuDoaRpt
12781 *
12782 *
12783 *     Desc : This structure contains the DOA estimated by the physical layer. 
12784   * @details DOA for a given UE.
12785 *
12786 *
12787 *     Ret  : S16
12788 *
12789 *     Notes:
12790 *
12791 *     File  : 
12792 *
12793 **********************************************************/
12794 #ifdef ANSI
12795 PUBLIC S16 cmUnpkTfuDoaRpt
12796 (
12797 TfuDoaRpt *param,
12798 Buffer *mBuf
12799 )
12800 #else
12801 PUBLIC S16 cmUnpkTfuDoaRpt(param, mBuf)
12802 TfuDoaRpt *param;
12803 Buffer *mBuf;
12804 #endif
12805 {
12806
12807    TRC3(cmUnpkTfuDoaRpt)
12808
12809    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12810    CMCHKUNPK(SUnpkU32, &param->doa, mBuf);
12811    RETVALUE(ROK);
12812 }
12813
12814
12815 \f
12816 /***********************************************************
12817 *
12818 *     Func : cmPkTfuDoaIndInfo
12819 *
12820 *
12821 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
12822  * @details DOA is calculated by the physical layer, and this
12823  * information is provided to the scheduler. 
12824  * This data structure clubs together the DOAs for all the UEs
12825  * calculated by PHY in this subframe.
12826 *
12827 *
12828 *     Ret  : S16
12829 *
12830 *     Notes:
12831 *
12832 *     File  : 
12833 *
12834 **********************************************************/
12835 #ifdef ANSI
12836 PUBLIC S16 cmPkTfuDoaIndInfo
12837 (
12838 TfuDoaIndInfo *param,
12839 Buffer *mBuf
12840 )
12841 #else
12842 PUBLIC S16 cmPkTfuDoaIndInfo(param, mBuf)
12843 TfuDoaIndInfo *param;
12844 Buffer *mBuf;
12845 #endif
12846 {
12847
12848    CmLList *node;
12849    U32 count;
12850    TfuDoaRpt *tfuDoaRpt;
12851    TRC3(cmPkTfuDoaIndInfo)
12852
12853    count = param->doaRpt.count;
12854    node = param->doaRpt.last;
12855    while (node) {
12856       tfuDoaRpt = (TfuDoaRpt *)node->node;
12857       node=node->prev;
12858       CMCHKPK(cmPkTfuDoaRpt, tfuDoaRpt, mBuf);
12859       cmLListDelFrm(&param->doaRpt, &tfuDoaRpt->lnk);
12860       tfuDoaRpt->lnk.node = (PTR)NULLP;
12861    }
12862    CMCHKPK(SPkU32, count, mBuf);
12863    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12864    RETVALUE(ROK);
12865 }
12866
12867
12868 \f
12869 /***********************************************************
12870 *
12871 *     Func : cmUnpkTfuDoaIndInfo
12872 *
12873 *
12874 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
12875  * @details DOA is calculated by the physical layer, and this
12876  * information is provided to the scheduler. 
12877  * This data structure clubs together the DOAs for all the UEs
12878  * calculated by PHY in this subframe.
12879 *
12880 *
12881 *     Ret  : S16
12882 *
12883 *     Notes:
12884 *
12885 *     File  : 
12886 *
12887 **********************************************************/
12888 #ifdef ANSI
12889 PUBLIC S16 cmUnpkTfuDoaIndInfo
12890 (
12891 TfuDoaIndInfo *param,
12892 Ptr memCp,
12893 Buffer *mBuf
12894 )
12895 #else
12896 PUBLIC S16 cmUnpkTfuDoaIndInfo(param, memCp, mBuf)
12897 TfuDoaIndInfo *param;
12898 Ptr memCp;
12899 Buffer *mBuf;
12900 #endif
12901 {
12902
12903    U32 count, loopCnt;
12904    TfuDoaRpt *tfuDoaRpt;
12905    TRC3(cmUnpkTfuDoaIndInfo)
12906
12907    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12908    cmLListInit(&param->doaRpt);
12909    CMCHKUNPK(SUnpkU32, &count, mBuf);
12910    for (loopCnt=0; loopCnt<count; loopCnt++) {
12911       cmGetMem((Ptr)memCp, sizeof(*tfuDoaRpt), (Ptr *)&tfuDoaRpt);
12912       CMCHKUNPK(cmUnpkTfuDoaRpt, tfuDoaRpt, mBuf);
12913       cmLListAdd2Tail(&param->doaRpt, &tfuDoaRpt->lnk);
12914       tfuDoaRpt->lnk.node = (PTR)tfuDoaRpt;
12915    }
12916    RETVALUE(ROK);
12917 }
12918
12919
12920 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
12921 #ifdef TFU_UPGRADE
12922
12923 \f
12924 /***********************************************************
12925 *
12926 *     Func : cmPkTfuSrsRpt
12927 *
12928 *
12929 *     Desc : This structure conveys the Uplink SRS indication of a UE.
12930  * @details Uplink SRS from each UE is received by the physical layer, and this
12931  * information is provided to the scheduler.
12932 *
12933 *
12934 *     Ret  : S16
12935 *
12936 *     Notes:
12937 *
12938 *     File  : 
12939 *
12940 **********************************************************/
12941 #ifdef ANSI
12942 PUBLIC S16 cmPkTfuSrsRpt
12943 (
12944 TfuSrsRpt *param,
12945 Buffer *mBuf
12946 )
12947 #else
12948 PUBLIC S16 cmPkTfuSrsRpt(param, mBuf)
12949 TfuSrsRpt *param;
12950 Buffer *mBuf;
12951 #endif
12952 {
12953
12954    S32 i;
12955    TRC3(cmPkTfuSrsRpt)
12956
12957    CMCHKPK(SPkU8, param->wideCqi, mBuf);
12958    CMCHKPK(SPkU8, param->wideCqiPres, mBuf);
12959    for (i=TFU_MAX_UL_RB-1; i >= 0; i--) {
12960       CMCHKPK(SPkU8, param->snr[i], mBuf);
12961    }
12962    CMCHKPK(SPkU8, param->rbStart, mBuf);
12963    CMCHKPK(SPkU8, param->numRbs, mBuf);
12964    CMCHKPK(SPkU16, param->ta, mBuf);
12965    CMCHKPK(SPkU16, param->dopEst, mBuf);
12966    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
12967    RETVALUE(ROK);
12968 }
12969
12970
12971 \f
12972 /***********************************************************
12973 *
12974 *     Func : cmUnpkTfuSrsRpt
12975 *
12976 *
12977 *     Desc : This structure conveys the Uplink SRS indication of a UE.
12978  * @details Uplink SRS from each UE is received by the physical layer, and this
12979  * information is provided to the scheduler.
12980 *
12981 *
12982 *     Ret  : S16
12983 *
12984 *     Notes:
12985 *
12986 *     File  : 
12987 *
12988 **********************************************************/
12989 #ifdef ANSI
12990 PUBLIC S16 cmUnpkTfuSrsRpt
12991 (
12992 TfuSrsRpt *param,
12993 Buffer *mBuf
12994 )
12995 #else
12996 PUBLIC S16 cmUnpkTfuSrsRpt(param, mBuf)
12997 TfuSrsRpt *param;
12998 Buffer *mBuf;
12999 #endif
13000 {
13001
13002    S32 i;
13003    TRC3(cmUnpkTfuSrsRpt)
13004
13005    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
13006    CMCHKUNPK(SUnpkU16, &param->dopEst, mBuf);
13007    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
13008    CMCHKUNPK(SUnpkU8, &param->numRbs, mBuf);
13009    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
13010    for (i=0; i<TFU_MAX_UL_RB; i++) {
13011       CMCHKUNPK(SUnpkU8, &param->snr[i], mBuf);
13012    }
13013    CMCHKUNPK(SUnpkU8, &param->wideCqiPres, mBuf);
13014    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
13015    RETVALUE(ROK);
13016 }
13017
13018
13019 \f
13020 /***********************************************************
13021 *
13022 *     Func : cmPkTfuSrsIndInfo
13023 *
13024 *
13025 *     Desc : This structure conveys the Uplink SRS indication.
13026  * @details Uplink SRS is received by the physical layer, and this
13027  * information is provided to the scheduler. 
13028  * This data structure clubs together the UL SRS indications of all the UEs 
13029  * in the subframe.
13030 *
13031 *
13032 *     Ret  : S16
13033 *
13034 *     Notes:
13035 *
13036 *     File  : 
13037 *
13038 **********************************************************/
13039 #ifdef ANSI
13040 PUBLIC S16 cmPkTfuSrsIndInfo
13041 (
13042 TfuSrsIndInfo *param,
13043 Buffer *mBuf
13044 )
13045 #else
13046 PUBLIC S16 cmPkTfuSrsIndInfo(param, mBuf)
13047 TfuSrsIndInfo *param;
13048 Buffer *mBuf;
13049 #endif
13050 {
13051
13052    CmLList *node;
13053    U32 count;
13054    TfuSrsRpt *tfuSrsRpt;
13055
13056    TRC3(cmPkTfuSrsIndInfo)
13057
13058    count = param->srsRpt.count;
13059    node = param->srsRpt.last;
13060    while (node) {
13061       tfuSrsRpt = (TfuSrsRpt *)node->node;
13062       node=node->prev;
13063       CMCHKPK(cmPkTfuSrsRpt, tfuSrsRpt, mBuf);
13064       cmLListDelFrm(&param->srsRpt, &tfuSrsRpt->lnk);
13065       tfuSrsRpt->lnk.node = (PTR)NULLP;
13066    }
13067    CMCHKPK(SPkU32, count, mBuf);
13068    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13069    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13070    RETVALUE(ROK);
13071 }
13072
13073
13074 \f
13075 /***********************************************************
13076 *
13077 *     Func : cmUnpkTfuSrsIndInfo
13078 *
13079 *
13080 *     Desc : This structure conveys the Uplink SRS indication.
13081  * @details Uplink SRS is received by the physical layer, and this
13082  * information is provided to the scheduler. 
13083  * This data structure clubs together the UL SRS indications of all the UEs 
13084  * in the subframe.
13085 *
13086 *
13087 *     Ret  : S16
13088 *
13089 *     Notes:
13090 *
13091 *     File  : 
13092 *
13093 **********************************************************/
13094 #ifdef ANSI
13095 PUBLIC S16 cmUnpkTfuSrsIndInfo
13096 (
13097 TfuSrsIndInfo *param,
13098 Ptr memCp,
13099 Buffer *mBuf
13100 )
13101 #else
13102 PUBLIC S16 cmUnpkTfuSrsIndInfo(param, memCp, mBuf)
13103 TfuSrsIndInfo *param;
13104 Ptr memCp;
13105 Buffer *mBuf;
13106 #endif
13107 {
13108
13109    U32 count, loopCnt;
13110    TfuSrsRpt *tfuSrsRpt;
13111
13112    TRC3(cmUnpkTfuSrsIndInfo)
13113
13114    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13115    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13116    cmLListInit(&param->srsRpt);
13117    CMCHKUNPK(SUnpkU32, &count, mBuf);
13118    for (loopCnt=0; loopCnt<count; loopCnt++) {
13119       cmGetMem((Ptr)memCp, sizeof(*tfuSrsRpt), (Ptr *)&tfuSrsRpt);
13120       CMCHKUNPK(cmUnpkTfuSrsRpt, tfuSrsRpt, mBuf);
13121       cmLListAdd2Tail(&param->srsRpt, &tfuSrsRpt->lnk);
13122       tfuSrsRpt->lnk.node = (PTR)tfuSrsRpt;
13123    }
13124    RETVALUE(ROK);
13125 }
13126
13127
13128 \f
13129 /***********************************************************
13130 *
13131 *     Func : cmPkTfuRawCqiRpt
13132 *
13133 *
13134 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13135  * as transmitted by the UE. 
13136  * @details These bits shall be interpretted by MAC to derive the following 
13137  * -# Wideband CQI
13138  * -# Subband CQI
13139  * -# PMI
13140  * -# RI
13141 *
13142 *
13143 *     Ret  : S16
13144 *
13145 *     Notes:
13146 *
13147 *     File  : 
13148 *
13149 **********************************************************/
13150 #ifdef ANSI
13151 PUBLIC S16 cmPkTfuRawCqiRpt
13152 (
13153 TfuRawCqiRpt *param,
13154 Buffer *mBuf
13155 )
13156 #else
13157 PUBLIC S16 cmPkTfuRawCqiRpt(param, mBuf)
13158 TfuRawCqiRpt *param;
13159 Buffer *mBuf;
13160 #endif
13161 {
13162
13163    TRC3(cmPkTfuRawCqiRpt)
13164 #ifdef TFU_5GTF
13165    CMCHKPK(SPkU32, param->uciPayload, mBuf);
13166 #else
13167    S32 i;
13168    for (i=CM_LTE_MAX_CELLS-1; i >= 0; i--) {
13169       CMCHKPK(SPkU8, param->ri[i], mBuf);
13170    }
13171    for (i=TFU_MAX_CQI_BYTES-1; i >= 0; i--) {
13172       CMCHKPK(SPkU8, param->cqiBits[i], mBuf);
13173    }
13174 #endif
13175    CMCHKPK(SPkU8, param->numBits, mBuf);
13176    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
13177    RETVALUE(ROK);
13178 }
13179
13180
13181 \f
13182 /***********************************************************
13183 *
13184 *     Func : cmUnpkTfuRawCqiRpt
13185 *
13186 *
13187 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13188  * as transmitted by the UE. 
13189  * @details These bits shall be interpretted by MAC to derive the following 
13190  * -# Wideband CQI
13191  * -# Subband CQI
13192  * -# PMI
13193  * -# RI
13194 *
13195 *
13196 *     Ret  : S16
13197 *
13198 *     Notes:
13199 *
13200 *     File  : 
13201 *
13202 **********************************************************/
13203 #ifdef ANSI
13204 PUBLIC S16 cmUnpkTfuRawCqiRpt
13205 (
13206 TfuRawCqiRpt *param,
13207 Buffer *mBuf
13208 )
13209 #else
13210 PUBLIC S16 cmUnpkTfuRawCqiRpt(param, mBuf)
13211 TfuRawCqiRpt *param;
13212 Buffer *mBuf;
13213 #endif
13214 {
13215
13216    TRC3(cmUnpkTfuRawCqiRpt)
13217
13218    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
13219    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
13220 #ifndef TFU_5GTF
13221    S32 i;
13222    for (i=0; i<TFU_MAX_CQI_BYTES; i++) {
13223       CMCHKUNPK(SUnpkU8, &param->cqiBits[i], mBuf);
13224    }
13225    for (i=0; i<CM_LTE_MAX_CELLS; i++) {
13226       CMCHKUNPK(SUnpkU8, &param->ri[i], mBuf);
13227    }
13228 #else
13229       CMCHKUNPK(SUnpkU32, &param->uciPayload, mBuf);
13230 #endif
13231    RETVALUE(ROK);
13232 }
13233
13234
13235 \f
13236 /***********************************************************
13237 *
13238 *     Func : cmPkTfuRawCqiIndInfo
13239 *
13240 *
13241 *     Desc : This structure contains the Raw CQI reports received for the
13242  * transmitting UEs in a single subframe. 
13243  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13244  * interpretation is upto the MAC layer.
13245 *
13246 *
13247 *     Ret  : S16
13248 *
13249 *     Notes:
13250 *
13251 *     File  : 
13252 *
13253 **********************************************************/
13254 #ifdef ANSI
13255 PUBLIC S16 cmPkTfuRawCqiIndInfo
13256 (
13257 TfuRawCqiIndInfo *param,
13258 Buffer *mBuf
13259 )
13260 #else
13261 PUBLIC S16 cmPkTfuRawCqiIndInfo(param, mBuf)
13262 TfuRawCqiIndInfo *param;
13263 Buffer *mBuf;
13264 #endif
13265 {
13266
13267    U32 count;
13268    TfuRawCqiRpt *tfuRawCqiRpt;
13269    CmLList *node;
13270
13271    TRC3(cmPkTfuRawCqiIndInfo)
13272
13273    count = param->rawCqiRpt.count;
13274    node = param->rawCqiRpt.last;
13275    while (node) {
13276       tfuRawCqiRpt = (TfuRawCqiRpt *)node->node;
13277       node=node->prev;
13278       CMCHKPK(cmPkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13279       cmLListDelFrm(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13280       tfuRawCqiRpt->lnk.node = (PTR)NULLP;
13281    }
13282    CMCHKPK(SPkU32, count, mBuf);
13283    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13284    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13285    RETVALUE(ROK);
13286 }
13287
13288
13289 \f
13290 /***********************************************************
13291 *
13292 *     Func : cmUnpkTfuRawCqiIndInfo
13293 *
13294 *
13295 *     Desc : This structure contains the Raw CQI reports received for the
13296  * transmitting UEs in a single subframe. 
13297  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13298  * interpretation is upto the MAC layer.
13299 *
13300 *
13301 *     Ret  : S16
13302 *
13303 *     Notes:
13304 *
13305 *     File  : 
13306 *
13307 **********************************************************/
13308 #ifdef ANSI
13309 PUBLIC S16 cmUnpkTfuRawCqiIndInfo
13310 (
13311 TfuRawCqiIndInfo *param,
13312 Ptr memCp,
13313 Buffer *mBuf
13314 )
13315 #else
13316 PUBLIC S16 cmUnpkTfuRawCqiIndInfo(param, memCp, mBuf)
13317 TfuRawCqiIndInfo *param;
13318 Ptr memCp;
13319 Buffer *mBuf;
13320 #endif
13321 {
13322
13323    U32 count, loopCnt;
13324    TfuRawCqiRpt *tfuRawCqiRpt;
13325
13326    TRC3(cmUnpkTfuRawCqiIndInfo)
13327
13328    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13329    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13330    cmLListInit(&param->rawCqiRpt);
13331    CMCHKUNPK(SUnpkU32, &count, mBuf);
13332    for (loopCnt=0; loopCnt<count; loopCnt++) {
13333       cmGetMem((Ptr)memCp, sizeof(*tfuRawCqiRpt), (Ptr *)&tfuRawCqiRpt);
13334       CMCHKUNPK(cmUnpkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13335       cmLListAdd2Tail(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13336       tfuRawCqiRpt->lnk.node = (PTR)tfuRawCqiRpt;
13337    }
13338    RETVALUE(ROK);
13339 }
13340
13341
13342 #ifdef TFU_TDD
13343
13344 #ifdef TFU_TDD
13345
13346 \f
13347 /***********************************************************
13348 *
13349 *     Func : cmPkTfuUePucchHqRecpInfo
13350 *
13351 *
13352 *     Desc : This structure is sent from scheduler to PHY in order to request the
13353  * reception of harq information on PUCCH.
13354 *
13355 *
13356 *     Ret  : S16
13357 *
13358 *     Notes:
13359 *
13360 *     File  : 
13361 *
13362 **********************************************************/
13363 #ifdef ANSI
13364 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13365 (
13366 TfuUePucchHqRecpInfo *param,
13367 Buffer *mBuf
13368 )
13369 #else
13370 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13371 TfuUePucchHqRecpInfo *param;
13372 Buffer *mBuf;
13373 #endif
13374 {
13375
13376    S32 i;
13377    TRC3(cmPkTfuUePucchHqRecpInfo)
13378
13379    CMCHKPK(SPkU8, param->a, mBuf);
13380    for (i=TFU_MAX_HQ_RES-1; i >= 0; i--) {
13381       CMCHKPK(SPkU16, param->hqRes[i], mBuf);
13382    }
13383    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13384    CMCHKPK(SPkU8, param->hqSz, mBuf);
13385    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13386    RETVALUE(ROK);
13387 }
13388
13389
13390 \f
13391 /***********************************************************
13392 *
13393 *     Func : cmUnpkTfuUePucchHqRecpInfo
13394 *
13395 *
13396 *     Desc : This structure is sent from scheduler to PHY in order to request the
13397  * reception of harq information on PUCCH.
13398 *
13399 *
13400 *     Ret  : S16
13401 *
13402 *     Notes:
13403 *
13404 *     File  : 
13405 *
13406 **********************************************************/
13407 #ifdef ANSI
13408 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13409 (
13410 TfuUePucchHqRecpInfo *param,
13411 Buffer *mBuf
13412 )
13413 #else
13414 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13415 TfuUePucchHqRecpInfo *param;
13416 Buffer *mBuf;
13417 #endif
13418 {
13419
13420    S32 i;
13421    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13422
13423    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13424    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13425    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13426    for (i=0; i<TFU_MAX_HQ_RES; i++) {
13427       CMCHKUNPK(SUnpkU16, &param->hqRes[i], mBuf);
13428    }
13429    CMCHKUNPK(SUnpkU8, &param->a, mBuf);
13430    RETVALUE(ROK);
13431 }
13432
13433
13434 #endif
13435
13436 #endif
13437
13438 #ifndef TFU_TDD  /* else of TFU_TDD */
13439
13440 #ifndef TFU_TDD  /* else of TFU_TDD */
13441
13442 \f
13443 /***********************************************************
13444 *
13445 *     Func : cmPkTfuUePucchHqRecpInfo
13446 *
13447 *
13448 *     Desc : This structure is sent from scheduler to PHY in order to request the
13449  * reception of harq information on PUCCH.
13450 *
13451 *
13452 *     Ret  : S16
13453 *
13454 *     Notes:
13455 *
13456 *     File  : 
13457 *
13458 **********************************************************/
13459 #ifdef ANSI
13460 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13461 (
13462 TfuUePucchHqRecpInfo *param,
13463 Buffer *mBuf
13464 )
13465 #else
13466 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13467 TfuUePucchHqRecpInfo *param;
13468 Buffer *mBuf;
13469 #endif
13470 {
13471
13472    TRC3(cmPkTfuUePucchHqRecpInfo)
13473 #ifdef LTE_ADV
13474    S32 idx;
13475    for (idx=(TFU_MAX_HQ_RES-1); idx >= 0; idx--) {
13476       CMCHKPK(SPkU16, param->hqRes[idx], mBuf);
13477    }
13478 #else
13479    CMCHKPK(SPkU16, param->hqRes[0], mBuf);
13480 #endif
13481    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13482    CMCHKPK(SPkU8, param->hqSz, mBuf);
13483    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13484
13485    RETVALUE(ROK);
13486 }
13487
13488
13489 \f
13490 /***********************************************************
13491 *
13492 *     Func : cmUnpkTfuUePucchHqRecpInfo
13493 *
13494 *
13495 *     Desc : This structure is sent from scheduler to PHY in order to request the
13496  * reception of harq information on PUCCH.
13497 *
13498 *
13499 *     Ret  : S16
13500 *
13501 *     Notes:
13502 *
13503 *     File  : 
13504 *
13505 **********************************************************/
13506 #ifdef ANSI
13507 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13508 (
13509 TfuUePucchHqRecpInfo *param,
13510 Buffer *mBuf
13511 )
13512 #else
13513 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13514 TfuUePucchHqRecpInfo *param;
13515 Buffer *mBuf;
13516 #endif
13517 {
13518    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13519
13520    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13521    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13522    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13523 #ifdef LTE_ADV
13524    S32 idx;
13525    for (idx=0; idx<TFU_MAX_HQ_RES; idx++) {
13526       CMCHKUNPK(SUnpkU16, &param->hqRes[idx], mBuf);
13527    }
13528 #else
13529    CMCHKUNPK(SUnpkU16, &param->hqRes[0], mBuf);
13530 #endif
13531
13532    RETVALUE(ROK);
13533 }
13534
13535
13536 #endif
13537
13538 #endif
13539
13540 \f
13541 /***********************************************************
13542 *
13543 *     Func : cmPkTfuUePucchSrRecpInfo
13544 *
13545 *
13546 *     Desc : This structure is sent from scheduler to PHY in order to request the
13547  * reception of SR information on PUCCH.
13548 *
13549 *
13550 *     Ret  : S16
13551 *
13552 *     Notes:
13553 *
13554 *     File  : 
13555 *
13556 **********************************************************/
13557 #ifdef ANSI
13558 PUBLIC S16 cmPkTfuUePucchSrRecpInfo
13559 (
13560 TfuUePucchSrRecpInfo *param,
13561 Buffer *mBuf
13562 )
13563 #else
13564 PUBLIC S16 cmPkTfuUePucchSrRecpInfo(param, mBuf)
13565 TfuUePucchSrRecpInfo *param;
13566 Buffer *mBuf;
13567 #endif
13568 {
13569
13570    TRC3(cmPkTfuUePucchSrRecpInfo)
13571
13572    CMCHKPK(SPkU16, param->n1PucchIdx, mBuf);
13573    RETVALUE(ROK);
13574 }
13575
13576
13577 \f
13578 /***********************************************************
13579 *
13580 *     Func : cmUnpkTfuUePucchSrRecpInfo
13581 *
13582 *
13583 *     Desc : This structure is sent from scheduler to PHY in order to request the
13584  * reception of SR information on PUCCH.
13585 *
13586 *
13587 *     Ret  : S16
13588 *
13589 *     Notes:
13590 *
13591 *     File  : 
13592 *
13593 **********************************************************/
13594 #ifdef ANSI
13595 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo
13596 (
13597 TfuUePucchSrRecpInfo *param,
13598 Buffer *mBuf
13599 )
13600 #else
13601 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo(param, mBuf)
13602 TfuUePucchSrRecpInfo *param;
13603 Buffer *mBuf;
13604 #endif
13605 {
13606
13607    TRC3(cmUnpkTfuUePucchSrRecpInfo)
13608
13609    CMCHKUNPK(SUnpkU16, &param->n1PucchIdx, mBuf);
13610    RETVALUE(ROK);
13611 }
13612
13613
13614 \f
13615 /***********************************************************
13616 *
13617 *     Func : cmPkTfuUePucchCqiRecpInfo
13618 *
13619 *
13620 *     Desc : This structure is sent from scheduler to PHY in order to request the
13621  * reception of CQI information on PUCCH.
13622 *
13623 *
13624 *     Ret  : S16
13625 *
13626 *     Notes:
13627 *
13628 *     File  : 
13629 *
13630 **********************************************************/
13631 #ifdef ANSI
13632 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo
13633 (
13634 TfuUePucchCqiRecpInfo *param,
13635 Buffer *mBuf
13636 )
13637 #else
13638 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo(param, mBuf)
13639 TfuUePucchCqiRecpInfo *param;
13640 Buffer *mBuf;
13641 #endif
13642 {
13643
13644    TRC3(cmPkTfuUePucchCqiRecpInfo)
13645
13646    CMCHKPK(SPkU8, param->cqiPmiSz, mBuf);
13647    CMCHKPK(SPkU16, param->n2PucchIdx, mBuf);
13648    RETVALUE(ROK);
13649 }
13650
13651
13652 \f
13653 /***********************************************************
13654 *
13655 *     Func : cmUnpkTfuUePucchCqiRecpInfo
13656 *
13657 *
13658 *     Desc : This structure is sent from scheduler to PHY in order to request the
13659  * reception of CQI information on PUCCH.
13660 *
13661 *
13662 *     Ret  : S16
13663 *
13664 *     Notes:
13665 *
13666 *     File  : 
13667 *
13668 **********************************************************/
13669 #ifdef ANSI
13670 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo
13671 (
13672 TfuUePucchCqiRecpInfo *param,
13673 Buffer *mBuf
13674 )
13675 #else
13676 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo(param, mBuf)
13677 TfuUePucchCqiRecpInfo *param;
13678 Buffer *mBuf;
13679 #endif
13680 {
13681
13682    TRC3(cmUnpkTfuUePucchCqiRecpInfo)
13683
13684    CMCHKUNPK(SUnpkU16, &param->n2PucchIdx, mBuf);
13685    CMCHKUNPK(SUnpkU8, &param->cqiPmiSz, mBuf);
13686    RETVALUE(ROK);
13687 }
13688
13689
13690 \f
13691 /***********************************************************
13692 *
13693 *     Func : cmPkTfuUePucchSrsRecpInfo
13694 *
13695 *
13696 *     Desc : This structure is sent from scheduler to PHY in order to request the
13697  * reception of SRS information on PUCCH.
13698 *
13699 *
13700 *     Ret  : S16
13701 *
13702 *     Notes:
13703 *
13704 *     File  : 
13705 *
13706 **********************************************************/
13707 #ifdef ANSI
13708 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo
13709 (
13710 TfuUePucchSrsRecpInfo *param,
13711 Buffer *mBuf
13712 )
13713 #else
13714 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo(param, mBuf)
13715 TfuUePucchSrsRecpInfo *param;
13716 Buffer *mBuf;
13717 #endif
13718 {
13719
13720    TRC3(cmPkTfuUePucchSrsRecpInfo)
13721
13722    CMCHKPK(SPkU32, param->srsCyclicShft, mBuf);
13723    CMCHKPK(SPkU16, param->srsCfgIdx, mBuf);
13724    CMCHKPK(SPkU8, param->transComb, mBuf);
13725    CMCHKPK(SPkU32, param->srsHopBw, mBuf);
13726    CMCHKPK(SPkU8, param->nRrc, mBuf);
13727    CMCHKPK(SPkU32, param->srsBw, mBuf);
13728    RETVALUE(ROK);
13729 }
13730
13731 #ifdef TFU_5GTF
13732 #ifdef ANSI
13733 PUBLIC S16 cmPkTfuUePucchUciRecpInfo
13734 (
13735 TfuUePucchUciRecpInfo *param,
13736 Buffer *mBuf
13737 )
13738 #else
13739 PUBLIC S16 cmPkTfuUePucchUciRecpInfo(param, mBuf)
13740 TfuUePucchUciRecpInfo *param;
13741 Buffer *mBuf;
13742 #endif
13743 {
13744
13745    TRC3(cmPkTfuUePucchUciRecpInfo)
13746
13747    CMCHKPK(SPkU8, param->SCID, mBuf);
13748    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
13749    CMCHKPK(SPkU8, param->numBits, mBuf);
13750    RETVALUE(ROK);
13751 }
13752 #endif
13753
13754 \f
13755 /***********************************************************
13756 *
13757 *     Func : cmUnpkTfuUePucchSrsRecpInfo
13758 *
13759 *
13760 *     Desc : This structure is sent from scheduler to PHY in order to request the
13761  * reception of SRS information on PUCCH.
13762 *
13763 *
13764 *     Ret  : S16
13765 *
13766 *     Notes:
13767 *
13768 *     File  : 
13769 *
13770 **********************************************************/
13771 #ifdef ANSI
13772 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo
13773 (
13774 TfuUePucchSrsRecpInfo *param,
13775 Buffer *mBuf
13776 )
13777 #else
13778 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo(param, mBuf)
13779 TfuUePucchSrsRecpInfo *param;
13780 Buffer *mBuf;
13781 #endif
13782 {
13783
13784    TRC3(cmUnpkTfuUePucchSrsRecpInfo)
13785
13786    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsBw, mBuf);
13787    CMCHKUNPK(SUnpkU8, &param->nRrc, mBuf);
13788    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsHopBw, mBuf);
13789    CMCHKUNPK(SUnpkU8, &param->transComb, mBuf);
13790    CMCHKUNPK(SUnpkU16, &param->srsCfgIdx, mBuf);
13791    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsCyclicShft, mBuf);
13792    RETVALUE(ROK);
13793 }
13794
13795 #ifdef TFU_5GTF 
13796 /***********************************************************
13797 *
13798 *     Func : cmPkTfuUePucchBsiBriRecpInfo
13799 *
13800 *
13801 *     Desc : This structure is sent from scheduler to PHY in order to request the
13802  * reception of BSI_BRI information on PUCCH.
13803 *
13804 *
13805 *     Ret  : S16
13806 *
13807 *     Notes:
13808 *
13809 *     File  : 
13810 *
13811 **********************************************************/
13812 #ifdef ANSI
13813 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo
13814 (
13815 TfuUePucchBsiBriRecpInfo *param,
13816 Buffer *mBuf
13817 )
13818 #else
13819 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo(param, mBuf)
13820 TfuUePucchBsiBriRecpInfo *param;
13821 Buffer *mBuf;
13822 #endif
13823 {
13824
13825    TRC3(cmPkTfuUePucchBsiBriRecpInfo)
13826
13827    CMCHKPK(SPkU8, param->briRpt, mBuf);
13828    CMCHKPK(SPkU8, param->bsiRpt, mBuf);
13829    CMCHKPK(SPkU8, param->SCID, mBuf);
13830    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
13831    CMCHKPK(SPkU8, param->puschFlag, mBuf);
13832    RETVALUE(ROK);
13833 }
13834
13835 /***********************************************************
13836 *
13837 *     Func : cmUnpkTfuUePucchBsiBriRecpInfo
13838 *
13839 *
13840 *     Desc : This structure is sent from scheduler to PHY in order to request the
13841  * reception of BSI_BRI information on PUCCH.
13842 *
13843 *
13844 *     Ret  : S16
13845 *
13846 *     Notes:
13847 *
13848 *     File  : 
13849 *
13850 **********************************************************/
13851 #ifdef ANSI
13852 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo
13853 (
13854 TfuUePucchBsiBriRecpInfo *param,
13855 Buffer *mBuf
13856 )
13857 #else
13858 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo(param, mBuf)
13859 TfuUePucchBsiBriRecpInfo *param;
13860 Buffer *mBuf;
13861 #endif
13862 {
13863
13864    TRC3(cmUnpkTfuUePucchBsiBriRecpInfo)
13865
13866    CMCHKUNPK(SUnpkU8, &param->puschFlag, mBuf);
13867    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
13868    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
13869    CMCHKUNPK(SUnpkU8, &param->bsiRpt, mBuf);
13870    CMCHKUNPK(SUnpkU8, &param->briRpt, mBuf);
13871    RETVALUE(ROK);
13872 }
13873 #endif
13874
13875 #ifdef TFU_5GTF
13876 #ifdef ANSI
13877 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo
13878 (
13879 TfuUePucchUciRecpInfo *param,
13880 Buffer *mBuf
13881 )
13882 #else
13883 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo(param, mBuf)
13884 TfuUePucchUciRecpInfo *param;
13885 Buffer *mBuf;
13886 #endif
13887 {
13888
13889    TRC3(cmUnpkTfuUePucchUciRecpInfo)
13890
13891    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
13892    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
13893    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
13894
13895    RETVALUE(ROK);
13896 }
13897 #endif
13898
13899 \f
13900 /***********************************************************
13901 *
13902 *     Func : cmPkTfuUePucchRecpReq
13903 *
13904 *
13905 *     Desc : This structure is sent from scheduler to PHY in order to request the
13906   * reception of UCI on PUCCH. This may contain the following:
13907   * -# HARQ
13908   * -# SR
13909   * -# SRS
13910   * -# CQI
13911   * -# HARQ+SR
13912   * -# HARQ+SRS
13913   * -# HARQ+CQI
13914   * -# HARQ+SR+SRS
13915   * -# HARQ+SR+CQI
13916   * -# SR+SRS
13917   * -# SR+CQI
13918 *
13919 *
13920 *     Ret  : S16
13921 *
13922 *     Notes:
13923 *
13924 *     File  : 
13925 *
13926 **********************************************************/
13927 #ifdef ANSI
13928 PUBLIC S16 cmPkTfuUePucchRecpReq
13929 (
13930 TfuUePucchRecpReq *param,
13931 Buffer *mBuf
13932 )
13933 #else
13934 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
13935 TfuUePucchRecpReq *param;
13936 Buffer *mBuf;
13937 #endif
13938 {
13939
13940    TRC3(cmPkTfuUePucchRecpReq)
13941
13942 #ifdef TFU_5GTF
13943    CMCHKPK(cmPkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
13944    CMCHKPK(cmPkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
13945 #endif /* TFU_5GTF */
13946    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
13947    CMCHKPK(cmPkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
13948    CMCHKPK(cmPkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
13949    CMCHKPK(cmPkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
13950    CMCHKPK(SPkU32, param->uciInfo, mBuf);
13951    RETVALUE(ROK);
13952 }
13953
13954
13955 \f
13956 /***********************************************************
13957 *
13958 *     Func : cmUnpkTfuUePucchRecpReq
13959 *
13960 *
13961 *     Desc : This structure is sent from scheduler to PHY in order to request the
13962   * reception of UCI on PUCCH. This may contain the following:
13963   * -# HARQ
13964   * -# SR
13965   * -# SRS
13966   * -# CQI
13967   * -# HARQ+SR
13968   * -# HARQ+SRS
13969   * -# HARQ+CQI
13970   * -# HARQ+SR+SRS
13971   * -# HARQ+SR+CQI
13972   * -# SR+SRS
13973   * -# SR+CQI
13974 *
13975 *
13976 *     Ret  : S16
13977 *
13978 *     Notes:
13979 *
13980 *     File  : 
13981 *
13982 **********************************************************/
13983 #ifdef ANSI
13984 PUBLIC S16 cmUnpkTfuUePucchRecpReq
13985 (
13986 TfuUePucchRecpReq *param,
13987 Buffer *mBuf
13988 )
13989 #else
13990 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
13991 TfuUePucchRecpReq *param;
13992 Buffer *mBuf;
13993 #endif
13994 {
13995
13996    TRC3(cmUnpkTfuUePucchRecpReq)
13997
13998    CMCHKUNPK(SUnpkU32, (U32 *)&param->uciInfo, mBuf);
13999    CMCHKUNPK(cmUnpkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14000    CMCHKUNPK(cmUnpkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14001    CMCHKUNPK(cmUnpkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14002    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14003 #ifdef TFU_5GTF
14004    CMCHKUNPK(cmUnpkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14005    CMCHKUNPK(cmUnpkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14006 #endif /* TFU_5GTF */
14007    RETVALUE(ROK);
14008 }
14009
14010
14011 \f
14012 /***********************************************************
14013 *
14014 *     Func : cmPkTfuUeUlSchRecpInfo
14015 *
14016 *
14017 *     Desc : This structure is sent from scheduler to PHY in order to request the
14018   * reception of UEs data on ULSCH.
14019 *
14020 *
14021 *     Ret  : S16
14022 *
14023 *     Notes:
14024 *
14025 *     File  : 
14026 *
14027 **********************************************************/
14028 #ifdef ANSI
14029 PUBLIC S16 cmPkTfuUeUlSchRecpInfo
14030 (
14031 TfuUeUlSchRecpInfo *param,
14032 Buffer *mBuf
14033 )
14034 #else
14035 PUBLIC S16 cmPkTfuUeUlSchRecpInfo(param, mBuf)
14036 TfuUeUlSchRecpInfo *param;
14037 Buffer *mBuf;
14038 #endif
14039 {
14040
14041    TRC3(cmPkTfuUeUlSchRecpInfo)
14042 #ifdef TFU_5GTF
14043    CMCHKPK(SPkU8, param->beamIndex, mBuf);
14044    CMCHKPK(SPkU8, param->uciWoTBFlag, mBuf);
14045    CMCHKPK(SPkU8, param->PMI, mBuf);
14046    CMCHKPK(SPkU8, param->SCID, mBuf);
14047    CMCHKPK(SPkU8, param->nAntPortLayer, mBuf);
14048    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
14049    CMCHKPK(SPkU8, param->numRbg, mBuf);
14050    CMCHKPK(SPkU8, param->rbgStart, mBuf);
14051 #endif
14052    CMCHKPK(SPkU8, param->mcs, mBuf);
14053    CMCHKPK(SPkU8, param->nSrs, mBuf);
14054    CMCHKPK(SPkU8, param->crntTxNb, mBuf);
14055    CMCHKPK(SPkU8, param->txMode, mBuf);
14056    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14057    CMCHKPK(SPkU8, param->rv, mBuf);
14058    CMCHKPK(SPkU8, param->ndi, mBuf);
14059    CMCHKPK(SPkU8, param->isRtx, mBuf);
14060    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
14061    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14062    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14063    CMCHKPK(SPkU32, param->modType, mBuf);
14064    CMCHKPK(SPkU8, param->numRb, mBuf);
14065    CMCHKPK(SPkU8, param->rbStart, mBuf);
14066    CMCHKPK(SPkU16, param->size, mBuf);
14067
14068    RETVALUE(ROK);
14069 }
14070
14071
14072 \f
14073 /***********************************************************
14074 *
14075 *     Func : cmUnpkTfuUeUlSchRecpInfo
14076 *
14077 *
14078 *     Desc : This structure is sent from scheduler to PHY in order to request the
14079   * reception of UEs data on ULSCH.
14080 *
14081 *
14082 *     Ret  : S16
14083 *
14084 *     Notes:
14085 *
14086 *     File  : 
14087 *
14088 **********************************************************/
14089 #ifdef ANSI
14090 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo
14091 (
14092 TfuUeUlSchRecpInfo *param,
14093 Buffer *mBuf
14094 )
14095 #else
14096 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo(param, mBuf)
14097 TfuUeUlSchRecpInfo *param;
14098 Buffer *mBuf;
14099 #endif
14100 {
14101
14102    TRC3(cmUnpkTfuUeUlSchRecpInfo)
14103
14104    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14105    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14106    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14107    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14108    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14109    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14110    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
14111    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14112    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14113    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14114    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14115    CMCHKUNPK(SUnpkU8, &param->txMode, mBuf);
14116    CMCHKUNPK(SUnpkU8, &param->crntTxNb, mBuf);
14117    CMCHKUNPK(SUnpkU8, &param->nSrs, mBuf);
14118    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14119 #ifdef TFU_5GTF 
14120    CMCHKUNPK(SUnpkU8, &param->rbgStart, mBuf);
14121    CMCHKUNPK(SUnpkU8, &param->numRbg, mBuf);
14122    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
14123    CMCHKUNPK(SUnpkU8, &param->nAntPortLayer, mBuf);
14124    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14125    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
14126    CMCHKUNPK(SUnpkU8, &param->uciWoTBFlag, mBuf);
14127    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
14128 #endif
14129    RETVALUE(ROK);
14130 }
14131
14132
14133 \f
14134 /***********************************************************
14135 *
14136 *     Func : cmPkTfuUePuschCqiRecpInfo
14137 *
14138 *
14139 *     Desc : This structure is sent from scheduler to PHY in order to request the
14140   * reception of CQI_RI info on PUSCH.
14141 *
14142 *
14143 *     Ret  : S16
14144 *
14145 *     Notes:
14146 *
14147 *     File  : 
14148 *
14149 **********************************************************/
14150 #ifdef ANSI
14151 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo
14152 (
14153 TfuUePuschCqiRecpInfo *param,
14154 Buffer *mBuf
14155 )
14156 #else
14157 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo(param, mBuf)
14158 TfuUePuschCqiRecpInfo *param;
14159 Buffer *mBuf;
14160 #endif
14161 {
14162
14163    U32 idx = 0;
14164    TRC3(cmPkTfuUePuschCqiRecpInfo)
14165
14166    CMCHKPK(SPkU8, param->riBetaOff, mBuf);
14167    CMCHKPK(SPkU8, param->cqiBetaOff, mBuf);
14168    for (idx = 0; idx < param->cCNum; idx++)
14169    {
14170       CMCHKPK(cmPkTknU8, &param->riSz[idx], mBuf);
14171       CMCHKPK(SPkU8, param->cqiPmiSzRn1[idx], mBuf);
14172       CMCHKPK(SPkU8, param->cqiPmiSzR1[idx], mBuf);
14173    }
14174    CMCHKPK(SPkU8, param->cCNum, mBuf);
14175    CMCHKPK(SPkU8, param->reportType, mBuf);
14176    RETVALUE(ROK);
14177 }
14178
14179
14180 \f
14181 /***********************************************************
14182 *
14183 *     Func : cmUnpkTfuUePuschCqiRecpInfo
14184 *
14185 *
14186 *     Desc : This structure is sent from scheduler to PHY in order to request the
14187   * reception of CQI_RI info on PUSCH.
14188 *
14189 *
14190 *     Ret  : S16
14191 *
14192 *     Notes:
14193 *
14194 *     File  : 
14195 *
14196 **********************************************************/
14197 #ifdef ANSI
14198 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo
14199 (
14200 TfuUePuschCqiRecpInfo *param,
14201 Buffer *mBuf
14202 )
14203 #else
14204 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo(param, mBuf)
14205 TfuUePuschCqiRecpInfo *param;
14206 Buffer *mBuf;
14207 #endif
14208 {
14209
14210    U32 idx;
14211    TRC3(cmUnpkTfuUePuschCqiRecpInfo)
14212
14213    CMCHKUNPK(SUnpkU8, &param->reportType, mBuf);
14214    CMCHKUNPK(SUnpkU8, &param->cCNum, mBuf);
14215    for (idx = param->cCNum; idx > 0; idx--)
14216    {
14217       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzR1[idx-1], mBuf);
14218       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzRn1[idx-1], mBuf);
14219       CMCHKUNPK(cmUnpkTknU8, &param->riSz[idx-1], mBuf);
14220    }
14221    CMCHKUNPK(SUnpkU8, &param->cqiBetaOff, mBuf);
14222    CMCHKUNPK(SUnpkU8, &param->riBetaOff, mBuf);
14223    RETVALUE(ROK);
14224 }
14225
14226
14227 \f
14228 /***********************************************************
14229 *
14230 *     Func : cmPkTfuUePuschHqRecpInfo
14231 *
14232 *
14233 *     Desc : This structure is sent from scheduler to PHY in order to request the
14234   * reception of Harq info on PUSCH.
14235 *
14236 *
14237 *     Ret  : S16
14238 *
14239 *     Notes:
14240 *
14241 *     File  : 
14242 *
14243 **********************************************************/
14244 #ifdef ANSI
14245 PUBLIC S16 cmPkTfuUePuschHqRecpInfo
14246 (
14247 TfuUePuschHqRecpInfo *param,
14248 Buffer *mBuf
14249 )
14250 #else
14251 PUBLIC S16 cmPkTfuUePuschHqRecpInfo(param, mBuf)
14252 TfuUePuschHqRecpInfo *param;
14253 Buffer *mBuf;
14254 #endif
14255 {
14256
14257    TRC3(cmPkTfuUePuschHqRecpInfo)
14258
14259
14260 #ifdef TFU_TDD
14261    CMCHKPK(SPkU8, param->ulDai, mBuf);
14262    CMCHKPK(SPkU8, param->nBundled, mBuf);
14263    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
14264 #endif
14265    CMCHKPK(SPkU8, param->hqBetaOff, mBuf);
14266    CMCHKPK(SPkU8, param->hqSz, mBuf);
14267    RETVALUE(ROK);
14268 }
14269
14270
14271 \f
14272 /***********************************************************
14273 *
14274 *     Func : cmUnpkTfuUePuschHqRecpInfo
14275 *
14276 *
14277 *     Desc : This structure is sent from scheduler to PHY in order to request the
14278   * reception of Harq info on PUSCH.
14279 *
14280 *
14281 *     Ret  : S16
14282 *
14283 *     Notes:
14284 *
14285 *     File  : 
14286 *
14287 **********************************************************/
14288 #ifdef ANSI
14289 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo
14290 (
14291 TfuUePuschHqRecpInfo *param,
14292 Buffer *mBuf
14293 )
14294 #else
14295 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo(param, mBuf)
14296 TfuUePuschHqRecpInfo *param;
14297 Buffer *mBuf;
14298 #endif
14299 {
14300
14301    TRC3(cmUnpkTfuUePuschHqRecpInfo)
14302
14303    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
14304    CMCHKUNPK(SUnpkU8, &param->hqBetaOff, mBuf);
14305
14306 #ifdef TFU_TDD
14307    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
14308    CMCHKUNPK(SUnpkU8, &param->nBundled, mBuf);
14309    CMCHKUNPK(SUnpkU8, &param->ulDai, mBuf);
14310 #endif
14311    RETVALUE(ROK);
14312 }
14313
14314
14315 \f
14316 /***********************************************************
14317 *
14318 *     Func : cmPkTfuUePuschRecpReq
14319 *
14320 *
14321 *     Desc : This structure is sent from scheduler to PHY in order to request the
14322   * reception of UEs data on PUSCH. This may contain the following: 
14323   * -# Data
14324   * -# Data + SRS
14325   * -# Data + HARQ
14326   * -# Data + HARQ + SRS
14327   * -# Data + CQI/RI
14328   * -# Data + CQI/RI + SRS
14329   * -# Data + CQI/RI + HARQ
14330   * -# Data + CQI/RI + HARQ + SRS
14331 *
14332 *
14333 *     Ret  : S16
14334 *
14335 *     Notes:
14336 *
14337 *     File  : 
14338 *
14339 **********************************************************/
14340 #ifdef ANSI
14341 PUBLIC S16 cmPkTfuUePuschRecpReq
14342 (
14343 TfuUePuschRecpReq *param,
14344 Buffer *mBuf
14345 )
14346 #else
14347 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
14348 TfuUePuschRecpReq *param;
14349 Buffer *mBuf;
14350 #endif
14351 {
14352
14353    TRC3(cmPkTfuUePuschRecpReq)
14354
14355    CMCHKPK(cmPkTknU8, &param->initialNumRbs, mBuf);
14356    CMCHKPK(cmPkTknU8, &param->initialNSrs, mBuf);
14357    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14358    CMCHKPK(cmPkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14359    CMCHKPK(cmPkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14360    CMCHKPK(cmPkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14361    CMCHKPK(SPkU32, param->rcpInfo, mBuf);
14362    RETVALUE(ROK);
14363 }
14364
14365
14366 \f
14367 /***********************************************************
14368 *
14369 *     Func : cmUnpkTfuUePuschRecpReq
14370 *
14371 *
14372 *     Desc : This structure is sent from scheduler to PHY in order to request the
14373   * reception of UEs data on PUSCH. This may contain the following: 
14374   * -# Data
14375   * -# Data + SRS
14376   * -# Data + HARQ
14377   * -# Data + HARQ + SRS
14378   * -# Data + CQI/RI
14379   * -# Data + CQI/RI + SRS
14380   * -# Data + CQI/RI + HARQ
14381   * -# Data + CQI/RI + HARQ + SRS
14382 *
14383 *
14384 *     Ret  : S16
14385 *
14386 *     Notes:
14387 *
14388 *     File  : 
14389 *
14390 **********************************************************/
14391 #ifdef ANSI
14392 PUBLIC S16 cmUnpkTfuUePuschRecpReq
14393 (
14394 TfuUePuschRecpReq *param,
14395 Buffer *mBuf
14396 )
14397 #else
14398 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14399 TfuUePuschRecpReq *param;
14400 Buffer *mBuf;
14401 #endif
14402 {
14403
14404    TRC3(cmUnpkTfuUePuschRecpReq)
14405
14406    CMCHKUNPK(SUnpkU32, (U32 *)&param->rcpInfo, mBuf);
14407    CMCHKUNPK(cmUnpkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14408    CMCHKUNPK(cmUnpkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14409    CMCHKUNPK(cmUnpkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14410    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14411    CMCHKUNPK(cmUnpkTknU8, &param->initialNSrs, mBuf);
14412    CMCHKUNPK(cmUnpkTknU8, &param->initialNumRbs, mBuf);
14413    RETVALUE(ROK);
14414 }
14415
14416
14417 \f
14418 /***********************************************************
14419 *
14420 *     Func : cmPkTfuUeRecpReqInfo
14421 *
14422 *
14423 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14424  * data. This contains information needed by PHY to decode the data sent by the
14425  * UE.
14426 *
14427 *
14428 *     Ret  : S16
14429 *
14430 *     Notes:
14431 *
14432 *     File  : 
14433 *
14434 **********************************************************/
14435 #ifdef ANSI
14436 PUBLIC S16 cmPkTfuUeRecpReqInfo
14437 (
14438 TfuUeRecpReqInfo *param,
14439 Buffer *mBuf
14440 )
14441 #else
14442 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14443 TfuUeRecpReqInfo *param;
14444 Buffer *mBuf;
14445 #endif
14446 {
14447
14448    TRC3(cmPkTfuUeRecpReqInfo)
14449
14450       switch(param->type) {
14451          case TFU_RECP_REQ_PUSCH:
14452             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14453             break;
14454          case TFU_RECP_REQ_PUCCH:
14455             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14456             break;
14457          default :
14458             RETVALUE(RFAILED);
14459       }
14460    CMCHKPK(SPkU32, param->type, mBuf);
14461 #ifdef TFU_5GTF
14462    CMCHKPK(SPkU8, param->groupId, mBuf);
14463 #endif /* TFU_5GTF */
14464    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14465    RETVALUE(ROK);
14466 }
14467
14468
14469 \f
14470 /***********************************************************
14471 *
14472 *     Func : cmUnpkTfuUeRecpReqInfo
14473 *
14474 *
14475 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14476  * data. This contains information needed by PHY to decode the data sent by the
14477  * UE.
14478 *
14479 *
14480 *     Ret  : S16
14481 *
14482 *     Notes:
14483 *
14484 *     File  : 
14485 *
14486 **********************************************************/
14487 #ifdef ANSI
14488 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
14489 (
14490 TfuUeRecpReqInfo *param,
14491 Buffer *mBuf
14492 )
14493 #else
14494 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14495 TfuUeRecpReqInfo *param;
14496 Buffer *mBuf;
14497 #endif
14498 {
14499
14500    TRC3(cmUnpkTfuUeRecpReqInfo)
14501
14502    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14503 #ifdef TFU_5GTF
14504    CMCHKUNPK(SUnpkU8, &param->groupId, mBuf);
14505 #endif /* TFU_5GTF */
14506    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14507       switch(param->type) {
14508          case TFU_RECP_REQ_PUCCH:
14509             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14510             break;
14511          case TFU_RECP_REQ_PUSCH:
14512             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14513             break;
14514          default :
14515             RETVALUE(RFAILED);
14516       }
14517    RETVALUE(ROK);
14518 }
14519 #endif /* TFU_UPGRADE */
14520 #ifndef TFU_UPGRADE  /* TFU_UPGRADE */
14521 /***********************************************************
14522 *
14523 *     Func : cmPkTfuUePucchRecpReq
14524 *
14525 *
14526 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14527   * reception of an UEs data on PUCCH. This may contain the following: 
14528   * -# HARQ-ACK 
14529   * -# Scheduling Request (SR)
14530   * -# HARQ-ACK and SR
14531   * -# CQI
14532   * -# CQI and HARQ-ACK
14533 *
14534 *
14535 *     Ret  : S16
14536 *
14537 *     Notes:
14538 *
14539 *     File  : 
14540 *
14541 **********************************************************/
14542 #ifdef ANSI
14543 PUBLIC S16 cmPkTfuUePucchRecpReq
14544 (
14545 TfuUePucchRecpReq *param,
14546 Buffer *mBuf
14547 )
14548 #else
14549 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14550 TfuUePucchRecpReq *param;
14551 Buffer *mBuf;
14552 #endif
14553 {
14554
14555 #ifdef TFU_TDD
14556    S32 i;
14557 #endif
14558    TRC3(cmPkTfuUePucchRecpReq)
14559
14560
14561 #ifdef TFU_TDD
14562    for (i=TFU_MAX_M-1; i >= 0; i--) {
14563       CMCHKPK(SPkU8, param->p[i], mBuf);
14564    }
14565    for (i=TFU_MAX_M-1; i >= 0; i--) {
14566       CMCHKPK(SPkU8, param->m[i], mBuf);
14567    }
14568    CMCHKPK(SPkU8, param->M, mBuf);
14569    CMCHKPK(SPkU8, param->multCnt, mBuf);
14570
14571 #endif
14572    CMCHKPK(SPkU32, param->type, mBuf);
14573       switch(param->hqType) {
14574          case TFU_HQ_RECP_REQ_N1PUCCH:
14575             CMCHKPK(SPkU16, param->t.n1Pucch, mBuf);
14576             break;
14577    
14578 #ifdef TFU_TDD
14579          case TFU_HQ_RECP_REQ_NORMAL:
14580             for (i=TFU_MAX_M-1; i >= 0; i--) {
14581                CMCHKPK(SPkU16, param->t.nCce[i], mBuf);
14582             }
14583             break;
14584    
14585 #endif
14586    
14587 #ifndef TFU_TDD
14588          case TFU_HQ_RECP_REQ_NORMAL:
14589             CMCHKPK(SPkU16, param->t.nCce, mBuf);
14590             break;
14591    
14592 #endif
14593          default :
14594             RETVALUE(RFAILED);
14595       }
14596    CMCHKPK(SPkU32, param->hqType, mBuf);
14597    RETVALUE(ROK);
14598 }
14599
14600
14601 \f
14602 /***********************************************************
14603 *
14604 *     Func : cmUnpkTfuUePucchRecpReq
14605 *
14606 *
14607 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14608   * reception of an UEs data on PUCCH. This may contain the following: 
14609   * -# HARQ-ACK 
14610   * -# Scheduling Request (SR)
14611   * -# HARQ-ACK and SR
14612   * -# CQI
14613   * -# CQI and HARQ-ACK
14614 *
14615 *
14616 *     Ret  : S16
14617 *
14618 *     Notes:
14619 *
14620 *     File  : 
14621 *
14622 **********************************************************/
14623 #ifdef ANSI
14624 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14625 (
14626 TfuUePucchRecpReq *param,
14627 Buffer *mBuf
14628 )
14629 #else
14630 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14631 TfuUePucchRecpReq *param;
14632 Buffer *mBuf;
14633 #endif
14634 {
14635
14636 #ifdef TFU_TDD
14637    S32 i;
14638 #endif
14639    TRC3(cmUnpkTfuUePucchRecpReq)
14640
14641    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqType, mBuf);
14642       switch(param->hqType) {
14643    
14644 #ifndef TFU_TDD
14645          case TFU_HQ_RECP_REQ_NORMAL:
14646             CMCHKUNPK(SUnpkU16, &param->t.nCce, mBuf);
14647             break;
14648    
14649 #endif
14650    
14651 #ifdef TFU_TDD
14652          case TFU_HQ_RECP_REQ_NORMAL:
14653             for (i=0; i<TFU_MAX_M; i++) {
14654                CMCHKUNPK(SUnpkU16, &param->t.nCce[i], mBuf);
14655             }
14656             break;
14657    
14658 #endif
14659          case TFU_HQ_RECP_REQ_N1PUCCH:
14660             CMCHKUNPK(SUnpkU16, &param->t.n1Pucch, mBuf);
14661             break;
14662          default :
14663             RETVALUE(RFAILED);
14664       }
14665    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14666
14667 #ifdef TFU_TDD
14668    CMCHKUNPK(SUnpkU8, &param->multCnt, mBuf);
14669    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
14670    for (i=0; i<TFU_MAX_M; i++) {
14671       CMCHKUNPK(SUnpkU8, &param->m[i], mBuf);
14672    }
14673    for (i=0; i<TFU_MAX_M; i++) {
14674       CMCHKUNPK(SUnpkU8, &param->p[i], mBuf);
14675    }
14676
14677 #endif
14678    RETVALUE(ROK);
14679 }
14680
14681
14682 \f
14683 /***********************************************************
14684 *
14685 *     Func : cmPkTfuUeMsg3RecpReq
14686 *
14687 *
14688 *     Desc : This structure is sent from scheduler to PHY in order to request the
14689   * reception of UEs data sent as MSG3 for Random access.
14690 *
14691 *
14692 *     Ret  : S16
14693 *
14694 *     Notes:
14695 *
14696 *     File  : 
14697 *
14698 **********************************************************/
14699 #ifdef ANSI
14700 PUBLIC S16 cmPkTfuUeMsg3RecpReq
14701 (
14702 TfuUeMsg3RecpReq *param,
14703 Buffer *mBuf
14704 )
14705 #else
14706 PUBLIC S16 cmPkTfuUeMsg3RecpReq(param, mBuf)
14707 TfuUeMsg3RecpReq *param;
14708 Buffer *mBuf;
14709 #endif
14710 {
14711
14712    TRC3(cmPkTfuUeMsg3RecpReq)
14713
14714    CMCHKPK(SPkU32, param->modType, mBuf);
14715    CMCHKPK(SPkU16, param->size, mBuf);
14716    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14717    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14718    CMCHKPK(SPkU8, param->rv, mBuf);
14719    CMCHKPK(SPkU8, param->ndi, mBuf);
14720    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14721    CMCHKPK(SPkU8, param->isRtx, mBuf);
14722    CMCHKPK(SPkU8, param->ulDelay, mBuf);
14723    CMCHKPK(SPkU8, param->expCqi, mBuf);
14724    CMCHKPK(SPkU8, param->mcs, mBuf);
14725    CMCHKPK(SPkU8, param->numRb, mBuf);
14726    CMCHKPK(SPkU8, param->rbStart, mBuf);
14727    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14728    RETVALUE(ROK);
14729 }
14730
14731
14732 \f
14733 /***********************************************************
14734 *
14735 *     Func : cmUnpkTfuUeMsg3RecpReq
14736 *
14737 *
14738 *     Desc : This structure is sent from scheduler to PHY in order to request the
14739   * reception of UEs data sent as MSG3 for Random access.
14740 *
14741 *
14742 *     Ret  : S16
14743 *
14744 *     Notes:
14745 *
14746 *     File  : 
14747 *
14748 **********************************************************/
14749 #ifdef ANSI
14750 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq
14751 (
14752 TfuUeMsg3RecpReq *param,
14753 Buffer *mBuf
14754 )
14755 #else
14756 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq(param, mBuf)
14757 TfuUeMsg3RecpReq *param;
14758 Buffer *mBuf;
14759 #endif
14760 {
14761
14762    TRC3(cmUnpkTfuUeMsg3RecpReq)
14763
14764    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14765    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14766    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14767    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14768    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
14769    CMCHKUNPK(SUnpkU8, &param->ulDelay, mBuf);
14770    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14771    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14772    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14773    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14774    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14775    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14776    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14777    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14778    RETVALUE(ROK);
14779 }
14780
14781
14782 \f
14783 /***********************************************************
14784 *
14785 *     Func : cmPkTfuUePuschRecpReq
14786 *
14787 *
14788 *     Desc : This structure is sent from scheduler to PHY in order to request the
14789   * reception of UEs data on PUSCH. This may contain the following: 
14790   * -# Data
14791   * -# Data + CQI and RI
14792   * -# Data + CQI and HARQ
14793 *
14794 *
14795 *     Ret  : S16
14796 *
14797 *     Notes:
14798 *
14799 *     File  : 
14800 *
14801 **********************************************************/
14802 #ifdef ANSI
14803 PUBLIC S16 cmPkTfuUePuschRecpReq
14804 (
14805 TfuUePuschRecpReq *param,
14806 Buffer *mBuf
14807 )
14808 #else
14809 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
14810 TfuUePuschRecpReq *param;
14811 Buffer *mBuf;
14812 #endif
14813 {
14814
14815    TRC3(cmPkTfuUePuschRecpReq)
14816
14817    CMCHKPK(SPkU32, param->modType, mBuf);
14818    CMCHKPK(SPkU16, param->size, mBuf);
14819    CMCHKPK(SPkU32, param->mode, mBuf);
14820    CMCHKPK(SPkU8, param->expHarq, mBuf);
14821    CMCHKPK(SPkU8, param->expCqi, mBuf);
14822    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14823    CMCHKPK(SPkU8, param->rv, mBuf);
14824    CMCHKPK(SPkU8, param->isRtx, mBuf);
14825    CMCHKPK(SPkU8, param->ndi, mBuf);
14826    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14827    CMCHKPK(SPkU8, param->mcs, mBuf);
14828    CMCHKPK(SPkU8, param->numRb, mBuf);
14829    CMCHKPK(SPkU8, param->rbStart, mBuf);
14830    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
14831    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14832    RETVALUE(ROK);
14833 }
14834
14835
14836 \f
14837 /***********************************************************
14838 *
14839 *     Func : cmUnpkTfuUePuschRecpReq
14840 *
14841 *
14842 *     Desc : This structure is sent from scheduler to PHY in order to request the
14843   * reception of UEs data on PUSCH. This may contain the following: 
14844   * -# Data
14845   * -# Data + CQI and RI
14846   * -# Data + CQI and HARQ
14847 *
14848 *
14849 *     Ret  : S16
14850 *
14851 *     Notes:
14852 *
14853 *     File  : 
14854 *
14855 **********************************************************/
14856 #ifdef ANSI
14857 PUBLIC S16 cmUnpkTfuUePuschRecpReq
14858 (
14859 TfuUePuschRecpReq *param,
14860 Buffer *mBuf
14861 )
14862 #else
14863 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14864 TfuUePuschRecpReq *param;
14865 Buffer *mBuf;
14866 #endif
14867 {
14868
14869    TRC3(cmUnpkTfuUePuschRecpReq)
14870
14871    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14872    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
14873    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14874    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14875    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14876    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14877    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14878    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14879    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14880    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14881    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
14882    CMCHKUNPK(SUnpkU8, &param->expHarq, mBuf);
14883    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
14884    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14885    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14886    RETVALUE(ROK);
14887 }
14888
14889
14890 \f
14891 /***********************************************************
14892 *
14893 *     Func : cmPkTfuUeRecpReqInfo
14894 *
14895 *
14896 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14897  * data. This contains information needed by PHY to decode the data sent by the
14898  * UE.
14899 *
14900 *
14901 *     Ret  : S16
14902 *
14903 *     Notes:
14904 *
14905 *     File  : 
14906 *
14907 **********************************************************/
14908 #ifdef ANSI
14909 PUBLIC S16 cmPkTfuUeRecpReqInfo
14910 (
14911 TfuUeRecpReqInfo *param,
14912 Buffer *mBuf
14913 )
14914 #else
14915 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14916 TfuUeRecpReqInfo *param;
14917 Buffer *mBuf;
14918 #endif
14919 {
14920
14921    TRC3(cmPkTfuUeRecpReqInfo)
14922
14923       switch(param->type) {
14924          case TFU_RECP_REQ_PUSCH:
14925             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14926             break;
14927          case TFU_RECP_REQ_MSG3:
14928             CMCHKPK(cmPkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
14929             break;
14930          case TFU_RECP_REQ_PUCCH:
14931             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14932             break;
14933          default :
14934             RETVALUE(RFAILED);
14935       }
14936    CMCHKPK(SPkU32, param->type, mBuf);
14937    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14938    RETVALUE(ROK);
14939 }
14940
14941
14942 \f
14943 /***********************************************************
14944 *
14945 *     Func : cmUnpkTfuUeRecpReqInfo
14946 *
14947 *
14948 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14949  * data. This contains information needed by PHY to decode the data sent by the
14950  * UE.
14951 *
14952 *
14953 *     Ret  : S16
14954 *
14955 *     Notes:
14956 *
14957 *     File  : 
14958 *
14959 **********************************************************/
14960 #ifdef ANSI
14961 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
14962 (
14963 TfuUeRecpReqInfo *param,
14964 Buffer *mBuf
14965 )
14966 #else
14967 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14968 TfuUeRecpReqInfo *param;
14969 Buffer *mBuf;
14970 #endif
14971 {
14972
14973    TRC3(cmUnpkTfuUeRecpReqInfo)
14974
14975    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14976    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14977       switch(param->type) {
14978          case TFU_RECP_REQ_PUCCH:
14979             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14980             break;
14981          case TFU_RECP_REQ_MSG3:
14982             CMCHKUNPK(cmUnpkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
14983             break;
14984          case TFU_RECP_REQ_PUSCH:
14985             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14986             break;
14987          default :
14988             RETVALUE(RFAILED);
14989       }
14990    RETVALUE(ROK);
14991 }
14992
14993
14994 #endif /* ifndef TFU_UPGRADE */
14995 /*LAA: Packing and Unpacking*/
14996
14997 /***********************************************************
14998 *
14999 *     Func : cmPkTfuErrIndInfo
15000 *
15001 *
15002 *     Desc : This structure contains information that is passed as a part of
15003 *     the ERR indication sent from PHY to MAC.
15004 *
15005 *
15006 *     Ret  : S16
15007 *
15008 *     Notes:
15009 *
15010 *     File  : 
15011 *
15012 **********************************************************/
15013 #ifdef ANSI
15014 PRIVATE S16 cmPkTfuErrIndInfo
15015 (
15016 TfuErrIndInfo *param,
15017 Buffer *mBuf
15018 )
15019 #else
15020 PRIVATE S16 cmPkTfuErrIndInfo(param, mBuf)
15021 TfuErrIndInfo *param;
15022 Buffer *mBuf;
15023 #endif
15024 {
15025
15026    TRC3(cmPkTfuErrIndInfo)
15027
15028    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
15029    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
15030    RETVALUE(ROK);
15031 }
15032 /***********************************************************
15033 *
15034 *     Func : cmUnpkTfuErrIndInfo
15035 *
15036 *
15037 *     Desc : This structure contains information that is passed as a part of the ERR
15038  * indication sent from PHY to MAC.
15039 *
15040 *
15041 *     Ret  : S16
15042 *
15043 *     Notes:
15044 *
15045 *     File  : 
15046 *
15047 **********************************************************/
15048 #ifdef ANSI
15049 PRIVATE S16 cmUnpkTfuErrIndInfo
15050 (
15051 TfuErrIndInfo *param,
15052 Buffer *mBuf
15053 )
15054 #else
15055 PRIVATE S16 cmUnpkTfuErrIndInfo(param, mBuf)
15056 TfuErrIndInfo *param;
15057 Buffer *mBuf;
15058 #endif
15059 {
15060
15061    TRC3(cmUnpkTfuErrIndInfo)
15062
15063    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
15064    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
15065    RETVALUE(ROK);
15066 }
15067
15068 /***********************************************************
15069 *
15070 *     Func : cmPkTfuErrInd
15071 *
15072 *
15073  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15074  *      Currently invoked in the cases when the Unlicensed SCell transmission
15075  *      fails.
15076  *      This API contains the Cell and subframe information for which the
15077  *      transmission failed. 
15078  *           
15079  *  @param[in]  Pst                *pst
15080  *  @param[in]  SuId               suId 
15081  *  @param[in]  TfuErrIndInfo      *errIndInfo 
15082  *  @return  S16
15083  *      -# ROK 
15084  *      -# RFAILED 
15085 *
15086 *
15087 *     Ret  : S16
15088 *
15089 *     Notes:
15090 *
15091 *     File  : 
15092 *
15093 **********************************************************/
15094 #ifdef ANSI
15095 PUBLIC S16 cmPkTfuErrInd
15096 (
15097 Pst * pst,
15098 SuId suId,
15099 TfuErrIndInfo * errInd
15100 )
15101 #else
15102 PUBLIC S16 cmPkTfuErrInd(pst, suId, errInd)
15103 Pst * pst;
15104 SuId suId;
15105 TfuErrIndInfo * errInd;
15106 #endif
15107 {
15108    Buffer *mBuf = NULLP;
15109    TRC3(cmPkTfuErrInd)
15110
15111    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
15112 #if (ERRCLASS & ERRCLS_ADD_RES)
15113       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15114          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15115          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
15116 #endif
15117       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15118       RETVALUE(RFAILED);
15119    }
15120    if (pst->selector == ODU_SELECTOR_LC) {
15121       if (cmPkTfuErrIndInfo(errInd, mBuf) != ROK) {
15122 #if (ERRCLASS & ERRCLS_ADD_RES)
15123          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15124             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15125             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
15126 #endif
15127          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15128          TFU_FREE_MSG(mBuf);
15129          RETVALUE(RFAILED);
15130       }
15131    }
15132    else if(pst->selector == ODU_SELECTOR_LWLC)
15133    {
15134       if (cmPkPtr((PTR)errInd, mBuf) != ROK)
15135       {
15136 #if (ERRCLASS & ERRCLS_ADD_RES)
15137          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15138             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15139             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
15140 #endif
15141          
15142          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
15143          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15144          TFU_FREE_MSG(mBuf);
15145          RETVALUE(RFAILED);
15146       }
15147    }
15148
15149    if (SPkS16(suId, mBuf) != ROK) {
15150 #if (ERRCLASS & ERRCLS_ADD_RES)
15151       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15152          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15153          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
15154 #endif
15155       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15156       TFU_FREE_MSG(mBuf);
15157       RETVALUE(RFAILED);
15158    }
15159    if (pst->selector != ODU_SELECTOR_LWLC) {
15160       if (SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo)) != ROK) {
15161 #if (ERRCLASS & ERRCLS_ADD_RES)
15162       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15163          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15164          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
15165 #endif
15166          TFU_FREE_MSG(mBuf);
15167          RETVALUE(RFAILED);
15168       }
15169    }
15170
15171    pst->event = (Event) EVTTFUERRIND;
15172    RETVALUE(SPstTsk(pst,mBuf));
15173 }
15174
15175 \f
15176 /***********************************************************
15177 *
15178 *     Func : cmUnpkTfuErrInd
15179 *
15180 *
15181  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15182  *      Currently invoked in the cases when the Unlicensed SCell transmission
15183  *      fails.
15184  *      This API contains the Cell and subframe information for which the
15185  *      transmission failed. 
15186  * @param pst Pointer to the post structure.
15187  * @param suId SAP ID of the service user.
15188  * @param errInd Pointer to the TfuErrIndInfo.
15189  * @return ROK/RFAILED
15190 *
15191 *
15192 *     Ret  : S16
15193 *
15194 *     Notes:
15195 *
15196 *     File  : 
15197 *
15198 **********************************************************/
15199 #ifdef ANSI
15200 PUBLIC S16 cmUnpkTfuErrInd
15201 (
15202 TfuErrInd func,
15203 Pst *pst,
15204 Buffer *mBuf
15205 )
15206 #else
15207 PUBLIC S16 cmUnpkTfuErrInd(func, pst, mBuf)
15208 TfuErrInd func;
15209 Pst *pst;
15210 Buffer *mBuf;
15211 #endif
15212 {
15213    SuId suId;
15214    TfuErrIndInfo *errInd;
15215    
15216    TRC3(cmUnpkTfuErrInd)
15217
15218    if (SUnpkS16(&suId, mBuf) != ROK) {
15219       TFU_FREE_MSG(mBuf);
15220 #if (ERRCLASS & ERRCLS_ADD_RES)
15221       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15222          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15223          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
15224 #endif
15225       RETVALUE(RFAILED);
15226    }
15227    if (pst->selector != ODU_SELECTOR_LWLC) {
15228       if ((SGetSBuf(pst->region, pst->pool, (Data **)&errInd, sizeof(TfuErrIndInfo))) != ROK) {
15229 #if (ERRCLASS & ERRCLS_ADD_RES)
15230          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15231             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15232             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
15233 #endif
15234          TFU_FREE_MSG(mBuf);
15235          RETVALUE(RFAILED);
15236       }
15237    }
15238
15239    if (pst->selector == ODU_SELECTOR_LC) 
15240    {
15241       if (cmUnpkTfuErrIndInfo(errInd, mBuf) != ROK) {
15242          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15243          TFU_FREE_MSG(mBuf);
15244 #if (ERRCLASS & ERRCLS_ADD_RES)
15245          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15246                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15247                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
15248 #endif
15249          RETVALUE(RFAILED);
15250       }
15251    }
15252    else if(pst->selector == ODU_SELECTOR_LWLC)
15253    {
15254       if (cmUnpkPtr((PTR *)&errInd, mBuf) != ROK)
15255       {
15256 #if (ERRCLASS & ERRCLS_ADD_RES)
15257          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15258             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15259             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
15260 #endif
15261          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15262          TFU_FREE_MSG(mBuf);
15263          RETVALUE(RFAILED);
15264       }
15265    }
15266    TFU_FREE_MSG(mBuf);
15267    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
15268    (*func)(pst, suId, errInd);
15269    SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15270    RETVALUE(ROK);
15271
15272 }
15273 #endif /* if defined(LCTFU) */
15274
15275 /**********************************************************************
15276          End of file
15277  **********************************************************************/