Moving all common header file into common_def.h file
[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 \f
3381 /***********************************************************
3382 *
3383 *     Func : cmUnpackSlotInd
3384 *
3385 *
3386 *     Desc : This API is the TTI indication from PHY to MAC . 
3387  * @details This primitive provides the timing information (SFN and subframe)
3388  * which is currently running on the physical layer. 
3389  * @param pst Pointer to the post structure.
3390  * @param suId SAP ID of the service user.
3391  * @param ttiInd Pointer to the TfuTtiIndInfo.
3392  * @return ROK/RFAILED
3393 *
3394 *
3395 *     Ret  : S16
3396 *
3397 *     Notes:
3398 *
3399 *     File  : 
3400 *
3401 **********************************************************/
3402 PUBLIC S16 cmUnpackSlotInd
3403 (
3404 TfuTtiInd func,
3405 Pst *pst,
3406 Buffer *mBuf
3407 )
3408 {
3409    SuId suId;
3410    SlotIndInfo *slotInd;
3411    
3412    TRC3(cmUnpackSlotInd)
3413
3414    if (SUnpkS16(&suId, mBuf) != ROK) {
3415       TFU_FREE_MSG(mBuf);
3416 #if (ERRCLASS & ERRCLS_ADD_RES)
3417       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3418          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3419          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3420 #endif
3421       RETVALUE(RFAILED);
3422    }
3423    if (pst->selector != ODU_SELECTOR_LWLC) {
3424       if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
3425 #if (ERRCLASS & ERRCLS_ADD_RES)
3426          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3427             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3428             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
3429 #endif
3430          TFU_FREE_MSG(mBuf);
3431          RETVALUE(RFAILED);
3432       }
3433    }
3434
3435    if (pst->selector == ODU_SELECTOR_LC) 
3436    {
3437       if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
3438          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3439          TFU_FREE_MSG(mBuf);
3440 #if (ERRCLASS & ERRCLS_ADD_RES)
3441          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3442                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3443                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
3444 #endif
3445          RETVALUE(RFAILED);
3446       }
3447    }
3448    else if(pst->selector == ODU_SELECTOR_LWLC)
3449    {
3450       if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
3451       {
3452 #if (ERRCLASS & ERRCLS_ADD_RES)
3453          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3454             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3455             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3456 #endif
3457          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3458          TFU_FREE_MSG(mBuf);
3459          RETVALUE(RFAILED);
3460       }
3461    }
3462    TFU_FREE_MSG(mBuf);
3463
3464    RETVALUE((*func)(pst, slotInd));
3465 }
3466
3467 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
3468 /***********************************************************
3469  *
3470  *     Func : cmPkTfuNonRtInd
3471  *
3472  *
3473  *     Desc : This API is the Non-Rt indication from CL to MAC . 
3474  * @param pst Pointer to the post structure.
3475  * @param suId SAP ID of the service user.
3476  * @return ROK/RFAILED
3477  *
3478  *
3479  *     Ret  : S16
3480  *
3481  *     Notes:
3482  *
3483  *     File  : 
3484  *
3485 **********************************************************/
3486 #ifdef ANSI
3487 PUBLIC S16 cmPkTfuNonRtInd
3488 (
3489 Pst * pst,
3490 SuId suId
3491 )
3492 #else
3493 PUBLIC S16 cmPkTfuNonRtInd(pst, suId)
3494 Pst * pst;
3495 SuId suId;
3496 #endif
3497 {
3498    Buffer *mBuf = NULLP;
3499    TRC3(cmPkTfuNonRtInd)
3500
3501    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3502 #if (ERRCLASS & ERRCLS_ADD_RES)
3503       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3504          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3505          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3506 #endif
3507       RETVALUE(RFAILED);
3508   }
3509   if (SPkS16(suId, mBuf) != ROK) {
3510 #if (ERRCLASS & ERRCLS_ADD_RES)
3511       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3512          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3513          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3514 #endif
3515       TFU_FREE_MSG(mBuf);
3516       RETVALUE(RFAILED);
3517   }
3518   pst->event = (Event) EVTTFUNONRTIND;
3519   RETVALUE(SPstTsk(pst,mBuf));
3520 }
3521
3522 /***********************************************************
3523 *
3524 *     Func : cmUnpkTfuNonRtInd
3525 *
3526 *
3527 *     Desc : This API is the Non Rt indication from PHY to MAC . 
3528 * @param pst Pointer to the post structure.
3529 * @param suId SAP ID of the service user.
3530 * @return ROK/RFAILED
3531 *
3532 *
3533 *     Ret  : S16
3534 *
3535 *     Notes:
3536 *
3537 *     File  : 
3538 *
3539 **********************************************************/
3540 #ifdef ANSI
3541 PUBLIC S16 cmUnpkTfuNonRtInd
3542 (
3543 TfuNonRtInd func,
3544 Pst *pst,
3545 Buffer *mBuf
3546 )
3547 #else
3548 PUBLIC S16 cmUnpkTfuNonRtInd(func, pst, mBuf)
3549 TfuNonRtInd func;
3550 Pst *pst;
3551 Buffer *mBuf;
3552 #endif
3553 {
3554    SuId suId;
3555    TRC3(cmUnpkTfuNonRtInd)
3556
3557    if (SUnpkS16(&suId, mBuf) != ROK) {
3558       TFU_FREE_MSG(mBuf);
3559 #if (ERRCLASS & ERRCLS_ADD_RES)
3560       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3561          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3562          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3563 #endif
3564       RETVALUE(RFAILED);
3565    }
3566    TFU_FREE_MSG(mBuf);
3567    RETVALUE((*func)(pst, suId));
3568 }
3569
3570 #endif
3571
3572 /***********************************************************
3573 *
3574 *     Func : cmUnpackMacSchSlotInd
3575 *
3576 *
3577 *     Desc : This API is the TTI indication from PHY to scheduler. 
3578  * @details This primitive provides the timing information (SFN and subframe)
3579  * which is currently running on the physical layer. 
3580  * @param pst Pointer to the post structure.
3581  * @param suId SAP ID of the service user.
3582  * @param ttiInd Pointer to the TfuTtiIndInfo.
3583  * @return ROK/RFAILED
3584 *
3585 *
3586 *     Ret  : S16
3587 *
3588 *     Notes:
3589 *
3590 *     File  : 
3591 *
3592 **********************************************************/
3593 PUBLIC S16 cmUnpackMacSchSlotInd
3594 (
3595 MacSchSlotIndFunc func,
3596 Pst *pst,
3597 Buffer *mBuf
3598 )
3599 {
3600 #if 0
3601    SuId suId;
3602    SlotIndInfo *slotInd;
3603    
3604    TRC3(cmUnpackMacSchSlotInd)
3605
3606    if (SUnpkS16(&suId, mBuf) != ROK) {
3607       TFU_FREE_MSG(mBuf);
3608 #if (ERRCLASS & ERRCLS_ADD_RES)
3609       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3610          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3611          (ErrVal)ETFU116, (ErrVal)0, "Packing failed");
3612 #endif
3613       RETVALUE(RFAILED);
3614    }
3615    if (pst->selector != ODU_SELECTOR_LWLC) {
3616       if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
3617 #if (ERRCLASS & ERRCLS_ADD_RES)
3618          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3619             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3620             (ErrVal)ETFU117, (ErrVal)0, "Packing failed");
3621 #endif
3622          TFU_FREE_MSG(mBuf);
3623          RETVALUE(RFAILED);
3624       }
3625    }
3626
3627    if (pst->selector == ODU_SELECTOR_LC) 
3628    {
3629       if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
3630          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3631          TFU_FREE_MSG(mBuf);
3632 #if (ERRCLASS & ERRCLS_ADD_RES)
3633          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3634                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3635                (ErrVal)ETFU118, (ErrVal)0, "Packing failed");
3636 #endif
3637          RETVALUE(RFAILED);
3638       }
3639    }
3640    else if(pst->selector == ODU_SELECTOR_LWLC)
3641    {
3642       if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
3643       {
3644 #if (ERRCLASS & ERRCLS_ADD_RES)
3645          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3646             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3647             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3648 #endif
3649          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3650          TFU_FREE_MSG(mBuf);
3651          RETVALUE(RFAILED);
3652       }
3653    }
3654    TFU_FREE_MSG(mBuf);
3655    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
3656 //   (*func)(pst, suId, slotInd);
3657    (*func)(pst, slotInd);
3658    SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3659 #endif
3660    return ROK;
3661 }
3662
3663 \f
3664 /***********************************************************
3665 *
3666 *     Func : cmPkTfuPucchDeltaPwr
3667 *
3668 *
3669 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3670  * Physical layer.
3671  * This information is utilized by Scheduler for power control. 
3672  * @param pst Pointer to the post structure.
3673  * @param suId SAP ID of the service user.
3674  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3675  * @return ROK/RFAILED
3676 *
3677 *
3678 *     Ret  : S16
3679 *
3680 *     Notes:
3681 *
3682 *     File  : 
3683 *
3684 **********************************************************/
3685 #ifdef ANSI
3686 PUBLIC S16 cmPkTfuPucchDeltaPwr
3687 (
3688 Pst * pst,
3689 SuId suId,
3690 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr
3691 )
3692 #else
3693 PUBLIC S16 cmPkTfuPucchDeltaPwr(pst, suId, pucchDeltaPwr)
3694 Pst * pst;
3695 SuId suId;
3696 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr;
3697 #endif
3698 {
3699    Buffer *mBuf = NULLP;
3700    TRC3(cmPkTfuPucchDeltaPwr)
3701
3702    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3703 #if (ERRCLASS & ERRCLS_ADD_RES)
3704       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3705          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3706          (ErrVal)ETFU119, (ErrVal)0, "Packing failed");
3707 #endif
3708       SPutSBuf(pst->region, pst->pool, (Data *)pucchDeltaPwr, sizeof(TfuPucchDeltaPwrIndInfo));
3709       RETVALUE(RFAILED);
3710    }
3711    if (pst->selector == ODU_SELECTOR_LC) {
3712       if (cmPkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, mBuf) != ROK) {
3713 #if (ERRCLASS & ERRCLS_ADD_RES)
3714          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3715             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3716             (ErrVal)ETFU120, (ErrVal)0, "Packing failed");
3717 #endif
3718          TFU_FREE_MEM(pucchDeltaPwr);
3719          TFU_FREE_MSG(mBuf);
3720          RETVALUE(RFAILED);
3721       }
3722    }
3723    else if(pst->selector == ODU_SELECTOR_LWLC)
3724    {
3725       if (cmPkPtr((PTR)pucchDeltaPwr, mBuf) != ROK)
3726       {
3727 #if (ERRCLASS & ERRCLS_ADD_RES)
3728          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3729             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3730             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3731 #endif
3732          TFU_FREE_MEM(pucchDeltaPwr);
3733          TFU_FREE_MSG(mBuf);
3734          RETVALUE(RFAILED);
3735       }
3736    }
3737
3738    if (SPkS16(suId, mBuf) != ROK) {
3739 #if (ERRCLASS & ERRCLS_ADD_RES)
3740       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3741          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3742          (ErrVal)ETFU121, (ErrVal)0, "Packing failed");
3743 #endif
3744       TFU_FREE_MEM(pucchDeltaPwr);
3745       TFU_FREE_MSG(mBuf);
3746       RETVALUE(RFAILED);
3747    }
3748    if (pst->selector != ODU_SELECTOR_LWLC) {
3749       TFU_FREE_MEM(pucchDeltaPwr);
3750    }
3751    pst->event = (Event) EVTTFUPUCCHDELPWR;
3752    RETVALUE(SPstTsk(pst,mBuf));
3753 }
3754
3755 \f
3756 /***********************************************************
3757 *
3758 *     Func : cmUnpkTfuPucchDeltaPwr
3759 *
3760 *
3761 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3762  * Physical layer.
3763  * This information is utilized by Scheduler for power control. 
3764  * @param pst Pointer to the post structure.
3765  * @param suId SAP ID of the service user.
3766  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3767  * @return ROK/RFAILED
3768 *
3769 *
3770 *     Ret  : S16
3771 *
3772 *     Notes:
3773 *
3774 *     File  : 
3775 *
3776 **********************************************************/
3777 #ifdef ANSI
3778 PUBLIC S16 cmUnpkTfuPucchDeltaPwr
3779 (
3780 TfuPucchDeltaPwrInd func,
3781 Pst *pst,
3782 Buffer *mBuf
3783 )
3784 #else
3785 PUBLIC S16 cmUnpkTfuPucchDeltaPwr(func, pst, mBuf)
3786 TfuPucchDeltaPwrInd func;
3787 Pst *pst;
3788 Buffer *mBuf;
3789 #endif
3790 {
3791    SuId suId;
3792    TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
3793    
3794    TRC3(cmUnpkTfuPucchDeltaPwr)
3795
3796    if (SUnpkS16(&suId, mBuf) != ROK) {
3797       TFU_FREE_MSG(mBuf);
3798 #if (ERRCLASS & ERRCLS_ADD_RES)
3799       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3800          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3801          (ErrVal)ETFU122, (ErrVal)0, "Packing failed");
3802 #endif
3803       RETVALUE(RFAILED);
3804    }
3805    if (pst->selector != ODU_SELECTOR_LWLC) {
3806       Mem   sMem;
3807       sMem.region = pst->region;
3808       sMem.pool = pst->pool;
3809       if ((cmAllocEvnt(sizeof(TfuPucchDeltaPwrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&pucchDeltaPwr)) != ROK)            {
3810 #if (ERRCLASS & ERRCLS_ADD_RES)
3811          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3812             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3813             (ErrVal)ETFU123, (ErrVal)0, "Packing failed");
3814 #endif
3815          TFU_FREE_MSG(mBuf);
3816          RETVALUE(RFAILED);
3817       }
3818    }
3819
3820    if (pst->selector == ODU_SELECTOR_LC) 
3821    {
3822       if (cmUnpkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, (Ptr)&pucchDeltaPwr->memCp, mBuf) != ROK) {
3823          TFU_FREE_MEM(pucchDeltaPwr);
3824          TFU_FREE_MSG(mBuf);
3825 #if (ERRCLASS & ERRCLS_ADD_RES)
3826          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3827                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3828                (ErrVal)ETFU124, (ErrVal)0, "Packing failed");
3829 #endif
3830          RETVALUE(RFAILED);
3831       }
3832    }
3833    else if(pst->selector == ODU_SELECTOR_LWLC)
3834    {
3835       if (cmUnpkPtr((PTR *)&pucchDeltaPwr, mBuf) != ROK)
3836       {
3837 #if (ERRCLASS & ERRCLS_ADD_RES)
3838          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3839             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3840             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3841 #endif
3842          TFU_FREE_MEM(pucchDeltaPwr);
3843          TFU_FREE_MSG(mBuf);
3844          RETVALUE(RFAILED);
3845       }
3846    }
3847    TFU_FREE_MSG(mBuf);
3848    RETVALUE((*func)(pst, suId, pucchDeltaPwr));
3849 }
3850
3851 #ifdef TFU_5GTF
3852 \f
3853 /***********************************************************
3854 *
3855 *     Func : cmPkTfuRbAssignA1Val324
3856 *
3857 *
3858 *     Desc : This structure contains the information needed to convey  RIV value 324.
3859 *
3860 *
3861 *     Ret  : S16
3862 *
3863 *     Notes:
3864 *
3865 *     File  : 
3866 *
3867 **********************************************************/
3868 #ifdef ANSI
3869 PUBLIC S16 cmPkTfuRbAssignA1Val324
3870 (
3871 TfuRbAssignA1Val324 *param,
3872 Buffer *mBuf
3873 )
3874 #else
3875 PUBLIC S16 cmPkTfuRbAssignA1Val324(param, mBuf)
3876 TfuRbAssignA1Val324 *param;
3877 Buffer *mBuf;
3878 #endif
3879 {
3880
3881    TRC3(cmPkTfuRbAssignA1Val324)
3882
3883    CMCHKPK(SPkU8, param->ndi, mBuf);
3884    CMCHKPK(SPkU8, param->mcs, mBuf);
3885    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3886 #ifdef UL_ADPT_DBG   
3887    printf("cmPkTfuRbAssignA1Val324 param->ndi %d mcs %d param->hqProcId %d \n",param->ndi,param->mcs,param->hqProcId);
3888 #endif   
3889    RETVALUE(ROK);
3890 }
3891
3892 \f
3893 /***********************************************************
3894 *
3895 *     Func : cmPkTfuRbAssignB1Val324
3896 *
3897 *
3898 *     Desc : This structure contains the information needed to convey  RIV value 324.
3899 *
3900 *
3901 *     Ret  : S16
3902 *
3903 *     Notes:
3904 *
3905 *     File  : 
3906 *
3907 **********************************************************/
3908 #ifdef ANSI
3909 PUBLIC S16 cmPkTfuRbAssignB1Val324
3910 (
3911 TfuRbAssignB1Val324 *param,
3912 Buffer *mBuf
3913 )
3914 #else
3915 PUBLIC S16 cmPkTfuRbAssignB1Val324(param, mBuf)
3916 TfuRbAssignB1Val324 *param;
3917 Buffer *mBuf;
3918 #endif
3919 {
3920
3921    TRC3(cmPkTfuRbAssignB1Val324)
3922
3923    CMCHKPK(SPkU8, param->bmiHqAckNack, mBuf);
3924    CMCHKPK(SPkU8, param->RV, mBuf);
3925    CMCHKPK(SPkU8, param->ndi, mBuf);
3926    CMCHKPK(SPkU8, param->mcs, mBuf);
3927    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3928    RETVALUE(ROK);
3929 }
3930
3931 \f
3932 /***********************************************************
3933 *
3934 *     Func : cmPkTfuRbAssignVal326
3935 *
3936 *
3937 *     Desc : This structure contains the information needed to convey  RIV value 326.
3938 *
3939 *
3940 *     Ret  : S16
3941 *
3942 *     Notes:
3943 *
3944 *     File  : 
3945 *
3946 **********************************************************/
3947 #ifdef ANSI
3948 PUBLIC S16 cmPkTfuRbAssignVal326
3949 (
3950 TfuRbAssignVal326 *param,
3951 Buffer *mBuf
3952 )
3953 #else
3954 PUBLIC S16 cmPkTfuRbAssignVal326(param, mBuf)
3955 TfuRbAssignVal326 *param;
3956 Buffer *mBuf;
3957 #endif
3958 {
3959
3960    TRC3(cmPkTfuRbAssignVal326)
3961
3962    CMCHKPK(SPkU8, param->CyclicShiftInd, mBuf);
3963    CMCHKPK(SPkU8, param->OCCInd, mBuf);
3964    CMCHKPK(SPkU8, param->FreqBandIdx, mBuf);
3965    RETVALUE(ROK);
3966 }
3967
3968 \f
3969 /***********************************************************
3970 *
3971 *     Func : cmUnpkTfuRbAssignA1Val324
3972 *
3973 *
3974 *     Desc : This structure contains the information needed to convey  RIV value 324.
3975 *
3976 *
3977 *     Ret  : S16
3978 *
3979 *     Notes:
3980 *
3981 *     File  : 
3982 *
3983 **********************************************************/
3984 #ifdef ANSI
3985 PUBLIC S16 cmUnpkTfuRbAssignA1Val324
3986 (
3987 TfuRbAssignA1Val324 *param,
3988 Buffer *mBuf
3989 )
3990 #else
3991 PUBLIC S16 cmUnpkTfuRbAssignA1Val324(param, mBuf)
3992 TfuRbAssignA1Val324 *param;
3993 Buffer *mBuf;
3994 #endif
3995 {
3996
3997    TRC3(cmUnpkTfuRbAssignA1Val324)
3998
3999    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4000    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4001    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4002    RETVALUE(ROK);
4003 }
4004
4005 \f
4006 /***********************************************************
4007 *
4008 *     Func : cmUnpkTfuRbAssignB1Val324
4009 *
4010 *
4011 *     Desc : This structure contains the information needed to convey  RIV value 324.
4012 *
4013 *
4014 *     Ret  : S16
4015 *
4016 *     Notes:
4017 *
4018 *     File  : 
4019 *
4020 **********************************************************/
4021 #ifdef ANSI
4022 PUBLIC S16 cmUnpkTfuRbAssignB1Val324
4023 (
4024 TfuRbAssignB1Val324 *param,
4025 Buffer *mBuf
4026 )
4027 #else
4028 PUBLIC S16 cmUnpkTfuRbAssignB1Val324(param, mBuf)
4029 TfuRbAssignB1Val324 *param;
4030 Buffer *mBuf;
4031 #endif
4032 {
4033
4034    TRC3(cmUnpkTfuRbAssignB1Val324)
4035
4036    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4037    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4038    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4039    CMCHKUNPK(SUnpkU8, &param->RV, mBuf);
4040    CMCHKUNPK(SUnpkU8, &param->bmiHqAckNack, mBuf);
4041    RETVALUE(ROK);
4042 }
4043
4044 \f
4045 /***********************************************************
4046 *
4047 *     Func : cmUnpkTfuRbAssignVal326
4048 *
4049 *
4050 *     Desc : This structure contains the information needed to convey  RIV value 326.
4051 *
4052 *
4053 *     Ret  : S16
4054 *
4055 *     Notes:
4056 *
4057 *     File  : 
4058 *
4059 **********************************************************/
4060 #ifdef ANSI
4061 PUBLIC S16 cmUnpkTfuRbAssignVal326
4062 (
4063 TfuRbAssignVal326 *param,
4064 Buffer *mBuf
4065 )
4066 #else
4067 PUBLIC S16 cmUnpkTfuRbAssignVal326(param, mBuf)
4068 TfuRbAssignVal326 *param;
4069 Buffer *mBuf;
4070 #endif
4071 {
4072
4073    TRC3(cmUnpkTfuRbAssignVal326)
4074
4075    CMCHKUNPK(SUnpkU8, &param->FreqBandIdx, mBuf);
4076    CMCHKUNPK(SUnpkU8, &param->OCCInd, mBuf);
4077    CMCHKUNPK(SUnpkU8, &param->CyclicShiftInd, mBuf);
4078    RETVALUE(ROK);
4079 }
4080
4081
4082 \f
4083 /***********************************************************
4084 *
4085 *     Func : cmPkTfuDciFormatA1A2Info
4086 *
4087 *
4088 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4089 *
4090 *
4091 *     Ret  : S16
4092 *
4093 *     Notes:
4094 *
4095 *     File  : 
4096 *
4097 **********************************************************/
4098 #ifdef ANSI
4099 PUBLIC S16 cmPkTfuDciFormatA1A2Info
4100 (
4101 TfuDciFormatA1Info *param,
4102 Buffer *mBuf
4103 )
4104 #else
4105 PUBLIC S16 cmPkTfuDciFormatA1A2Info(param, mBuf)
4106 TfuDciFormatA1Info *param;
4107 Buffer *mBuf;
4108 #endif
4109 {
4110
4111    TRC3(cmPkTfuDciFormatA1A2Info)
4112
4113    //printf("5GTF_DBG: cmPkTfuDciFormatA1Info() called by eNB\n");   
4114    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4115    CMCHKPK(SPkU8, param->UL_PCRS, mBuf);
4116    CMCHKPK(SPkU8, param->PMI, mBuf);
4117    CMCHKPK(SPkU8, param->SCID, mBuf);
4118
4119    CMCHKPK(SPkU8, param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4120    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4121    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4122    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4123    CMCHKPK(SPkU8, param->uciOnxPUSCH, mBuf);
4124
4125    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4126    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4127    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4128    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4129    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4130    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4131
4132    if(param->RBAssign <= TFU_RIV_324)
4133    {
4134       CMCHKPK(cmPkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4135    }
4136    else if (param->RBAssign == TFU_RIV_326)
4137    {
4138       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4139    }
4140
4141    CMCHKPK(SPkU8, param->rv, mBuf);
4142    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4143    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4144    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4145    CMCHKPK(SPkU8, param->xPUSCH_TxTiming, mBuf);
4146    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
4147    CMCHKPK(SPkU8, param->formatType, mBuf);
4148    RETVALUE(ROK);
4149 }
4150
4151 \f
4152 /***********************************************************
4153 *
4154 *     Func : cmPkTfuDciFormatB1B2Info
4155 *
4156 *
4157 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4158 *
4159 *
4160 *     Ret  : S16
4161 *
4162 *     Notes:
4163 *
4164 *     File  : 
4165 *
4166 **********************************************************/
4167 #ifdef ANSI
4168 PUBLIC S16 cmPkTfuDciFormatB1B2Info
4169 (
4170 TfuDciFormatB1Info *param,
4171 Buffer *mBuf
4172 )
4173 #else
4174 PUBLIC S16 cmPkTfuDciFormatB1B2Info(param, mBuf)
4175 TfuDciFormatB1Info *param;
4176 Buffer *mBuf;
4177 #endif
4178 {
4179
4180    TRC3(cmPkTfuDciFormatB1B2Info)
4181
4182    CMCHKPK(SPkU8, param->DL_PCRS, mBuf);
4183    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4184    CMCHKPK(SPkU8, param->SCID, mBuf);
4185
4186    CMCHKPK(SPkU8, param->AntPorts_numLayers, mBuf);
4187    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4188    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4189    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4190    CMCHKPK(SPkU8, param->freqResIdx_xPUCCH, mBuf);
4191
4192    CMCHKPK(SPkU8, param->xPUCCH_TxTiming, mBuf);
4193
4194    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4195    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4196    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4197    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4198    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4199    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4200
4201    if(param->RBAssign <= TFU_RIV_324)
4202    {
4203       CMCHKPK(cmPkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4204    }
4205    else if (param->RBAssign == TFU_RIV_326)
4206    {
4207       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4208    }
4209   
4210    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4211    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4212    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4213    CMCHKPK(SPkU8, param->xPDSCHRange, mBuf);
4214    CMCHKPK(SPkU8, param->formatType, mBuf);
4215    RETVALUE(ROK);
4216 }
4217
4218
4219 \f
4220 /***********************************************************
4221 *
4222 *     Func : cmUnpkTfuDciFormatA1A2Info
4223 *
4224 *
4225 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4226 *
4227 *
4228 *     Ret  : S16
4229 *
4230 *     Notes:
4231 *
4232 *     File  : 
4233 *
4234 **********************************************************/
4235 #ifdef ANSI
4236 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info
4237 (
4238 TfuDciFormatA1Info *param,
4239 Buffer *mBuf
4240 )
4241 #else
4242 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info(param, mBuf)
4243 TfuDciFormatA1Info *param;
4244 Buffer *mBuf;
4245 #endif
4246 {
4247
4248    TRC3(cmUnpkTfuDciFormatA1A2Info)
4249
4250    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4251    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
4252    CMCHKUNPK(SUnpkU8, &param->xPUSCH_TxTiming, mBuf);
4253    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4254    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4255    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4256    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4257
4258    if(param->RBAssign <= TFU_RIV_324)
4259    {
4260       CMCHKUNPK(cmUnpkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4261    }
4262    else if(param->RBAssign == TFU_RIV_326)
4263    {
4264       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4265    }
4266
4267    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4268    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4269    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4270    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4271    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4272    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4273
4274    CMCHKUNPK(SUnpkU8, &param->uciOnxPUSCH, mBuf);
4275    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4276    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4277    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4278    CMCHKUNPK(SUnpkU8, &param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4279
4280    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4281    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
4282    CMCHKUNPK(SUnpkU8, &param->UL_PCRS, mBuf);
4283    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4284
4285    RETVALUE(ROK);
4286 }
4287
4288 \f
4289 /***********************************************************
4290 *
4291 *     Func : cmUnpkTfuDciFormatB1B2Info
4292 *
4293 *
4294 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4295 *
4296 *
4297 *     Ret  : S16
4298 *
4299 *     Notes:
4300 *
4301 *     File  : 
4302 *
4303 **********************************************************/
4304 #ifdef ANSI
4305 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info
4306 (
4307 TfuDciFormatB1Info *param,
4308 Buffer *mBuf
4309 )
4310 #else
4311 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info(param, mBuf)
4312 TfuDciFormatB1Info *param;
4313 Buffer *mBuf;
4314 #endif
4315 {
4316
4317    TRC3(cmUnpkTfuDciFormatB1B2Info)
4318
4319    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4320    CMCHKUNPK(SUnpkU8, &param->xPDSCHRange, mBuf);
4321    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4322    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4323    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4324
4325    if(param->RBAssign <= TFU_RIV_324)
4326    {
4327       CMCHKUNPK(cmUnpkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4328    }
4329    else if (param->RBAssign == TFU_RIV_326)
4330    {
4331       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4332    }
4333
4334    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4335    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4336    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4337    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4338    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4339    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4340
4341    CMCHKUNPK(SUnpkU8, &param->xPUCCH_TxTiming, mBuf);
4342    CMCHKUNPK(SUnpkU8, &param->freqResIdx_xPUCCH, mBuf);
4343    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4344    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4345    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4346    CMCHKUNPK(SUnpkU8, &param->AntPorts_numLayers, mBuf);
4347    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4348    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4349    CMCHKUNPK(SUnpkU8, &param->DL_PCRS, mBuf);
4350
4351    RETVALUE(ROK);
4352 }
4353
4354
4355 #endif /* TFU_5GTF */
4356
4357 \f
4358 /***********************************************************
4359 *
4360 *     Func : cmPkTfuDciFormat0Info
4361 *
4362 *
4363 *     Desc : This structure contains the information needed to convey DCI format 0.
4364 *
4365 *
4366 *     Ret  : S16
4367 *
4368 *     Notes:
4369 *
4370 *     File  : 
4371 *
4372 **********************************************************/
4373 #ifdef ANSI
4374 PUBLIC S16 cmPkTfuDciFormat0Info
4375 (
4376 TfuDciFormat0Info *param,
4377 Buffer *mBuf
4378 )
4379 #else
4380 PUBLIC S16 cmPkTfuDciFormat0Info(param, mBuf)
4381 TfuDciFormat0Info *param;
4382 Buffer *mBuf;
4383 #endif
4384 {
4385
4386    TRC3(cmPkTfuDciFormat0Info)
4387
4388    /* tfu_c_001.main_3: Adding pack for hqProcId */
4389    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4390    CMCHKPK(SPkU8, param->txAntenna, mBuf);
4391    CMCHKPK(SPkU8, param->numCqiBit, mBuf);
4392    CMCHKPK(SPkU8, param->cqiReq, mBuf);
4393    CMCHKPK(SPkU8, param->nDmrs, mBuf);
4394
4395 #ifdef TFU_TDD
4396    CMCHKPK(SPkU8, param->dai, mBuf);
4397    CMCHKPK(SPkU8, param->ulIdx, mBuf);
4398
4399 #endif
4400    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4401    CMCHKPK(SPkU8, param->ndi, mBuf);
4402    CMCHKPK(SPkU8, param->mcs, mBuf);
4403    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
4404 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
4405 #ifdef TFU_UPGRADE
4406    CMCHKPK(SPkU32, param->riv, mBuf);
4407 #endif
4408    CMCHKPK(SPkU8, param->numRb, mBuf);
4409    CMCHKPK(SPkU8, param->rbStart, mBuf);
4410    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
4411    RETVALUE(ROK);
4412 }
4413
4414
4415 \f
4416 /***********************************************************
4417 *
4418 *     Func : cmUnpkTfuDciFormat0Info
4419 *
4420 *
4421 *     Desc : This structure contains the information needed to convey DCI format 0.
4422 *
4423 *
4424 *     Ret  : S16
4425 *
4426 *     Notes:
4427 *
4428 *     File  : 
4429 *
4430 **********************************************************/
4431 #ifdef ANSI
4432 PUBLIC S16 cmUnpkTfuDciFormat0Info
4433 (
4434 TfuDciFormat0Info *param,
4435 Buffer *mBuf
4436 )
4437 #else
4438 PUBLIC S16 cmUnpkTfuDciFormat0Info(param, mBuf)
4439 TfuDciFormat0Info *param;
4440 Buffer *mBuf;
4441 #endif
4442 {
4443
4444    TRC3(cmUnpkTfuDciFormat0Info)
4445
4446    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
4447    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
4448    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
4449 #ifdef TFU_UPGRADE
4450    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4451 #endif /* TFU_UPGRADE */
4452    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
4453    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4454    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4455    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4456
4457 #ifdef TFU_TDD
4458    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
4459    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4460
4461 #endif
4462    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
4463    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
4464    CMCHKUNPK(SUnpkU8, &param->numCqiBit, mBuf);
4465    CMCHKUNPK(SUnpkU8, &param->txAntenna, mBuf);
4466    /* tfu_c_001.main_3: Adding unpack for hqProcId */
4467    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4468
4469    RETVALUE(ROK);
4470 }
4471
4472
4473 \f
4474 /***********************************************************
4475 *
4476 *     Func : cmPkTfuAllocMapOrRiv
4477 *
4478 *
4479 *     Desc : This Structure could either contain a resource allocation bit map OR a
4480  * RIV Value as defined in 213 - 7.1.6.
4481 *
4482 *
4483 *     Ret  : S16
4484 *
4485 *     Notes:
4486 *
4487 *     File  : 
4488 *
4489 **********************************************************/
4490 #ifdef ANSI
4491 PUBLIC S16 cmPkTfuAllocMapOrRiv
4492 (
4493 TfuAllocMapOrRiv *param,
4494 Buffer *mBuf
4495 )
4496 #else
4497 PUBLIC S16 cmPkTfuAllocMapOrRiv(param, mBuf)
4498 TfuAllocMapOrRiv *param;
4499 Buffer *mBuf;
4500 #endif
4501 {
4502
4503    S32 i;
4504    TRC3(cmPkTfuAllocMapOrRiv)
4505
4506       switch(param->type) {
4507       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4508 #ifdef TFU_RESMAP_CHANGE
4509          case UnKnown:
4510             CMCHKPK(cmPkTfuAllocMap, &param->u.allocMap, mBuf);
4511             break;
4512    
4513 #endif
4514    
4515       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4516 #ifndef TFU_RESMAP_CHANGE
4517          case TFU_ALLOC_TYPE_MAP:
4518             for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4519                CMCHKPK(SPkU8, param->u.resAllocMap[i], mBuf);
4520             }
4521             break;
4522    
4523 #endif
4524          case TFU_ALLOC_TYPE_RIV:
4525             CMCHKPK(SPkU32, param->u.riv, mBuf);
4526             break;
4527          default :
4528             RETVALUE(RFAILED);
4529       }
4530    CMCHKPK(SPkU32, param->type, mBuf);
4531    RETVALUE(ROK);
4532 }
4533
4534
4535 \f
4536 /***********************************************************
4537 *
4538 *     Func : cmUnpkTfuAllocMapOrRiv
4539 *
4540 *
4541 *     Desc : This Structure could either contain a resource allocation bit map OR a
4542  * RIV Value as defined in 213 - 7.1.6.
4543 *
4544 *
4545 *     Ret  : S16
4546 *
4547 *     Notes:
4548 *
4549 *     File  : 
4550 *
4551 **********************************************************/
4552 #ifdef ANSI
4553 PUBLIC S16 cmUnpkTfuAllocMapOrRiv
4554 (
4555 TfuAllocMapOrRiv *param,
4556 Buffer *mBuf
4557 )
4558 #else
4559 PUBLIC S16 cmUnpkTfuAllocMapOrRiv(param, mBuf)
4560 TfuAllocMapOrRiv *param;
4561 Buffer *mBuf;
4562 #endif
4563 {
4564
4565    S32 i;
4566    TRC3(cmUnpkTfuAllocMapOrRiv)
4567
4568    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
4569       switch(param->type) {
4570          case TFU_ALLOC_TYPE_RIV:
4571             CMCHKUNPK(SUnpkU32, &param->u.riv, mBuf);
4572             break;
4573    
4574       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4575 #ifndef TFU_RESMAP_CHANGE
4576          case TFU_ALLOC_TYPE_MAP:
4577             for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4578                CMCHKUNPK(SUnpkU8, &param->u.resAllocMap[i], mBuf);
4579             }
4580             break;
4581    
4582 #endif
4583    
4584       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4585 #ifdef TFU_RESMAP_CHANGE
4586          case UnKnown:
4587             CMCHKUNPK(cmUnpkTfuAllocMap, &param->u.allocMap, mBuf);
4588             break;
4589    
4590 #endif
4591          default :
4592             RETVALUE(RFAILED);
4593       }
4594    RETVALUE(ROK);
4595 }
4596
4597
4598 \f
4599 /***********************************************************
4600 *
4601 *     Func : cmPkTfuDciFormat1AllocInfo
4602 *
4603 *
4604 *     Desc : This structure contains only the allocation information, thats part
4605  * of DCI format 1. 
4606  * @details Allocation information also contains parameters necessary
4607  * for Physical layer to process Downlink Data. This structure accompanies the
4608  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4609  * @sa TfuDciFormat1Info
4610 *
4611 *
4612 *     Ret  : S16
4613 *
4614 *     Notes:
4615 *
4616 *     File  : 
4617 *
4618 **********************************************************/
4619 #ifdef ANSI
4620 PUBLIC S16 cmPkTfuDciFormat1AllocInfo
4621 (
4622 TfuDciFormat1AllocInfo *param,
4623 Buffer *mBuf
4624 )
4625 #else
4626 PUBLIC S16 cmPkTfuDciFormat1AllocInfo(param, mBuf)
4627 TfuDciFormat1AllocInfo *param;
4628 Buffer *mBuf;
4629 #endif
4630 {
4631
4632    S32 i;
4633    TRC3(cmPkTfuDciFormat1AllocInfo)
4634
4635    CMCHKPK(SPkU8, param->rv, mBuf);
4636    CMCHKPK(SPkU8, param->mcs, mBuf);
4637    CMCHKPK(SPkU8, param->ndi, mBuf);
4638    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4639    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4640       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4641    }
4642    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4643    RETVALUE(ROK);
4644 }
4645
4646
4647 \f
4648 /***********************************************************
4649 *
4650 *     Func : cmUnpkTfuDciFormat1AllocInfo
4651 *
4652 *
4653 *     Desc : This structure contains only the allocation information, thats part
4654  * of DCI format 1. 
4655  * @details Allocation information also contains parameters necessary
4656  * for Physical layer to process Downlink Data. This structure accompanies the
4657  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4658  * @sa TfuDciFormat1Info
4659 *
4660 *
4661 *     Ret  : S16
4662 *
4663 *     Notes:
4664 *
4665 *     File  : 
4666 *
4667 **********************************************************/
4668 #ifdef ANSI
4669 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo
4670 (
4671 TfuDciFormat1AllocInfo *param,
4672 Buffer *mBuf
4673 )
4674 #else
4675 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo(param, mBuf)
4676 TfuDciFormat1AllocInfo *param;
4677 Buffer *mBuf;
4678 #endif
4679 {
4680
4681    S32 i;
4682    TRC3(cmUnpkTfuDciFormat1AllocInfo)
4683
4684    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4685    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4686       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4687    }
4688    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4689    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4690    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4691    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4692    RETVALUE(ROK);
4693 }
4694
4695 \f
4696 /***********************************************************
4697 *
4698 *     Func : cmPkTfuDciFormat1Info
4699 *
4700 *
4701 *     Desc : This structure contains the information needed to convey DCI format 1.
4702  * @details Allocation information is separated from the other control
4703  * information carried in this format. This separation is needed as Data shall
4704  * also carry some control information, essentially allocation information,
4705  * along with it, in order to aid physical layer processing of the data.
4706 *
4707 *
4708 *     Ret  : S16
4709 *
4710 *     Notes:
4711 *
4712 *     File  : 
4713 *
4714 **********************************************************/
4715 #ifdef ANSI
4716 PUBLIC S16 cmPkTfuDciFormat1Info
4717 (
4718 TfuDciFormat1Info *param,
4719 Buffer *mBuf
4720 )
4721 #else
4722 PUBLIC S16 cmPkTfuDciFormat1Info(param, mBuf)
4723 TfuDciFormat1Info *param;
4724 Buffer *mBuf;
4725 #endif
4726 {
4727
4728    TRC3(cmPkTfuDciFormat1Info)
4729
4730    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4731
4732 #ifdef TFU_TDD
4733    CMCHKPK(SPkU8, param->dai, mBuf);
4734
4735 #endif
4736    CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4737    RETVALUE(ROK);
4738 }
4739
4740
4741 \f
4742 /***********************************************************
4743 *
4744 *     Func : cmUnpkTfuDciFormat1Info
4745 *
4746 *
4747 *     Desc : This structure contains the information needed to convey DCI format 1.
4748  * @details Allocation information is separated from the other control
4749  * information carried in this format. This separation is needed as Data shall
4750  * also carry some control information, essentially allocation information,
4751  * along with it, in order to aid physical layer processing of the data.
4752 *
4753 *
4754 *     Ret  : S16
4755 *
4756 *     Notes:
4757 *
4758 *     File  : 
4759 *
4760 **********************************************************/
4761 #ifdef ANSI
4762 PUBLIC S16 cmUnpkTfuDciFormat1Info
4763 (
4764 TfuDciFormat1Info *param,
4765 Buffer *mBuf
4766 )
4767 #else
4768 PUBLIC S16 cmUnpkTfuDciFormat1Info(param, mBuf)
4769 TfuDciFormat1Info *param;
4770 Buffer *mBuf;
4771 #endif
4772 {
4773
4774    TRC3(cmUnpkTfuDciFormat1Info)
4775
4776    CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4777
4778 #ifdef TFU_TDD
4779    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4780
4781 #endif
4782    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4783    RETVALUE(ROK);
4784 }
4785
4786
4787 \f
4788 /***********************************************************
4789 *
4790 *     Func : cmPkTfuDciFormat2AAllocInfo
4791 *
4792 *
4793 *     Desc : This structure contains only the allocation information, that is part
4794   * of DCI format 2A. 
4795   * @details Allocation information also contains parameters necessary
4796   * for Physical layer to process Downlink data. This structure accompanies the
4797   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4798   * @sa TfuDciFormat2AInfo
4799 *
4800 *
4801 *     Ret  : S16
4802 *
4803 *     Notes:
4804 *
4805 *     File  : 
4806 *
4807 **********************************************************/
4808 #ifdef ANSI
4809 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo
4810 (
4811 TfuDciFormat2AAllocInfo *param,
4812 Buffer *mBuf
4813 )
4814 #else
4815 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo(param, mBuf)
4816 TfuDciFormat2AAllocInfo *param;
4817 Buffer *mBuf;
4818 #endif
4819 {
4820
4821    S32 i;
4822    TRC3(cmPkTfuDciFormat2AAllocInfo)
4823
4824    CMCHKPK(SPkU8, param->transSwap, mBuf);
4825    CMCHKPK(SPkU8, param->precoding, mBuf);
4826
4827    for (i=1; i >= 0; i--) {
4828       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4829    }
4830
4831    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4832    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4833       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4834    }
4835
4836    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4837
4838    RETVALUE(ROK);
4839 }
4840
4841
4842 \f
4843 /***********************************************************
4844 *
4845 *     Func : cmUnpkTfuDciFormat2AAllocInfo
4846 *
4847 *
4848 *     Desc : This structure contains only the allocation information, that is part
4849   * of DCI format 2A. 
4850   * @details Allocation information also contains parameters necessary
4851   * for Physical layer to process Downlink data. This structure accompanies the
4852   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4853   * @sa TfuDciFormat2AInfo
4854 *
4855 *
4856 *     Ret  : S16
4857 *
4858 *     Notes:
4859 *
4860 *     File  : 
4861 *
4862 **********************************************************/
4863 #ifdef ANSI
4864 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo
4865 (
4866 TfuDciFormat2AAllocInfo *param,
4867 Buffer *mBuf
4868 )
4869 #else
4870 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo(param, mBuf)
4871 TfuDciFormat2AAllocInfo *param;
4872 Buffer *mBuf;
4873 #endif
4874 {
4875
4876    S32 i;
4877    TRC3(cmUnpkTfuDciFormat2AAllocInfo)
4878
4879
4880 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4881 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4882    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4883
4884
4885 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4886 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4887    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4888       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4889    }
4890    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4891
4892 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4893 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4894
4895 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4896 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4897    for (i=0; i<=1; i++) {
4898       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4899    }
4900
4901    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
4902    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
4903    RETVALUE(ROK);
4904 }
4905
4906 #ifdef EMTC_ENABLE
4907 /***********************************************************
4908 *
4909 *     Func : cmPkTfuDciFormat6AAllocInfo
4910 *
4911 *
4912 *     Desc : This structure contains only the allocation information, that is part
4913   * of DCI format 6-1A. 
4914   * @details Allocation information also contains parameters necessary
4915   * for Physical layer to process Downlink data. This structure accompanies the
4916   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4917   * @sa TfuDciFormat61aInfo
4918 *
4919 *
4920 *     Ret  : S16
4921 *
4922 *     Notes:
4923 *
4924 *     File  : 
4925 *
4926 **********************************************************/
4927 #ifdef ANSI
4928 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo
4929 (
4930 TfuDciFormat61AllocInfo *param,
4931 Buffer *mBuf
4932 )
4933 #else
4934 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo(param, mBuf)
4935 TfuDciFormat61AllocInfo *param;
4936 Buffer *mBuf;
4937 #endif
4938 {
4939
4940    TRC3(cmPkTfuDciFormat6AAllocInfo)
4941
4942    CMCHKPK(SPkU8, param->rv, mBuf);
4943    CMCHKPK(SPkU8, param->mcs, mBuf);
4944    CMCHKPK(SPkU8, param->ndi, mBuf);
4945    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4946    CMCHKPK(SPkU32, param->riv, mBuf);
4947
4948    RETVALUE(ROK);
4949 }
4950
4951
4952 \f
4953 /***********************************************************
4954 *
4955 *     Func : cmUnpkTfuDciFormat6AAllocInfo
4956 *
4957 *
4958 *     Desc : This structure contains only the allocation information, that is part
4959   * of DCI format 6-1A. 
4960   * @details Allocation information also contains parameters necessary
4961   * for Physical layer to process Downlink data. This structure accompanies the
4962   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4963   * @sa TfuDciFormat61aInfo
4964 *
4965 *
4966 *     Ret  : S16
4967 *
4968 *     Notes:
4969 *
4970 *     File  : 
4971 *
4972 **********************************************************/
4973 #ifdef ANSI
4974 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo
4975 (
4976 TfuDciFormat61AllocInfo *param,
4977 Buffer *mBuf
4978 )
4979 #else
4980 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo(param, mBuf)
4981 TfuDciFormat61AllocInfo *param;
4982 Buffer *mBuf;
4983 #endif
4984 {
4985
4986    TRC3(cmUnpkTfuDciFormat6AAllocInfo)
4987
4988    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4989    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4990    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4991    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4992    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4993    printf("In cmUnpkTfuDciFormat6AAllocInfo :: Passed \n");
4994    RETVALUE(ROK);
4995 }
4996 #endif
4997
4998
4999 \f
5000 /***********************************************************
5001 *
5002 *     Func : cmPkTfuDciFormat2AInfo
5003 *
5004 *
5005 *     Desc : This structure contains the information carried by DCI format 2A. 
5006  * @details It carries the allocation information and other control information.
5007 *
5008 *
5009 *     Ret  : S16
5010 *
5011 *     Notes:
5012 *
5013 *     File  : 
5014 *
5015 **********************************************************/
5016 #ifdef ANSI
5017 PUBLIC S16 cmPkTfuDciFormat2AInfo
5018 (
5019 TfuDciFormat2AInfo *param,
5020 Buffer *mBuf
5021 )
5022 #else
5023 PUBLIC S16 cmPkTfuDciFormat2AInfo(param, mBuf)
5024 TfuDciFormat2AInfo *param;
5025 Buffer *mBuf;
5026 #endif
5027 {
5028
5029    TRC3(cmPkTfuDciFormat2AInfo)
5030
5031    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5032
5033 #ifdef TFU_TDD
5034    CMCHKPK(SPkU8, param->dai, mBuf);
5035
5036 #endif
5037    CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5038    RETVALUE(ROK);
5039 }
5040
5041
5042 \f
5043 /***********************************************************
5044 *
5045 *     Func : cmUnpkTfuDciFormat2AInfo
5046 *
5047 *
5048 *     Desc : This structure contains the information carried by DCI format 2A. 
5049  * @details It carries the allocation information and other control information.
5050 *
5051 *
5052 *     Ret  : S16
5053 *
5054 *     Notes:
5055 *
5056 *     File  : 
5057 *
5058 **********************************************************/
5059 #ifdef ANSI
5060 PUBLIC S16 cmUnpkTfuDciFormat2AInfo
5061 (
5062 TfuDciFormat2AInfo *param,
5063 Buffer *mBuf
5064 )
5065 #else
5066 PUBLIC S16 cmUnpkTfuDciFormat2AInfo(param, mBuf)
5067 TfuDciFormat2AInfo *param;
5068 Buffer *mBuf;
5069 #endif
5070 {
5071
5072    TRC3(cmUnpkTfuDciFormat2AInfo)
5073
5074    CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5075
5076 #ifdef TFU_TDD
5077    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5078
5079 #endif
5080    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5081    RETVALUE(ROK);
5082 }
5083
5084
5085 \f
5086 /***********************************************************
5087 *
5088 *     Func : cmPkTfuDciFormat2AllocInfo
5089 *
5090 *
5091 *     Desc : This structure contains only the allocation information, that is part
5092   * of DCI format 2. 
5093   * @details Allocation information also contains parameters necessary
5094   * for Physical layer to process Downlink data. This structure accompanies the
5095   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5096   * @sa TfuDciFormat2Info
5097 *
5098 *
5099 *     Ret  : S16
5100 *
5101 *     Notes:
5102 *
5103 *     File  : 
5104 *
5105 **********************************************************/
5106 #ifdef ANSI
5107 PUBLIC S16 cmPkTfuDciFormat2AllocInfo
5108 (
5109 TfuDciFormat2AllocInfo *param,
5110 Buffer *mBuf
5111 )
5112 #else
5113 PUBLIC S16 cmPkTfuDciFormat2AllocInfo(param, mBuf)
5114 TfuDciFormat2AllocInfo *param;
5115 Buffer *mBuf;
5116 #endif
5117 {
5118
5119    S32 i;
5120    TRC3(cmPkTfuDciFormat2AllocInfo)
5121
5122
5123 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5124 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5125    for (i=1; i >= 0; i--) {
5126       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5127    }
5128    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5129
5130    CMCHKPK(SPkU8, param->precoding, mBuf);
5131    CMCHKPK(SPkU8, param->transSwap, mBuf);
5132
5133 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5134 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5135
5136 #ifdef TFU_TDD
5137    CMCHKPK(SPkU8, param->dai, mBuf);
5138
5139 #endif
5140    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
5141       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
5142    }
5143
5144 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5145 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5146
5147 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5148 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5149    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
5150
5151    RETVALUE(ROK);
5152 }
5153
5154
5155 \f
5156 /***********************************************************
5157 *
5158 *     Func : cmUnpkTfuDciFormat2AllocInfo
5159 *
5160 *
5161 *     Desc : This structure contains only the allocation information, that is part
5162   * of DCI format 2. 
5163   * @details Allocation information also contains parameters necessary
5164   * for Physical layer to process Downlink data. This structure accompanies the
5165   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5166   * @sa TfuDciFormat2Info
5167 *
5168 *
5169 *     Ret  : S16
5170 *
5171 *     Notes:
5172 *
5173 *     File  : 
5174 *
5175 **********************************************************/
5176 #ifdef ANSI
5177 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo
5178 (
5179 TfuDciFormat2AllocInfo *param,
5180 Buffer *mBuf
5181 )
5182 #else
5183 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo(param, mBuf)
5184 TfuDciFormat2AllocInfo *param;
5185 Buffer *mBuf;
5186 #endif
5187 {
5188
5189    S32 i;
5190    TRC3(cmUnpkTfuDciFormat2AllocInfo)
5191
5192
5193 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5194 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5195    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
5196
5197
5198 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5199 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5200    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
5201       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
5202    }
5203
5204 #ifdef TFU_TDD
5205    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5206
5207 #endif
5208
5209 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5210 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5211    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
5212    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
5213
5214 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5215 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5216    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5217    for (i=0; i<=1; i++) {
5218       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5219    }
5220
5221    RETVALUE(ROK);
5222 }
5223
5224
5225 \f
5226 /***********************************************************
5227 *
5228 *     Func : cmPkTfuDciFormat2Info
5229 *
5230 *
5231 *     Desc : This structure contains the information carried by DCI format 2.
5232  * @details Allocation information is separated from the other control
5233  * information carried in this format. This separation is needed as Data must
5234  * also carry some control information, essentially, allocation information
5235  * along with it, in order to aid physical layer processing of the data.
5236 *
5237 *
5238 *     Ret  : S16
5239 *
5240 *     Notes:
5241 *
5242 *     File  : 
5243 *
5244 **********************************************************/
5245 #ifdef ANSI
5246 PUBLIC S16 cmPkTfuDciFormat2Info
5247 (
5248 TfuDciFormat2Info *param,
5249 Buffer *mBuf
5250 )
5251 #else
5252 PUBLIC S16 cmPkTfuDciFormat2Info(param, mBuf)
5253 TfuDciFormat2Info *param;
5254 Buffer *mBuf;
5255 #endif
5256 {
5257
5258    TRC3(cmPkTfuDciFormat2Info)
5259
5260
5261 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5262 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5263
5264 #ifdef TFU_TDD
5265    CMCHKPK(SPkU8, param->dai, mBuf);
5266
5267 #endif
5268
5269    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5270
5271 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5272 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5273    CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5274    RETVALUE(ROK);
5275 }
5276
5277
5278 \f
5279 /***********************************************************
5280 *
5281 *     Func : cmUnpkTfuDciFormat2Info
5282 *
5283 *
5284 *     Desc : This structure contains the information carried by DCI format 2.
5285  * @details Allocation information is separated from the other control
5286  * information carried in this format. This separation is needed as Data must
5287  * also carry some control information, essentially, allocation information
5288  * along with it, in order to aid physical layer processing of the data.
5289 *
5290 *
5291 *     Ret  : S16
5292 *
5293 *     Notes:
5294 *
5295 *     File  : 
5296 *
5297 **********************************************************/
5298 #ifdef ANSI
5299 PUBLIC S16 cmUnpkTfuDciFormat2Info
5300 (
5301 TfuDciFormat2Info *param,
5302 Buffer *mBuf
5303 )
5304 #else
5305 PUBLIC S16 cmUnpkTfuDciFormat2Info(param, mBuf)
5306 TfuDciFormat2Info *param;
5307 Buffer *mBuf;
5308 #endif
5309 {
5310
5311    TRC3(cmUnpkTfuDciFormat2Info)
5312
5313    CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5314
5315 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5316 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5317    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5318
5319 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5320 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5321
5322 #ifdef TFU_TDD
5323    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5324
5325 #endif
5326
5327    RETVALUE(ROK);
5328 }
5329
5330
5331 \f
5332 /***********************************************************
5333 *
5334 *     Func : cmPkTfuDciFormat3Info
5335 *
5336 *
5337 *     Desc : This structure contains the information carried in DCI format 3.
5338 *
5339 *
5340 *     Ret  : S16
5341 *
5342 *     Notes:
5343 *
5344 *     File  : 
5345 *
5346 **********************************************************/
5347 #ifdef ANSI
5348 PUBLIC S16 cmPkTfuDciFormat3Info
5349 (
5350 TfuDciFormat3Info *param,
5351 Buffer *mBuf
5352 )
5353 #else
5354 PUBLIC S16 cmPkTfuDciFormat3Info(param, mBuf)
5355 TfuDciFormat3Info *param;
5356 Buffer *mBuf;
5357 #endif
5358 {
5359
5360    S32 i;
5361    TRC3(cmPkTfuDciFormat3Info)
5362
5363    CMCHKPK(SPkU8, param->isPucch, mBuf);
5364    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5365       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5366    }
5367    RETVALUE(ROK);
5368 }
5369
5370
5371 \f
5372 /***********************************************************
5373 *
5374 *     Func : cmUnpkTfuDciFormat3Info
5375 *
5376 *
5377 *     Desc : This structure contains the information carried in DCI format 3.
5378 *
5379 *
5380 *     Ret  : S16
5381 *
5382 *     Notes:
5383 *
5384 *     File  : 
5385 *
5386 **********************************************************/
5387 #ifdef ANSI
5388 PUBLIC S16 cmUnpkTfuDciFormat3Info
5389 (
5390 TfuDciFormat3Info *param,
5391 Buffer *mBuf
5392 )
5393 #else
5394 PUBLIC S16 cmUnpkTfuDciFormat3Info(param, mBuf)
5395 TfuDciFormat3Info *param;
5396 Buffer *mBuf;
5397 #endif
5398 {
5399
5400    S32 i;
5401    TRC3(cmUnpkTfuDciFormat3Info)
5402
5403    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5404       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5405    }
5406    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5407    RETVALUE(ROK);
5408 }
5409
5410
5411 \f
5412 /***********************************************************
5413 *
5414 *     Func : cmPkTfuDciFormat3AInfo
5415 *
5416 *
5417 *     Desc : This structure contains the information carried by DCI format 3A.
5418 *
5419 *
5420 *     Ret  : S16
5421 *
5422 *     Notes:
5423 *
5424 *     File  : 
5425 *
5426 **********************************************************/
5427 #ifdef ANSI
5428 PUBLIC S16 cmPkTfuDciFormat3AInfo
5429 (
5430 TfuDciFormat3AInfo *param,
5431 Buffer *mBuf
5432 )
5433 #else
5434 PUBLIC S16 cmPkTfuDciFormat3AInfo(param, mBuf)
5435 TfuDciFormat3AInfo *param;
5436 Buffer *mBuf;
5437 #endif
5438 {
5439
5440    S32 i;
5441    TRC3(cmPkTfuDciFormat3AInfo)
5442    CMCHKPK(SPkU8, param->isPucch, mBuf);
5443    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5444       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5445    }
5446    RETVALUE(ROK);
5447 }
5448
5449
5450 \f
5451 /***********************************************************
5452 *
5453 *     Func : cmUnpkTfuDciFormat3AInfo
5454 *
5455 *
5456 *     Desc : This structure contains the information carried by DCI format 3A.
5457 *
5458 *
5459 *     Ret  : S16
5460 *
5461 *     Notes:
5462 *
5463 *     File  : 
5464 *
5465 **********************************************************/
5466 #ifdef ANSI
5467 PUBLIC S16 cmUnpkTfuDciFormat3AInfo
5468 (
5469 TfuDciFormat3AInfo *param,
5470 Buffer *mBuf
5471 )
5472 #else
5473 PUBLIC S16 cmUnpkTfuDciFormat3AInfo(param, mBuf)
5474 TfuDciFormat3AInfo *param;
5475 Buffer *mBuf;
5476 #endif
5477 {
5478
5479    S32 i;
5480    TRC3(cmUnpkTfuDciFormat3AInfo)
5481
5482    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5483       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5484    }
5485    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5486    RETVALUE(ROK);
5487 }
5488
5489 #ifdef EMTC_ENABLE
5490
5491
5492 /***********************************************************
5493 *
5494 *     Func : cmPkTfuDciFormat60aInfo 
5495 *
5496 *
5497 *     Desc : This structure contains the information that is carried in DCI
5498   * format 6-0A
5499 *
5500 *
5501 *     Ret  : S16
5502 *
5503 *     Notes:
5504 *
5505 *     File  :
5506 *
5507 ************************************************************/
5508
5509 #ifdef ANSI
5510 PRIVATE S16 cmPkTfuDciFormat60aInfo
5511 (
5512 TfuDciFormat60aInfo *param,
5513 Buffer *mBuf
5514 )
5515 #else
5516 PRIVATE S16 cmPkTfuDciFormat60aInfo(param, mBuf)
5517 TfuDciFormat60aInfo *param;
5518 Buffer *mBuf;
5519 #endif
5520 {
5521
5522    TRC3(cmPkTfuDciFormat60aInfo)
5523
5524    CMCHKPK(SPkU8, param->dciRep, mBuf);
5525    CMCHKPK(SPkU8, param->isSrs, mBuf);
5526    CMCHKPK(SPkU8, param->cqiReq, mBuf);
5527 #ifdef TFU_TDD
5528    CMCHKPK(SPkU8, param->dai, mBuf);
5529    CMCHKPK(SPkU8, param->ulIdx, mBuf);
5530 #endif
5531    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5532    CMCHKPK(SPkU8, param->rv, mBuf);
5533    CMCHKPK(SPkU8, param->ndi, mBuf);
5534    CMCHKPK(SPkU8, param->hqProcId, mBuf);
5535    CMCHKPK(SPkU8, param->rep, mBuf);
5536    CMCHKPK(SPkU8, param->mcs, mBuf);
5537    CMCHKPK(SPkU32, param->riv, mBuf);
5538    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5539    RETVALUE(ROK);
5540 }
5541 /***********************************************************
5542 *
5543 *     Func : cmPkTfuPdcchOrderInfoEmtc
5544 *
5545 *
5546 *     Desc : This structure contains the information that is carried in DCI
5547   * format 6-1A in the case of a PDCCH order.
5548 *
5549 *
5550 *     Ret  : S16
5551 *
5552 *     Notes:
5553 *
5554 *     File  : 
5555 *
5556 **********************************************************/
5557 #ifdef ANSI
5558 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc
5559 (
5560 TfuPdcchOrderInfoEmtc *param,
5561 Buffer *mBuf
5562 )
5563 #else
5564 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc(param, mBuf)
5565 TfuPdcchOrderInfoEmtc *param;
5566 Buffer *mBuf;
5567 #endif
5568 {
5569
5570    TRC3(cmPkTfuPdcchOrderInfoEmtc)
5571
5572    CMCHKPK(SPkU8, param->ceLevel, mBuf);
5573    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
5574    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
5575    CMCHKPK(SPkU32, param->riv, mBuf);
5576    RETVALUE(ROK);
5577 }
5578
5579 /***********************************************************
5580 *
5581 *     Func : cmPkTfudciformat61aPdsch
5582 *
5583 *
5584 *     Desc : This structure contains the information carried in DCI format 6-1A
5585   * when it is NOT used for a PDCCH order.
5586 *
5587 *
5588 *     Ret  : S16
5589 *
5590 *     Notes:
5591 *
5592 *     File  : 
5593 *
5594 **********************************************************/
5595 #ifdef ANSI
5596 PRIVATE S16 cmPkTfudciformat61aPdsch
5597 (
5598 Tfudciformat61aPdsch *param,
5599 Buffer *mBuf
5600 )
5601 #else
5602 PRIVATE S16 cmPkTfudciformat61aPdsch(param, mBuf)
5603 Tfudciformat61aPdsch *param;
5604 Buffer *mBuf;
5605 #endif
5606 {
5607
5608    TRC3(cmPkTfudciformat61aPdsch)
5609
5610    CMCHKPK(SPkU8, param->isTBMsg4, mBuf);
5611    CMCHKPK(SPkU8, param->dciRep, mBuf);
5612    CMCHKPK(SPkU8, param->harqAckOffst, mBuf);
5613    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
5614    CMCHKPK(SPkU8, param->tPmi, mBuf);
5615    CMCHKPK(SPkU8, param->isSrs, mBuf);
5616    CMCHKPK(SPkU8, param->antPortAndScrId, mBuf);
5617
5618 #ifdef TFU_TDD
5619    CMCHKPK(SPkU8, param->dai, mBuf);
5620 #endif
5621    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5622    CMCHKPK(SPkU8, param->rep, mBuf);
5623    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5624    CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
5625    RETVALUE(ROK);
5626 }
5627
5628
5629 /***********************************************************
5630 *
5631 *     Func : cmPkTfuDciFormat61aInfo
5632 *
5633 *
5634 *     Desc : This structure contains the information needed to convey DCI format 6-1A.
5635  * @details Format can possibly carry PDSCH allocation or information needed for
5636  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
5637  * sync with eNodeB.
5638 *
5639 *
5640 *     Ret  : S16
5641 *
5642 *     Notes:
5643 *
5644 *     File  : 
5645 *
5646 **********************************************************/
5647 #ifdef ANSI
5648 PUBLIC S16 cmPkTfuDciFormat61aInfo
5649 (
5650 TfuDciFormat61aInfo *param,
5651 Buffer *mBuf
5652 )
5653 #else
5654 PUBLIC S16 cmPkTfuDciFormat61aInfo(param, mBuf)
5655 TfuDciFormat61aInfo *param;
5656 Buffer *mBuf;
5657 #endif
5658 {
5659
5660    TRC3(cmPkTfuDciFormat61aInfo)
5661
5662    switch(param->isPdcchOrder) {
5663       case FALSE:
5664          CMCHKPK(cmPkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5665          break;
5666       case TRUE:
5667          CMCHKPK(cmPkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5668          break;
5669       default :
5670          RETVALUE(RFAILED);
5671       }
5672    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
5673
5674    RETVALUE(ROK);
5675 }
5676
5677 /***********************************************************
5678 *
5679 *     Func : cmUnpkTfuDciFormat60aInfo
5680 *
5681 *
5682 *     Desc : This structure contains the information that is carried in DCI
5683   * format 6-0A.
5684 *
5685 *
5686 *     Ret  : S16
5687 *
5688 *     Notes:
5689 *
5690 *     File  : 
5691 *
5692 * **********************************************************/
5693
5694 #ifdef ANSI
5695 PRIVATE S16 cmUnpkTfuDciFormat60aInfo 
5696 (
5697 TfuDciFormat60aInfo *param,
5698 Buffer *mBuf
5699 )
5700 #else
5701 PRIVATE S16 cmUnpkTfuDciFormat60aInfo(param, mBuf)
5702 TfuDciFormat60aInfo *param;
5703 Buffer *mBuf;
5704 #endif
5705 {
5706
5707    TRC3(cmUnpkTfuDciFormat60aInfo)
5708
5709    printf("In cmUnpkTfuDciFormat60aInfo :: Entry \n");
5710    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
5711    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5712    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5713    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
5714    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
5715    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5716    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5717    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5718 #ifdef TFU_TDD
5719    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
5720    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5721 #endif
5722    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
5723    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
5724    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
5725    printf("In cmUnpkTfuDciFormat60aInfo :: Exit \n");
5726    RETVALUE(ROK);
5727 }
5728 /***********************************************************
5729 *
5730 *     Func : cmUnpkTfuPdcchOrderInfoEmtc
5731 *
5732 *
5733 *     Desc : This structure contains the information that is carried in DCI
5734   * format 6-1A in the case of a PDCCH order.
5735 *
5736 *
5737 *     Ret  : S16
5738 *
5739 *     Notes:
5740 *
5741 *     File  : 
5742 *
5743 **********************************************************/
5744 #ifdef ANSI
5745 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc
5746 (
5747 TfuPdcchOrderInfoEmtc *param,
5748 Buffer *mBuf
5749 )
5750 #else
5751 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc(param, mBuf)
5752 TfuPdcchOrderInfoEmtc *param;
5753 Buffer *mBuf;
5754 #endif
5755 {
5756
5757    TRC3(cmUnpkTfuPdcchOrderInfoEmtc)
5758
5759    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Entry \n");
5760    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5761    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
5762    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
5763    CMCHKUNPK(SUnpkU8, &param->ceLevel, mBuf);
5764    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Passed \n");
5765    RETVALUE(ROK);
5766 }
5767
5768 /***********************************************************
5769 *
5770 *     Func : cmUnpkTfuDciFormat61aInfo
5771 *
5772 *
5773 *     Desc : This structure contains the information carried by DCI format 6-1A.
5774 *
5775 *
5776 *     Ret  : S16
5777 *
5778 *     Notes:
5779 *
5780 *     File  : 
5781 *
5782 **********************************************************/
5783 #ifdef ANSI
5784 PUBLIC S16 cmUnpkTfuDciFormat61aInfo
5785 (
5786 TfuDciFormat61aInfo *param,
5787 Buffer *mBuf
5788 )
5789 #else
5790 PUBLIC S16 cmUnpkTfuDciFormat61aInfo(param, mBuf)
5791 TfuDciFormat61aInfo *param;
5792 Buffer *mBuf;
5793 #endif
5794 {
5795
5796    TRC3(cmUnpkTfuDciFormat61aInfo)
5797
5798    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
5799    printf("1. cmUnpkTfuDciFormat61aInfo ::  isPdcchOrder %d \n", param->isPdcchOrder); 
5800    switch(param->isPdcchOrder) {
5801       case TRUE:
5802          CMCHKUNPK(cmUnpkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5803          break;
5804       case FALSE:
5805          CMCHKUNPK(cmUnpkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5806          break;
5807       default :
5808          RETVALUE(RFAILED);
5809       }
5810    RETVALUE(ROK);
5811 }
5812 #endif
5813 \f
5814 /***********************************************************
5815 *
5816 *     Func : cmPkTfuDciFormat1dAllocInfo
5817 *
5818 *
5819 *     Desc : This structure contains only the allocation information, thats part
5820   * of DCI format 1D. 
5821   * @details Allocation information also contains parameters necessary
5822   * for Physical layer to process Downlink Data. This structure accompanies the
5823   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5824   * @sa TfuDciFormat1dInfo
5825 *
5826 *
5827 *     Ret  : S16
5828 *
5829 *     Notes:
5830 *
5831 *     File  : 
5832 *
5833 **********************************************************/
5834 #ifdef ANSI
5835 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo
5836 (
5837 TfuDciFormat1dAllocInfo *param,
5838 Buffer *mBuf
5839 )
5840 #else
5841 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo(param, mBuf)
5842 TfuDciFormat1dAllocInfo *param;
5843 Buffer *mBuf;
5844 #endif
5845 {
5846
5847    TRC3(cmPkTfuDciFormat1dAllocInfo)
5848
5849    CMCHKPK(SPkU8, param->tPmi, mBuf);
5850    CMCHKPK(SPkU8, param->rv, mBuf);
5851    CMCHKPK(SPkU8, param->mcs, mBuf);
5852    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5853    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5854    CMCHKPK(SPkU8, param->isLocal, mBuf);
5855    RETVALUE(ROK);
5856 }
5857
5858
5859 \f
5860 /***********************************************************
5861 *
5862 *     Func : cmUnpkTfuDciFormat1dAllocInfo
5863 *
5864 *
5865 *     Desc : This structure contains only the allocation information, thats part
5866   * of DCI format 1D. 
5867   * @details Allocation information also contains parameters necessary
5868   * for Physical layer to process Downlink Data. This structure accompanies the
5869   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5870   * @sa TfuDciFormat1dInfo
5871 *
5872 *
5873 *     Ret  : S16
5874 *
5875 *     Notes:
5876 *
5877 *     File  : 
5878 *
5879 **********************************************************/
5880 #ifdef ANSI
5881 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo
5882 (
5883 TfuDciFormat1dAllocInfo *param,
5884 Buffer *mBuf
5885 )
5886 #else
5887 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo(param, mBuf)
5888 TfuDciFormat1dAllocInfo *param;
5889 Buffer *mBuf;
5890 #endif
5891 {
5892
5893    TRC3(cmUnpkTfuDciFormat1dAllocInfo)
5894
5895    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
5896    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
5897    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5898    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5899    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5900    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
5901    RETVALUE(ROK);
5902 }
5903
5904
5905 \f
5906 /***********************************************************
5907 *
5908 *     Func : cmPkTfuDciFormat1dInfo
5909 *
5910 *
5911 *     Desc : This structure contains the information carried by DCI format 1D.
5912  * @details Allocation information is separated from the other control
5913  * information carried in this format. This separation is needed as Data shall
5914  * also carry some control information, essentially allocation information,
5915  * along with it, in order to aid physical layer processing of the data.
5916 *
5917 *
5918 *     Ret  : S16
5919 *
5920 *     Notes:
5921 *
5922 *     File  : 
5923 *
5924 **********************************************************/
5925 #ifdef ANSI
5926 PUBLIC S16 cmPkTfuDciFormat1dInfo
5927 (
5928 TfuDciFormat1dInfo *param,
5929 Buffer *mBuf
5930 )
5931 #else
5932 PUBLIC S16 cmPkTfuDciFormat1dInfo(param, mBuf)
5933 TfuDciFormat1dInfo *param;
5934 Buffer *mBuf;
5935 #endif
5936 {
5937
5938    TRC3(cmPkTfuDciFormat1dInfo)
5939
5940    CMCHKPK(SPkU8, param->dlPwrOffset, mBuf);
5941
5942 #ifdef TFU_TDD
5943    CMCHKPK(SPkU8, param->dai, mBuf);
5944
5945 #endif
5946    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5947    CMCHKPK(SPkU8, param->ndi, mBuf);
5948    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5949    CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5950    RETVALUE(ROK);
5951 }
5952
5953
5954 \f
5955 /***********************************************************
5956 *
5957 *     Func : cmUnpkTfuDciFormat1dInfo
5958 *
5959 *
5960 *     Desc : This structure contains the information carried by DCI format 1D.
5961  * @details Allocation information is separated from the other control
5962  * information carried in this format. This separation is needed as Data shall
5963  * also carry some control information, essentially allocation information,
5964  * along with it, in order to aid physical layer processing of the data.
5965 *
5966 *
5967 *     Ret  : S16
5968 *
5969 *     Notes:
5970 *
5971 *     File  : 
5972 *
5973 **********************************************************/
5974 #ifdef ANSI
5975 PUBLIC S16 cmUnpkTfuDciFormat1dInfo
5976 (
5977 TfuDciFormat1dInfo *param,
5978 Buffer *mBuf
5979 )
5980 #else
5981 PUBLIC S16 cmUnpkTfuDciFormat1dInfo(param, mBuf)
5982 TfuDciFormat1dInfo *param;
5983 Buffer *mBuf;
5984 #endif
5985 {
5986
5987    TRC3(cmUnpkTfuDciFormat1dInfo)
5988
5989    CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5990    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5991    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5992    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5993
5994 #ifdef TFU_TDD
5995    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5996
5997 #endif
5998    CMCHKUNPK(SUnpkU8, &param->dlPwrOffset, mBuf);
5999    RETVALUE(ROK);
6000 }
6001
6002
6003 \f
6004 /***********************************************************
6005 *
6006 *     Func : cmPkTfuDciFormat1cInfo
6007 *
6008 *
6009 *     Desc : This structure contains only the allocation information, thats part
6010   * of DCI format 1C. 
6011   * @details Allocation information also contains parameters necessary
6012   * for Physical layer to process Downlink Data. This structure accompanies the
6013   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6014   * @sa TfuDciFormat1CInfo
6015 *
6016 *
6017 *     Ret  : S16
6018 *
6019 *     Notes:
6020 *
6021 *     File  : 
6022 *
6023 **********************************************************/
6024 #ifdef ANSI
6025 PUBLIC S16 cmPkTfuDciFormat1cInfo
6026 (
6027 TfuDciFormat1cInfo *param,
6028 Buffer *mBuf
6029 )
6030 #else
6031 PUBLIC S16 cmPkTfuDciFormat1cInfo(param, mBuf)
6032 TfuDciFormat1cInfo *param;
6033 Buffer *mBuf;
6034 #endif
6035 {
6036
6037    TRC3(cmPkTfuDciFormat1cInfo)
6038
6039    CMCHKPK(SPkU8, param->iTbs, mBuf);
6040    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6041    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6042    RETVALUE(ROK);
6043 }
6044
6045
6046 \f
6047 /***********************************************************
6048 *
6049 *     Func : cmUnpkTfuDciFormat1cInfo
6050 *
6051 *
6052 *     Desc : This structure contains only the allocation information, thats part
6053   * of DCI format 1C. 
6054   * @details Allocation information also contains parameters necessary
6055   * for Physical layer to process Downlink Data. This structure accompanies the
6056   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6057   * @sa TfuDciFormat1CInfo
6058 *
6059 *
6060 *     Ret  : S16
6061 *
6062 *     Notes:
6063 *
6064 *     File  : 
6065 *
6066 **********************************************************/
6067 #ifdef ANSI
6068 PUBLIC S16 cmUnpkTfuDciFormat1cInfo
6069 (
6070 TfuDciFormat1cInfo *param,
6071 Buffer *mBuf
6072 )
6073 #else
6074 PUBLIC S16 cmUnpkTfuDciFormat1cInfo(param, mBuf)
6075 TfuDciFormat1cInfo *param;
6076 Buffer *mBuf;
6077 #endif
6078 {
6079
6080    TRC3(cmUnpkTfuDciFormat1cInfo)
6081
6082    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6083    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6084    CMCHKUNPK(SUnpkU8, &param->iTbs, mBuf);
6085    RETVALUE(ROK);
6086 }
6087
6088
6089 \f
6090 /***********************************************************
6091 *
6092 *     Func : cmPkTfuDciFormat1bAllocInfo
6093 *
6094 *
6095 *     Desc : This structure contains only the allocation information, thats part
6096   * of DCI format 1 B. 
6097   * @details Allocation information also contains parameters necessary
6098   * for Physical layer to process Downlink Data. This structure accompanies the
6099   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6100   * @sa TfuDciFormat1BInfo
6101 *
6102 *
6103 *     Ret  : S16
6104 *
6105 *     Notes:
6106 *
6107 *     File  : 
6108 *
6109 **********************************************************/
6110 #ifdef ANSI
6111 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo
6112 (
6113 TfuDciFormat1bAllocInfo *param,
6114 Buffer *mBuf
6115 )
6116 #else
6117 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo(param, mBuf)
6118 TfuDciFormat1bAllocInfo *param;
6119 Buffer *mBuf;
6120 #endif
6121 {
6122
6123    TRC3(cmPkTfuDciFormat1bAllocInfo)
6124
6125    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
6126    CMCHKPK(SPkU8, param->tPmi, mBuf);
6127    CMCHKPK(SPkU8, param->ndi, mBuf);
6128    CMCHKPK(SPkU8, param->harqProcId, mBuf);
6129    CMCHKPK(SPkU8, param->rv, mBuf);
6130    CMCHKPK(SPkU8, param->mcs, mBuf);
6131    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6132    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6133    CMCHKPK(SPkU8, param->isLocal, mBuf);
6134    RETVALUE(ROK);
6135 }
6136
6137
6138 \f
6139 /***********************************************************
6140 *
6141 *     Func : cmUnpkTfuDciFormat1bAllocInfo
6142 *
6143 *
6144 *     Desc : This structure contains only the allocation information, thats part
6145   * of DCI format 1 B. 
6146   * @details Allocation information also contains parameters necessary
6147   * for Physical layer to process Downlink Data. This structure accompanies the
6148   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6149   * @sa TfuDciFormat1BInfo
6150 *
6151 *
6152 *     Ret  : S16
6153 *
6154 *     Notes:
6155 *
6156 *     File  : 
6157 *
6158 **********************************************************/
6159 #ifdef ANSI
6160 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo
6161 (
6162 TfuDciFormat1bAllocInfo *param,
6163 Buffer *mBuf
6164 )
6165 #else
6166 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo(param, mBuf)
6167 TfuDciFormat1bAllocInfo *param;
6168 Buffer *mBuf;
6169 #endif
6170 {
6171
6172    TRC3(cmUnpkTfuDciFormat1bAllocInfo)
6173
6174    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6175    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6176    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6177    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6178    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6179    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6180    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6181    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6182    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6183    RETVALUE(ROK);
6184 }
6185
6186
6187 \f
6188 /***********************************************************
6189 *
6190 *     Func : cmPkTfuPdcchOrderInfo
6191 *
6192 *
6193 *     Desc : This structure contains the information that is carried in DCI
6194   * format 1A in the case of a PDCCH order.
6195 *
6196 *
6197 *     Ret  : S16
6198 *
6199 *     Notes:
6200 *
6201 *     File  : 
6202 *
6203 **********************************************************/
6204 #ifdef ANSI
6205 PUBLIC S16 cmPkTfuPdcchOrderInfo
6206 (
6207 TfuPdcchOrderInfo *param,
6208 Buffer *mBuf
6209 )
6210 #else
6211 PUBLIC S16 cmPkTfuPdcchOrderInfo(param, mBuf)
6212 TfuPdcchOrderInfo *param;
6213 Buffer *mBuf;
6214 #endif
6215 {
6216
6217    TRC3(cmPkTfuPdcchOrderInfo)
6218
6219    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
6220    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
6221    RETVALUE(ROK);
6222 }
6223
6224
6225 \f
6226 /***********************************************************
6227 *
6228 *     Func : cmUnpkTfuPdcchOrderInfo
6229 *
6230 *
6231 *     Desc : This structure contains the information that is carried in DCI
6232   * format 1A in the case of a PDCCH order.
6233 *
6234 *
6235 *     Ret  : S16
6236 *
6237 *     Notes:
6238 *
6239 *     File  : 
6240 *
6241 **********************************************************/
6242 #ifdef ANSI
6243 PUBLIC S16 cmUnpkTfuPdcchOrderInfo
6244 (
6245 TfuPdcchOrderInfo *param,
6246 Buffer *mBuf
6247 )
6248 #else
6249 PUBLIC S16 cmUnpkTfuPdcchOrderInfo(param, mBuf)
6250 TfuPdcchOrderInfo *param;
6251 Buffer *mBuf;
6252 #endif
6253 {
6254
6255    TRC3(cmUnpkTfuPdcchOrderInfo)
6256
6257    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
6258    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
6259    RETVALUE(ROK);
6260 }
6261
6262
6263 \f
6264 /***********************************************************
6265 *
6266 *     Func : cmPkTfuDciFormat1aAllocInfo
6267 *
6268 *
6269 *     Desc : This structure contains only the allocation information, thats part
6270   * of DCI format 1A. 
6271   * @details Allocation information also contains parameters necessary
6272   * for Physical layer to process Downlink Data. This structure accompanies the
6273   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6274   * @sa TfuDciFormat1AInfo
6275 *
6276 *
6277 *     Ret  : S16
6278 *
6279 *     Notes:
6280 *
6281 *     File  : 
6282 *
6283 **********************************************************/
6284 #ifdef ANSI
6285 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo
6286 (
6287 TfuDciFormat1aAllocInfo *param,
6288 Buffer *mBuf
6289 )
6290 #else
6291 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo(param, mBuf)
6292 TfuDciFormat1aAllocInfo *param;
6293 Buffer *mBuf;
6294 #endif
6295 {
6296
6297    TRC3(cmPkTfuDciFormat1aAllocInfo)
6298
6299    CMCHKPK(SPkU8, param->ndi, mBuf);
6300    CMCHKPK(cmPkTknU8, &param->harqProcId, mBuf);
6301    CMCHKPK(SPkU8, param->rv, mBuf);
6302    CMCHKPK(SPkU8, param->mcs, mBuf);
6303    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6304    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6305    CMCHKPK(SPkU8, param->isLocal, mBuf);
6306    RETVALUE(ROK);
6307 }
6308
6309
6310 \f
6311 /***********************************************************
6312 *
6313 *     Func : cmUnpkTfuDciFormat1aAllocInfo
6314 *
6315 *
6316 *     Desc : This structure contains only the allocation information, thats part
6317   * of DCI format 1A. 
6318   * @details Allocation information also contains parameters necessary
6319   * for Physical layer to process Downlink Data. This structure accompanies the
6320   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6321   * @sa TfuDciFormat1AInfo
6322 *
6323 *
6324 *     Ret  : S16
6325 *
6326 *     Notes:
6327 *
6328 *     File  : 
6329 *
6330 **********************************************************/
6331 #ifdef ANSI
6332 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo
6333 (
6334 TfuDciFormat1aAllocInfo *param,
6335 Buffer *mBuf
6336 )
6337 #else
6338 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo(param, mBuf)
6339 TfuDciFormat1aAllocInfo *param;
6340 Buffer *mBuf;
6341 #endif
6342 {
6343
6344    TRC3(cmUnpkTfuDciFormat1aAllocInfo)
6345
6346    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6347    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6348    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6349    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6350    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6351    CMCHKUNPK(cmUnpkTknU8, &param->harqProcId, mBuf);
6352    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6353    RETVALUE(ROK);
6354 }
6355
6356
6357 \f
6358 /***********************************************************
6359 *
6360 *     Func : cmPkTfudciformat1aPdsch
6361 *
6362 *
6363 *     Desc : This structure contains the information carried in DCI format 1A
6364   * when it is NOT used for a PDCCH order.
6365 *
6366 *
6367 *     Ret  : S16
6368 *
6369 *     Notes:
6370 *
6371 *     File  : 
6372 *
6373 **********************************************************/
6374 #ifdef ANSI
6375 PUBLIC S16 cmPkTfudciformat1aPdsch
6376 (
6377 Tfudciformat1aPdsch *param,
6378 Buffer *mBuf
6379 )
6380 #else
6381 PUBLIC S16 cmPkTfudciformat1aPdsch(param, mBuf)
6382 Tfudciformat1aPdsch *param;
6383 Buffer *mBuf;
6384 #endif
6385 {
6386
6387    TRC3(cmPkTfudciformat1aPdsch)
6388
6389    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6390
6391 #ifdef TFU_TDD
6392    CMCHKPK(cmPkTknU8, &param->dai, mBuf);
6393
6394 #endif
6395    CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6396    RETVALUE(ROK);
6397 }
6398
6399
6400 \f
6401 /***********************************************************
6402 *
6403 *     Func : cmUnpkTfudciformat1aPdsch
6404 *
6405 *
6406 *     Desc : This structure contains the information carried in DCI format 1A
6407   * when it is NOT used for a PDCCH order.
6408 *
6409 *
6410 *     Ret  : S16
6411 *
6412 *     Notes:
6413 *
6414 *     File  : 
6415 *
6416 **********************************************************/
6417 #ifdef ANSI
6418 PUBLIC S16 cmUnpkTfudciformat1aPdsch
6419 (
6420 Tfudciformat1aPdsch *param,
6421 Buffer *mBuf
6422 )
6423 #else
6424 PUBLIC S16 cmUnpkTfudciformat1aPdsch(param, mBuf)
6425 Tfudciformat1aPdsch *param;
6426 Buffer *mBuf;
6427 #endif
6428 {
6429
6430    TRC3(cmUnpkTfudciformat1aPdsch)
6431
6432    CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6433
6434 #ifdef TFU_TDD
6435    CMCHKUNPK(cmUnpkTknU8, &param->dai, mBuf);
6436
6437 #endif
6438    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6439    RETVALUE(ROK);
6440 }
6441
6442 #ifdef EMTC_ENABLE
6443
6444 \f
6445 /***********************************************************
6446 *
6447 *     Func : cmUnpkTfudciformat61aPdsch
6448 *
6449 *
6450 *     Desc : This structure contains the information carried in DCI format 6-1A
6451   * when it is NOT used for a PDCCH order.
6452 *
6453 *
6454 *     Ret  : S16
6455 *
6456 *     Notes:
6457 *
6458 *     File  : 
6459 *
6460 **********************************************************/
6461 #ifdef ANSI
6462 PUBLIC S16 cmUnpkTfudciformat61aPdsch
6463 (
6464 Tfudciformat61aPdsch *param,
6465 Buffer *mBuf
6466 )
6467 #else
6468 PUBLIC S16 cmUnpkTfudciformat61aPdsch(param, mBuf)
6469 Tfudciformat61aPdsch *param;
6470 Buffer *mBuf;
6471 #endif
6472 {
6473
6474    TRC3(cmUnpkTfudciformat61aPdsch)
6475
6476    printf("1. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6477    CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
6478    printf("2. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6479    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
6480    printf("3. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6481    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
6482    printf("4. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6483    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6484    printf("5. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6485 #ifdef TFU_TDD
6486    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6487    printf("6. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6488 #endif
6489    CMCHKUNPK(SUnpkU8, &param->antPortAndScrId, mBuf);
6490    printf("7. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6491    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
6492    printf("8. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6493    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6494    printf("9. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6495    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6496    printf("10. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6497    CMCHKUNPK(SUnpkU8, &param->harqAckOffst, mBuf);
6498    printf("11. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6499    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
6500    printf("12. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6501    CMCHKUNPK(SUnpkU8, &param->isTBMsg4, mBuf);
6502    printf("1. cmUnpkTfudciformat61aPdsch ::  Passed \n"); 
6503    RETVALUE(ROK);
6504 }
6505 /***********************************************************
6506  *
6507  *     Func : cmUnpkTfuDirectIndication
6508  *
6509  *
6510  *     Desc : This structure contains the information that is carried in DCI
6511  *       format 6-2 in the case of a Direct information indication.
6512  *
6513  *
6514  *     Ret  : S16
6515  *
6516  *     Notes:
6517  *
6518  *     File  : 
6519  *
6520  **********************************************************/
6521 #ifdef ANSI
6522 PRIVATE S16 cmUnpkTfuDirectIndication
6523 (
6524  TfuDirectIndication *param,
6525  Buffer *mBuf
6526  )
6527 #else
6528 PRIVATE S16 cmUnpkTfuDirectIndication(param, mBuf)
6529    TfuDirectIndication *param;
6530    Buffer *mBuf;
6531 #endif
6532 {
6533
6534    TRC3(cmUnpkTfuDirectIndication)
6535    CMCHKUNPK(SUnpkU8, &param->directInd, mBuf);
6536
6537
6538
6539    RETVALUE(ROK);
6540 }
6541 /***********************************************************
6542  *
6543  *     Func : cmUnpkTfuDciFormat62AllocInfo
6544  *
6545  *
6546  *     Desc : This structure contains only the allocation information, that is part
6547  * of DCI format 6-2. 
6548  * @details Allocation information also contains parameters necessary
6549  * for Physical layer to process Downlink data. This structure accompanies the
6550  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6551  * @sa TfuDciFormat62Info
6552  *
6553  *
6554  *     Ret  : S16
6555  *
6556  *     Notes:
6557  *
6558  *     File  : 
6559  *
6560  **********************************************************/
6561 #ifdef ANSI
6562 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo
6563 (
6564  TfuDciFormat62AllocInfo *param,
6565  Buffer *mBuf
6566  )
6567 #else
6568 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo(param, mBuf)
6569    TfuDciFormat62AllocInfo *param;
6570    Buffer *mBuf;
6571 #endif
6572 {
6573    TRC3(cmUnpkTfuDciFormat62AllocInfo)
6574    CMCHKUNPK(SUnpkU8, &param->riv, mBuf);
6575    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6576    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6577
6578    RETVALUE(ROK);
6579 }
6580
6581 /***********************************************************
6582  *
6583  *     Func : cmUnpkTfudciformat62Pdsch
6584  *
6585  *
6586  *     Desc : This structure contains the information carried in DCI format 6-2
6587  *            when It is used for Paging message.
6588  *
6589  *
6590  *     Ret  : S16
6591  *
6592  *     Notes:
6593  *
6594  *     File  : 
6595  *
6596  **********************************************************/
6597 #ifdef ANSI
6598 PRIVATE S16 cmUnpkTfudciformat62Pdsch
6599 (
6600  Tfudciformat62Pdsch *param,
6601  Buffer *mBuf
6602  )
6603 #else
6604 PRIVATE S16 cmUnpkTfudciformat62Pdsch(param, mBuf)
6605    Tfudciformat62Pdsch *param;
6606    Buffer *mBuf;
6607 #endif
6608 {
6609
6610    TRC3(cmUnpkTfudciformat62Pdsch)
6611
6612
6613    CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6614    CMCHKUNPK(SUnpkU8, &param->repNum, mBuf);
6615    CMCHKUNPK(SUnpkU8, &param->dciSubRepNum, mBuf);
6616    RETVALUE(ROK);
6617 }
6618
6619
6620 /***********************************************************
6621  *
6622  *     Func : cmUnpkTfuDciFormat62Info
6623  *
6624  *
6625  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6626  *     @details Format can possibly carry PDSCH allocation or information needed for
6627  *     a Direct information Indication.
6628  * 
6629  *
6630  *
6631  *     Ret  : S16
6632  *
6633  *     Notes:
6634  *
6635  *     File  : 
6636  *
6637  **********************************************************/
6638 #ifdef ANSI
6639 PUBLIC S16 cmUnpkTfuDciFormat62Info
6640 (
6641  TfuDciFormat62Info *param,
6642  Buffer *mBuf
6643  )
6644 #else
6645 PUBLIC S16 cmUnpkTfuDciFormat62Info(param, mBuf)
6646    TfuDciFormat62Info *param;
6647    Buffer *mBuf;
6648 #endif
6649 {
6650
6651    TRC3(cmUnpkTfuDciFormat62Info)
6652       CMCHKUNPK(SUnpkU8, &param->isPaging, mBuf);
6653    switch(param->isPaging) {
6654       case FALSE:
6655          CMCHKUNPK(cmUnpkTfuDirectIndication, &param->t.directIndication, mBuf);
6656          break;
6657       case TRUE:
6658          CMCHKUNPK(cmUnpkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6659          break;
6660       default :
6661          RETVALUE(RFAILED);
6662    }
6663
6664
6665    RETVALUE(ROK);
6666 }
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679 /***********************************************************
6680  *
6681  *     Func : cmPkTfuDirectIndication
6682  *
6683  *
6684  *     Desc : This structure contains the information that is carried in DCI
6685  *       format 6-2 in the case of a Direct information indication.
6686  *
6687  *
6688  *     Ret  : S16
6689  *
6690  *     Notes:
6691  *
6692  *     File  : 
6693  *
6694  **********************************************************/
6695 #ifdef ANSI
6696 PRIVATE S16 cmPkTfuDirectIndication
6697 (
6698  TfuDirectIndication *param,
6699  Buffer *mBuf
6700  )
6701 #else
6702 PRIVATE S16 cmPkTfuDirectIndication(param, mBuf)
6703    TfuDirectIndication *param;
6704    Buffer *mBuf;
6705 #endif
6706 {
6707
6708    TRC3(cmPkTfuDirectIndication)
6709    CMCHKPK(SPkU8, param->directInd, mBuf);
6710
6711
6712    RETVALUE(ROK);
6713 }
6714
6715
6716
6717 /***********************************************************
6718  *
6719  *     Func : cmPkTfuDciFormat62AllocInfo
6720  *
6721  *
6722  *     Desc : This structure contains only the allocation information, that is part
6723  * of DCI format 6-2. 
6724  * @details Allocation information also contains parameters necessary
6725  * for Physical layer to process Downlink data. This structure accompanies the
6726  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6727  * @sa TfuDciFormat62Info
6728  *
6729  *
6730  *     Ret  : S16
6731  *
6732  *     Notes:
6733  *
6734  *     File  : 
6735  *
6736  **********************************************************/
6737 #ifdef ANSI
6738 PUBLIC S16 cmPkTfuDciFormat62AllocInfo
6739 (
6740  TfuDciFormat62AllocInfo *param,
6741  Buffer *mBuf
6742  )
6743 #else
6744 PUBLIC S16 cmPkTfuDciFormat62AllocInfo(param, mBuf)
6745    TfuDciFormat62AllocInfo *param;
6746    Buffer *mBuf;
6747 #endif
6748 {
6749
6750    TRC3(cmPkTfuDciFormat6AAllocInfo)
6751
6752    CMCHKPK(SPkU8, param->rv, mBuf);
6753    CMCHKPK(SPkU8, param->mcs, mBuf);
6754    CMCHKPK(SPkU8, param->riv, mBuf);
6755
6756    RETVALUE(ROK);
6757 }
6758
6759
6760
6761 /***********************************************************
6762  *
6763  *     Func : cmPkTfudciformat62Pdsch
6764  *
6765  *
6766  *     Desc : This structure contains the information carried in DCI format 6-2
6767  *            when It is used for Paging message.
6768  *
6769  *
6770  *     Ret  : S16
6771  *
6772  *     Notes:
6773  *
6774  *     File  : 
6775  *
6776  **********************************************************/
6777 #ifdef ANSI
6778 PRIVATE S16 cmPkTfudciformat62Pdsch
6779 (
6780  Tfudciformat62Pdsch *param,
6781  Buffer *mBuf
6782  )
6783 #else
6784 PRIVATE S16 cmPkTfudciformat62Pdsch(param, mBuf)
6785    Tfudciformat62Pdsch *param;
6786    Buffer *mBuf;
6787 #endif
6788 {
6789
6790    TRC3(cmPkTfudciformat62Pdsch)
6791    CMCHKPK(SPkU8, param->dciSubRepNum, mBuf);
6792    CMCHKPK(SPkU8, param->repNum, mBuf);
6793    CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6794    RETVALUE(ROK);
6795 }
6796
6797
6798
6799
6800 /***********************************************************
6801  *
6802  *     Func : cmPkTfuDciFormat62Info
6803  *
6804  *
6805  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6806  *      @details Format can possibly carry PDSCH allocation or information needed for
6807  *      a Direct information Indication.
6808  * 
6809  *
6810  *
6811  *     Ret  : S16
6812  *
6813  *     Notes:
6814  *
6815  *     File  : 
6816  *
6817  **********************************************************/
6818 #ifdef ANSI
6819 PUBLIC S16 cmPkTfuDciFormat62Info
6820 (
6821  TfuDciFormat62Info *param,
6822  Buffer *mBuf
6823  )
6824 #else
6825 PUBLIC S16 cmPkTfuDciFormat62Info(param, mBuf)
6826    TfuDciFormat62Info *param;
6827    Buffer *mBuf;
6828 #endif
6829 {
6830
6831    TRC3(cmPkTfuDciFormat62Info)
6832
6833       switch(param->isPaging) {
6834          case TRUE:
6835             CMCHKPK(cmPkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6836             break;
6837          case FALSE:
6838             CMCHKPK(cmPkTfuDirectIndication, &param->t.directIndication, mBuf);
6839             break;
6840          default :
6841             RETVALUE(RFAILED);
6842       }
6843    CMCHKPK(SPkU8, param->isPaging, mBuf);
6844
6845    RETVALUE(ROK);
6846 }
6847
6848
6849
6850
6851
6852
6853 #endif
6854
6855 \f
6856 /***********************************************************
6857 *
6858 *     Func : cmPkTfuDciFormat1aInfo
6859 *
6860 *
6861 *     Desc : This structure contains the information needed to convey DCI format 1A.
6862  * @details Format can possibly carry PDSCH allocation or information needed for
6863  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6864  * sync with eNodeB.
6865 *
6866 *
6867 *     Ret  : S16
6868 *
6869 *     Notes:
6870 *
6871 *     File  : 
6872 *
6873 **********************************************************/
6874 #ifdef ANSI
6875 PUBLIC S16 cmPkTfuDciFormat1aInfo
6876 (
6877 TfuDciFormat1aInfo *param,
6878 Buffer *mBuf
6879 )
6880 #else
6881 PUBLIC S16 cmPkTfuDciFormat1aInfo(param, mBuf)
6882 TfuDciFormat1aInfo *param;
6883 Buffer *mBuf;
6884 #endif
6885 {
6886
6887    TRC3(cmPkTfuDciFormat1aInfo)
6888
6889    switch(param->isPdcchOrder) {
6890       case FALSE:
6891          CMCHKPK(cmPkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6892          break;
6893       case TRUE:
6894          CMCHKPK(cmPkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6895          break;
6896       default :
6897          RETVALUE(RFAILED);
6898       }
6899    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
6900
6901    RETVALUE(ROK);
6902 }
6903
6904
6905 \f
6906 /***********************************************************
6907 *
6908 *     Func : cmUnpkTfuDciFormat1aInfo
6909 *
6910 *
6911 *     Desc : This structure contains the information needed to convey DCI format 1A.
6912  * @details Format can possibly carry PDSCH allocation or information needed for
6913  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6914  * sync with eNodeB.
6915 *
6916 *
6917 *     Ret  : S16
6918 *
6919 *     Notes:
6920 *
6921 *     File  : 
6922 *
6923 **********************************************************/
6924 #ifdef ANSI
6925 PUBLIC S16 cmUnpkTfuDciFormat1aInfo
6926 (
6927 TfuDciFormat1aInfo *param,
6928 Buffer *mBuf
6929 )
6930 #else
6931 PUBLIC S16 cmUnpkTfuDciFormat1aInfo(param, mBuf)
6932 TfuDciFormat1aInfo *param;
6933 Buffer *mBuf;
6934 #endif
6935 {
6936
6937    TRC3(cmUnpkTfuDciFormat1aInfo)
6938
6939    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
6940    switch(param->isPdcchOrder) {
6941       case TRUE:
6942          CMCHKUNPK(cmUnpkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6943          break;
6944       case FALSE:
6945          CMCHKUNPK(cmUnpkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6946          break;
6947       default :
6948          RETVALUE(RFAILED);
6949       }
6950    RETVALUE(ROK);
6951 }
6952
6953
6954 \f
6955 /***********************************************************
6956 *
6957 *     Func : cmPkTfuDciFormat1bInfo
6958 *
6959 *
6960 *     Desc : This structure contains the information needed to convey DCI format 1A.
6961  * @details Allocation information is separated from the other control
6962  * information carried in this format. This separation is needed as Data shall
6963  * also carry some control information, essentially allocation information,
6964  * along with it, in order to aid physical layer processing of the data.
6965 *
6966 *
6967 *     Ret  : S16
6968 *
6969 *     Notes:
6970 *
6971 *     File  : 
6972 *
6973 **********************************************************/
6974 #ifdef ANSI
6975 PUBLIC S16 cmPkTfuDciFormat1bInfo
6976 (
6977 TfuDciFormat1bInfo *param,
6978 Buffer *mBuf
6979 )
6980 #else
6981 PUBLIC S16 cmPkTfuDciFormat1bInfo(param, mBuf)
6982 TfuDciFormat1bInfo *param;
6983 Buffer *mBuf;
6984 #endif
6985 {
6986
6987    TRC3(cmPkTfuDciFormat1bInfo)
6988
6989    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6990
6991 #ifdef TFU_TDD
6992    CMCHKPK(SPkU8, param->dai, mBuf);
6993
6994 #endif
6995    CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
6996    RETVALUE(ROK);
6997 }
6998
6999
7000 \f
7001 /***********************************************************
7002 *
7003 *     Func : cmUnpkTfuDciFormat1bInfo
7004 *
7005 *
7006 *     Desc : This structure contains the information needed to convey DCI format 1A.
7007  * @details Allocation information is separated from the other control
7008  * information carried in this format. This separation is needed as Data shall
7009  * also carry some control information, essentially allocation information,
7010  * along with it, in order to aid physical layer processing of the data.
7011 *
7012 *
7013 *     Ret  : S16
7014 *
7015 *     Notes:
7016 *
7017 *     File  : 
7018 *
7019 **********************************************************/
7020 #ifdef ANSI
7021 PUBLIC S16 cmUnpkTfuDciFormat1bInfo
7022 (
7023 TfuDciFormat1bInfo *param,
7024 Buffer *mBuf
7025 )
7026 #else
7027 PUBLIC S16 cmUnpkTfuDciFormat1bInfo(param, mBuf)
7028 TfuDciFormat1bInfo *param;
7029 Buffer *mBuf;
7030 #endif
7031 {
7032
7033    TRC3(cmUnpkTfuDciFormat1bInfo)
7034
7035    CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
7036
7037 #ifdef TFU_TDD
7038    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
7039
7040 #endif
7041    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
7042    RETVALUE(ROK);
7043 }
7044
7045
7046 \f
7047 /***********************************************************
7048 *
7049 *     Func : cmPkTfuDciInfo
7050 *
7051 *
7052 *     Desc : This structure contains the information needed to convey the possible DCI
7053  * formats. The following are the supported formats - 
7054  * -# Format 0    - used for PUSCH scheduling
7055  * -# Format 1    - used for PDSCH scheduling
7056  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7057  *                   intitiated by a PDCCH order.
7058  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7059  *                   information.
7060  * -# Format 1C   - used for very compact scheduling of PDSCH.
7061  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7062  *                   information with power offset.
7063  * -# Format 2    - used for PDSCH Scheduling
7064  * -# Format 2A   - used for PDSCH Scheduling
7065  * -# Format 3    - used for power control 
7066  * -# Format 3A   - used for power control
7067 *
7068 *
7069 *     Ret  : S16
7070 *
7071 *     Notes:
7072 *
7073 *     File  : 
7074 *
7075 **********************************************************/
7076 #ifdef ANSI
7077 PUBLIC S16 cmPkTfuDciInfo
7078 (
7079 TfuDciInfo *param,
7080 Buffer *mBuf
7081 )
7082 #else
7083 PUBLIC S16 cmPkTfuDciInfo(param, mBuf)
7084 TfuDciInfo *param;
7085 Buffer *mBuf;
7086 #endif
7087 {
7088
7089    TRC3(cmPkTfuDciInfo)
7090
7091       switch(param->dciFormat) {
7092 #ifdef TFU_5GTF
7093          case TFU_DCI_FORMAT_B1:
7094             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7095             break;
7096          case TFU_DCI_FORMAT_B2:
7097             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7098             break;
7099          case TFU_DCI_FORMAT_A1:
7100             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7101             break;
7102          case TFU_DCI_FORMAT_A2:
7103             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7104             break;
7105 #endif
7106 #ifdef EMTC_ENABLE            
7107          case TFU_DCI_FORMAT_6_2:
7108             CMCHKPK(cmPkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7109             break;
7110          case TFU_DCI_FORMAT_6_1A:
7111             CMCHKPK(cmPkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7112             break;
7113          case TFU_DCI_FORMAT_6_0A:
7114             CMCHKPK(cmPkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7115             break;
7116 #endif            
7117          case TFU_DCI_FORMAT_3A:
7118             CMCHKPK(cmPkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7119             break;
7120          case TFU_DCI_FORMAT_3:
7121             CMCHKPK(cmPkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7122             break;
7123          case TFU_DCI_FORMAT_2A:
7124             CMCHKPK(cmPkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7125             break;
7126          case TFU_DCI_FORMAT_2:
7127             CMCHKPK(cmPkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7128             break;
7129          case TFU_DCI_FORMAT_1D:
7130             CMCHKPK(cmPkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7131             break;
7132          case TFU_DCI_FORMAT_1C:
7133             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7134             break;
7135          case TFU_DCI_FORMAT_1B:
7136             CMCHKPK(cmPkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7137             break;
7138          case TFU_DCI_FORMAT_1A:
7139             CMCHKPK(cmPkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7140             break;
7141          case TFU_DCI_FORMAT_1:
7142             CMCHKPK(cmPkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7143             break;
7144          case TFU_DCI_FORMAT_0:
7145             CMCHKPK(cmPkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7146             break;
7147          default :
7148             RETVALUE(RFAILED);
7149       }
7150    CMCHKPK(SPkU32, param->dciFormat, mBuf);
7151    RETVALUE(ROK);
7152 }
7153
7154
7155 \f
7156 /***********************************************************
7157 *
7158 *     Func : cmUnpkTfuDciInfo
7159 *
7160 *
7161 *     Desc : This structure contains the information needed to convey the possible DCI
7162  * formats. The following are the supported formats - 
7163  * -# Format 0    - used for PUSCH scheduling
7164  * -# Format 1    - used for PDSCH scheduling
7165  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7166  *                   intitiated by a PDCCH order.
7167  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7168  *                   information.
7169  * -# Format 1C   - used for very compact scheduling of PDSCH.
7170  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7171  *                   information with power offset.
7172  * -# Format 2    - used for PDSCH Scheduling
7173  * -# Format 2A   - used for PDSCH Scheduling
7174  * -# Format 3    - used for power control 
7175  * -# Format 3A   - used for power control
7176 *
7177 *
7178 *     Ret  : S16
7179 *
7180 *     Notes:
7181 *
7182 *     File  : 
7183 *
7184 **********************************************************/
7185 #ifdef ANSI
7186 PUBLIC S16 cmUnpkTfuDciInfo
7187 (
7188 TfuDciInfo *param,
7189 Buffer *mBuf
7190 )
7191 #else
7192 PUBLIC S16 cmUnpkTfuDciInfo(param, mBuf)
7193 TfuDciInfo *param;
7194 Buffer *mBuf;
7195 #endif
7196 {
7197
7198    TRC3(cmUnpkTfuDciInfo)
7199
7200
7201    CMCHKUNPK(SUnpkU32, (U32 *)&param->dciFormat, mBuf);
7202       switch(param->dciFormat) {
7203          case TFU_DCI_FORMAT_0:
7204             CMCHKUNPK(cmUnpkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7205             break;
7206          case TFU_DCI_FORMAT_1:
7207             CMCHKUNPK(cmUnpkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7208             break;
7209          case TFU_DCI_FORMAT_1A:
7210             CMCHKUNPK(cmUnpkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7211             break;
7212          case TFU_DCI_FORMAT_1B:
7213             CMCHKUNPK(cmUnpkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7214             break;
7215          case TFU_DCI_FORMAT_1C:
7216             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7217             break;
7218          case TFU_DCI_FORMAT_1D:
7219             CMCHKUNPK(cmUnpkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7220             break;
7221          case TFU_DCI_FORMAT_2:
7222             CMCHKUNPK(cmUnpkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7223             break;
7224          case TFU_DCI_FORMAT_2A:
7225             CMCHKUNPK(cmUnpkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7226             break;
7227          case TFU_DCI_FORMAT_3:
7228             CMCHKUNPK(cmUnpkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7229             break;
7230          case TFU_DCI_FORMAT_3A:
7231             CMCHKUNPK(cmUnpkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7232             break;
7233 #ifdef EMTC_ENABLE            
7234          case TFU_DCI_FORMAT_6_0A:
7235             CMCHKUNPK(cmUnpkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7236             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7237             break;
7238          case TFU_DCI_FORMAT_6_1A:
7239             CMCHKUNPK(cmUnpkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7240             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7241             break;
7242          case TFU_DCI_FORMAT_6_2:
7243             CMCHKUNPK(cmUnpkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7244             break;
7245
7246 #endif            
7247 #ifdef TFU_5GTF
7248          case TFU_DCI_FORMAT_A1:
7249             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7250             break;
7251                         case TFU_DCI_FORMAT_A2:
7252             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7253             break;
7254          case TFU_DCI_FORMAT_B1:
7255             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7256             break;
7257                         case TFU_DCI_FORMAT_B2:
7258             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7259             break;
7260 #endif
7261          default :
7262             RETVALUE(RFAILED);
7263       }
7264    RETVALUE(ROK);
7265 }
7266
7267
7268 \f
7269 /***********************************************************
7270 *
7271 *     Func : cmPkTfuSubbandInfo
7272 *
7273 *
7274 *     Desc : This structure contains the information needed to convey the start and size
7275  * of the subband in the CQI report.
7276 *
7277 *
7278 *     Ret  : S16
7279 *
7280 *     Notes:
7281 *
7282 *     File  : 
7283 *
7284 **********************************************************/
7285 #ifdef ANSI
7286 PUBLIC S16 cmPkTfuSubbandInfo
7287 (
7288 TfuSubbandInfo *param,
7289 Buffer *mBuf
7290 )
7291 #else
7292 PUBLIC S16 cmPkTfuSubbandInfo(param, mBuf)
7293 TfuSubbandInfo *param;
7294 Buffer *mBuf;
7295 #endif
7296 {
7297
7298    TRC3(cmPkTfuSubbandInfo)
7299
7300    CMCHKPK(SPkU8, param->numRb, mBuf);
7301    CMCHKPK(SPkU8, param->rbStart, mBuf);
7302    RETVALUE(ROK);
7303 }
7304
7305
7306 \f
7307 /***********************************************************
7308 *
7309 *     Func : cmUnpkTfuSubbandInfo
7310 *
7311 *
7312 *     Desc : This structure contains the information needed to convey the start and size
7313  * of the subband in the CQI report.
7314 *
7315 *
7316 *     Ret  : S16
7317 *
7318 *     Notes:
7319 *
7320 *     File  : 
7321 *
7322 **********************************************************/
7323 #ifdef ANSI
7324 PUBLIC S16 cmUnpkTfuSubbandInfo
7325 (
7326 TfuSubbandInfo *param,
7327 Buffer *mBuf
7328 )
7329 #else
7330 PUBLIC S16 cmUnpkTfuSubbandInfo(param, mBuf)
7331 TfuSubbandInfo *param;
7332 Buffer *mBuf;
7333 #endif
7334 {
7335
7336    TRC3(cmUnpkTfuSubbandInfo)
7337
7338    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
7339    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
7340    RETVALUE(ROK);
7341 }
7342
7343
7344
7345 \f
7346 /***********************************************************
7347 *
7348 *     Func : cmPkTfuSubbandCqiInfo
7349 *
7350 *
7351 *     Desc : This structure is used to convey the subbannd CQI reported.
7352 *
7353 *
7354 *     Ret  : S16
7355 *
7356 *     Notes:
7357 *
7358 *     File  : 
7359 *
7360 **********************************************************/
7361 #ifdef ANSI
7362 PUBLIC S16 cmPkTfuSubbandCqiInfo
7363 (
7364 TfuSubbandCqiInfo *param,
7365 Buffer *mBuf
7366 )
7367 #else
7368 PUBLIC S16 cmPkTfuSubbandCqiInfo(param, mBuf)
7369 TfuSubbandCqiInfo *param;
7370 Buffer *mBuf;
7371 #endif
7372 {
7373
7374    TRC3(cmPkTfuSubbandCqiInfo)
7375
7376    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
7377    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
7378    RETVALUE(ROK);
7379 }
7380
7381
7382 \f
7383 /***********************************************************
7384 *
7385 *     Func : cmUnpkTfuSubbandCqiInfo
7386 *
7387 *
7388 *     Desc : This structure is used to convey the subbannd CQI reported.
7389 *
7390 *
7391 *     Ret  : S16
7392 *
7393 *     Notes:
7394 *
7395 *     File  : 
7396 *
7397 **********************************************************/
7398 #ifdef ANSI
7399 PUBLIC S16 cmUnpkTfuSubbandCqiInfo
7400 (
7401 TfuSubbandCqiInfo *param,
7402 Buffer *mBuf
7403 )
7404 #else
7405 PUBLIC S16 cmUnpkTfuSubbandCqiInfo(param, mBuf)
7406 TfuSubbandCqiInfo *param;
7407 Buffer *mBuf;
7408 #endif
7409 {
7410
7411    TRC3(cmUnpkTfuSubbandCqiInfo)
7412
7413    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
7414    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
7415    RETVALUE(ROK);
7416 }
7417
7418
7419 \f
7420 /***********************************************************
7421 *
7422 *     Func : cmPkTfuPdcchCceInfo
7423 *
7424 *
7425 *     Desc : This structure conveys the CCE information.
7426 *
7427 *
7428 *     Ret  : S16
7429 *
7430 *     Notes:
7431 *
7432 *     File  : 
7433 *
7434 **********************************************************/
7435 #ifdef ANSI
7436 PUBLIC S16 cmPkTfuPdcchCceInfo
7437 (
7438 TfuPdcchCceInfo *param,
7439 Buffer *mBuf
7440 )
7441 #else
7442 PUBLIC S16 cmPkTfuPdcchCceInfo(param, mBuf)
7443 TfuPdcchCceInfo *param;
7444 Buffer *mBuf;
7445 #endif
7446 {
7447
7448    TRC3(cmPkTfuPdcchCceInfo)
7449
7450    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
7451    CMCHKPK(SPkU8, param->cceIdx, mBuf);
7452    RETVALUE(ROK);
7453 }
7454
7455
7456 \f
7457 /***********************************************************
7458 *
7459 *     Func : cmUnpkTfuPdcchCceInfo
7460 *
7461 *
7462 *     Desc : This structure conveys the CCE information.
7463 *
7464 *
7465 *     Ret  : S16
7466 *
7467 *     Notes:
7468 *
7469 *     File  : 
7470 *
7471 **********************************************************/
7472 #ifdef ANSI
7473 PUBLIC S16 cmUnpkTfuPdcchCceInfo
7474 (
7475 TfuPdcchCceInfo *param,
7476 Buffer *mBuf
7477 )
7478 #else
7479 PUBLIC S16 cmUnpkTfuPdcchCceInfo(param, mBuf)
7480 TfuPdcchCceInfo *param;
7481 Buffer *mBuf;
7482 #endif
7483 {
7484
7485    TRC3(cmUnpkTfuPdcchCceInfo)
7486
7487    CMCHKUNPK(SUnpkU8, &param->cceIdx, mBuf);
7488    CMCHKUNPK(cmUnpkLteAggrLvl,(U32 *)&param->aggrLvl, mBuf);
7489    RETVALUE(ROK);
7490 }
7491
7492
7493 \f
7494 /***********************************************************
7495 *
7496 *     Func : cmPkTfuCqiPucchMode10
7497 *
7498 *
7499 *     Desc : This structure maps to the CQI mode 10. The report could either
7500   * convey a Rank index or a wideband CQI.
7501 *
7502 *
7503 *     Ret  : S16
7504 *
7505 *     Notes:
7506 *
7507 *     File  : 
7508 *
7509 **********************************************************/
7510 #ifdef ANSI
7511 PUBLIC S16 cmPkTfuCqiPucchMode10
7512 (
7513 TfuCqiPucchMode10 *param,
7514 Buffer *mBuf
7515 )
7516 #else
7517 PUBLIC S16 cmPkTfuCqiPucchMode10(param, mBuf)
7518 TfuCqiPucchMode10 *param;
7519 Buffer *mBuf;
7520 #endif
7521 {
7522
7523    TRC3(cmPkTfuCqiPucchMode10)
7524
7525       switch(param->type) {
7526          case TFU_RPT_CQI:
7527             CMCHKPK(SPkU8, param->u.cqi, mBuf);
7528             break;
7529          case TFU_RPT_RI:
7530             CMCHKPK(SPkU8, param->u.ri, mBuf);
7531             break;
7532          default :
7533             RETVALUE(RFAILED);
7534       }
7535    CMCHKPK(SPkU32, param->type, mBuf);
7536    RETVALUE(ROK);
7537 }
7538
7539
7540 \f
7541 /***********************************************************
7542 *
7543 *     Func : cmUnpkTfuCqiPucchMode10
7544 *
7545 *
7546 *     Desc : This structure maps to the CQI mode 10. The report could either
7547   * convey a Rank index or a wideband CQI.
7548 *
7549 *
7550 *     Ret  : S16
7551 *
7552 *     Notes:
7553 *
7554 *     File  : 
7555 *
7556 **********************************************************/
7557 #ifdef ANSI
7558 PUBLIC S16 cmUnpkTfuCqiPucchMode10
7559 (
7560 TfuCqiPucchMode10 *param,
7561 Buffer *mBuf
7562 )
7563 #else
7564 PUBLIC S16 cmUnpkTfuCqiPucchMode10(param, mBuf)
7565 TfuCqiPucchMode10 *param;
7566 Buffer *mBuf;
7567 #endif
7568 {
7569
7570    TRC3(cmUnpkTfuCqiPucchMode10)
7571
7572    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7573       switch(param->type) {
7574          case TFU_RPT_RI:
7575             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7576             break;
7577          case TFU_RPT_CQI:
7578             CMCHKUNPK(SUnpkU8, &param->u.cqi, mBuf);
7579             break;
7580          default :
7581             RETVALUE(RFAILED);
7582       }
7583    RETVALUE(ROK);
7584 }
7585
7586
7587 \f
7588 /***********************************************************
7589 *
7590 *     Func : cmPkTfuCqiMode11Cqi
7591 *
7592 *
7593 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7594   * wideband differential CQI.
7595 *
7596 *
7597 *     Ret  : S16
7598 *
7599 *     Notes:
7600 *
7601 *     File  : 
7602 *
7603 **********************************************************/
7604 #ifdef ANSI
7605 PUBLIC S16 cmPkTfuCqiMode11Cqi
7606 (
7607 TfuCqiMode11Cqi *param,
7608 Buffer *mBuf
7609 )
7610 #else
7611 PUBLIC S16 cmPkTfuCqiMode11Cqi(param, mBuf)
7612 TfuCqiMode11Cqi *param;
7613 Buffer *mBuf;
7614 #endif
7615 {
7616
7617    TRC3(cmPkTfuCqiMode11Cqi)
7618
7619    CMCHKPK(cmPkTknU8, &param->wideDiffCqi, mBuf);
7620    CMCHKPK(SPkU8, param->pmi, mBuf);
7621    CMCHKPK(SPkU8, param->cqi, mBuf);
7622    RETVALUE(ROK);
7623 }
7624
7625
7626 \f
7627 /***********************************************************
7628 *
7629 *     Func : cmUnpkTfuCqiMode11Cqi
7630 *
7631 *
7632 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7633   * wideband differential CQI.
7634 *
7635 *
7636 *     Ret  : S16
7637 *
7638 *     Notes:
7639 *
7640 *     File  : 
7641 *
7642 **********************************************************/
7643 #ifdef ANSI
7644 PUBLIC S16 cmUnpkTfuCqiMode11Cqi
7645 (
7646 TfuCqiMode11Cqi *param,
7647 Buffer *mBuf
7648 )
7649 #else
7650 PUBLIC S16 cmUnpkTfuCqiMode11Cqi(param, mBuf)
7651 TfuCqiMode11Cqi *param;
7652 Buffer *mBuf;
7653 #endif
7654 {
7655
7656    TRC3(cmUnpkTfuCqiMode11Cqi)
7657
7658    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7659    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
7660    CMCHKUNPK(cmUnpkTknU8, &param->wideDiffCqi, mBuf);
7661    RETVALUE(ROK);
7662 }
7663
7664
7665 \f
7666 /***********************************************************
7667 *
7668 *     Func : cmPkTfuCqiPucchMode11
7669 *
7670 *
7671 *     Desc : This structure maps to the CQI mode 11. The report could either
7672   * convey a Rank index or a CQI report.
7673 *
7674 *
7675 *     Ret  : S16
7676 *
7677 *     Notes:
7678 *
7679 *     File  : 
7680 *
7681 **********************************************************/
7682 #ifdef ANSI
7683 PUBLIC S16 cmPkTfuCqiPucchMode11
7684 (
7685 TfuCqiPucchMode11 *param,
7686 Buffer *mBuf
7687 )
7688 #else
7689 PUBLIC S16 cmPkTfuCqiPucchMode11(param, mBuf)
7690 TfuCqiPucchMode11 *param;
7691 Buffer *mBuf;
7692 #endif
7693 {
7694
7695    TRC3(cmPkTfuCqiPucchMode11)
7696
7697       switch(param->type) {
7698          case TFU_RPT_CQI:
7699             CMCHKPK(cmPkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7700             break;
7701          case TFU_RPT_RI:
7702             CMCHKPK(SPkU8, param->u.ri, mBuf);
7703             break;
7704          default :
7705             RETVALUE(RFAILED);
7706       }
7707    CMCHKPK(SPkU32, param->type, mBuf);
7708    RETVALUE(ROK);
7709 }
7710
7711
7712 \f
7713 /***********************************************************
7714 *
7715 *     Func : cmUnpkTfuCqiPucchMode11
7716 *
7717 *
7718 *     Desc : This structure maps to the CQI mode 11. The report could either
7719   * convey a Rank index or a CQI report.
7720 *
7721 *
7722 *     Ret  : S16
7723 *
7724 *     Notes:
7725 *
7726 *     File  : 
7727 *
7728 **********************************************************/
7729 #ifdef ANSI
7730 PUBLIC S16 cmUnpkTfuCqiPucchMode11
7731 (
7732 TfuCqiPucchMode11 *param,
7733 Buffer *mBuf
7734 )
7735 #else
7736 PUBLIC S16 cmUnpkTfuCqiPucchMode11(param, mBuf)
7737 TfuCqiPucchMode11 *param;
7738 Buffer *mBuf;
7739 #endif
7740 {
7741
7742    TRC3(cmUnpkTfuCqiPucchMode11)
7743
7744    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7745       switch(param->type) {
7746          case TFU_RPT_RI:
7747             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7748             break;
7749          case TFU_RPT_CQI:
7750             CMCHKUNPK(cmUnpkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7751             break;
7752          default :
7753             RETVALUE(RFAILED);
7754       }
7755    RETVALUE(ROK);
7756 }
7757
7758
7759 \f
7760 /***********************************************************
7761 *
7762 *     Func : cmPkTfuCqiMode20SubCqi
7763 *
7764 *
7765 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7766 *
7767 *
7768 *     Ret  : S16
7769 *
7770 *     Notes:
7771 *
7772 *     File  : 
7773 *
7774 **********************************************************/
7775 #ifdef ANSI
7776 PUBLIC S16 cmPkTfuCqiMode20SubCqi
7777 (
7778 TfuCqiMode20SubCqi *param,
7779 Buffer *mBuf
7780 )
7781 #else
7782 PUBLIC S16 cmPkTfuCqiMode20SubCqi(param, mBuf)
7783 TfuCqiMode20SubCqi *param;
7784 Buffer *mBuf;
7785 #endif
7786 {
7787
7788    TRC3(cmPkTfuCqiMode20SubCqi)
7789
7790    CMCHKPK(SPkU8, param->l, mBuf);
7791    CMCHKPK(SPkU8, param->cqi, mBuf);
7792    RETVALUE(ROK);
7793 }
7794
7795
7796 \f
7797 /***********************************************************
7798 *
7799 *     Func : cmUnpkTfuCqiMode20SubCqi
7800 *
7801 *
7802 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7803 *
7804 *
7805 *     Ret  : S16
7806 *
7807 *     Notes:
7808 *
7809 *     File  : 
7810 *
7811 **********************************************************/
7812 #ifdef ANSI
7813 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi
7814 (
7815 TfuCqiMode20SubCqi *param,
7816 Buffer *mBuf
7817 )
7818 #else
7819 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi(param, mBuf)
7820 TfuCqiMode20SubCqi *param;
7821 Buffer *mBuf;
7822 #endif
7823 {
7824
7825    TRC3(cmUnpkTfuCqiMode20SubCqi)
7826
7827    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7828    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
7829    RETVALUE(ROK);
7830 }
7831
7832
7833 \f
7834 /***********************************************************
7835 *
7836 *     Func : cmPkTfuCqiMode20Cqi
7837 *
7838 *
7839 *     Desc : This structure contains Mode20 CQI report. It could either be a
7840   * wideband CQI or a sub-band CQI.
7841 *
7842 *
7843 *     Ret  : S16
7844 *
7845 *     Notes:
7846 *
7847 *     File  : 
7848 *
7849 **********************************************************/
7850 #ifdef ANSI
7851 PUBLIC S16 cmPkTfuCqiMode20Cqi
7852 (
7853 TfuCqiMode20Cqi *param,
7854 Buffer *mBuf
7855 )
7856 #else
7857 PUBLIC S16 cmPkTfuCqiMode20Cqi(param, mBuf)
7858 TfuCqiMode20Cqi *param;
7859 Buffer *mBuf;
7860 #endif
7861 {
7862
7863    TRC3(cmPkTfuCqiMode20Cqi)
7864
7865       switch(param->isWideband) {
7866          case FALSE:
7867             CMCHKPK(cmPkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7868             break;
7869          case TRUE:
7870             CMCHKPK(SPkU8, param->u.wideCqi, mBuf);
7871             break;
7872          default :
7873             RETVALUE(RFAILED);
7874       }
7875    CMCHKPK(SPkU8, param->isWideband, mBuf);
7876    RETVALUE(ROK);
7877 }
7878
7879
7880 \f
7881 /***********************************************************
7882 *
7883 *     Func : cmUnpkTfuCqiMode20Cqi
7884 *
7885 *
7886 *     Desc : This structure contains Mode20 CQI report. It could either be a
7887   * wideband CQI or a sub-band CQI.
7888 *
7889 *
7890 *     Ret  : S16
7891 *
7892 *     Notes:
7893 *
7894 *     File  : 
7895 *
7896 **********************************************************/
7897 #ifdef ANSI
7898 PUBLIC S16 cmUnpkTfuCqiMode20Cqi
7899 (
7900 TfuCqiMode20Cqi *param,
7901 Buffer *mBuf
7902 )
7903 #else
7904 PUBLIC S16 cmUnpkTfuCqiMode20Cqi(param, mBuf)
7905 TfuCqiMode20Cqi *param;
7906 Buffer *mBuf;
7907 #endif
7908 {
7909
7910    TRC3(cmUnpkTfuCqiMode20Cqi)
7911
7912    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
7913       switch(param->isWideband) {
7914          case TRUE:
7915             CMCHKUNPK(SUnpkU8, &param->u.wideCqi, mBuf);
7916             break;
7917          case FALSE:
7918             CMCHKUNPK(cmUnpkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7919             break;
7920          default :
7921             RETVALUE(RFAILED);
7922       }
7923    RETVALUE(ROK);
7924 }
7925
7926
7927 \f
7928 /***********************************************************
7929 *
7930 *     Func : cmPkTfuCqiPucchMode20
7931 *
7932 *
7933 *     Desc : This structure maps to CQI mode 20. The report either contains a
7934   * Rank Index or a CQI report.
7935 *
7936 *
7937 *     Ret  : S16
7938 *
7939 *     Notes:
7940 *
7941 *     File  : 
7942 *
7943 **********************************************************/
7944 #ifdef ANSI
7945 PUBLIC S16 cmPkTfuCqiPucchMode20
7946 (
7947 TfuCqiPucchMode20 *param,
7948 Buffer *mBuf
7949 )
7950 #else
7951 PUBLIC S16 cmPkTfuCqiPucchMode20(param, mBuf)
7952 TfuCqiPucchMode20 *param;
7953 Buffer *mBuf;
7954 #endif
7955 {
7956
7957    TRC3(cmPkTfuCqiPucchMode20)
7958
7959       switch(param->type) {
7960          case TFU_RPT_CQI:
7961             CMCHKPK(cmPkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7962             break;
7963          case TFU_RPT_RI:
7964             CMCHKPK(SPkU8, param->u.ri, mBuf);
7965             break;
7966          default :
7967             RETVALUE(RFAILED);
7968       }
7969    CMCHKPK(SPkU32, param->type, mBuf);
7970    RETVALUE(ROK);
7971 }
7972
7973
7974 \f
7975 /***********************************************************
7976 *
7977 *     Func : cmUnpkTfuCqiPucchMode20
7978 *
7979 *
7980 *     Desc : This structure maps to CQI mode 20. The report either contains a
7981   * Rank Index or a CQI report.
7982 *
7983 *
7984 *     Ret  : S16
7985 *
7986 *     Notes:
7987 *
7988 *     File  : 
7989 *
7990 **********************************************************/
7991 #ifdef ANSI
7992 PUBLIC S16 cmUnpkTfuCqiPucchMode20
7993 (
7994 TfuCqiPucchMode20 *param,
7995 Buffer *mBuf
7996 )
7997 #else
7998 PUBLIC S16 cmUnpkTfuCqiPucchMode20(param, mBuf)
7999 TfuCqiPucchMode20 *param;
8000 Buffer *mBuf;
8001 #endif
8002 {
8003
8004    TRC3(cmUnpkTfuCqiPucchMode20)
8005
8006    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8007       switch(param->type) {
8008          case TFU_RPT_RI:
8009             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8010             break;
8011          case TFU_RPT_CQI:
8012             CMCHKUNPK(cmUnpkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
8013             break;
8014          default :
8015             RETVALUE(RFAILED);
8016       }
8017    RETVALUE(ROK);
8018 }
8019
8020
8021 \f
8022 /***********************************************************
8023 *
8024 *     Func : cmPkTfuCqiMode21SubCqi
8025 *
8026 *
8027 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8028   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8029 *
8030 *
8031 *     Ret  : S16
8032 *
8033 *     Notes:
8034 *
8035 *     File  : 
8036 *
8037 **********************************************************/
8038 #ifdef ANSI
8039 PUBLIC S16 cmPkTfuCqiMode21SubCqi
8040 (
8041 TfuCqiMode21SubCqi *param,
8042 Buffer *mBuf
8043 )
8044 #else
8045 PUBLIC S16 cmPkTfuCqiMode21SubCqi(param, mBuf)
8046 TfuCqiMode21SubCqi *param;
8047 Buffer *mBuf;
8048 #endif
8049 {
8050
8051    TRC3(cmPkTfuCqiMode21SubCqi)
8052
8053    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8054    CMCHKPK(SPkU8, param->l, mBuf);
8055    CMCHKPK(SPkU8, param->cqi, mBuf);
8056    RETVALUE(ROK);
8057 }
8058
8059
8060 \f
8061 /***********************************************************
8062 *
8063 *     Func : cmUnpkTfuCqiMode21SubCqi
8064 *
8065 *
8066 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8067   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8068 *
8069 *
8070 *     Ret  : S16
8071 *
8072 *     Notes:
8073 *
8074 *     File  : 
8075 *
8076 **********************************************************/
8077 #ifdef ANSI
8078 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi
8079 (
8080 TfuCqiMode21SubCqi *param,
8081 Buffer *mBuf
8082 )
8083 #else
8084 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi(param, mBuf)
8085 TfuCqiMode21SubCqi *param;
8086 Buffer *mBuf;
8087 #endif
8088 {
8089
8090    TRC3(cmUnpkTfuCqiMode21SubCqi)
8091
8092    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8093    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
8094    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8095    RETVALUE(ROK);
8096 }
8097
8098
8099 \f
8100 /***********************************************************
8101 *
8102 *     Func : cmPkTfuCqiMode21WideCqi
8103 *
8104 *
8105 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8106   * It carries a wideband CQI, PMI and optionally a differential CQI.
8107 *
8108 *
8109 *     Ret  : S16
8110 *
8111 *     Notes:
8112 *
8113 *     File  : 
8114 *
8115 **********************************************************/
8116 #ifdef ANSI
8117 PUBLIC S16 cmPkTfuCqiMode21WideCqi
8118 (
8119 TfuCqiMode21WideCqi *param,
8120 Buffer *mBuf
8121 )
8122 #else
8123 PUBLIC S16 cmPkTfuCqiMode21WideCqi(param, mBuf)
8124 TfuCqiMode21WideCqi *param;
8125 Buffer *mBuf;
8126 #endif
8127 {
8128
8129    TRC3(cmPkTfuCqiMode21WideCqi)
8130
8131    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8132    CMCHKPK(SPkU8, param->pmi, mBuf);
8133    CMCHKPK(SPkU8, param->cqi, mBuf);
8134    RETVALUE(ROK);
8135 }
8136
8137
8138 \f
8139 /***********************************************************
8140 *
8141 *     Func : cmUnpkTfuCqiMode21WideCqi
8142 *
8143 *
8144 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8145   * It carries a wideband CQI, PMI and optionally a differential CQI.
8146 *
8147 *
8148 *     Ret  : S16
8149 *
8150 *     Notes:
8151 *
8152 *     File  : 
8153 *
8154 **********************************************************/
8155 #ifdef ANSI
8156 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi
8157 (
8158 TfuCqiMode21WideCqi *param,
8159 Buffer *mBuf
8160 )
8161 #else
8162 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi(param, mBuf)
8163 TfuCqiMode21WideCqi *param;
8164 Buffer *mBuf;
8165 #endif
8166 {
8167
8168    TRC3(cmUnpkTfuCqiMode21WideCqi)
8169
8170    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8171    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8172    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8173    RETVALUE(ROK);
8174 }
8175
8176
8177 \f
8178 /***********************************************************
8179 *
8180 *     Func : cmPkTfuCqiMode21Cqi
8181 *
8182 *
8183 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8184   * could either be wideband or sub-band.
8185 *
8186 *
8187 *     Ret  : S16
8188 *
8189 *     Notes:
8190 *
8191 *     File  : 
8192 *
8193 **********************************************************/
8194 #ifdef ANSI
8195 PUBLIC S16 cmPkTfuCqiMode21Cqi
8196 (
8197 TfuCqiMode21Cqi *param,
8198 Buffer *mBuf
8199 )
8200 #else
8201 PUBLIC S16 cmPkTfuCqiMode21Cqi(param, mBuf)
8202 TfuCqiMode21Cqi *param;
8203 Buffer *mBuf;
8204 #endif
8205 {
8206
8207    TRC3(cmPkTfuCqiMode21Cqi)
8208
8209       switch(param->isWideband) {
8210          case FALSE:
8211             CMCHKPK(cmPkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8212             break;
8213          case TRUE:
8214             CMCHKPK(cmPkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8215             break;
8216          default :
8217             RETVALUE(RFAILED);
8218       }
8219    CMCHKPK(SPkU8, param->isWideband, mBuf);
8220    RETVALUE(ROK);
8221 }
8222
8223
8224 \f
8225 /***********************************************************
8226 *
8227 *     Func : cmUnpkTfuCqiMode21Cqi
8228 *
8229 *
8230 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8231   * could either be wideband or sub-band.
8232 *
8233 *
8234 *     Ret  : S16
8235 *
8236 *     Notes:
8237 *
8238 *     File  : 
8239 *
8240 **********************************************************/
8241 #ifdef ANSI
8242 PUBLIC S16 cmUnpkTfuCqiMode21Cqi
8243 (
8244 TfuCqiMode21Cqi *param,
8245 Buffer *mBuf
8246 )
8247 #else
8248 PUBLIC S16 cmUnpkTfuCqiMode21Cqi(param, mBuf)
8249 TfuCqiMode21Cqi *param;
8250 Buffer *mBuf;
8251 #endif
8252 {
8253
8254    TRC3(cmUnpkTfuCqiMode21Cqi)
8255
8256    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
8257       switch(param->isWideband) {
8258          case TRUE:
8259             CMCHKUNPK(cmUnpkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8260             break;
8261          case FALSE:
8262             CMCHKUNPK(cmUnpkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8263             break;
8264          default :
8265             RETVALUE(RFAILED);
8266       }
8267    RETVALUE(ROK);
8268 }
8269
8270
8271 \f
8272 /***********************************************************
8273 *
8274 *     Func : cmPkTfuCqiPucchMode21
8275 *
8276 *
8277 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8278   * conveys a Rank Indicator or a CQI report.
8279 *
8280 *
8281 *     Ret  : S16
8282 *
8283 *     Notes:
8284 *
8285 *     File  : 
8286 *
8287 **********************************************************/
8288 #ifdef ANSI
8289 PUBLIC S16 cmPkTfuCqiPucchMode21
8290 (
8291 TfuCqiPucchMode21 *param,
8292 Buffer *mBuf
8293 )
8294 #else
8295 PUBLIC S16 cmPkTfuCqiPucchMode21(param, mBuf)
8296 TfuCqiPucchMode21 *param;
8297 Buffer *mBuf;
8298 #endif
8299 {
8300
8301    TRC3(cmPkTfuCqiPucchMode21)
8302
8303       switch(param->type) {
8304          case TFU_RPT_CQI:
8305             CMCHKPK(cmPkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8306             break;
8307          case TFU_RPT_RI:
8308             CMCHKPK(SPkU8, param->u.ri, mBuf);
8309             break;
8310          default :
8311             RETVALUE(RFAILED);
8312       }
8313    CMCHKPK(SPkU32, param->type, mBuf);
8314    RETVALUE(ROK);
8315 }
8316
8317
8318 \f
8319 /***********************************************************
8320 *
8321 *     Func : cmUnpkTfuCqiPucchMode21
8322 *
8323 *
8324 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8325   * conveys a Rank Indicator or a CQI report.
8326 *
8327 *
8328 *     Ret  : S16
8329 *
8330 *     Notes:
8331 *
8332 *     File  : 
8333 *
8334 **********************************************************/
8335 #ifdef ANSI
8336 PUBLIC S16 cmUnpkTfuCqiPucchMode21
8337 (
8338 TfuCqiPucchMode21 *param,
8339 Buffer *mBuf
8340 )
8341 #else
8342 PUBLIC S16 cmUnpkTfuCqiPucchMode21(param, mBuf)
8343 TfuCqiPucchMode21 *param;
8344 Buffer *mBuf;
8345 #endif
8346 {
8347
8348    TRC3(cmUnpkTfuCqiPucchMode21)
8349
8350    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8351       switch(param->type) {
8352          case TFU_RPT_RI:
8353             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8354             break;
8355          case TFU_RPT_CQI:
8356             CMCHKUNPK(cmUnpkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8357             break;
8358          default :
8359             RETVALUE(RFAILED);
8360       }
8361    RETVALUE(ROK);
8362 }
8363
8364
8365 \f
8366 /***********************************************************
8367 *
8368 *     Func : cmPkTfuDlCqiPucch
8369 *
8370 *
8371 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8372 *
8373 *
8374 *     Ret  : S16
8375 *
8376 *     Notes:
8377 *
8378 *     File  : 
8379 *
8380 **********************************************************/
8381 #ifdef ANSI
8382 PUBLIC S16 cmPkTfuDlCqiPucch
8383 (
8384 TfuDlCqiPucch *param,
8385 Buffer *mBuf
8386 )
8387 #else
8388 PUBLIC S16 cmPkTfuDlCqiPucch(param, mBuf)
8389 TfuDlCqiPucch *param;
8390 Buffer *mBuf;
8391 #endif
8392 {
8393
8394    TRC3(cmPkTfuDlCqiPucch)
8395
8396       switch(param->mode) {
8397          case TFU_PUCCH_CQI_MODE21:
8398             CMCHKPK(cmPkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8399             break;
8400          case TFU_PUCCH_CQI_MODE20:
8401             CMCHKPK(cmPkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8402             break;
8403          case TFU_PUCCH_CQI_MODE11:
8404             CMCHKPK(cmPkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8405             break;
8406          case TFU_PUCCH_CQI_MODE10:
8407             CMCHKPK(cmPkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8408             break;
8409          default :
8410             RETVALUE(RFAILED);
8411       }
8412    CMCHKPK(SPkU32, param->mode, mBuf);
8413    CMCHKPK(SPkU8, param->cellIdx, mBuf);
8414    RETVALUE(ROK);
8415 }
8416
8417
8418 \f
8419 /***********************************************************
8420 *
8421 *     Func : cmUnpkTfuDlCqiPucch
8422 *
8423 *
8424 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8425 *
8426 *
8427 *     Ret  : S16
8428 *
8429 *     Notes:
8430 *
8431 *     File  : 
8432 *
8433 **********************************************************/
8434 #ifdef ANSI
8435 PUBLIC S16 cmUnpkTfuDlCqiPucch
8436 (
8437 TfuDlCqiPucch *param,
8438 Buffer *mBuf
8439 )
8440 #else
8441 PUBLIC S16 cmUnpkTfuDlCqiPucch(param, mBuf)
8442 TfuDlCqiPucch *param;
8443 Buffer *mBuf;
8444 #endif
8445 {
8446
8447    TRC3(cmUnpkTfuDlCqiPucch)
8448
8449    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
8450    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
8451       switch(param->mode) {
8452          case TFU_PUCCH_CQI_MODE10:
8453             CMCHKUNPK(cmUnpkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8454             break;
8455          case TFU_PUCCH_CQI_MODE11:
8456             CMCHKUNPK(cmUnpkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8457             break;
8458          case TFU_PUCCH_CQI_MODE20:
8459             CMCHKUNPK(cmUnpkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8460             break;
8461          case TFU_PUCCH_CQI_MODE21:
8462             CMCHKUNPK(cmUnpkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8463             break;
8464          default :
8465             RETVALUE(RFAILED);
8466       }
8467    RETVALUE(ROK);
8468 }
8469
8470
8471 \f
8472 /***********************************************************
8473 *
8474 *     Func : cmPkTfuSubbandMode12
8475 *
8476 *
8477 *     Desc : This structure carries subband information and PMI, in the CQI
8478   * reporting format 1-2.
8479 *
8480 *
8481 *     Ret  : S16
8482 *
8483 *     Notes:
8484 *
8485 *     File  : 
8486 *
8487 **********************************************************/
8488 #ifdef ANSI
8489 PUBLIC S16 cmPkTfuSubbandMode12
8490 (
8491 TfuSubbandMode12 *param,
8492 Buffer *mBuf
8493 )
8494 #else
8495 PUBLIC S16 cmPkTfuSubbandMode12(param, mBuf)
8496 TfuSubbandMode12 *param;
8497 Buffer *mBuf;
8498 #endif
8499 {
8500
8501    TRC3(cmPkTfuSubbandMode12)
8502
8503    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8504    CMCHKPK(SPkU8, param->pmi, mBuf);
8505    RETVALUE(ROK);
8506 }
8507
8508
8509 \f
8510 /***********************************************************
8511 *
8512 *     Func : cmUnpkTfuSubbandMode12
8513 *
8514 *
8515 *     Desc : This structure carries subband information and PMI, in the CQI
8516   * reporting format 1-2.
8517 *
8518 *
8519 *     Ret  : S16
8520 *
8521 *     Notes:
8522 *
8523 *     File  : 
8524 *
8525 **********************************************************/
8526 #ifdef ANSI
8527 PUBLIC S16 cmUnpkTfuSubbandMode12
8528 (
8529 TfuSubbandMode12 *param,
8530 Buffer *mBuf
8531 )
8532 #else
8533 PUBLIC S16 cmUnpkTfuSubbandMode12(param, mBuf)
8534 TfuSubbandMode12 *param;
8535 Buffer *mBuf;
8536 #endif
8537 {
8538
8539    TRC3(cmUnpkTfuSubbandMode12)
8540
8541    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8542    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8543    RETVALUE(ROK);
8544 }
8545
8546
8547 \f
8548 /***********************************************************
8549 *
8550 *     Func : cmPkTfuCqiPuschMode12
8551 *
8552 *
8553 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8554  * over PUSCH.
8555 *
8556 *
8557 *     Ret  : S16
8558 *
8559 *     Notes:
8560 *
8561 *     File  : 
8562 *
8563 **********************************************************/
8564 #ifdef ANSI
8565 PUBLIC S16 cmPkTfuCqiPuschMode12
8566 (
8567 TfuCqiPuschMode12 *param,
8568 Buffer *mBuf
8569 )
8570 #else
8571 PUBLIC S16 cmPkTfuCqiPuschMode12(param, mBuf)
8572 TfuCqiPuschMode12 *param;
8573 Buffer *mBuf;
8574 #endif
8575 {
8576
8577    S32 i;
8578    TRC3(cmPkTfuCqiPuschMode12)
8579
8580    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8581       CMCHKPK(cmPkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8582    }
8583    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8584       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
8585    }
8586    CMCHKPK(SPkU8, param->numSubband, mBuf);
8587    RETVALUE(ROK);
8588 }
8589
8590
8591 \f
8592 /***********************************************************
8593 *
8594 *     Func : cmUnpkTfuCqiPuschMode12
8595 *
8596 *
8597 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8598  * over PUSCH.
8599 *
8600 *
8601 *     Ret  : S16
8602 *
8603 *     Notes:
8604 *
8605 *     File  : 
8606 *
8607 **********************************************************/
8608 #ifdef ANSI
8609 PUBLIC S16 cmUnpkTfuCqiPuschMode12
8610 (
8611 TfuCqiPuschMode12 *param,
8612 Buffer *mBuf
8613 )
8614 #else
8615 PUBLIC S16 cmUnpkTfuCqiPuschMode12(param, mBuf)
8616 TfuCqiPuschMode12 *param;
8617 Buffer *mBuf;
8618 #endif
8619 {
8620
8621    S32 i;
8622    TRC3(cmUnpkTfuCqiPuschMode12)
8623
8624    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8625    for (i=0; i<TFU_MAX_TB; i++) {
8626       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
8627    }
8628    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8629       CMCHKUNPK(cmUnpkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8630    }
8631    RETVALUE(ROK);
8632 }
8633
8634
8635 \f
8636 /***********************************************************
8637 *
8638 *     Func : cmPkTfuCqiPuschMode20
8639 *
8640 *
8641 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8642  * over PUSCH. This mode is for UE selected sub-band feedback.
8643 *
8644 *
8645 *     Ret  : S16
8646 *
8647 *     Notes:
8648 *
8649 *     File  : 
8650 *
8651 **********************************************************/
8652 #ifdef ANSI
8653 PUBLIC S16 cmPkTfuCqiPuschMode20
8654 (
8655 TfuCqiPuschMode20 *param,
8656 Buffer *mBuf
8657 )
8658 #else
8659 PUBLIC S16 cmPkTfuCqiPuschMode20(param, mBuf)
8660 TfuCqiPuschMode20 *param;
8661 Buffer *mBuf;
8662 #endif
8663 {
8664
8665    S32 i;
8666    TRC3(cmPkTfuCqiPuschMode20)
8667
8668    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8669       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8670    }
8671    CMCHKPK(SPkU8, param->numSubband, mBuf);
8672    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8673    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
8674    RETVALUE(ROK);
8675 }
8676
8677
8678 \f
8679 /***********************************************************
8680 *
8681 *     Func : cmUnpkTfuCqiPuschMode20
8682 *
8683 *
8684 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8685  * over PUSCH. This mode is for UE selected sub-band feedback.
8686 *
8687 *
8688 *     Ret  : S16
8689 *
8690 *     Notes:
8691 *
8692 *     File  : 
8693 *
8694 **********************************************************/
8695 #ifdef ANSI
8696 PUBLIC S16 cmUnpkTfuCqiPuschMode20
8697 (
8698 TfuCqiPuschMode20 *param,
8699 Buffer *mBuf
8700 )
8701 #else
8702 PUBLIC S16 cmUnpkTfuCqiPuschMode20(param, mBuf)
8703 TfuCqiPuschMode20 *param;
8704 Buffer *mBuf;
8705 #endif
8706 {
8707
8708    S32 i;
8709    TRC3(cmUnpkTfuCqiPuschMode20)
8710
8711    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
8712    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8713    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8714    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8715       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8716    }
8717    RETVALUE(ROK);
8718 }
8719
8720 \f
8721 /***********************************************************
8722 *
8723 *     Func : cmPkTfuCqiPuschMode22
8724 *
8725 *
8726 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8727  * over PUSCH.
8728 *
8729 *
8730 *     Ret  : S16
8731 *
8732 *     Notes:
8733 *
8734 *     File  : 
8735 *
8736 **********************************************************/
8737 #ifdef ANSI
8738 PUBLIC S16 cmPkTfuCqiPuschMode22
8739 (
8740 TfuCqiPuschMode22 *param,
8741 Buffer *mBuf
8742 )
8743 #else
8744 PUBLIC S16 cmPkTfuCqiPuschMode22(param, mBuf)
8745 TfuCqiPuschMode22 *param;
8746 Buffer *mBuf;
8747 #endif
8748 {
8749
8750    S32 i;
8751    TRC3(cmPkTfuCqiPuschMode22)
8752
8753
8754    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8755       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8756    }
8757
8758    CMCHKPK(SPkU8, param->numSubband, mBuf);
8759    CMCHKPK(SPkU8, param->wideBandPmi, mBuf);
8760    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8761       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
8762    }
8763    CMCHKPK(SPkU8, param->pmi, mBuf);
8764    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8765       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8766    }
8767    RETVALUE(ROK);
8768 }
8769
8770
8771 \f
8772 /***********************************************************
8773 *
8774 *     Func : cmUnpkTfuCqiPuschMode22
8775 *
8776 *
8777 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8778  * over PUSCH.
8779 *
8780 *
8781 *     Ret  : S16
8782 *
8783 *     Notes:
8784 *
8785 *     File  : 
8786 *
8787 **********************************************************/
8788 #ifdef ANSI
8789 PUBLIC S16 cmUnpkTfuCqiPuschMode22
8790 (
8791 TfuCqiPuschMode22 *param,
8792 Buffer *mBuf
8793 )
8794 #else
8795 PUBLIC S16 cmUnpkTfuCqiPuschMode22(param, mBuf)
8796 TfuCqiPuschMode22 *param;
8797 Buffer *mBuf;
8798 #endif
8799 {
8800
8801    S32 i;
8802    TRC3(cmUnpkTfuCqiPuschMode22)
8803
8804    for (i=0; i<TFU_MAX_TB; i++) {
8805       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8806    }
8807    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8808    for (i=0; i<TFU_MAX_TB; i++) {
8809       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
8810    }
8811    CMCHKUNPK(SUnpkU8, &param->wideBandPmi, mBuf);
8812    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8813
8814    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8815       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8816    }
8817
8818    RETVALUE(ROK);
8819 }
8820
8821
8822 #ifdef ANSI
8823 PUBLIC S16 cmPkTfuSubbandMode30
8824 (
8825 TfuSubbandMode30 *param,
8826 Buffer *mBuf
8827 )
8828 #else
8829 PUBLIC S16 cmPkTfuSubbandMode30(param, mBuf)
8830 TfuSubbandMode30 *param;
8831 Buffer *mBuf;
8832 #endif
8833 {
8834
8835    TRC3(cmPkTfuSubbandMode30)
8836
8837    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8838    CMCHKPK(SPkU8, param->cqi, mBuf);
8839    RETVALUE(ROK);
8840 }
8841
8842
8843 #ifdef ANSI
8844 PUBLIC S16 cmUnpkTfuSubbandMode30
8845 (
8846 TfuSubbandMode30 *param,
8847 Buffer *mBuf
8848 )
8849 #else
8850 PUBLIC S16 cmUnpkTfuSubbandMode30(param, mBuf)
8851 TfuSubbandMode30 *param;
8852 Buffer *mBuf;
8853 #endif
8854 {
8855
8856    TRC3(cmUnpkTfuSubbandMode30)
8857
8858    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8859    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8860    RETVALUE(ROK);
8861 }
8862
8863
8864 \f
8865 /***********************************************************
8866 *
8867 *     Func : cmPkTfuCqiPuschMode30
8868 *
8869 *
8870 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8871  * received over PUSCH.
8872 *
8873 *
8874 *     Ret  : S16
8875 *
8876 *     Notes:
8877 *
8878 *     File  : 
8879 *
8880 **********************************************************/
8881 #ifdef ANSI
8882 PUBLIC S16 cmPkTfuCqiPuschMode30
8883 (
8884 TfuCqiPuschMode30 *param,
8885 Buffer *mBuf
8886 )
8887 #else
8888 PUBLIC S16 cmPkTfuCqiPuschMode30(param, mBuf)
8889 TfuCqiPuschMode30 *param;
8890 Buffer *mBuf;
8891 #endif
8892 {
8893
8894    S32 i;
8895    TRC3(cmPkTfuCqiPuschMode30)
8896
8897    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8898       CMCHKPK(cmPkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8899    }
8900    CMCHKPK(SPkU8, param->numSubband, mBuf);
8901    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8902    RETVALUE(ROK);
8903 }
8904
8905
8906 \f
8907 /***********************************************************
8908 *
8909 *     Func : cmUnpkTfuCqiPuschMode30
8910 *
8911 *
8912 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8913  * received over PUSCH.
8914 *
8915 *
8916 *     Ret  : S16
8917 *
8918 *     Notes:
8919 *
8920 *     File  : 
8921 *
8922 **********************************************************/
8923 #ifdef ANSI
8924 PUBLIC S16 cmUnpkTfuCqiPuschMode30
8925 (
8926 TfuCqiPuschMode30 *param,
8927 Buffer *mBuf
8928 )
8929 #else
8930 PUBLIC S16 cmUnpkTfuCqiPuschMode30(param, mBuf)
8931 TfuCqiPuschMode30 *param;
8932 Buffer *mBuf;
8933 #endif
8934 {
8935
8936    S32 i;
8937    TRC3(cmUnpkTfuCqiPuschMode30)
8938
8939    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8940    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8941    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8942       CMCHKUNPK(cmUnpkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8943    }
8944    RETVALUE(ROK);
8945 }
8946
8947
8948 #ifdef ANSI
8949 PUBLIC S16 cmPkTfuSubbandMode31
8950 (
8951 TfuSubbandMode31 *param,
8952 Buffer *mBuf
8953 )
8954 #else
8955 PUBLIC S16 cmPkTfuSubbandMode31(param, mBuf)
8956 TfuSubbandMode31 *param;
8957 Buffer *mBuf;
8958 #endif
8959 {
8960
8961    S32 i;
8962    TRC3(cmPkTfuSubbandMode31)
8963
8964    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8965    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8966       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8967    }
8968    RETVALUE(ROK);
8969 }
8970
8971
8972 #ifdef ANSI
8973 PUBLIC S16 cmUnpkTfuSubbandMode31
8974 (
8975 TfuSubbandMode31 *param,
8976 Buffer *mBuf
8977 )
8978 #else
8979 PUBLIC S16 cmUnpkTfuSubbandMode31(param, mBuf)
8980 TfuSubbandMode31 *param;
8981 Buffer *mBuf;
8982 #endif
8983 {
8984
8985    S32 i;
8986    TRC3(cmUnpkTfuSubbandMode31)
8987
8988    for (i=0; i<TFU_MAX_TB; i++) {
8989       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8990    }
8991    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8992    RETVALUE(ROK);
8993 }
8994
8995
8996 \f
8997 /***********************************************************
8998 *
8999 *     Func : cmPkTfuCqiPuschMode31
9000 *
9001 *
9002 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9003  * received over PUSCH.
9004 *
9005 *
9006 *     Ret  : S16
9007 *
9008 *     Notes:
9009 *
9010 *     File  : 
9011 *
9012 **********************************************************/
9013 #ifdef ANSI
9014 PUBLIC S16 cmPkTfuCqiPuschMode31
9015 (
9016 TfuCqiPuschMode31 *param,
9017 Buffer *mBuf
9018 )
9019 #else
9020 PUBLIC S16 cmPkTfuCqiPuschMode31(param, mBuf)
9021 TfuCqiPuschMode31 *param;
9022 Buffer *mBuf;
9023 #endif
9024 {
9025
9026    S32 i;
9027    TRC3(cmPkTfuCqiPuschMode31)
9028
9029
9030 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9031 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9032
9033 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9034 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9035    for (i=param->numSubband-1; i >= 0; i--) {
9036       CMCHKPK(cmPkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9037    }
9038
9039    CMCHKPK(SPkU8, param->numSubband, mBuf);
9040    for (i=TFU_MAX_TB-1; i >= 0; i--) {
9041       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
9042    }
9043    CMCHKPK(SPkU8, param->pmi, mBuf);
9044    RETVALUE(ROK);
9045 }
9046
9047
9048 \f
9049 /***********************************************************
9050 *
9051 *     Func : cmUnpkTfuCqiPuschMode31
9052 *
9053 *
9054 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9055  * received over PUSCH.
9056 *
9057 *
9058 *     Ret  : S16
9059 *
9060 *     Notes:
9061 *
9062 *     File  : 
9063 *
9064 **********************************************************/
9065 #ifdef ANSI
9066 PUBLIC S16 cmUnpkTfuCqiPuschMode31
9067 (
9068 TfuCqiPuschMode31 *param,
9069 Buffer *mBuf
9070 )
9071 #else
9072 PUBLIC S16 cmUnpkTfuCqiPuschMode31(param, mBuf)
9073 TfuCqiPuschMode31 *param;
9074 Buffer *mBuf;
9075 #endif
9076 {
9077
9078    S32 i;
9079    TRC3(cmUnpkTfuCqiPuschMode31)
9080
9081    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
9082    for (i=0; i<TFU_MAX_TB; i++) {
9083       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
9084    }
9085    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
9086
9087 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9088 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9089    for (i=0; i<param->numSubband; i++) {
9090       CMCHKUNPK(cmUnpkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9091    }
9092
9093
9094 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9095 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9096
9097    RETVALUE(ROK);
9098 }
9099
9100
9101 \f
9102 /***********************************************************
9103 *
9104 *     Func : cmPkTfuDlCqiPusch
9105 *
9106 *
9107 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9108  * CQI) received over PUSCH.
9109 *
9110 *
9111 *     Ret  : S16
9112 *
9113 *     Notes:
9114 *
9115 *     File  : 
9116 *
9117 **********************************************************/
9118 #ifdef ANSI
9119 PUBLIC S16 cmPkTfuDlCqiPusch
9120 (
9121 TfuDlCqiPusch *param,
9122 Buffer *mBuf
9123 )
9124 #else
9125 PUBLIC S16 cmPkTfuDlCqiPusch(param, mBuf)
9126 TfuDlCqiPusch *param;
9127 Buffer *mBuf;
9128 #endif
9129 {
9130
9131    TRC3(cmPkTfuDlCqiPusch)
9132
9133       switch(param->mode) {
9134          case TFU_PUSCH_CQI_MODE_31:
9135             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9136             break;
9137          case TFU_PUSCH_CQI_MODE_30:
9138             CMCHKPK(cmPkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9139             break;
9140          case TFU_PUSCH_CQI_MODE_22:
9141             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9142             break;
9143          case TFU_PUSCH_CQI_MODE_20:
9144             CMCHKPK(cmPkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9145             break;
9146          case TFU_PUSCH_CQI_MODE_12:
9147             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9148             break;
9149          default :
9150             RETVALUE(RFAILED);
9151       }
9152
9153    CMCHKPK(cmPkTknU8, &param->ri, mBuf);
9154    CMCHKPK(SPkU32, param->mode, mBuf);
9155
9156    CMCHKPK(SPkU8, param->cellIdx, mBuf);
9157    RETVALUE(ROK);
9158 }
9159
9160
9161 \f
9162 /***********************************************************
9163 *
9164 *     Func : cmUnpkTfuDlCqiPusch
9165 *
9166 *
9167 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9168  * CQI) received over PUSCH.
9169 *
9170 *
9171 *     Ret  : S16
9172 *
9173 *     Notes:
9174 *
9175 *     File  : 
9176 *
9177 **********************************************************/
9178 #ifdef ANSI
9179 PUBLIC S16 cmUnpkTfuDlCqiPusch
9180 (
9181 TfuDlCqiPusch *param,
9182 Buffer *mBuf
9183 )
9184 #else
9185 PUBLIC S16 cmUnpkTfuDlCqiPusch(param, mBuf)
9186 TfuDlCqiPusch *param;
9187 Buffer *mBuf;
9188 #endif
9189 {
9190
9191    TRC3(cmUnpkTfuDlCqiPusch)
9192
9193    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
9194    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
9195    CMCHKUNPK(cmUnpkTknU8, &param->ri, mBuf);
9196    switch(param->mode) {
9197       case TFU_PUSCH_CQI_MODE_12:
9198          CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9199          break;
9200       case TFU_PUSCH_CQI_MODE_20:
9201          CMCHKUNPK(cmUnpkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9202          break;
9203       case TFU_PUSCH_CQI_MODE_22:
9204          CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9205          break;
9206       case TFU_PUSCH_CQI_MODE_30:
9207          CMCHKUNPK(cmUnpkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9208          break;
9209       case TFU_PUSCH_CQI_MODE_31:
9210          CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9211          break;
9212       default :
9213          RETVALUE(RFAILED);
9214    }
9215    RETVALUE(ROK);
9216 }
9217
9218 \f
9219 /***********************************************************
9220 *
9221 *     Func : cmPkTfuDlCqiInfo
9222 *
9223 *
9224 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9225 *
9226 *
9227 *     Ret  : S16
9228 *
9229 *     Notes:
9230 *
9231 *     File  : 
9232 *
9233 **********************************************************/
9234 #ifdef ANSI
9235 PUBLIC S16 cmPkTfuDlCqiInfo
9236 (
9237 U8 selector,
9238 TfuDlCqiInfo *param,
9239 Buffer *mBuf
9240 )
9241 #else
9242 PUBLIC S16 cmPkTfuDlCqiInfo(selector, param, mBuf)
9243 U8 selector;
9244 TfuDlCqiInfo *param;
9245 Buffer *mBuf;
9246 #endif
9247 {
9248    U32 idx;
9249
9250    TRC3(cmPkTfuDlCqiInfo)
9251
9252    switch(selector) {
9253       case FALSE:
9254          for (idx = 0; idx < param->pusch.numOfCells; idx++)
9255          {
9256             CMCHKPK(cmPkTfuDlCqiPusch, &param->pusch.puschCqi[idx], mBuf);
9257          }
9258          CMCHKPK(SPkU8, param->pusch.numOfCells, mBuf);
9259          break;
9260       case TRUE:
9261          CMCHKPK(cmPkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9262          break;
9263       default :
9264          RETVALUE(RFAILED);
9265    }
9266    RETVALUE(ROK);
9267 }
9268
9269
9270 \f
9271 /***********************************************************
9272 *
9273 *     Func : cmUnpkTfuDlCqiInfo
9274 *
9275 *
9276 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9277 *
9278 *
9279 *     Ret  : S16
9280 *
9281 *     Notes:
9282 *
9283 *     File  : 
9284 *
9285 **********************************************************/
9286 #ifdef ANSI
9287 PUBLIC S16 cmUnpkTfuDlCqiInfo
9288 (
9289 U8 selector,
9290 TfuDlCqiInfo *param,
9291 Buffer *mBuf
9292 )
9293 #else
9294 PUBLIC S16 cmUnpkTfuDlCqiInfo(selector, param, mBuf)
9295 U8 selector;
9296 TfuDlCqiInfo *param;
9297 Buffer *mBuf;
9298 #endif
9299 {
9300
9301    U8 idx;
9302    TRC3(cmUnpkTfuDlCqiInfo)
9303
9304    switch(selector) {
9305       case TRUE:
9306          CMCHKUNPK(cmUnpkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9307          break;
9308       case FALSE:
9309          CMCHKUNPK(SUnpkU8, &param->pusch.numOfCells, mBuf);
9310          for (idx = param->pusch.numOfCells; idx > 0; idx--)
9311          {
9312             CMCHKUNPK(cmUnpkTfuDlCqiPusch, &param->pusch.puschCqi[idx-1], mBuf);
9313          }
9314          break;
9315       default :
9316          RETVALUE(RFAILED);
9317    }
9318    RETVALUE(ROK);
9319 }
9320
9321
9322 \f
9323 /***********************************************************
9324 *
9325 *     Func : cmPkTfuRecpReqInfo
9326 *
9327 *
9328 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9329  * needed by PHY to decode the following 
9330  * 1. DATA on PUSCH
9331  * 2. HARQ Feedback on PUCCH
9332  * 3. CQI Report 
9333  * 4. RI Report
9334  * 5. SR Indications.
9335  * This structure carries the reception information for all the scheduled UE.
9336 *
9337 *
9338 *     Ret  : S16
9339 *
9340 *     Notes:
9341 *
9342 *     File  : 
9343 *
9344 **********************************************************/
9345 #ifdef ANSI
9346 PUBLIC S16 cmPkTfuRecpReqInfo
9347 (
9348 TfuRecpReqInfo *param,
9349 Buffer *mBuf
9350 )
9351 #else
9352 PUBLIC S16 cmPkTfuRecpReqInfo(param, mBuf)
9353 TfuRecpReqInfo *param;
9354 Buffer *mBuf;
9355 #endif
9356 {
9357    CmLList *node;
9358    U32 count;
9359    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9360
9361    TRC3(cmPkTfuRecpReqInfo)
9362
9363    /*ccpu00116923 - ADD - SRS present support*/
9364    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9365 #ifdef TFU_UPGRADE
9366    CMCHKPK(SPkU8, param->srsPres, mBuf);
9367 #endif
9368    count = param->ueRecpReqLst.count;
9369    node = param->ueRecpReqLst.last;
9370    while (node) {
9371       tfuUeRecpReqInfo = (TfuUeRecpReqInfo *)node->node;
9372       node=node->prev;
9373       CMCHKPK(cmPkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9374       cmLListDelFrm(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9375       tfuUeRecpReqInfo->lnk.node = (PTR)NULLP;
9376    }
9377    CMCHKPK(SPkU32, count, mBuf);
9378    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
9379    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9380    RETVALUE(ROK);
9381 }
9382
9383
9384 \f
9385 /***********************************************************
9386 *
9387 *     Func : cmUnpkTfuRecpReqInfo
9388 *
9389 *
9390 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9391  * needed by PHY to decode the following 
9392  * 1. DATA on PUSCH
9393  * 2. HARQ Feedback on PUCCH
9394  * 3. CQI Report 
9395  * 4. RI Report
9396  * 5. SR Indications.
9397  * This structure carries the reception information for all the scheduled UE.
9398 *
9399 *
9400 *     Ret  : S16
9401 *
9402 *     Notes:
9403 *
9404 *     File  : 
9405 *
9406 **********************************************************/
9407 #ifdef ANSI
9408 PUBLIC S16 cmUnpkTfuRecpReqInfo
9409 (
9410 TfuRecpReqInfo *param,
9411 Ptr memCp,
9412 Buffer *mBuf
9413 )
9414 #else
9415 PUBLIC S16 cmUnpkTfuRecpReqInfo(param, memCp, mBuf)
9416 TfuRecpReqInfo *param;
9417 Ptr memCp;
9418 Buffer *mBuf;
9419 #endif
9420 {
9421
9422    U32 count, loopCnt;
9423    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9424
9425    TRC3(cmUnpkTfuRecpReqInfo)
9426
9427    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9428    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
9429    cmLListInit(&param->ueRecpReqLst);
9430    CMCHKUNPK(SUnpkU32, &count, mBuf);
9431    for (loopCnt=0; loopCnt<count; loopCnt++) {
9432       cmGetMem((Ptr)memCp, sizeof(*tfuUeRecpReqInfo), (Ptr *)&tfuUeRecpReqInfo);
9433       CMCHKUNPK(cmUnpkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9434       cmLListAdd2Tail(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9435       tfuUeRecpReqInfo->lnk.node = (PTR)tfuUeRecpReqInfo;
9436    }
9437    /*ccpu00116923 - ADD - SRS present support*/
9438    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9439 #ifdef TFU_UPGRADE
9440    CMCHKUNPK(SUnpkU8, &param->srsPres, mBuf);
9441 #endif
9442    RETVALUE(ROK);
9443 }
9444
9445
9446 \f
9447 /***********************************************************
9448 *
9449 *     Func : cmPkTfuPdcchInfo
9450 *
9451 *
9452 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9453   * formats. This information is associated with an RNTI.
9454 *
9455 *
9456 *     Ret  : S16
9457 *
9458 *     Notes:
9459 *
9460 *     File  : 
9461 *
9462 **********************************************************/
9463 #ifdef ANSI
9464 PUBLIC S16 cmPkTfuPdcchInfo
9465 (
9466 TfuPdcchInfo *param,
9467 Buffer *mBuf
9468 )
9469 #else
9470 PUBLIC S16 cmPkTfuPdcchInfo(param, mBuf)
9471 TfuPdcchInfo *param;
9472 Buffer *mBuf;
9473 #endif
9474 {
9475
9476    TRC3(cmPkTfuPdcchInfo)
9477 #ifdef TFU_5GTF
9478    CMCHKPK(SPkU8, param->grpId, mBuf);
9479    CMCHKPK(SPkU8, param->sccIdx, mBuf);
9480    CMCHKPK(SPkU8, param->sectorId, mBuf);
9481 #endif /* TFU_5GTF */
9482    CMCHKPK(cmPkTfuDciInfo, &param->dci, mBuf);
9483    CMCHKPK(SPkU8, param->dciNumOfBits, mBuf);
9484    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
9485    CMCHKPK(SPkU16, param->nCce, mBuf);
9486 #ifdef LTEMAC_SPS
9487    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9488    CMCHKPK(SPkU8, param->isSpsRnti, mBuf);
9489 #endif
9490    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9491    RETVALUE(ROK);
9492 }
9493
9494
9495 \f
9496 /***********************************************************
9497 *
9498 *     Func : cmUnpkTfuPdcchInfo
9499 *
9500 *
9501 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9502   * formats. This information is associated with an RNTI.
9503 *
9504 *
9505 *     Ret  : S16
9506 *
9507 *     Notes:
9508 *
9509 *     File  : 
9510 *
9511 **********************************************************/
9512 #ifdef ANSI
9513 PUBLIC S16 cmUnpkTfuPdcchInfo
9514 (
9515 TfuPdcchInfo *param,
9516 Buffer *mBuf
9517 )
9518 #else
9519 PUBLIC S16 cmUnpkTfuPdcchInfo(param, mBuf)
9520 TfuPdcchInfo *param;
9521 Buffer *mBuf;
9522 #endif
9523 {
9524
9525    TRC3(cmUnpkTfuPdcchInfo)
9526
9527    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9528 #ifdef LTEMAC_SPS
9529    CMCHKUNPK(SUnpkU8, &param->isSpsRnti, mBuf);
9530    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9531 #endif
9532    CMCHKUNPK(SUnpkU16, &param->nCce, mBuf);
9533    CMCHKUNPK(cmUnpkLteAggrLvl, (U32*)&param->aggrLvl, mBuf);
9534    CMCHKUNPK(SUnpkU8, &param->dciNumOfBits, mBuf);
9535    CMCHKUNPK(cmUnpkTfuDciInfo, &param->dci, mBuf);
9536 #ifdef TFU_5GTF 
9537    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
9538    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
9539    CMCHKUNPK(SUnpkU8, &param->grpId, mBuf);
9540 #endif /* TFU_5GTF */
9541    RETVALUE(ROK);
9542 }
9543
9544
9545 \f
9546 /***********************************************************
9547 *
9548 *     Func : cmPkTfuPhichInfo
9549 *
9550 *
9551 *     Desc : This structure contains one PHICH information. In order to locate the
9552  * resources to be used for PHICH the following information is provided along
9553  * with the feedback -
9554  * -# rbStart
9555  * -# nDmrs
9556 *
9557 *
9558 *     Ret  : S16
9559 *
9560 *     Notes:
9561 *
9562 *     File  : 
9563 *
9564 **********************************************************/
9565 #ifdef ANSI
9566 PUBLIC S16 cmPkTfuPhichInfo
9567 (
9568 TfuPhichInfo *param,
9569 Buffer *mBuf
9570 )
9571 #else
9572 PUBLIC S16 cmPkTfuPhichInfo(param, mBuf)
9573 TfuPhichInfo *param;
9574 Buffer *mBuf;
9575 #endif
9576 {
9577
9578    TRC3(cmPkTfuPhichInfo)
9579 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9580 #ifdef TFU_UPGRADE
9581    CMCHKPK(SPkU16, param->txPower, mBuf);
9582 #endif
9583 #ifdef TFU_TDD
9584    CMCHKPK(SPkU8, param->iPhich, mBuf);
9585 #endif
9586    CMCHKPK(SPkU8, param->isAck, mBuf);
9587    CMCHKPK(SPkU8, param->nDmrs, mBuf);
9588    CMCHKPK(SPkU8, param->rbStart, mBuf);
9589    RETVALUE(ROK);
9590 }
9591
9592
9593 \f
9594 /***********************************************************
9595 *
9596 *     Func : cmUnpkTfuPhichInfo
9597 *
9598 *
9599 *     Desc : This structure contains one PHICH information. In order to locate the
9600  * resources to be used for PHICH the following information is provided along
9601  * with the feedback -
9602  * -# rbStart
9603  * -# nDmrs
9604 *
9605 *
9606 *     Ret  : S16
9607 *
9608 *     Notes:
9609 *
9610 *     File  : 
9611 *
9612 **********************************************************/
9613 #ifdef ANSI
9614 PUBLIC S16 cmUnpkTfuPhichInfo
9615 (
9616 TfuPhichInfo *param,
9617 Buffer *mBuf
9618 )
9619 #else
9620 PUBLIC S16 cmUnpkTfuPhichInfo(param, mBuf)
9621 TfuPhichInfo *param;
9622 Buffer *mBuf;
9623 #endif
9624 {
9625
9626    TRC3(cmUnpkTfuPhichInfo)
9627
9628    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
9629    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
9630    CMCHKUNPK(SUnpkU8, &param->isAck, mBuf);
9631 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9632 #ifdef TFU_TDD
9633    CMCHKUNPK(SUnpkU8, &param->iPhich, mBuf);
9634 #endif
9635 #ifdef TFU_UPGRADE   
9636    CMCHKUNPK(SUnpkU16, &param->txPower, mBuf);
9637 #endif
9638    RETVALUE(ROK);
9639 }
9640
9641
9642 \f
9643 /***********************************************************
9644 *
9645 *     Func : cmPkTfuCntrlReqInfo
9646 *
9647 *
9648 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9649  * control information to be sent to the UE. 
9650  * -# PDCCH  Physical Downlink Control Channel
9651  * -# PHICH  Physical HARQ Indicator Channel
9652  * -# PCFICH Physical Control Format Indicator Channel
9653 *
9654 *
9655 *     Ret  : S16
9656 *
9657 *     Notes:
9658 *
9659 *     File  : 
9660 *
9661 **********************************************************/
9662 #ifdef ANSI
9663 PUBLIC S16 cmPkTfuCntrlReqInfo
9664 (
9665 TfuCntrlReqInfo *param,
9666 Buffer *mBuf
9667 )
9668 #else
9669 PUBLIC S16 cmPkTfuCntrlReqInfo(param, mBuf)
9670 TfuCntrlReqInfo *param;
9671 Buffer *mBuf;
9672 #endif
9673 {
9674
9675    TfuPdcchInfo   *tfuPdcchInfo;
9676    TfuPhichInfo *tfuPhichInfo;
9677    CmLList *node;
9678    U32 count;
9679
9680    TRC3(cmPkTfuCntrlReqInfo)
9681 #ifdef EMTC_ENABLE
9682    count = param->dlMpdcchLst.count;
9683    node = param->dlMpdcchLst.last;
9684    while (node) {
9685       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9686       node=node->prev;
9687       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9688       cmLListDelFrm(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9689       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9690    }
9691    CMCHKPK(SPkU32, count, mBuf);
9692    count = param->ulMpdcchLst.count;
9693    node = param->ulMpdcchLst.last;
9694    while (node) {
9695       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9696       node=node->prev;
9697       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9698       cmLListDelFrm(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9699       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9700    }
9701    CMCHKPK(SPkU32, count, mBuf);
9702 #endif      
9703 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9704    CMCHKPK(cmPkBool, param->isSPSOcc, mBuf);
9705 #endif
9706    count = param->phichLst.count;
9707    node = param->phichLst.last;
9708    while (node) {
9709       tfuPhichInfo = (TfuPhichInfo *)node->node;
9710       node=node->prev;
9711       CMCHKPK(cmPkTfuPhichInfo, tfuPhichInfo, mBuf);
9712       cmLListDelFrm(&param->phichLst, &tfuPhichInfo->lnk);
9713       tfuPhichInfo->lnk.node = (PTR)NULLP;
9714    }
9715    CMCHKPK(SPkU32, count, mBuf);
9716    count = param->dlPdcchLst.count;
9717    node = param->dlPdcchLst.last;
9718    while (node) {
9719       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9720       node=node->prev;
9721       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9722       cmLListDelFrm(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9723       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9724    }
9725    CMCHKPK(SPkU32, count, mBuf);
9726    count = param->ulPdcchLst.count;
9727    node = param->ulPdcchLst.last;
9728    while (node) {
9729       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9730       node=node->prev;
9731 #ifdef UL_ADPT_DBG      
9732       printf("ulPdcchLst count %d  time[ %d %d] \n",count,param->ulTiming.sfn,param->ulTiming.subframe);
9733 #endif
9734       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9735       cmLListDelFrm(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9736       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9737    }
9738    CMCHKPK(SPkU32, count, mBuf);
9739    CMCHKPK(SPkU8, param->cfi, mBuf);
9740    CMCHKPK(cmPkLteTimingInfo, &param->dlTiming, mBuf);
9741    CMCHKPK(cmPkLteTimingInfo, &param->ulTiming, mBuf);
9742    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9743    RETVALUE(ROK);
9744 }
9745
9746
9747 \f
9748 /***********************************************************
9749 *
9750 *     Func : cmUnpkTfuCntrlReqInfo
9751 *
9752 *
9753 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9754  * control information to be sent to the UE. 
9755  * -# PDCCH  Physical Downlink Control Channel
9756  * -# PHICH  Physical HARQ Indicator Channel
9757  * -# PCFICH Physical Control Format Indicator Channel
9758 *
9759 *
9760 *     Ret  : S16
9761 *
9762 *     Notes:
9763 *
9764 *     File  : 
9765 *
9766 **********************************************************/
9767 #ifdef ANSI
9768 PUBLIC S16 cmUnpkTfuCntrlReqInfo
9769 (
9770 TfuCntrlReqInfo *param,
9771 Ptr memCp,
9772 Buffer *mBuf
9773 )
9774 #else
9775 PUBLIC S16 cmUnpkTfuCntrlReqInfo(param, memCp, mBuf)
9776 TfuCntrlReqInfo *param;
9777 Ptr memCp;
9778 Buffer *mBuf;
9779 #endif
9780 {
9781
9782    TfuPdcchInfo *tfuPdcchInfo;
9783    U32 count, loopCnt;
9784    TfuPhichInfo *tfuPhichInfo;
9785
9786    TRC3(cmUnpkTfuCntrlReqInfo)
9787
9788    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9789    CMCHKUNPK(cmUnpkLteTimingInfo, &param->ulTiming, mBuf);
9790    CMCHKUNPK(cmUnpkLteTimingInfo, &param->dlTiming, mBuf);
9791    CMCHKUNPK(SUnpkU8, &param->cfi, mBuf);
9792    cmLListInit(&param->ulPdcchLst);
9793    CMCHKUNPK(SUnpkU32, &count, mBuf);
9794    for (loopCnt=0; loopCnt<count; loopCnt++) {
9795       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9796       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9797       cmLListAdd2Tail(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9798       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9799    }
9800    cmLListInit(&param->dlPdcchLst);
9801    CMCHKUNPK(SUnpkU32, &count, mBuf);
9802    for (loopCnt=0; loopCnt<count; loopCnt++) {
9803       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9804       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9805       cmLListAdd2Tail(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9806       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9807    }
9808    cmLListInit(&param->phichLst);
9809    CMCHKUNPK(SUnpkU32, &count, mBuf);
9810    for (loopCnt=0; loopCnt<count; loopCnt++) {
9811       cmGetMem((Ptr)memCp, sizeof(*tfuPhichInfo), (Ptr *)&tfuPhichInfo);
9812       CMCHKUNPK(cmUnpkTfuPhichInfo, tfuPhichInfo, mBuf);
9813       cmLListAdd2Tail(&param->phichLst, &tfuPhichInfo->lnk);
9814       tfuPhichInfo->lnk.node = (PTR)tfuPhichInfo;
9815    }
9816
9817 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9818    CMCHKUNPK(cmUnpkBool, &param->isSPSOcc, mBuf);
9819 #endif
9820 #ifdef EMTC_ENABLE   
9821    cmLListInit(&param->ulMpdcchLst);
9822    CMCHKUNPK(SUnpkU32, &count, mBuf);
9823    for (loopCnt=0; loopCnt<count; loopCnt++) {
9824       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9825       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9826       cmLListAdd2Tail(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9827       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9828    }
9829    cmLListInit(&param->dlMpdcchLst);
9830    CMCHKUNPK(SUnpkU32, &count, mBuf);
9831    printf("4. cmUnpkTfuCntrlReqInfo :: count %ld \n", count); 
9832    for (loopCnt=0; loopCnt<count; loopCnt++) {
9833       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9834       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9835       cmLListAdd2Tail(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9836       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9837       printf("5. cmUnpkTfuCntrlReqInfo :: Failed \n"); 
9838    }
9839 #endif  
9840    RETVALUE(ROK);
9841 }
9842
9843
9844 \f
9845 /***********************************************************
9846 *
9847 *     Func : cmPkTfuPdschDciInfo
9848 *
9849 *
9850 *     Desc : This structure Carries the control information that would be needed
9851   * by the Physical layer to process the data to be sent on PDSCH.
9852 *
9853 *
9854 *     Ret  : S16
9855 *
9856 *     Notes:
9857 *
9858 *     File  : 
9859 *
9860 **********************************************************/
9861 #ifdef ANSI
9862 PUBLIC S16 cmPkTfuPdschDciInfo
9863 (
9864 TfuPdschDciInfo *param,
9865 Buffer *mBuf
9866 )
9867 #else
9868 PUBLIC S16 cmPkTfuPdschDciInfo(param, mBuf)
9869 TfuPdschDciInfo *param;
9870 Buffer *mBuf;
9871 #endif
9872 {
9873
9874    TRC3(cmPkTfuPdschDciInfo)
9875
9876       switch(param->format) {
9877 #ifdef TFU_5GTF
9878          case TFU_DCI_FORMAT_B1:
9879             /* 
9880             if (param->u.formatB1Info.RBAssign <= 324)
9881             {
9882                printf("DCI Format: [B1] RBAssign: [%d] MCS: [%d]", 
9883                      param->u.formatB1Info.RBAssign, 
9884                      param->u.formatB1Info.u.rbAssignB1Val324.mcs);
9885             } 
9886             */
9887             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9888             break;
9889          case TFU_DCI_FORMAT_B2:
9890             /* 
9891             if (param->u.formatB2Info.RBAssign <= 324)
9892             {
9893                printf("DCI Format: [B2] RBAssign: [%d] MCS: [%d]", 
9894                      param->u.formatB2Info.RBAssign, 
9895                      param->u.formatB2Info.u.rbAssignB1Val324.mcs);
9896             } 
9897             */
9898             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9899             break;
9900          case TFU_DCI_FORMAT_A1:
9901             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9902             break;
9903          case TFU_DCI_FORMAT_A2:
9904             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9905             break;
9906 #endif
9907 #ifdef EMTC_ENABLE            
9908          case TFU_DCI_FORMAT_6_2:
9909              CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9910          break;
9911          case TFU_DCI_FORMAT_6_1A:
9912             CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9913             break;
9914 #endif            
9915          case TFU_DCI_FORMAT_2A:
9916             CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9917             break;
9918          case TFU_DCI_FORMAT_2:
9919             CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9920             break;
9921          case TFU_DCI_FORMAT_1D:
9922             CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9923             break;
9924          case TFU_DCI_FORMAT_1C:
9925             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9926             break;
9927          case TFU_DCI_FORMAT_1B:
9928             CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9929             break;
9930          case TFU_DCI_FORMAT_1A:
9931             CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9932             break;
9933          case TFU_DCI_FORMAT_1:
9934             CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9935             break;
9936          default :
9937             RETVALUE(RFAILED);
9938       }
9939    CMCHKPK(SPkU32, param->format, mBuf);
9940    RETVALUE(ROK);
9941 }
9942
9943
9944 \f
9945 /***********************************************************
9946 *
9947 *     Func : cmUnpkTfuPdschDciInfo
9948 *
9949 *
9950 *     Desc : This structure Carries the control information that would be needed
9951   * by the Physical layer to process the data to be sent on PDSCH.
9952 *
9953 *
9954 *     Ret  : S16
9955 *
9956 *     Notes:
9957 *
9958 *     File  : 
9959 *
9960 **********************************************************/
9961 #ifdef ANSI
9962 PUBLIC S16 cmUnpkTfuPdschDciInfo
9963 (
9964 TfuPdschDciInfo *param,
9965 Buffer *mBuf
9966 )
9967 #else
9968 PUBLIC S16 cmUnpkTfuPdschDciInfo(param, mBuf)
9969 TfuPdschDciInfo *param;
9970 Buffer *mBuf;
9971 #endif
9972 {
9973
9974    TRC3(cmUnpkTfuPdschDciInfo)
9975
9976    CMCHKUNPK(SUnpkU32, (U32 *)&param->format, mBuf);
9977       switch(param->format) {
9978          case TFU_DCI_FORMAT_1:
9979             CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9980             break;
9981          case TFU_DCI_FORMAT_1A:
9982             CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9983             break;
9984          case TFU_DCI_FORMAT_1B:
9985             CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9986             break;
9987          case TFU_DCI_FORMAT_1C:
9988             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9989             break;
9990          case TFU_DCI_FORMAT_1D:
9991             CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9992             break;
9993          case TFU_DCI_FORMAT_2:
9994             CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9995             break;
9996          case TFU_DCI_FORMAT_2A:
9997             CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9998             break;
9999 #ifdef EMTC_ENABLE            
10000          case TFU_DCI_FORMAT_6_1A:
10001             CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
10002             break;
10003          case TFU_DCI_FORMAT_6_2:
10004             CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
10005             break;
10006 #endif   
10007 #ifdef TFU_5GTF
10008          case TFU_DCI_FORMAT_A1:
10009             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
10010             break;
10011                         case TFU_DCI_FORMAT_A2:
10012             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
10013             break;
10014          case TFU_DCI_FORMAT_B1:
10015             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
10016             break;
10017                         case TFU_DCI_FORMAT_B2:
10018             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
10019             break;
10020 #endif
10021          default :
10022             RETVALUE(RFAILED);
10023       }
10024    RETVALUE(ROK);
10025 }
10026 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10027 #ifdef TFU_UPGRADE
10028 /***********************************************************
10029 *
10030 *     Func : cmPkTfuBfVectorInfo
10031 *
10032 *
10033 *     Desc : This structure conveys the BeamForming Vector 
10034 *               Information that hold relevance to Tx Mode 7
10035 *
10036 *
10037 *     Ret  : S16
10038 *
10039 *     Notes:
10040 *
10041 *     File  : 
10042 *
10043 **********************************************************/
10044 #ifdef ANSI
10045 PUBLIC S16 cmPkTfuBfVectorInfo
10046 (
10047 TfuBfVectorInfo *param,
10048 Buffer *mBuf
10049 )
10050 #else
10051 PUBLIC S16 cmPkTfuBfVectorInfo(param, mBuf)
10052 TfuBfVectorInfo *param;
10053 Buffer *mBuf;
10054 #endif
10055 {
10056    S32 idx, idx2;
10057    TRC3(cmPkTfuBfVectorInfo)
10058    for(idx=TFU_MAX_DL_SUBBAND-1;idx>=0; idx--)
10059    {
10060       for (idx2=param->numPhyAnt -1; idx2 >= 0; idx2--) {
10061       CMCHKPK(SPkU16, param->bfValue[idx2], mBuf);}
10062       CMCHKPK(SPkU8, param->numPhyAnt, mBuf);
10063       CMCHKPK(SPkU8, param->sbIndex, mBuf);
10064    }
10065    RETVALUE(ROK);
10066 }
10067
10068 /***********************************************************
10069 *
10070 *     Func : cmUnpkTfuBfVectorInfo
10071 *
10072 *
10073 *     Desc : This structure conveys the BeamForming Vector 
10074 *               Information that hold relevance to Tx Mode 7
10075 *
10076 *
10077 *     Ret  : S16
10078 *
10079 *     Notes:
10080 *
10081 *     File  : 
10082 *
10083 **********************************************************/
10084 #ifdef ANSI
10085 PUBLIC S16 cmUnpkTfuBfVectorInfo
10086 (
10087    TfuBfVectorInfo *param,
10088    Buffer *mBuf
10089 )
10090 #else
10091 PUBLIC S16 cmUnpkTfuBfVectorInfo(param, mBuf)
10092  TfuBfVectorInfo *param;
10093  Buffer *mBuf;
10094 #endif
10095 {
10096    S32 idx, idx2;
10097    TRC3(cmUnpkTfuBfVectorInfo)
10098     for(idx=0;idx<TFU_MAX_DL_SUBBAND; idx++)
10099    {
10100       CMCHKUNPK(SUnpkU8, &param->sbIndex, mBuf);
10101       CMCHKUNPK(SUnpkU8, &param->numPhyAnt, mBuf);
10102       for (idx2=0; idx2 <param->numPhyAnt; idx2++) {
10103       CMCHKUNPK(SUnpkU16, &param->bfValue[idx2], mBuf);}
10104    }
10105   
10106    RETVALUE(ROK);
10107 }
10108 #endif 
10109 \f
10110 /***********************************************************
10111 *
10112 *     Func : cmPkTfuDatReqPduInfo
10113 *
10114 *
10115 *     Desc : Pack Function for Tfu Dat Req PDU.
10116 *
10117 *
10118 *     Ret  : S16
10119 *
10120 *     Notes:
10121 *
10122 *     File  : 
10123 *
10124 **********************************************************/
10125 #ifdef ANSI
10126 PUBLIC S16 cmPkTfuDatReqPduInfo
10127 (
10128 TfuDatReqPduInfo *param,
10129 Buffer *mBuf
10130 )
10131 #else
10132 PUBLIC S16 cmPkTfuDatReqPduInfo(param, mBuf)
10133 TfuDatReqPduInfo *param;
10134 Buffer *mBuf;
10135 #endif
10136 {
10137
10138    S32 i;
10139    U8  tbMask = 0;
10140 #ifdef L2_OPTMZ
10141    U32 lchIdx, pduIdx;
10142 #endif
10143
10144    TRC3(cmPkTfuDatReqPduInfo)
10145
10146    /* LTE_ADV_FLAG_REMOVED_START */
10147    CMCHKPK(SPkU8, param->isEnbSFR, mBuf);
10148    /* LTE_ADV_FLAG_REMOVED_END */
10149
10150    /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10151 #ifdef TFU_UPGRADE 
10152    CMCHKPK(SPkU16, param->txPwrOffset, mBuf);
10153    if(param->transMode == TFU_UE_TM_7)
10154    {
10155       CMCHKPK(cmPkTfuBfVectorInfo, param->bfVector, mBuf);
10156       CMCHKPK(SPkU8, param->numBfVectors, mBuf);
10157       CMCHKPK(SPkU8, param->numBfPrbPerSb, mBuf);
10158    }
10159    CMCHKPK(SPkU8, param->deltaPowOffIdx, mBuf);
10160    /* LTE_ADV_FLAG_REMOVED_START */
10161    CMCHKPK(SPkU8, param->pa, mBuf);
10162    /* LTE_ADV_FLAG_REMOVED_END */
10163    CMCHKPK(SPkU8, param->numLayers, mBuf);
10164 #endif
10165    CMCHKPK(cmPkBool, param->isTApres, mBuf);
10166    CMCHKPK(cmPkTknU32, &param->doa, mBuf);
10167    CMCHKPK(SPkU32, param->transMode, mBuf);
10168    CMCHKPK(cmPkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10169    CMCHKPK(SPkU8, param->puschRptUsd, mBuf);
10170    for (i = 0; i < TFU_MAX_TB; i++)
10171    {
10172 #ifndef L2_OPTMZ
10173      if (param->mBuf[i] != NULLP)
10174      {
10175         tbMask = tbMask | (1 << i);
10176      }
10177 #else /* L2_OPTMZ */
10178      for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10179      {
10180         for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10181               pduIdx++)
10182         {
10183            if (param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] != NULLP)
10184            {
10185               tbMask = tbMask | (1 << i);
10186            }
10187         }
10188      }
10189 #endif /* L2_OPTMZ */
10190    }
10191    /* tfu_c_001.main_2: Packing should consider nmbOfTBs.*/
10192    for (i=TFU_MAX_TB - 1; i >= 0; i--) {
10193 #ifndef L2_OPTMZ
10194       if (param->mBuf[i] != NULLP)
10195       {
10196          CMCHKPK(cmPkBuffer, &param->mBuf[i], mBuf);
10197       }
10198 #else
10199      // CMCHKPK(cmPkBuffer, &param->tbInfo[i].macPad, mBuf);
10200       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10201       {
10202          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10203                pduIdx++)
10204          {
10205             CMCHKPK(cmPkBuffer, &param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx],
10206                   mBuf);
10207
10208          }
10209          CMCHKPK(SPkU32, param->tbInfo[i].lchInfo[lchIdx].numPdu, mBuf);
10210       }
10211       CMCHKPK(SPkU32, param->tbInfo[i].numLch, mBuf);
10212       CMCHKPK(SPkU32, param->tbInfo[i].padSize, mBuf);
10213       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macCes, mBuf);
10214       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macHdr, mBuf);
10215       CMCHKPK(cmPkMsgLen, param->tbInfo[i].tbSize, mBuf);
10216       CMCHKPK(cmPkBool, param->tbInfo[i].tbPres, mBuf);
10217 #endif
10218    }
10219    CMCHKPK(SPkU8, tbMask, mBuf);
10220    CMCHKPK(SPkU8, param->nmbOfTBs, mBuf);
10221    CMCHKPK(cmPkTfuPdschDciInfo, &param->dciInfo, mBuf);
10222    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10223    RETVALUE(ROK);
10224 }
10225
10226
10227 \f
10228 /***********************************************************
10229 *
10230 *     Func : cmUnpkTfuDatReqPduInfo
10231 *
10232 *
10233 *     Desc : UnPack function for Tfu Dat req pdu .
10234 *
10235 *
10236 *     Ret  : S16
10237 *
10238 *     Notes:
10239 *
10240 *     File  : 
10241 *
10242 **********************************************************/
10243 #ifdef ANSI
10244 PUBLIC S16 cmUnpkTfuDatReqPduInfo
10245 (
10246 TfuDatReqPduInfo *param,
10247 Buffer *mBuf
10248 )
10249 #else
10250 PUBLIC S16 cmUnpkTfuDatReqPduInfo(param, mBuf)
10251 TfuDatReqPduInfo *param;
10252 Buffer *mBuf;
10253 #endif
10254 {
10255
10256    U8 i;
10257    U8  tbMask = 0;
10258 #ifdef L2_OPTMZ
10259    U32 lchIdx, pduIdx;
10260 #endif
10261    TRC3(cmUnpkTfuDatReqPduInfo)
10262
10263    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10264    CMCHKUNPK(cmUnpkTfuPdschDciInfo, &param->dciInfo, mBuf);
10265    CMCHKUNPK(SUnpkU8, &param->nmbOfTBs, mBuf);
10266
10267    CMCHKUNPK(SUnpkU8, &tbMask, mBuf);
10268    for (i=0; i<TFU_MAX_TB; i++) {
10269 #ifndef L2_OPTMZ
10270       if (tbMask & (1<<i))
10271       {
10272          CMCHKUNPK(cmUnpkBuffer, &param->mBuf[i], mBuf);
10273       }
10274       else
10275       {
10276          param->mBuf[i] = NULLP;
10277       }
10278 #else /* L2_OPTMZ*/
10279       CMCHKUNPK(cmUnpkBool, &param->tbInfo[i].tbPres, mBuf);
10280       CMCHKUNPK(cmUnpkMsgLen, &param->tbInfo[i].tbSize, mBuf);
10281       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macHdr, mBuf);
10282       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macCes, mBuf);
10283       CMCHKUNPK(SUnpkU32, &param->tbInfo[i].padSize, mBuf);
10284       CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].numLch, mBuf);
10285       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10286       {
10287          CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].lchInfo[lchIdx].numPdu,
10288                mBuf);
10289          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10290                pduIdx++)
10291          {
10292             if (tbMask & (1<<i))
10293             {
10294                CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].lchInfo[lchIdx].\
10295                      mBuf[pduIdx], mBuf);
10296             }
10297             else
10298             {
10299                param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] = NULLP;
10300             }
10301          }
10302       }
10303       //CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macPad, mBuf);
10304 #endif /* L2_OPTMZ*/
10305    }
10306
10307    CMCHKUNPK(SUnpkU8, &param->puschRptUsd, mBuf);
10308    CMCHKUNPK(cmUnpkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10309    CMCHKUNPK(SUnpkU32, (U32 *)&param->transMode, mBuf);
10310    CMCHKUNPK(cmUnpkTknU32, &param->doa, mBuf);
10311    CMCHKUNPK(cmUnpkBool, &param->isTApres, mBuf);
10312 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10313 #ifdef TFU_UPGRADE
10314    CMCHKUNPK(SUnpkU8, &param->numLayers, mBuf);
10315    /* LTE_ADV_FLAG_REMOVED_START */
10316    CMCHKUNPK(SUnpkU8, &param->pa, mBuf);
10317    /* LTE_ADV_FLAG_REMOVED_END */
10318    CMCHKUNPK(SUnpkU8, &param->deltaPowOffIdx, mBuf);
10319    if(param->transMode == TFU_UE_TM_7)
10320    {
10321       CMCHKUNPK(SUnpkU8, &param->numBfPrbPerSb, mBuf);
10322       CMCHKUNPK(SUnpkU8, &param->numBfVectors, mBuf);
10323       CMCHKUNPK(cmUnpkTfuBfVectorInfo, param->bfVector, mBuf);
10324    }
10325    CMCHKUNPK(SUnpkU16, &param->txPwrOffset, mBuf);
10326 #endif
10327
10328    /* LTE_ADV_FLAG_REMOVED_START */
10329    CMCHKUNPK(SUnpkU8, &param->isEnbSFR, mBuf);
10330    /* LTE_ADV_FLAG_REMOVED_END */
10331
10332    RETVALUE(ROK);
10333 }
10334
10335
10336 \f
10337 /***********************************************************
10338 *
10339 *     Func : cmPkTfuDatReqInfo
10340 *
10341 *
10342 *     Desc : This structure contains the Data PDUs 
10343  * @details This structure contains Data meant to be sent on both PBCH and
10344  * PDSCH. Control information necessary for processing of the data is sent along
10345  * with the Data.
10346 *
10347 *
10348 *     Ret  : S16
10349 *
10350 *     Notes:
10351 *
10352 *     File  : 
10353 *
10354 **********************************************************/
10355 #ifdef ANSI
10356 PUBLIC S16 cmPkTfuDatReqInfo
10357 (
10358 TfuDatReqInfo *param,
10359 Buffer *mBuf
10360 )
10361 #else
10362 PUBLIC S16 cmPkTfuDatReqInfo(param, mBuf)
10363 TfuDatReqInfo *param;
10364 Buffer *mBuf;
10365 #endif
10366 {
10367
10368    CmLList *node;
10369    U32 count;
10370    TfuDatReqPduInfo *tfuDatReqPduInfo;
10371
10372    TRC3(cmPkTfuDatReqInfo)
10373
10374    count = param->pdus.count;
10375    node = param->pdus.last;
10376    while (node) {
10377       tfuDatReqPduInfo = (TfuDatReqPduInfo *)node->node;
10378       node=node->prev;
10379       CMCHKPK(cmPkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10380       cmLListDelFrm(&param->pdus, &tfuDatReqPduInfo->lnk);
10381       tfuDatReqPduInfo->lnk.node = (PTR)NULLP;
10382    }
10383    CMCHKPK(SPkU32, count, mBuf);
10384    CMCHKPK(cmPkTknBuf, &param->bchDat, mBuf);
10385    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10386    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10387    RETVALUE(ROK);
10388 }
10389
10390
10391 \f
10392 /***********************************************************
10393 *
10394 *     Func : cmUnpkTfuDatReqInfo
10395 *
10396 *
10397 *     Desc : This structure contains the Data PDUs 
10398  * @details This structure contains Data meant to be sent on both PBCH and
10399  * PDSCH. Control information necessary for processing of the data is sent along
10400  * with the Data.
10401 *
10402 *
10403 *     Ret  : S16
10404 *
10405 *     Notes:
10406 *
10407 *     File  : 
10408 *
10409 **********************************************************/
10410 #ifdef ANSI
10411 PUBLIC S16 cmUnpkTfuDatReqInfo
10412 (
10413 TfuDatReqInfo *param,
10414 Ptr memCp,
10415 Buffer *mBuf
10416 )
10417 #else
10418 PUBLIC S16 cmUnpkTfuDatReqInfo(param, memCp, mBuf)
10419 TfuDatReqInfo *param;
10420 Ptr memCp;
10421 Buffer *mBuf;
10422 #endif
10423 {
10424
10425    U32 count, loopCnt;
10426    TfuDatReqPduInfo *tfuDatReqPduInfo;
10427
10428    TRC3(cmUnpkTfuDatReqInfo)
10429
10430    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10431    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10432    CMCHKUNPK(cmUnpkTknBuf, &param->bchDat, &mBuf);
10433    cmLListInit(&param->pdus);
10434    CMCHKUNPK(SUnpkU32, &count, mBuf);
10435    for (loopCnt=0; loopCnt<count; loopCnt++) {
10436       cmGetMem((Ptr)memCp, sizeof(*tfuDatReqPduInfo), (Ptr *)&tfuDatReqPduInfo);
10437       CMCHKUNPK(cmUnpkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10438       cmLListAdd2Tail(&param->pdus, &tfuDatReqPduInfo->lnk);
10439       tfuDatReqPduInfo->lnk.node = (PTR)tfuDatReqPduInfo;
10440    }
10441    RETVALUE(ROK);
10442 }
10443
10444
10445 \f
10446 /***********************************************************
10447 *
10448 *     Func : cmPkTfuDatInfo
10449 *
10450 *
10451 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10452 *
10453 *
10454 *     Ret  : S16
10455 *
10456 *     Notes:
10457 *
10458 *     File  : 
10459 *
10460 **********************************************************/
10461 #ifdef ANSI
10462 PUBLIC S16 cmPkTfuDatInfo
10463 (
10464 TfuDatInfo *param,
10465 Buffer *mBuf
10466 )
10467 #else
10468 PUBLIC S16 cmPkTfuDatInfo(param, mBuf)
10469 TfuDatInfo *param;
10470 Buffer *mBuf;
10471 #endif
10472 {
10473
10474    TRC3(cmPkTfuDatInfo)
10475
10476    CMCHKPK(cmPkBuffer, &param->mBuf, mBuf);
10477    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10478    RETVALUE(ROK);
10479 }
10480
10481
10482 \f
10483 /***********************************************************
10484 *
10485 *     Func : cmUnpkTfuDatInfo
10486 *
10487 *
10488 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10489 *
10490 *
10491 *     Ret  : S16
10492 *
10493 *     Notes:
10494 *
10495 *     File  : 
10496 *
10497 **********************************************************/
10498 #ifdef ANSI
10499 PUBLIC S16 cmUnpkTfuDatInfo
10500 (
10501 TfuDatInfo *param,
10502 Buffer *mBuf
10503 )
10504 #else
10505 PUBLIC S16 cmUnpkTfuDatInfo(param, mBuf)
10506 TfuDatInfo *param;
10507 Buffer *mBuf;
10508 #endif
10509 {
10510
10511    TRC3(cmUnpkTfuDatInfo)
10512
10513    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10514    CMCHKUNPK(cmUnpkBuffer, &param->mBuf, mBuf);
10515    RETVALUE(ROK);
10516 }
10517
10518
10519 \f
10520 /***********************************************************
10521 *
10522 *     Func : cmPkTfuDatIndInfo
10523 *
10524 *
10525 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10526  * @details All the PDUs received by Physical layer in one subframe are clubbed
10527  * together into a single data structure and sent to MAC for processing.
10528 *
10529 *
10530 *     Ret  : S16
10531 *
10532 *     Notes:
10533 *
10534 *     File  : 
10535 *
10536 **********************************************************/
10537 #ifdef ANSI
10538 PUBLIC S16 cmPkTfuDatIndInfo
10539 (
10540 TfuDatIndInfo *param,
10541 Buffer *mBuf
10542 )
10543 #else
10544 PUBLIC S16 cmPkTfuDatIndInfo(param, mBuf)
10545 TfuDatIndInfo *param;
10546 Buffer *mBuf;
10547 #endif
10548 {
10549
10550    CmLList *node;
10551    U32 count;
10552    TfuDatInfo *tfuDatInfo;
10553
10554    TRC3(cmPkTfuDatIndInfo)
10555
10556 #ifdef TFU_5GTF
10557    CMCHKPK(SPkU8, param->sccIdx, mBuf);
10558    CMCHKPK(SPkU8, param->sectorId, mBuf);
10559 #endif /* TFU_5GTF */
10560    count = param->datIndLst.count;
10561    node = param->datIndLst.last;
10562    while (node) {
10563       tfuDatInfo = (TfuDatInfo *)node->node;
10564       node=node->prev;
10565       CMCHKPK(cmPkTfuDatInfo, tfuDatInfo, mBuf);
10566       cmLListDelFrm(&param->datIndLst, &tfuDatInfo->lnk);
10567       tfuDatInfo->lnk.node = (PTR)NULLP;
10568    }
10569    CMCHKPK(SPkU32, count, mBuf);
10570    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10571    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10572    RETVALUE(ROK);
10573 }
10574
10575
10576 \f
10577 /***********************************************************
10578 *
10579 *     Func : cmUnpkTfuDatIndInfo
10580 *
10581 *
10582 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10583  * @details All the PDUs received by Physical layer in one subframe are clubbed
10584  * together into a single data structure and sent to MAC for processing.
10585 *
10586 *
10587 *     Ret  : S16
10588 *
10589 *     Notes:
10590 *
10591 *     File  : 
10592 *
10593 **********************************************************/
10594 #ifdef ANSI
10595 PUBLIC S16 cmUnpkTfuDatIndInfo
10596 (
10597 TfuDatIndInfo *param,
10598 Ptr memCp,
10599 Buffer *mBuf
10600 )
10601 #else
10602 PUBLIC S16 cmUnpkTfuDatIndInfo(param, memCp, mBuf)
10603 TfuDatIndInfo *param;
10604 Ptr memCp;
10605 Buffer *mBuf;
10606 #endif
10607 {
10608
10609    U32 count, loopCnt;
10610    TfuDatInfo *tfuDatInfo;
10611
10612    TRC3(cmUnpkTfuDatIndInfo)
10613
10614    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10615    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10616    cmLListInit(&param->datIndLst);
10617    CMCHKUNPK(SUnpkU32, &count, mBuf);
10618    for (loopCnt=0; loopCnt<count; loopCnt++) {
10619       cmGetMem((Ptr)memCp, sizeof(*tfuDatInfo), (Ptr *)&tfuDatInfo);
10620       CMCHKUNPK(cmUnpkTfuDatInfo, tfuDatInfo, mBuf);
10621       cmLListAdd2Tail(&param->datIndLst, &tfuDatInfo->lnk);
10622       tfuDatInfo->lnk.node = (PTR)tfuDatInfo;
10623    }
10624 #ifdef TFU_5GTF
10625    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
10626    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
10627 #endif /* TFU_5GTF */
10628    RETVALUE(ROK);
10629 }
10630
10631
10632 \f
10633 /***********************************************************
10634 *
10635 *     Func : cmPkTfuSrInfo
10636 *
10637 *
10638 *     Desc : This structure contains the SR indication for a UE, identified by
10639   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10640   * calculated by the physical layer, and is used by the scheduler for Power
10641   * control of the UE.
10642 *
10643 *
10644 *     Ret  : S16
10645 *
10646 *     Notes:
10647 *
10648 *     File  : 
10649 *
10650 **********************************************************/
10651 #ifdef ANSI
10652 PUBLIC S16 cmPkTfuSrInfo
10653 (
10654 TfuSrInfo *param,
10655 Buffer *mBuf
10656 )
10657 #else
10658 PUBLIC S16 cmPkTfuSrInfo(param, mBuf)
10659 TfuSrInfo *param;
10660 Buffer *mBuf;
10661 #endif
10662 {
10663
10664    TRC3(cmPkTfuSrInfo)
10665
10666    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10667    RETVALUE(ROK);
10668 }
10669
10670
10671 \f
10672 /***********************************************************
10673 *
10674 *     Func : cmUnpkTfuSrInfo
10675 *
10676 *
10677 *     Desc : This structure contains the SR indication for a UE, identified by
10678   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10679   * calculated by the physical layer, and is used by the scheduler for Power
10680   * control of the UE.
10681 *
10682 *
10683 *     Ret  : S16
10684 *
10685 *     Notes:
10686 *
10687 *     File  : 
10688 *
10689 **********************************************************/
10690 #ifdef ANSI
10691 PUBLIC S16 cmUnpkTfuSrInfo
10692 (
10693 TfuSrInfo *param,
10694 Buffer *mBuf
10695 )
10696 #else
10697 PUBLIC S16 cmUnpkTfuSrInfo(param, mBuf)
10698 TfuSrInfo *param;
10699 Buffer *mBuf;
10700 #endif
10701 {
10702
10703    TRC3(cmUnpkTfuSrInfo)
10704
10705    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10706    RETVALUE(ROK);
10707 }
10708
10709
10710 \f
10711 /***********************************************************
10712 *
10713 *     Func : cmPkTfuSrIndInfo
10714 *
10715 *
10716 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10717   * received in a subframe.
10718 *
10719 *
10720 *     Ret  : S16
10721 *
10722 *     Notes:
10723 *
10724 *     File  : 
10725 *
10726 **********************************************************/
10727 #ifdef ANSI
10728 PUBLIC S16 cmPkTfuSrIndInfo
10729 (
10730 TfuSrIndInfo *param,
10731 Buffer *mBuf
10732 )
10733 #else
10734 PUBLIC S16 cmPkTfuSrIndInfo(param, mBuf)
10735 TfuSrIndInfo *param;
10736 Buffer *mBuf;
10737 #endif
10738 {
10739
10740    CmLList *node;
10741    U32 count;
10742    TfuSrInfo *tfuSrInfo;
10743
10744    TRC3(cmPkTfuSrIndInfo)
10745
10746    count = param->srLst.count;
10747    node = param->srLst.last;
10748    while (node) {
10749       tfuSrInfo = (TfuSrInfo *)node->node;
10750       node=node->prev;
10751       CMCHKPK(cmPkTfuSrInfo, tfuSrInfo, mBuf);
10752       cmLListDelFrm(&param->srLst, &tfuSrInfo->lnk);
10753       tfuSrInfo->lnk.node = (PTR)NULLP;
10754    }
10755    CMCHKPK(SPkU32, count, mBuf);
10756    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10757    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10758    RETVALUE(ROK);
10759 }
10760
10761
10762 \f
10763 /***********************************************************
10764 *
10765 *     Func : cmUnpkTfuSrIndInfo
10766 *
10767 *
10768 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10769   * received in a subframe.
10770 *
10771 *
10772 *     Ret  : S16
10773 *
10774 *     Notes:
10775 *
10776 *     File  : 
10777 *
10778 **********************************************************/
10779 #ifdef ANSI
10780 PUBLIC S16 cmUnpkTfuSrIndInfo
10781 (
10782 TfuSrIndInfo *param,
10783 Ptr memCp,
10784 Buffer *mBuf
10785 )
10786 #else
10787 PUBLIC S16 cmUnpkTfuSrIndInfo(param, memCp, mBuf)
10788 TfuSrIndInfo *param;
10789 Ptr memCp;
10790 Buffer *mBuf;
10791 #endif
10792 {
10793
10794    U32 count, loopCnt;
10795    TfuSrInfo *tfuSrInfo;
10796
10797    TRC3(cmUnpkTfuSrIndInfo)
10798
10799    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10800    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10801    cmLListInit(&param->srLst);
10802    CMCHKUNPK(SUnpkU32, &count, mBuf);
10803    for (loopCnt=0; loopCnt<count; loopCnt++) {
10804       cmGetMem((Ptr)memCp, sizeof(*tfuSrInfo), (Ptr *)&tfuSrInfo);
10805       CMCHKUNPK(cmUnpkTfuSrInfo, tfuSrInfo, mBuf);
10806       cmLListAdd2Tail(&param->srLst, &tfuSrInfo->lnk);
10807       tfuSrInfo->lnk.node = (PTR)tfuSrInfo;
10808    }
10809    RETVALUE(ROK);
10810 }
10811
10812 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10813 /***********************************************************
10814 *
10815 *     Func : cmPkTfuHqInfo
10816 *
10817 *
10818 *     Desc : This structure contains the HARQ feedback for a single UE. 
10819   * @details RNTI is present to identify the UE. 
10820   * For FDD a single feedback is present. 
10821   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10822 *
10823 *
10824 *     Ret  : S16
10825 *
10826 *     Notes:
10827 *
10828 *     File  : 
10829 *
10830 **********************************************************/
10831 #ifdef ANSI
10832 PUBLIC S16 cmPkTfuHqInfo
10833 (
10834 TfuHqInfo *param,
10835 Buffer *mBuf
10836 )
10837 #else
10838 PUBLIC S16 cmPkTfuHqInfo(param, mBuf)
10839 TfuHqInfo *param;
10840 Buffer *mBuf;
10841 #endif
10842 {
10843
10844    S32 i;
10845    TRC3(cmPkTfuHqInfo)
10846
10847    CMCHKPK(SPkU8, param->isPusch, mBuf);
10848    for (i=TFU_MAX_HARQ_FDBKS-1; i >= 0; i--) {
10849       CMCHKPK(SPkU32, param->isAck[i], mBuf);
10850    }
10851 #ifdef TFU_TDD        
10852    CMCHKPK(SPkU8, param->M, mBuf);
10853 #endif/*TFU_TDD*/
10854    CMCHKPK(SPkU8, param->noOfTbs, mBuf);
10855 /* ACC-TDD ccpu00130520 */
10856    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
10857    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10858    RETVALUE(ROK);
10859 }
10860
10861 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10862 /***********************************************************
10863 *
10864 *     Func : cmUnpkTfuHqInfo
10865 *
10866 *
10867 *     Desc : This structure contains the HARQ feedback for a single UE. 
10868   * @details RNTI is present to identify the UE. 
10869   * For FDD a single feedback is present. 
10870   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10871 *
10872 *
10873 *     Ret  : S16
10874 *
10875 *     Notes:
10876 *
10877 *     File  : 
10878 *
10879 **********************************************************/
10880 #ifdef ANSI
10881 PUBLIC S16 cmUnpkTfuHqInfo
10882 (
10883 TfuHqInfo *param,
10884 Buffer *mBuf
10885 )
10886 #else
10887 PUBLIC S16 cmUnpkTfuHqInfo(param, mBuf)
10888 TfuHqInfo *param;
10889 Buffer *mBuf;
10890 #endif
10891 {
10892    S32 i;
10893    TRC3(cmUnpkTfuHqInfo)
10894
10895    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10896 /* ACC-TDD ccpu00130520 */
10897    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
10898    CMCHKUNPK(SUnpkU8, &param->noOfTbs, mBuf);
10899 #ifdef TFU_TDD
10900    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
10901 #endif
10902    for (i=0; i<TFU_MAX_HARQ_FDBKS; i++) {
10903       CMCHKUNPK(SUnpkU32, (U32 *)&param->isAck[i], mBuf);
10904    }
10905    CMCHKUNPK(SUnpkU8, &param->isPusch, mBuf);
10906    RETVALUE(ROK);
10907 }
10908
10909
10910
10911
10912 \f
10913 /***********************************************************
10914 *
10915 *     Func : cmPkTfuHqIndInfo
10916 *
10917 *
10918 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10919   * @details All the HARQ feedback received in the subframe are clubbed together
10920   * in this data structure and given to the scheduler for processing.
10921 *
10922 *
10923 *     Ret  : S16
10924 *
10925 *     Notes:
10926 *
10927 *     File  : 
10928 *
10929 **********************************************************/
10930 #ifdef ANSI
10931 PUBLIC S16 cmPkTfuHqIndInfo
10932 (
10933 TfuHqIndInfo *param,
10934 Buffer *mBuf
10935 )
10936 #else
10937 PUBLIC S16 cmPkTfuHqIndInfo(param, mBuf)
10938 TfuHqIndInfo *param;
10939 Buffer *mBuf;
10940 #endif
10941 {
10942
10943    CmLList *node;
10944    U32 count;
10945    TfuHqInfo *tfuHqInfo;
10946
10947    TRC3(cmPkTfuHqIndInfo)
10948
10949    count = param->hqIndLst.count;
10950    node = param->hqIndLst.last;
10951    while (node) {
10952       tfuHqInfo = (TfuHqInfo *)node->node;
10953       node=node->prev;
10954       CMCHKPK(cmPkTfuHqInfo, tfuHqInfo, mBuf);
10955       cmLListDelFrm(&param->hqIndLst, &tfuHqInfo->lnk);
10956       tfuHqInfo->lnk.node = (PTR)NULLP;
10957    }
10958    CMCHKPK(SPkU32, count, mBuf);
10959    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10960    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10961    RETVALUE(ROK);
10962 }
10963
10964
10965 \f
10966 /***********************************************************
10967 *
10968 *     Func : cmUnpkTfuHqIndInfo
10969 *
10970 *
10971 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10972   * @details All the HARQ feedback received in the subframe are clubbed together
10973   * in this data structure and given to the scheduler for processing.
10974 *
10975 *
10976 *     Ret  : S16
10977 *
10978 *     Notes:
10979 *
10980 *     File  : 
10981 *
10982 **********************************************************/
10983 #ifdef ANSI
10984 PUBLIC S16 cmUnpkTfuHqIndInfo
10985 (
10986 TfuHqIndInfo *param,
10987 Ptr memCp,
10988 Buffer *mBuf
10989 )
10990 #else
10991 PUBLIC S16 cmUnpkTfuHqIndInfo(param, memCp, mBuf)
10992 TfuHqIndInfo *param;
10993 Ptr memCp;
10994 Buffer *mBuf;
10995 #endif
10996 {
10997
10998    U32 count, loopCnt;
10999    TfuHqInfo *tfuHqInfo;
11000
11001    TRC3(cmUnpkTfuHqIndInfo)
11002
11003    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11004    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11005    cmLListInit(&param->hqIndLst);
11006    CMCHKUNPK(SUnpkU32, &count, mBuf);
11007    for (loopCnt=0; loopCnt<count; loopCnt++) {
11008       cmGetMem((Ptr)memCp, sizeof(*tfuHqInfo), (Ptr *)&tfuHqInfo);
11009       CMCHKUNPK(cmUnpkTfuHqInfo, tfuHqInfo, mBuf);
11010       cmLListAdd2Tail(&param->hqIndLst, &tfuHqInfo->lnk);
11011       tfuHqInfo->lnk.node = (PTR)tfuHqInfo;
11012    }
11013    RETVALUE(ROK);
11014 }
11015
11016
11017 \f
11018 /***********************************************************
11019 *
11020 *     Func : cmPkTfuUlCqiInfo
11021 *
11022 *
11023 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11024 *
11025 *
11026 *     Ret  : S16
11027 *
11028 *     Notes:
11029 *
11030 *     File  : 
11031 *
11032 **********************************************************/
11033 #ifdef ANSI
11034 PUBLIC S16 cmPkTfuUlCqiInfo
11035 (
11036 TfuUlCqiInfo *param,
11037 Buffer *mBuf
11038 )
11039 #else
11040 PUBLIC S16 cmPkTfuUlCqiInfo(param, mBuf)
11041 TfuUlCqiInfo *param;
11042 Buffer *mBuf;
11043 #endif
11044 {
11045
11046    TRC3(cmPkTfuUlCqiInfo)
11047
11048    CMCHKPK(cmPkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11049    RETVALUE(ROK);
11050 }
11051
11052
11053 \f
11054 /***********************************************************
11055 *
11056 *     Func : cmUnpkTfuUlCqiInfo
11057 *
11058 *
11059 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11060 *
11061 *
11062 *     Ret  : S16
11063 *
11064 *     Notes:
11065 *
11066 *     File  : 
11067 *
11068 **********************************************************/
11069 #ifdef ANSI
11070 PUBLIC S16 cmUnpkTfuUlCqiInfo
11071 (
11072 TfuUlCqiInfo *param,
11073 Buffer *mBuf
11074 )
11075 #else
11076 PUBLIC S16 cmUnpkTfuUlCqiInfo(param, mBuf)
11077 TfuUlCqiInfo *param;
11078 Buffer *mBuf;
11079 #endif
11080 {
11081
11082    TRC3(cmUnpkTfuUlCqiInfo)
11083
11084    CMCHKUNPK(cmUnpkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11085    RETVALUE(ROK);
11086 }
11087
11088
11089 \f
11090 /***********************************************************
11091 *
11092 *     Func : cmPkTfuUlCqiRpt
11093 *
11094 *
11095 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11096   * @details The report could be wideband CQI or subBand CQI or both.
11097 *
11098 *
11099 *     Ret  : S16
11100 *
11101 *     Notes:
11102 *
11103 *     File  : 
11104 *
11105 **********************************************************/
11106 #ifdef ANSI
11107 PUBLIC S16 cmPkTfuUlCqiRpt
11108 (
11109 TfuUlCqiRpt *param,
11110 Buffer *mBuf
11111 )
11112 #else
11113 PUBLIC S16 cmPkTfuUlCqiRpt(param, mBuf)
11114 TfuUlCqiRpt *param;
11115 Buffer *mBuf;
11116 #endif
11117 {
11118
11119    S32 i;
11120    TRC3(cmPkTfuUlCqiRpt)
11121
11122    for (i=TFU_MAX_UL_SUBBAND-1; i >= 0; i--) {
11123       CMCHKPK(cmPkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11124    }
11125    CMCHKPK(SPkU8, param->numSubband, mBuf);
11126    CMCHKPK(SPkU8, param->wideCqi, mBuf);
11127    CMCHKPK(SPkU8, param->isTxPort0, mBuf);
11128    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11129    RETVALUE(ROK);
11130 }
11131
11132
11133 \f
11134 /***********************************************************
11135 *
11136 *     Func : cmUnpkTfuUlCqiRpt
11137 *
11138 *
11139 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11140   * @details The report could be wideband CQI or subBand CQI or both.
11141 *
11142 *
11143 *     Ret  : S16
11144 *
11145 *     Notes:
11146 *
11147 *     File  : 
11148 *
11149 **********************************************************/
11150 #ifdef ANSI
11151 PUBLIC S16 cmUnpkTfuUlCqiRpt
11152 (
11153 TfuUlCqiRpt *param,
11154 Buffer *mBuf
11155 )
11156 #else
11157 PUBLIC S16 cmUnpkTfuUlCqiRpt(param, mBuf)
11158 TfuUlCqiRpt *param;
11159 Buffer *mBuf;
11160 #endif
11161 {
11162
11163    S32 i;
11164    TRC3(cmUnpkTfuUlCqiRpt)
11165
11166    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11167    CMCHKUNPK(SUnpkU8, &param->isTxPort0, mBuf);
11168    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
11169    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
11170    for (i=0; i<TFU_MAX_UL_SUBBAND; i++) {
11171       CMCHKUNPK(cmUnpkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11172    }
11173    RETVALUE(ROK);
11174 }
11175
11176
11177 \f
11178 /***********************************************************
11179 *
11180 *     Func : cmPkTfuUlCqiIndInfo
11181 *
11182 *
11183 *     Desc : This structure conveys the Uplink CQI information.
11184  * @details Uplink CQI is calculated by the physical layer, and is this
11185  * information is provided to the scheduler. 
11186  * This data structure clubs together the UL CQI estimates for all the UEs that
11187  * have been scheduled in the subframe for uplink transmission.
11188 *
11189 *
11190 *     Ret  : S16
11191 *
11192 *     Notes:
11193 *
11194 *     File  : 
11195 *
11196 **********************************************************/
11197 #ifdef ANSI
11198 PUBLIC S16 cmPkTfuUlCqiIndInfo
11199 (
11200 TfuUlCqiIndInfo *param,
11201 Buffer *mBuf
11202 )
11203 #else
11204 PUBLIC S16 cmPkTfuUlCqiIndInfo(param, mBuf)
11205 TfuUlCqiIndInfo *param;
11206 Buffer *mBuf;
11207 #endif
11208 {
11209
11210    CmLList *node;
11211    U32 count;
11212    TfuUlCqiRpt *tfuUlCqiRpt;
11213
11214    TRC3(cmPkTfuUlCqiIndInfo)
11215
11216    count = param->ulCqiRpt.count;
11217    node = param->ulCqiRpt.last;
11218    while (node) {
11219       tfuUlCqiRpt = (TfuUlCqiRpt *)node->node;
11220       node=node->prev;
11221       CMCHKPK(cmPkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11222       cmLListDelFrm(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11223       tfuUlCqiRpt->lnk.node = (PTR)NULLP;
11224    }
11225    CMCHKPK(SPkU32, count, mBuf);
11226    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11227    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11228    RETVALUE(ROK);
11229 }
11230
11231
11232 \f
11233 /***********************************************************
11234 *
11235 *     Func : cmUnpkTfuUlCqiIndInfo
11236 *
11237 *
11238 *     Desc : This structure conveys the Uplink CQI information.
11239  * @details Uplink CQI is calculated by the physical layer, and is this
11240  * information is provided to the scheduler. 
11241  * This data structure clubs together the UL CQI estimates for all the UEs that
11242  * have been scheduled in the subframe for uplink transmission.
11243 *
11244 *
11245 *     Ret  : S16
11246 *
11247 *     Notes:
11248 *
11249 *     File  : 
11250 *
11251 **********************************************************/
11252 #ifdef ANSI
11253 PUBLIC S16 cmUnpkTfuUlCqiIndInfo
11254 (
11255 TfuUlCqiIndInfo *param,
11256 Ptr memCp,
11257 Buffer *mBuf
11258 )
11259 #else
11260 PUBLIC S16 cmUnpkTfuUlCqiIndInfo(param, memCp, mBuf)
11261 TfuUlCqiIndInfo *param;
11262 Ptr memCp;
11263 Buffer *mBuf;
11264 #endif
11265 {
11266
11267    U32 count, loopCnt;
11268    TfuUlCqiRpt *tfuUlCqiRpt;
11269
11270    TRC3(cmUnpkTfuUlCqiIndInfo)
11271
11272    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11273    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11274    cmLListInit(&param->ulCqiRpt);
11275    CMCHKUNPK(SUnpkU32, &count, mBuf);
11276    for (loopCnt=0; loopCnt<count; loopCnt++) {
11277       cmGetMem((Ptr)memCp, sizeof(*tfuUlCqiRpt), (Ptr *)&tfuUlCqiRpt);
11278       CMCHKUNPK(cmUnpkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11279       cmLListAdd2Tail(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11280       tfuUlCqiRpt->lnk.node = (PTR)tfuUlCqiRpt;
11281    }
11282    RETVALUE(ROK);
11283 }
11284
11285
11286
11287 \f
11288 /***********************************************************
11289 *
11290 *     Func : cmPkTfuDlCqiRpt
11291 *
11292 *
11293 *     Desc : This structure contains the DL CQI report for a single UE. 
11294   * @details The report could either be reported on PUCCH or PUSCH, a flag
11295   * conveys this information.
11296 *
11297 *
11298 *     Ret  : S16
11299 *
11300 *     Notes:
11301 *
11302 *     File  : 
11303 *
11304 **********************************************************/
11305 #ifdef ANSI
11306 PUBLIC S16 cmPkTfuDlCqiRpt
11307 (
11308 TfuDlCqiRpt *param,
11309 Buffer *mBuf
11310 )
11311 #else
11312 PUBLIC S16 cmPkTfuDlCqiRpt(param, mBuf)
11313 TfuDlCqiRpt *param;
11314 Buffer *mBuf;
11315 #endif
11316 {
11317
11318    TRC3(cmPkTfuDlCqiRpt)
11319
11320       if (cmPkTfuDlCqiInfo(param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11321          RETVALUE(RFAILED);
11322    CMCHKPK(SPkU8, param->isPucchInfo, mBuf);
11323    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11324    RETVALUE(ROK);
11325 }
11326
11327
11328 \f
11329 /***********************************************************
11330 *
11331 *     Func : cmUnpkTfuDlCqiRpt
11332 *
11333 *
11334 *     Desc : This structure contains the DL CQI report for a single UE. 
11335   * @details The report could either be reported on PUCCH or PUSCH, a flag
11336   * conveys this information.
11337 *
11338 *
11339 *     Ret  : S16
11340 *
11341 *     Notes:
11342 *
11343 *     File  : 
11344 *
11345 **********************************************************/
11346 #ifdef ANSI
11347 PUBLIC S16 cmUnpkTfuDlCqiRpt
11348 (
11349 TfuDlCqiRpt *param,
11350 Buffer *mBuf
11351 )
11352 #else
11353 PUBLIC S16 cmUnpkTfuDlCqiRpt(param, mBuf)
11354 TfuDlCqiRpt *param;
11355 Buffer *mBuf;
11356 #endif
11357 {
11358
11359    TRC3(cmUnpkTfuDlCqiRpt)
11360
11361    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11362    CMCHKUNPK(SUnpkU8, &param->isPucchInfo, mBuf);
11363    if (cmUnpkTfuDlCqiInfo (param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11364       RETVALUE(RFAILED);
11365    RETVALUE(ROK);
11366 }
11367
11368
11369 \f
11370 /***********************************************************
11371 *
11372 *     Func : cmPkTfuDlCqiIndInfo
11373 *
11374 *
11375 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11376  * UEs. 
11377  * @details This structure clubs together DL CQI reports for a number of UEs.
11378 *
11379 *
11380 *     Ret  : S16
11381 *
11382 *     Notes:
11383 *
11384 *     File  : 
11385 *
11386 **********************************************************/
11387 #ifdef ANSI
11388 PUBLIC S16 cmPkTfuDlCqiIndInfo
11389 (
11390 TfuDlCqiIndInfo *param,
11391 Buffer *mBuf
11392 )
11393 #else
11394 PUBLIC S16 cmPkTfuDlCqiIndInfo(param, mBuf)
11395 TfuDlCqiIndInfo *param;
11396 Buffer *mBuf;
11397 #endif
11398 {
11399
11400    CmLList *node;
11401    U32 count;
11402    TfuDlCqiRpt *tfuDlCqiRpt;
11403
11404    TRC3(cmPkTfuDlCqiIndInfo)
11405
11406    count = param->dlCqiRptsLst.count;
11407    node = param->dlCqiRptsLst.last;
11408    while (node) {
11409       tfuDlCqiRpt = (TfuDlCqiRpt *)node->node;
11410       node=node->prev;
11411       CMCHKPK(cmPkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11412       cmLListDelFrm(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11413       tfuDlCqiRpt->lnk.node = (PTR)NULLP;
11414    }
11415    CMCHKPK(SPkU32, count, mBuf);
11416    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11417    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11418    RETVALUE(ROK);
11419 }
11420
11421
11422 \f
11423 /***********************************************************
11424 *
11425 *     Func : cmUnpkTfuDlCqiIndInfo
11426 *
11427 *
11428 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11429  * UEs. 
11430  * @details This structure clubs together DL CQI reports for a number of UEs.
11431 *
11432 *
11433 *     Ret  : S16
11434 *
11435 *     Notes:
11436 *
11437 *     File  : 
11438 *
11439 **********************************************************/
11440 #ifdef ANSI
11441 PUBLIC S16 cmUnpkTfuDlCqiIndInfo
11442 (
11443 TfuDlCqiIndInfo *param,
11444 Ptr memCp,
11445 Buffer *mBuf
11446 )
11447 #else
11448 PUBLIC S16 cmUnpkTfuDlCqiIndInfo(param, memCp, mBuf)
11449 TfuDlCqiIndInfo *param;
11450 Ptr memCp;
11451 Buffer *mBuf;
11452 #endif
11453 {
11454
11455    U32 count, loopCnt;
11456    TfuDlCqiRpt *tfuDlCqiRpt;
11457
11458    TRC3(cmUnpkTfuDlCqiIndInfo)
11459
11460    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11461    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11462    cmLListInit(&param->dlCqiRptsLst);
11463    CMCHKUNPK(SUnpkU32, &count, mBuf);
11464    for (loopCnt=0; loopCnt<count; loopCnt++) {
11465       cmGetMem((Ptr)memCp, sizeof(*tfuDlCqiRpt), (Ptr *)&tfuDlCqiRpt);
11466       CMCHKUNPK(cmUnpkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11467       cmLListAdd2Tail(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11468       tfuDlCqiRpt->lnk.node = (PTR)tfuDlCqiRpt;
11469    }
11470    RETVALUE(ROK);
11471 }
11472
11473
11474 \f
11475 /***********************************************************
11476 *
11477 *     Func : cmPkTfuCrcInfo
11478 *
11479 *
11480 *     Desc : This structure contains the CRC indication for a single
11481   * UE.
11482 *
11483 *
11484 *     Ret  : S16
11485 *
11486 *     Notes:
11487 *
11488 *     File  : 
11489 *
11490 **********************************************************/
11491 #ifdef ANSI
11492 PUBLIC S16 cmPkTfuCrcInfo
11493 (
11494 TfuCrcInfo *param,
11495 Buffer *mBuf
11496 )
11497 #else
11498 PUBLIC S16 cmPkTfuCrcInfo(param, mBuf)
11499 TfuCrcInfo *param;
11500 Buffer *mBuf;
11501 #endif
11502 {
11503
11504    TRC3(cmPkTfuCrcInfo)
11505
11506    CMCHKPK(cmPkTknU8, &param->rv, mBuf);
11507    CMCHKPK(SPkU8, param->isFailure, mBuf);
11508    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11509    RETVALUE(ROK);
11510 }
11511
11512
11513 \f
11514 /***********************************************************
11515 *
11516 *     Func : cmUnpkTfuCrcInfo
11517 *
11518 *
11519 *     Desc : This structure contains the CRC indication for a single
11520   * UE.
11521 *
11522 *
11523 *     Ret  : S16
11524 *
11525 *     Notes:
11526 *
11527 *     File  : 
11528 *
11529 **********************************************************/
11530 #ifdef ANSI
11531 PUBLIC S16 cmUnpkTfuCrcInfo
11532 (
11533 TfuCrcInfo *param,
11534 Buffer *mBuf
11535 )
11536 #else
11537 PUBLIC S16 cmUnpkTfuCrcInfo(param, mBuf)
11538 TfuCrcInfo *param;
11539 Buffer *mBuf;
11540 #endif
11541 {
11542
11543    TRC3(cmUnpkTfuCrcInfo)
11544
11545    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11546    CMCHKUNPK(SUnpkU8, &param->isFailure, mBuf);
11547    CMCHKUNPK(cmUnpkTknU8, &param->rv, mBuf);
11548    RETVALUE(ROK);
11549 }
11550
11551
11552 \f
11553 /***********************************************************
11554 *
11555 *     Func : cmPkTfuCrcIndInfo
11556 *
11557 *
11558 *     Desc : This structure contains information that is passed as a part of the
11559  * CRC Indication from PHY to MAC.
11560  * @details This structure clubs together all the CRC indications for
11561  * a single subframe and conveys this information to the scheduler.
11562 *
11563 *
11564 *     Ret  : S16
11565 *
11566 *     Notes:
11567 *
11568 *     File  : 
11569 *
11570 **********************************************************/
11571 #ifdef ANSI
11572 PUBLIC S16 cmPkTfuCrcIndInfo
11573 (
11574 TfuCrcIndInfo *param,
11575 Buffer *mBuf
11576 )
11577 #else
11578 PUBLIC S16 cmPkTfuCrcIndInfo(param, mBuf)
11579 TfuCrcIndInfo *param;
11580 Buffer *mBuf;
11581 #endif
11582 {
11583
11584    CmLList *node;
11585    U32 count;
11586    TfuCrcInfo *tfuCrcIndInfo;
11587
11588    TRC3(cmPkTfuCrcIndInfo)
11589
11590 #ifdef TFU_5GTF
11591    CMCHKPK(SPkU8, param->sccIdx, mBuf);
11592    CMCHKPK(SPkU8, param->sectorId, mBuf);
11593 #endif /* TFU_5GTF */
11594    count = param->crcLst.count;
11595    node = param->crcLst.last;
11596    while (node) {
11597       tfuCrcIndInfo = (TfuCrcInfo *)node->node;
11598       node=node->prev;
11599       CMCHKPK(cmPkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11600       cmLListDelFrm(&param->crcLst, &tfuCrcIndInfo->lnk);
11601       tfuCrcIndInfo->lnk.node = (PTR)NULLP;
11602    }
11603    CMCHKPK(SPkU32, count, mBuf);
11604    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11605    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11606    RETVALUE(ROK);
11607 }
11608
11609
11610 \f
11611 /***********************************************************
11612 *
11613 *     Func : cmUnpkTfuCrcIndInfo
11614 *
11615 *
11616 *     Desc : This structure contains information that is passed as a part of the
11617  * CRC Indication from PHY to MAC.
11618  * @details This structure clubs together all the CRC indications for
11619  * a single subframe and conveys this information to the scheduler.
11620 *
11621 *
11622 *     Ret  : S16
11623 *
11624 *     Notes:
11625 *
11626 *     File  : 
11627 *
11628 **********************************************************/
11629 #ifdef ANSI
11630 PUBLIC S16 cmUnpkTfuCrcIndInfo
11631 (
11632 TfuCrcIndInfo *param,
11633 Ptr memCp,
11634 Buffer *mBuf
11635 )
11636 #else
11637 PUBLIC S16 cmUnpkTfuCrcIndInfo(param, memCp, mBuf)
11638 TfuCrcIndInfo *param;
11639 Ptr memCp;
11640 Buffer *mBuf;
11641 #endif
11642 {
11643
11644    U32 count, loopCnt;
11645    TfuCrcInfo *tfuCrcIndInfo;
11646
11647    TRC3(cmUnpkTfuCrcIndInfo)
11648
11649    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11650    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11651    cmLListInit(&param->crcLst);
11652    CMCHKUNPK(SUnpkU32, &count, mBuf);
11653    for (loopCnt=0; loopCnt<count; loopCnt++) {
11654       cmGetMem((Ptr)memCp, sizeof(*tfuCrcIndInfo), (Ptr *)&tfuCrcIndInfo);
11655       CMCHKUNPK(cmUnpkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11656       cmLListAdd2Tail(&param->crcLst, &tfuCrcIndInfo->lnk);
11657       tfuCrcIndInfo->lnk.node = (PTR)tfuCrcIndInfo;
11658    }
11659 #ifdef TFU_5GTF
11660    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
11661    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
11662 #endif /* TFU_5GTF */
11663    RETVALUE(ROK);
11664 }
11665
11666
11667 \f
11668 /***********************************************************
11669 *
11670 *     Func : cmPkTfuTimingAdvInfo
11671 *
11672 *
11673 *     Desc : This structure contains the timing advance information for a single
11674   * UE.
11675 *
11676 *
11677 *     Ret  : S16
11678 *
11679 *     Notes:
11680 *
11681 *     File  : 
11682 *
11683 **********************************************************/
11684 #ifdef ANSI
11685 PUBLIC S16 cmPkTfuTimingAdvInfo
11686 (
11687 TfuTimingAdvInfo *param,
11688 Buffer *mBuf
11689 )
11690 #else
11691 PUBLIC S16 cmPkTfuTimingAdvInfo(param, mBuf)
11692 TfuTimingAdvInfo *param;
11693 Buffer *mBuf;
11694 #endif
11695 {
11696
11697    TRC3(cmPkTfuTimingAdvInfo)
11698
11699    CMCHKPK(SPkU8, param->timingAdv, mBuf);
11700    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11701    RETVALUE(ROK);
11702 }
11703
11704
11705 \f
11706 /***********************************************************
11707 *
11708 *     Func : cmUnpkTfuTimingAdvInfo
11709 *
11710 *
11711 *     Desc : This structure contains the timing advance information for a single
11712   * UE.
11713 *
11714 *
11715 *     Ret  : S16
11716 *
11717 *     Notes:
11718 *
11719 *     File  : 
11720 *
11721 **********************************************************/
11722 #ifdef ANSI
11723 PUBLIC S16 cmUnpkTfuTimingAdvInfo
11724 (
11725 TfuTimingAdvInfo *param,
11726 Buffer *mBuf
11727 )
11728 #else
11729 PUBLIC S16 cmUnpkTfuTimingAdvInfo(param, mBuf)
11730 TfuTimingAdvInfo *param;
11731 Buffer *mBuf;
11732 #endif
11733 {
11734
11735    TRC3(cmUnpkTfuTimingAdvInfo)
11736
11737    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11738    CMCHKUNPK(SUnpkU8, &param->timingAdv, mBuf);
11739    RETVALUE(ROK);
11740 }
11741
11742
11743 \f
11744 /***********************************************************
11745 *
11746 *     Func : cmPkTfuTimingAdvIndInfo
11747 *
11748 *
11749 *     Desc : This structure contains information that is passed as part of the Timing
11750  * Advance indication from PHY to MAC.
11751  * @details This structure clubs together timing advances for a number of UEs.
11752 *
11753 *
11754 *     Ret  : S16
11755 *
11756 *     Notes:
11757 *
11758 *     File  : 
11759 *
11760 **********************************************************/
11761 #ifdef ANSI
11762 PUBLIC S16 cmPkTfuTimingAdvIndInfo
11763 (
11764 TfuTimingAdvIndInfo *param,
11765 Buffer *mBuf
11766 )
11767 #else
11768 PUBLIC S16 cmPkTfuTimingAdvIndInfo(param, mBuf)
11769 TfuTimingAdvIndInfo *param;
11770 Buffer *mBuf;
11771 #endif
11772 {
11773
11774    CmLList *node;
11775    U32 count;
11776    TfuTimingAdvInfo *tfuTimingAdvInfo;
11777
11778    TRC3(cmPkTfuTimingAdvIndInfo)
11779
11780    count = param->timingAdvLst.count;
11781    node = param->timingAdvLst.last;
11782    while (node) {
11783       tfuTimingAdvInfo = (TfuTimingAdvInfo *)node->node;
11784       node=node->prev;
11785       CMCHKPK(cmPkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11786       cmLListDelFrm(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11787       tfuTimingAdvInfo->lnk.node = (PTR)NULLP;
11788    }
11789    CMCHKPK(SPkU32, count, mBuf);
11790    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11791    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11792    RETVALUE(ROK);
11793 }
11794
11795
11796 \f
11797 /***********************************************************
11798 *
11799 *     Func : cmUnpkTfuTimingAdvIndInfo
11800 *
11801 *
11802 *     Desc : This structure contains information that is passed as part of the Timing
11803  * Advance indication from PHY to MAC.
11804  * @details This structure clubs together timing advances for a number of UEs.
11805 *
11806 *
11807 *     Ret  : S16
11808 *
11809 *     Notes:
11810 *
11811 *     File  : 
11812 *
11813 **********************************************************/
11814 #ifdef ANSI
11815 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo
11816 (
11817 TfuTimingAdvIndInfo *param,
11818 Ptr memCp,
11819 Buffer *mBuf
11820 )
11821 #else
11822 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo(param, memCp, mBuf)
11823 TfuTimingAdvIndInfo *param;
11824 Ptr memCp;
11825 Buffer *mBuf;
11826 #endif
11827 {
11828
11829    U32 count, loopCnt;
11830    TfuTimingAdvInfo *tfuTimingAdvInfo;
11831
11832    TRC3(cmUnpkTfuTimingAdvIndInfo)
11833
11834    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11835    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11836    cmLListInit(&param->timingAdvLst);
11837    CMCHKUNPK(SUnpkU32, &count, mBuf);
11838    for (loopCnt=0; loopCnt<count; loopCnt++) {
11839       cmGetMem((Ptr)memCp, sizeof(*tfuTimingAdvInfo), (Ptr *)&tfuTimingAdvInfo);
11840       CMCHKUNPK(cmUnpkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11841       cmLListAdd2Tail(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11842       tfuTimingAdvInfo->lnk.node = (PTR)tfuTimingAdvInfo;
11843    }
11844    RETVALUE(ROK);
11845 }
11846
11847 /*CA dev Start*/
11848 /***********************************************************
11849 *
11850 *     Func : cmPkTfuTtiCellInfo
11851 *
11852 *
11853 *     Desc : This structure contains information that is 
11854 *     passed as a part of the TTI indication sent 
11855 *     from CL to MAC and SCH
11856 *
11857 *
11858 *     Ret  : S16
11859 *
11860 *     Notes:
11861 *
11862 *     File  : 
11863 *
11864 **********************************************************/
11865 #ifdef ANSI
11866 PUBLIC S16 cmPkTfuTtiCellInfo
11867 (
11868 TfuTtiCellInfo *param,
11869 Buffer *mBuf
11870 )
11871 #else
11872 PUBLIC S16 cmPkTfuTtiCellInfo(param, mBuf)
11873 TfuTtiCellInfo *param;
11874 Buffer *mBuf;
11875 #endif
11876 {
11877
11878    TRC3(cmPkTfuTtiCellInfo)
11879
11880    CMCHKPK(SPkU8, param->ulBlankSf, mBuf);
11881    CMCHKPK(SPkU8, param->dlBlankSf, mBuf);
11882    CMCHKPK(SPkU8, param->schTickDelta, mBuf);
11883    CMCHKPK(cmPkBool, param->isDummyTti, mBuf);
11884    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11885    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11886    RETVALUE(ROK);
11887 }
11888 /*CA dev End*/
11889 \f
11890 /***********************************************************
11891 *
11892 *     Func : cmPkTfuTtiIndInfo
11893 *
11894 *
11895 *     Desc : This structure contains information that is passed as a part of the TTI
11896  * indication sent from PHY to MAC.
11897 *
11898 *
11899 *     Ret  : S16
11900 *
11901 *     Notes:
11902 *
11903 *     File  : 
11904 *
11905 **********************************************************/
11906 #ifdef ANSI
11907 PUBLIC S16 cmPkTfuTtiIndInfo
11908 (
11909 TfuTtiIndInfo *param,
11910 Buffer *mBuf
11911 )
11912 #else
11913 PUBLIC S16 cmPkTfuTtiIndInfo(param, mBuf)
11914 TfuTtiIndInfo *param;
11915 Buffer *mBuf;
11916 #endif
11917 {
11918
11919    S32 i;
11920    TRC3(cmPkTfuTtiIndInfo)
11921
11922    /*CA dev Start*/
11923    for (i=(param->numCells-1); i >= 0; i--) {
11924          CMCHKPK(cmPkTfuTtiCellInfo, &param->cells[i], mBuf);
11925       }
11926    CMCHKPK(SPkU8, param->numCells, mBuf);
11927    /*CA dev End*/
11928    RETVALUE(ROK);
11929 }
11930
11931 /* CA dev Start */
11932 /***********************************************************
11933 *
11934 *     Func : cmUnpkTfuTtiCellInfo
11935 *
11936 *
11937 *     Desc : This structure contains information that is 
11938 *     passed as a part of the TTI indication sent 
11939 *     from CL to MAC and SCH
11940 *
11941 *
11942 *     Ret  : S16
11943 *
11944 *     Notes:
11945 *
11946 *     File  : 
11947 *
11948 **********************************************************/
11949 #ifdef ANSI
11950 PUBLIC S16 cmUnpkTfuTtiCellInfo
11951 (
11952 TfuTtiCellInfo *param,
11953 Buffer *mBuf
11954 )
11955 #else
11956 PUBLIC S16 cmUnpkTfuTtiCellInfo(param, mBuf)
11957 TfuTtiCellInfo *param;
11958 Buffer *mBuf;
11959 #endif
11960 {
11961
11962    TRC3(cmUnpkTfuTtiCellInfo)
11963
11964    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11965    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11966    CMCHKUNPK(cmUnpkBool, &param->isDummyTti, mBuf);
11967    CMCHKUNPK(SUnpkU8, &param->schTickDelta, mBuf);
11968    CMCHKUNPK(SUnpkU8, &param->dlBlankSf, mBuf);
11969    CMCHKUNPK(SUnpkU8, &param->ulBlankSf, mBuf);
11970    RETVALUE(ROK);
11971 }
11972 /* CA dev End */
11973
11974 \f
11975 /***********************************************************
11976 *
11977 *     Func : cmUnpackSlotIndInfo
11978 *
11979 *
11980 *     Desc : This structure contains information that is passed as a part of the Slot
11981  * indication sent from PHY to MAC.
11982 *
11983 *
11984 *     Ret  : S16
11985 *
11986 *     Notes:
11987 *
11988 *     File  : 
11989 *
11990 **********************************************************/
11991 PUBLIC S16 cmUnpackSlotIndInfo
11992 (
11993 SlotIndInfo *param,
11994 Buffer *mBuf
11995 )
11996 {
11997    CMCHKUNPK(SUnpkU16, &param->sfn, mBuf);
11998    CMCHKUNPK(SUnpkU16, &param->slot, mBuf);
11999
12000    RETVALUE(ROK);
12001 }
12002
12003
12004 \f
12005 /***********************************************************
12006 *
12007 *     Func : cmPkTfuRaReqInfo
12008 *
12009 *
12010 *     Desc : This structure contains the information for a single Random Access Request.
12011  * @details The information present in this structure is for a single preamble.
12012  * Associated with each preamble are fields that the physical layer calculates
12013  * based on the reception of the Random Access Request. These are the following
12014  * -# Timing Advance
12015  * -# TPC
12016  * -# CQI (optional).
12017 *
12018 *
12019 *     Ret  : S16
12020 *
12021 *     Notes:
12022 *
12023 *     File  : 
12024 *
12025 **********************************************************/
12026 #ifdef ANSI
12027 PUBLIC S16 cmPkTfuRaReqInfo
12028 (
12029 TfuRaReqInfo *param,
12030 Buffer *mBuf
12031 )
12032 #else
12033 PUBLIC S16 cmPkTfuRaReqInfo(param, mBuf)
12034 TfuRaReqInfo *param;
12035 Buffer *mBuf;
12036 #endif
12037 {
12038
12039    TRC3(cmPkTfuRaReqInfo)
12040
12041    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
12042    CMCHKPK(SPkU8, param->cqiPres, mBuf);
12043    CMCHKPK(SPkU8, param->tpc, mBuf);
12044    CMCHKPK(SPkU16, param->ta, mBuf);
12045    CMCHKPK(SPkU8, param->rapId, mBuf);
12046    RETVALUE(ROK);
12047 }
12048
12049
12050 \f
12051 /***********************************************************
12052 *
12053 *     Func : cmUnpkTfuRaReqInfo
12054 *
12055 *
12056 *     Desc : This structure contains the information for a single Random Access Request.
12057  * @details The information present in this structure is for a single preamble.
12058  * Associated with each preamble are fields that the physical layer calculates
12059  * based on the reception of the Random Access Request. These are the following
12060  * -# Timing Advance
12061  * -# TPC
12062  * -# CQI (optional).
12063 *
12064 *
12065 *     Ret  : S16
12066 *
12067 *     Notes:
12068 *
12069 *     File  : 
12070 *
12071 **********************************************************/
12072 #ifdef ANSI
12073 PUBLIC S16 cmUnpkTfuRaReqInfo
12074 (
12075 TfuRaReqInfo *param,
12076 Buffer *mBuf
12077 )
12078 #else
12079 PUBLIC S16 cmUnpkTfuRaReqInfo(param, mBuf)
12080 TfuRaReqInfo *param;
12081 Buffer *mBuf;
12082 #endif
12083 {
12084
12085    TRC3(cmUnpkTfuRaReqInfo)
12086
12087    CMCHKUNPK(SUnpkU8, &param->rapId, mBuf);
12088    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
12089    CMCHKUNPK(SUnpkU8, &param->tpc, mBuf);
12090    CMCHKUNPK(SUnpkU8, &param->cqiPres, mBuf);
12091    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
12092    RETVALUE(ROK);
12093 }
12094
12095
12096 \f
12097 /***********************************************************
12098 *
12099 *     Func : cmPkTfuRachInfo
12100 *
12101 *
12102 *     Desc : This structure contains RACH request information for a single
12103   * RA-RNTI.
12104 *
12105 *
12106 *     Ret  : S16
12107 *
12108 *     Notes:
12109 *
12110 *     File  : 
12111 *
12112 **********************************************************/
12113 #ifdef ANSI
12114 PUBLIC S16 cmPkTfuRachInfo
12115 (
12116  CmMemListCp   memCp,
12117 TfuRachInfo *param,
12118 Buffer *mBuf
12119 )
12120 #else
12121 PUBLIC S16 cmPkTfuRachInfo(memCp, param, mBuf)
12122  CmMemListCp   memCp;
12123 TfuRachInfo *param;
12124 Buffer *mBuf;
12125 #endif
12126 {
12127
12128    S32 i;
12129    TRC3(cmPkTfuRachInfo)
12130
12131    for (i= (param->numRaReqInfo - 1); i >= 0; i--) {
12132       CMCHKPK(cmPkTfuRaReqInfo, &(param->raReqInfoArr[i]), mBuf);
12133    }
12134 #ifdef PRACH_5GTF 
12135    CMCHKPK(SPkU16, param->nPwrFactor, mBuf);
12136    CMCHKPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12137    CMCHKPK(SPkU8, param->nf1Value, mBuf);
12138    CMCHKPK(SPkU8, param->nCyclicShift, mBuf);
12139    CMCHKPK(SPkU8, param->nRootSeq, mBuf);
12140    CMCHKPK(SPkU8, param->nPRACHConfiguration, mBuf);
12141    CMCHKPK(SPkU8, param->nPreambleFormat, mBuf);
12142 #endif
12143    CMCHKPK(SPkU8, param->numRaReqInfo, mBuf);
12144    CMCHKPK(cmPkLteRnti, param->raRnti, mBuf);
12145    RETVALUE(ROK);
12146 }
12147
12148
12149 \f
12150 /***********************************************************
12151 *
12152 *     Func : cmUnpkTfuRachInfo
12153 *
12154 *
12155 *     Desc : This structure contains RACH request information for a single
12156   * RA-RNTI.
12157 *
12158 *
12159 *     Ret  : S16
12160 *
12161 *     Notes:
12162 *
12163 *     File  : 
12164 *
12165 **********************************************************/
12166 #ifdef ANSI
12167 PUBLIC S16 cmUnpkTfuRachInfo
12168 (
12169 CmMemListCp   memCp,
12170 TfuRachInfo *param,
12171 Buffer *mBuf
12172 )
12173 #else
12174 PUBLIC S16 cmUnpkTfuRachInfo(memCp, param, mBuf)
12175 CmMemListCp   memCp;
12176 TfuRachInfo *param;
12177 Buffer *mBuf;
12178 #endif
12179 {
12180
12181    S32 i;
12182    TRC3(cmUnpkTfuRachInfo)
12183
12184    CMCHKUNPK(cmUnpkLteRnti, &param->raRnti, mBuf);
12185    CMCHKUNPK(SUnpkU8, &param->numRaReqInfo, mBuf);
12186 #ifdef PRACH_5GTF 
12187    CMCHKUNPK(SPkU8, param->nPreambleFormat, mBuf);
12188    CMCHKUNPK(SPkU8, param->nPRACHConfiguration, mBuf);
12189    CMCHKUNPK(SPkU8, param->nRootSeq, mBuf);
12190    CMCHKUNPK(SPkU8, param->nCyclicShift, mBuf);
12191    CMCHKUNPK(SPkU8, param->nf1Value, mBuf);
12192    CMCHKUNPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12193    CMCHKUNPK(SPkU16, param->nPwrFactor, mBuf);
12194 #endif
12195    if (cmGetMem (&(memCp), (sizeof(TfuRaReqInfo) * param->numRaReqInfo), 
12196             (Ptr *)&param->raReqInfoArr) != ROK)
12197    {
12198       RETVALUE(RFAILED);
12199    }
12200    for (i=0; i<param->numRaReqInfo; i++) {
12201       CMCHKUNPK(cmUnpkTfuRaReqInfo, &param->raReqInfoArr[i], mBuf);
12202    }
12203    RETVALUE(ROK);
12204 }
12205
12206
12207 \f
12208 /***********************************************************
12209 *
12210 *     Func : cmPkTfuRaReqIndInfo
12211 *
12212 *
12213 *     Desc : This structure contains the list of Random Access Requests received in a
12214  * single TTI.
12215  * @details Random Access Request is associated with a RA-RNTI, which remains
12216  * common for all the Random access requests within a subframe. This structure
12217  * thus carries the RA-RNTI and a list of Random Access Request information.
12218  * This information consists of the following 
12219  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12220  * UE.
12221  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12222  * needs to be uplink synchronized. This value is calculated by physical layer. 
12223  * -# tpc - this is the power control command that the physical layer calculates
12224  * from the received RA request. This value is transmitted in the RA Response
12225  * sent out by MAC.
12226  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12227  * physical layer. This aids MAC in the scheduling of this UE.
12228 *
12229 *
12230 *     Ret  : S16
12231 *
12232 *     Notes:
12233 *
12234 *     File  : 
12235 *
12236 **********************************************************/
12237 #ifdef ANSI
12238 PUBLIC S16 cmPkTfuRaReqIndInfo
12239 (
12240 TfuRaReqIndInfo *param,
12241 Buffer *mBuf
12242 )
12243 #else
12244 PUBLIC S16 cmPkTfuRaReqIndInfo(param, mBuf)
12245 TfuRaReqIndInfo *param;
12246 Buffer *mBuf;
12247 #endif
12248 {
12249
12250    S32 i;
12251    TRC3(cmPkTfuRaReqIndInfo)
12252
12253    for (i= (param->nmbOfRaRnti-1); i >= 0; i--) 
12254    {
12255       if (ROK != cmPkTfuRachInfo(param->memCp, 
12256                &(param->rachInfoArr[i]), mBuf))
12257       {
12258          RETVALUE(RFAILED);
12259       }
12260    }
12261    CMCHKPK(SPkU8, param->nmbOfRaRnti, mBuf);
12262    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12263    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12264    RETVALUE(ROK);
12265 }
12266
12267
12268 \f
12269 /***********************************************************
12270 *
12271 *     Func : cmUnpkTfuRaReqIndInfo
12272 *
12273 *
12274 *     Desc : This structure contains the list of Random Access Requests received in a
12275  * single TTI.
12276  * @details Random Access Request is associated with a RA-RNTI, which remains
12277  * common for all the Random access requests within a subframe. This structure
12278  * thus carries the RA-RNTI and a list of Random Access Request information.
12279  * This information consists of the following 
12280  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12281  * UE.
12282  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12283  * needs to be uplink synchronized. This value is calculated by physical layer. 
12284  * -# tpc - this is the power control command that the physical layer calculates
12285  * from the received RA request. This value is transmitted in the RA Response
12286  * sent out by MAC.
12287  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12288  * physical layer. This aids MAC in the scheduling of this UE.
12289 *
12290 *
12291 *     Ret  : S16
12292 *
12293 *     Notes:
12294 *
12295 *     File  : 
12296 *
12297 **********************************************************/
12298 #ifdef ANSI
12299 PUBLIC S16 cmUnpkTfuRaReqIndInfo
12300 (
12301 TfuRaReqIndInfo *param,
12302 Buffer *mBuf
12303 )
12304 #else
12305 PUBLIC S16 cmUnpkTfuRaReqIndInfo(param, mBuf)
12306 TfuRaReqIndInfo *param;
12307 Buffer *mBuf;
12308 #endif
12309 {
12310
12311    S32 i;
12312    TRC3(cmUnpkTfuRaReqIndInfo)
12313
12314    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12315    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12316    CMCHKUNPK(SUnpkU8, &param->nmbOfRaRnti, mBuf);
12317    if (cmGetMem (&(param->memCp), (sizeof(TfuRachInfo) * param->nmbOfRaRnti), 
12318             (Ptr *)&param->rachInfoArr) != ROK)
12319    {
12320       RETVALUE(RFAILED);
12321    }
12322    for (i=0; i<param->nmbOfRaRnti; i++) 
12323    {
12324       if (ROK != cmUnpkTfuRachInfo(param->memCp, &param->rachInfoArr[i], mBuf))
12325       {
12326          RETVALUE(RFAILED);
12327       }
12328    }
12329    RETVALUE(ROK);
12330 }
12331
12332
12333 \f
12334 /***********************************************************
12335 *
12336 *     Func : cmPkTfuPucchDeltaPwr
12337 *
12338 *
12339 *     Desc : This structure contains PUCCH Delta power for a single UE.
12340 *
12341 *
12342 *     Ret  : S16
12343 *
12344 *     Notes:
12345 *
12346 *     File  : 
12347 *
12348 **********************************************************/
12349 #ifdef ANSI
12350 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo
12351 (
12352 TfuPucchDeltaPwr *param,
12353 Buffer *mBuf
12354 )
12355 #else
12356 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo(param, mBuf)
12357 TfuPucchDeltaPwr *param;
12358 Buffer *mBuf;
12359 #endif
12360 {
12361
12362    TRC3(cmPkTfuPucchDeltaPwrInfo)
12363
12364    CMCHKPK(SPkS8, param->pucchDeltaPwr, mBuf);
12365    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12366    RETVALUE(ROK);
12367 }
12368
12369
12370 \f
12371 /***********************************************************
12372 *
12373 *     Func : cmUnpkTfuPucchDeltaPwr
12374 *
12375 *
12376 *     Desc : This structure contains PUCCH Delta power for a single UE.
12377 *
12378 *
12379 *     Ret  : S16
12380 *
12381 *     Notes:
12382 *
12383 *     File  : 
12384 *
12385 **********************************************************/
12386 #ifdef ANSI
12387 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo
12388 (
12389 TfuPucchDeltaPwr *param,
12390 Buffer *mBuf
12391 )
12392 #else
12393 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo(param, mBuf)
12394 TfuPucchDeltaPwr *param;
12395 Buffer *mBuf;
12396 #endif
12397 {
12398
12399    TRC3(cmUnpkTfuPucchDeltaPwrInfo)
12400
12401    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12402    CMCHKUNPK(SUnpkS8, &param->pucchDeltaPwr, mBuf);
12403    RETVALUE(ROK);
12404 }
12405
12406
12407 \f
12408 /***********************************************************
12409 *
12410 *     Func : cmPkTfuPucchDeltaPwrIndInfo
12411 *
12412 *
12413 *     Desc : This structure contains information that is passed as a part of the
12414  * PUCCH Delta power indication from PHY to SCH.
12415  * @details This structure clubs together PUCCH Delta power values for a number
12416  * of UEs.
12417 *
12418 *
12419 *     Ret  : S16
12420 *
12421 *     Notes:
12422 *
12423 *     File  : 
12424 *
12425 **********************************************************/
12426 #ifdef ANSI
12427 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo
12428 (
12429 TfuPucchDeltaPwrIndInfo *param,
12430 Buffer *mBuf
12431 )
12432 #else
12433 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo(param, mBuf)
12434 TfuPucchDeltaPwrIndInfo *param;
12435 Buffer *mBuf;
12436 #endif
12437 {
12438
12439    CmLList *node;
12440    U32 count;
12441    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12442
12443    TRC3(cmPkTfuPucchDeltaPwrIndInfo)
12444
12445    count = param->pucchDeltaPwrLst.count;
12446    node = param->pucchDeltaPwrLst.last;
12447    while (node) {
12448       tfuPucchDeltaPwr = (TfuPucchDeltaPwr *)node->node;
12449       node=node->prev;
12450       CMCHKPK(cmPkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12451       cmLListDelFrm(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12452       tfuPucchDeltaPwr->lnk.node = (PTR)NULLP;
12453    }
12454    CMCHKPK(SPkU32, count, mBuf);
12455    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12456    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12457    RETVALUE(ROK);
12458 }
12459
12460
12461 \f
12462 /***********************************************************
12463 *
12464 *     Func : cmUnpkTfuPucchDeltaPwrIndInfo
12465 *
12466 *
12467 *     Desc : This structure contains information that is passed as a part of the
12468  * PUCCH Delta power indication from PHY to SCH.
12469  * @details This structure clubs together PUCCH Delta power values for a number
12470  * of UEs.
12471 *
12472 *
12473 *     Ret  : S16
12474 *
12475 *     Notes:
12476 *
12477 *     File  : 
12478 *
12479 **********************************************************/
12480 #ifdef ANSI
12481 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo
12482 (
12483 TfuPucchDeltaPwrIndInfo *param,
12484 Ptr memCp,
12485 Buffer *mBuf
12486 )
12487 #else
12488 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo(param, memCp, mBuf)
12489 TfuPucchDeltaPwrIndInfo *param;
12490 Ptr memCp;
12491 Buffer *mBuf;
12492 #endif
12493 {
12494
12495    U32 count, loopCnt;
12496    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12497
12498    TRC3(cmUnpkTfuPucchDeltaPwrIndInfo)
12499
12500    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12501    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12502    cmLListInit(&param->pucchDeltaPwrLst);
12503    CMCHKUNPK(SUnpkU32, &count, mBuf);
12504    for (loopCnt=0; loopCnt<count; loopCnt++) {
12505       cmGetMem((Ptr)memCp, sizeof(*tfuPucchDeltaPwr), (Ptr *)&tfuPucchDeltaPwr);
12506       CMCHKUNPK(cmUnpkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12507       cmLListAdd2Tail(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12508       tfuPucchDeltaPwr->lnk.node = (PTR)tfuPucchDeltaPwr;
12509    }
12510    RETVALUE(ROK);
12511 }
12512
12513 #ifdef ANSI
12514 PUBLIC S16 cmPkBuffer
12515 (
12516 Buffer **param,
12517 Buffer *mBuf
12518 )
12519 #else
12520 PUBLIC S16 cmPkBuffer(param, mBuf)
12521 Buffer **param;
12522 Buffer *mBuf;
12523 #endif
12524 {
12525    MsgLen msgLen=0;
12526    TRC3(cmPkBuffer)
12527    if (SFndLenMsg(*param, &msgLen) != ROK)
12528       RETVALUE(RFAILED);
12529    if (SCatMsg(mBuf, *param, M1M2) != ROK)
12530       RETVALUE(RFAILED);
12531    TFU_FREE_MSG(*param);
12532    *param = NULLP;
12533    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
12534    RETVALUE(ROK);
12535 }
12536 #ifdef ANSI
12537 PUBLIC S16 cmUnpkBuffer
12538 (
12539 Buffer **param,
12540 Buffer *mBuf
12541 )
12542 #else
12543 PUBLIC S16 cmUnpkBuffer(param, mBuf)
12544 Buffer **param;
12545 Buffer *mBuf;
12546 #endif
12547 {
12548    MsgLen msgLen=0, totalMsgLen=0;
12549    TRC3(cmUnpkBuffer)
12550    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
12551    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
12552       RETVALUE(RFAILED);
12553    if (SSegMsg(mBuf, totalMsgLen-msgLen, param) != ROK)
12554       RETVALUE(RFAILED);
12555    RETVALUE(ROK);
12556 }
12557
12558
12559 /***********************************************************
12560 *
12561 *     Func : cmPkTfuDoaInd
12562 *
12563 *
12564 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12565  * identifier for one or more UEs.
12566  * It carries a DOA for each UE. 
12567  * @param pst Pointer to the post structure.
12568  * @param suId SAP ID of the service user.
12569  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12570  * @return ROK/RFAILED
12571 *
12572 *
12573 *     Ret  : S16
12574 *
12575 *     Notes:
12576 *
12577 *     File  : 
12578 *
12579 **********************************************************/
12580 #ifdef ANSI
12581 PUBLIC S16 cmPkTfuDoaInd
12582 (
12583 Pst * pst,
12584 SuId suId,
12585 TfuDoaIndInfo * doaInd
12586 )
12587 #else
12588 PUBLIC S16 cmPkTfuDoaInd(pst, suId, doaInd)
12589 Pst * pst;
12590 SuId suId;
12591 TfuDoaIndInfo * doaInd;
12592 #endif
12593 {
12594    Buffer *mBuf = NULLP;
12595    TRC3(cmPkTfuDoaInd)
12596
12597    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
12598 #if (ERRCLASS & ERRCLS_ADD_RES)
12599       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12600          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12601          (ErrVal)ETFU125, (ErrVal)0, "Packing failed");
12602 #endif
12603       SPutSBuf(pst->region, pst->pool, (Data *)doaInd, sizeof(TfuDoaIndInfo));
12604       RETVALUE(RFAILED);
12605    }
12606       cmPkTfuDoaIndInfo(doaInd, mBuf);
12607    if (SPkS16(suId, mBuf) != ROK) {
12608 #if (ERRCLASS & ERRCLS_ADD_RES)
12609       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12610          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12611          (ErrVal)ETFU126, (ErrVal)0, "Packing failed");
12612 #endif
12613       TFU_FREE_MEM(doaInd);
12614       TFU_FREE_MSG(mBuf);
12615       RETVALUE(RFAILED);
12616    }
12617    TFU_FREE_MEM(doaInd);
12618    pst->event = (Event) EVTTFUDOAIND;
12619    RETVALUE(SPstTsk(pst,mBuf));
12620 }
12621
12622 \f
12623 /***********************************************************
12624 *
12625 *     Func : cmUnpkTfuDoaInd
12626 *
12627 *
12628 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12629  * identifier for one or more UEs.
12630  * It carries a DOA for each UE. 
12631  * @param pst Pointer to the post structure.
12632  * @param suId SAP ID of the service user.
12633  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12634  * @return ROK/RFAILED
12635 *
12636 *
12637 *     Ret  : S16
12638 *
12639 *     Notes:
12640 *
12641 *     File  : 
12642 *
12643 **********************************************************/
12644 #ifdef ANSI
12645 PUBLIC S16 cmUnpkTfuDoaInd
12646 (
12647 TfuDoaInd func,
12648 Pst *pst,
12649 Buffer *mBuf
12650 )
12651 #else
12652 PUBLIC S16 cmUnpkTfuDoaInd(func, pst, mBuf)
12653 TfuDoaInd func;
12654 Pst *pst;
12655 Buffer *mBuf;
12656 #endif
12657 {
12658    SuId suId;
12659    TfuDoaIndInfo *doaInd;
12660    
12661    TRC3(cmUnpkTfuDoaInd)
12662
12663    if (SUnpkS16(&suId, mBuf) != ROK) {
12664       TFU_FREE_MSG(mBuf);
12665 #if (ERRCLASS & ERRCLS_ADD_RES)
12666       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12667          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12668          (ErrVal)ETFU127, (ErrVal)0, "Packing failed");
12669 #endif
12670       RETVALUE(RFAILED);
12671    }
12672    {
12673       Mem   sMem;
12674       sMem.region = pst->region;
12675       sMem.pool = pst->pool;
12676       if ((cmAllocEvnt(sizeof(TfuDoaIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&doaInd)) != ROK)            {
12677 #if (ERRCLASS & ERRCLS_ADD_RES)
12678          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12679             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12680             (ErrVal)ETFU128, (ErrVal)0, "Packing failed");
12681 #endif
12682          TFU_FREE_MSG(mBuf);
12683          RETVALUE(RFAILED);
12684       }
12685    }
12686    
12687       cmUnpkTfuDoaIndInfo(doaInd, (Ptr)&doaInd->memCp, mBuf);
12688    TFU_FREE_MSG(mBuf);
12689    RETVALUE((*func)(pst, suId, doaInd));
12690 }
12691
12692
12693 \f
12694 /***********************************************************
12695 *
12696 *     Func : cmPkTfuDciFormatTbInfo
12697 *
12698 *
12699 *     Desc : This structure contains the TB level DCI signalling
12700   * parameters in case of DCI formats 2 and 2A
12701 *
12702 *
12703 *     Ret  : S16
12704 *
12705 *     Notes:
12706 *
12707 *     File  : 
12708 *
12709 **********************************************************/
12710 #ifdef ANSI
12711 PUBLIC S16 cmPkTfuDciFormatTbInfo
12712 (
12713 TfuDciFormatTbInfo *param,
12714 Buffer *mBuf
12715 )
12716 #else
12717 PUBLIC S16 cmPkTfuDciFormatTbInfo(param, mBuf)
12718 TfuDciFormatTbInfo *param;
12719 Buffer *mBuf;
12720 #endif
12721 {
12722
12723    TRC3(cmPkTfuDciFormatTbInfo)
12724
12725    CMCHKPK(SPkU8, param->mcs, mBuf);
12726    CMCHKPK(SPkU8, param->rv, mBuf);
12727    CMCHKPK(SPkU8, param->ndi, mBuf);
12728    RETVALUE(ROK);
12729 }
12730
12731
12732 \f
12733 /***********************************************************
12734 *
12735 *     Func : cmUnpkTfuDciFormatTbInfo
12736 *
12737 *
12738 *     Desc : This structure contains the TB level DCI signalling
12739   * parameters in case of DCI formats 2 and 2A
12740 *
12741 *
12742 *     Ret  : S16
12743 *
12744 *     Notes:
12745 *
12746 *     File  : 
12747 *
12748 **********************************************************/
12749 #ifdef ANSI
12750 PUBLIC S16 cmUnpkTfuDciFormatTbInfo
12751 (
12752 TfuDciFormatTbInfo *param,
12753 Buffer *mBuf
12754 )
12755 #else
12756 PUBLIC S16 cmUnpkTfuDciFormatTbInfo(param, mBuf)
12757 TfuDciFormatTbInfo *param;
12758 Buffer *mBuf;
12759 #endif
12760 {
12761
12762    TRC3(cmUnpkTfuDciFormatTbInfo)
12763
12764    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
12765    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
12766    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
12767    RETVALUE(ROK);
12768 }
12769
12770
12771 \f
12772 /***********************************************************
12773 *
12774 *     Func : cmPkTfuSubbandDlCqiInfo
12775 *
12776 *
12777 *     Desc : This structure is used to convey the subbannd CQI reported.
12778 *
12779 *
12780 *     Ret  : S16
12781 *
12782 *     Notes:
12783 *
12784 *     File  : 
12785 *
12786 **********************************************************/
12787 #ifdef ANSI
12788 PUBLIC S16 cmPkTfuSubbandDlCqiInfo
12789 (
12790 TfuSubbandDlCqiInfo *param,
12791 Buffer *mBuf
12792 )
12793 #else
12794 PUBLIC S16 cmPkTfuSubbandDlCqiInfo(param, mBuf)
12795 TfuSubbandDlCqiInfo *param;
12796 Buffer *mBuf;
12797 #endif
12798 {
12799
12800    S32 i;
12801    TRC3(cmPkTfuSubbandDlCqiInfo)
12802
12803    for (i=TFU_MAX_TB-1; i >= 0; i--) {
12804       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
12805    }
12806    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
12807    RETVALUE(ROK);
12808 }
12809
12810
12811 \f
12812 /***********************************************************
12813 *
12814 *     Func : cmUnpkTfuSubbandDlCqiInfo
12815 *
12816 *
12817 *     Desc : This structure is used to convey the subbannd CQI reported.
12818 *
12819 *
12820 *     Ret  : S16
12821 *
12822 *     Notes:
12823 *
12824 *     File  : 
12825 *
12826 **********************************************************/
12827 #ifdef ANSI
12828 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo
12829 (
12830 TfuSubbandDlCqiInfo *param,
12831 Buffer *mBuf
12832 )
12833 #else
12834 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo(param, mBuf)
12835 TfuSubbandDlCqiInfo *param;
12836 Buffer *mBuf;
12837 #endif
12838 {
12839
12840    S32 i;
12841    TRC3(cmUnpkTfuSubbandDlCqiInfo)
12842
12843    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
12844    for (i=0; i<TFU_MAX_TB; i++) {
12845       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
12846    }
12847    RETVALUE(ROK);
12848 }
12849
12850 /***********************************************************
12851 *
12852 *     Func : cmPkTfuDlCqiPuschInfo
12853 *
12854 *
12855 *     Desc : This structure conveys explicitly the PMI information in case
12856  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12857 *
12858 *
12859 *     Ret  : S16
12860 *
12861 *     Notes:
12862 *
12863 *     File  : 
12864 *
12865 **********************************************************/
12866 #ifdef ANSI
12867 PUBLIC S16 cmPkTfuDlCqiPuschInfo
12868 (
12869 TfuDlCqiPuschInfo *param,
12870 Buffer *mBuf
12871 )
12872 #else
12873 PUBLIC S16 cmPkTfuDlCqiPuschInfo(param, mBuf)
12874 TfuDlCqiPuschInfo *param;
12875 Buffer *mBuf;
12876 #endif
12877 {
12878
12879    TRC3(cmPkTfuDlCqiPuschInfo)
12880
12881       switch(param->mode) {
12882          case TFU_PUSCH_CQI_MODE_31:
12883             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12884             break;
12885          case TFU_PUSCH_CQI_MODE_22:
12886             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12887             break;
12888          case TFU_PUSCH_CQI_MODE_12:
12889             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12890             break;
12891          default :
12892             RETVALUE(RFAILED);
12893       }
12894    CMCHKPK(SPkU32, param->mode, mBuf);
12895    RETVALUE(ROK);
12896 }
12897
12898
12899 \f
12900 /***********************************************************
12901 *
12902 *     Func : cmUnpkTfuDlCqiPuschInfo
12903 *
12904 *
12905 *     Desc : This structure conveys explicitly the PMI information in case
12906  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12907 *
12908 *
12909 *     Ret  : S16
12910 *
12911 *     Notes:
12912 *
12913 *     File  : 
12914 *
12915 **********************************************************/
12916 #ifdef ANSI
12917 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo
12918 (
12919 TfuDlCqiPuschInfo *param,
12920 Buffer *mBuf
12921 )
12922 #else
12923 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo(param, mBuf)
12924 TfuDlCqiPuschInfo *param;
12925 Buffer *mBuf;
12926 #endif
12927 {
12928
12929    TRC3(cmUnpkTfuDlCqiPuschInfo)
12930
12931    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
12932       switch(param->mode) {
12933          case TFU_PUSCH_CQI_MODE_12:
12934             CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12935             break;
12936          case TFU_PUSCH_CQI_MODE_22:
12937             CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12938             break;
12939          case TFU_PUSCH_CQI_MODE_31:
12940             CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12941             break;
12942          default :
12943             RETVALUE(RFAILED);
12944       }
12945    RETVALUE(ROK);
12946 }
12947 \f
12948 /***********************************************************
12949 *
12950 *     Func : cmPkTfuDoaRpt
12951 *
12952 *
12953 *     Desc : This structure contains the DOA estimated by the physical layer. 
12954   * @details DOA for a given UE.
12955 *
12956 *
12957 *     Ret  : S16
12958 *
12959 *     Notes:
12960 *
12961 *     File  : 
12962 *
12963 **********************************************************/
12964 #ifdef ANSI
12965 PUBLIC S16 cmPkTfuDoaRpt
12966 (
12967 TfuDoaRpt *param,
12968 Buffer *mBuf
12969 )
12970 #else
12971 PUBLIC S16 cmPkTfuDoaRpt(param, mBuf)
12972 TfuDoaRpt *param;
12973 Buffer *mBuf;
12974 #endif
12975 {
12976
12977    TRC3(cmPkTfuDoaRpt)
12978
12979    CMCHKPK(SPkU32, param->doa, mBuf);
12980    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12981    RETVALUE(ROK);
12982 }
12983
12984
12985 \f
12986 /***********************************************************
12987 *
12988 *     Func : cmUnpkTfuDoaRpt
12989 *
12990 *
12991 *     Desc : This structure contains the DOA estimated by the physical layer. 
12992   * @details DOA for a given UE.
12993 *
12994 *
12995 *     Ret  : S16
12996 *
12997 *     Notes:
12998 *
12999 *     File  : 
13000 *
13001 **********************************************************/
13002 #ifdef ANSI
13003 PUBLIC S16 cmUnpkTfuDoaRpt
13004 (
13005 TfuDoaRpt *param,
13006 Buffer *mBuf
13007 )
13008 #else
13009 PUBLIC S16 cmUnpkTfuDoaRpt(param, mBuf)
13010 TfuDoaRpt *param;
13011 Buffer *mBuf;
13012 #endif
13013 {
13014
13015    TRC3(cmUnpkTfuDoaRpt)
13016
13017    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
13018    CMCHKUNPK(SUnpkU32, &param->doa, mBuf);
13019    RETVALUE(ROK);
13020 }
13021
13022
13023 \f
13024 /***********************************************************
13025 *
13026 *     Func : cmPkTfuDoaIndInfo
13027 *
13028 *
13029 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13030  * @details DOA is calculated by the physical layer, and this
13031  * information is provided to the scheduler. 
13032  * This data structure clubs together the DOAs for all the UEs
13033  * calculated by PHY in this subframe.
13034 *
13035 *
13036 *     Ret  : S16
13037 *
13038 *     Notes:
13039 *
13040 *     File  : 
13041 *
13042 **********************************************************/
13043 #ifdef ANSI
13044 PUBLIC S16 cmPkTfuDoaIndInfo
13045 (
13046 TfuDoaIndInfo *param,
13047 Buffer *mBuf
13048 )
13049 #else
13050 PUBLIC S16 cmPkTfuDoaIndInfo(param, mBuf)
13051 TfuDoaIndInfo *param;
13052 Buffer *mBuf;
13053 #endif
13054 {
13055
13056    CmLList *node;
13057    U32 count;
13058    TfuDoaRpt *tfuDoaRpt;
13059    TRC3(cmPkTfuDoaIndInfo)
13060
13061    count = param->doaRpt.count;
13062    node = param->doaRpt.last;
13063    while (node) {
13064       tfuDoaRpt = (TfuDoaRpt *)node->node;
13065       node=node->prev;
13066       CMCHKPK(cmPkTfuDoaRpt, tfuDoaRpt, mBuf);
13067       cmLListDelFrm(&param->doaRpt, &tfuDoaRpt->lnk);
13068       tfuDoaRpt->lnk.node = (PTR)NULLP;
13069    }
13070    CMCHKPK(SPkU32, count, mBuf);
13071    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13072    RETVALUE(ROK);
13073 }
13074
13075
13076 \f
13077 /***********************************************************
13078 *
13079 *     Func : cmUnpkTfuDoaIndInfo
13080 *
13081 *
13082 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13083  * @details DOA is calculated by the physical layer, and this
13084  * information is provided to the scheduler. 
13085  * This data structure clubs together the DOAs for all the UEs
13086  * calculated by PHY in this subframe.
13087 *
13088 *
13089 *     Ret  : S16
13090 *
13091 *     Notes:
13092 *
13093 *     File  : 
13094 *
13095 **********************************************************/
13096 #ifdef ANSI
13097 PUBLIC S16 cmUnpkTfuDoaIndInfo
13098 (
13099 TfuDoaIndInfo *param,
13100 Ptr memCp,
13101 Buffer *mBuf
13102 )
13103 #else
13104 PUBLIC S16 cmUnpkTfuDoaIndInfo(param, memCp, mBuf)
13105 TfuDoaIndInfo *param;
13106 Ptr memCp;
13107 Buffer *mBuf;
13108 #endif
13109 {
13110
13111    U32 count, loopCnt;
13112    TfuDoaRpt *tfuDoaRpt;
13113    TRC3(cmUnpkTfuDoaIndInfo)
13114
13115    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13116    cmLListInit(&param->doaRpt);
13117    CMCHKUNPK(SUnpkU32, &count, mBuf);
13118    for (loopCnt=0; loopCnt<count; loopCnt++) {
13119       cmGetMem((Ptr)memCp, sizeof(*tfuDoaRpt), (Ptr *)&tfuDoaRpt);
13120       CMCHKUNPK(cmUnpkTfuDoaRpt, tfuDoaRpt, mBuf);
13121       cmLListAdd2Tail(&param->doaRpt, &tfuDoaRpt->lnk);
13122       tfuDoaRpt->lnk.node = (PTR)tfuDoaRpt;
13123    }
13124    RETVALUE(ROK);
13125 }
13126
13127
13128 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
13129 #ifdef TFU_UPGRADE
13130
13131 \f
13132 /***********************************************************
13133 *
13134 *     Func : cmPkTfuSrsRpt
13135 *
13136 *
13137 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13138  * @details Uplink SRS from each UE is received by the physical layer, and this
13139  * information is provided to the scheduler.
13140 *
13141 *
13142 *     Ret  : S16
13143 *
13144 *     Notes:
13145 *
13146 *     File  : 
13147 *
13148 **********************************************************/
13149 #ifdef ANSI
13150 PUBLIC S16 cmPkTfuSrsRpt
13151 (
13152 TfuSrsRpt *param,
13153 Buffer *mBuf
13154 )
13155 #else
13156 PUBLIC S16 cmPkTfuSrsRpt(param, mBuf)
13157 TfuSrsRpt *param;
13158 Buffer *mBuf;
13159 #endif
13160 {
13161
13162    S32 i;
13163    TRC3(cmPkTfuSrsRpt)
13164
13165    CMCHKPK(SPkU8, param->wideCqi, mBuf);
13166    CMCHKPK(SPkU8, param->wideCqiPres, mBuf);
13167    for (i=TFU_MAX_UL_RB-1; i >= 0; i--) {
13168       CMCHKPK(SPkU8, param->snr[i], mBuf);
13169    }
13170    CMCHKPK(SPkU8, param->rbStart, mBuf);
13171    CMCHKPK(SPkU8, param->numRbs, mBuf);
13172    CMCHKPK(SPkU16, param->ta, mBuf);
13173    CMCHKPK(SPkU16, param->dopEst, mBuf);
13174    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
13175    RETVALUE(ROK);
13176 }
13177
13178
13179 \f
13180 /***********************************************************
13181 *
13182 *     Func : cmUnpkTfuSrsRpt
13183 *
13184 *
13185 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13186  * @details Uplink SRS from each UE is received by the physical layer, and this
13187  * information is provided to the scheduler.
13188 *
13189 *
13190 *     Ret  : S16
13191 *
13192 *     Notes:
13193 *
13194 *     File  : 
13195 *
13196 **********************************************************/
13197 #ifdef ANSI
13198 PUBLIC S16 cmUnpkTfuSrsRpt
13199 (
13200 TfuSrsRpt *param,
13201 Buffer *mBuf
13202 )
13203 #else
13204 PUBLIC S16 cmUnpkTfuSrsRpt(param, mBuf)
13205 TfuSrsRpt *param;
13206 Buffer *mBuf;
13207 #endif
13208 {
13209
13210    S32 i;
13211    TRC3(cmUnpkTfuSrsRpt)
13212
13213    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
13214    CMCHKUNPK(SUnpkU16, &param->dopEst, mBuf);
13215    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
13216    CMCHKUNPK(SUnpkU8, &param->numRbs, mBuf);
13217    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
13218    for (i=0; i<TFU_MAX_UL_RB; i++) {
13219       CMCHKUNPK(SUnpkU8, &param->snr[i], mBuf);
13220    }
13221    CMCHKUNPK(SUnpkU8, &param->wideCqiPres, mBuf);
13222    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
13223    RETVALUE(ROK);
13224 }
13225
13226
13227 \f
13228 /***********************************************************
13229 *
13230 *     Func : cmPkTfuSrsIndInfo
13231 *
13232 *
13233 *     Desc : This structure conveys the Uplink SRS indication.
13234  * @details Uplink SRS is received by the physical layer, and this
13235  * information is provided to the scheduler. 
13236  * This data structure clubs together the UL SRS indications of all the UEs 
13237  * in the subframe.
13238 *
13239 *
13240 *     Ret  : S16
13241 *
13242 *     Notes:
13243 *
13244 *     File  : 
13245 *
13246 **********************************************************/
13247 #ifdef ANSI
13248 PUBLIC S16 cmPkTfuSrsIndInfo
13249 (
13250 TfuSrsIndInfo *param,
13251 Buffer *mBuf
13252 )
13253 #else
13254 PUBLIC S16 cmPkTfuSrsIndInfo(param, mBuf)
13255 TfuSrsIndInfo *param;
13256 Buffer *mBuf;
13257 #endif
13258 {
13259
13260    CmLList *node;
13261    U32 count;
13262    TfuSrsRpt *tfuSrsRpt;
13263
13264    TRC3(cmPkTfuSrsIndInfo)
13265
13266    count = param->srsRpt.count;
13267    node = param->srsRpt.last;
13268    while (node) {
13269       tfuSrsRpt = (TfuSrsRpt *)node->node;
13270       node=node->prev;
13271       CMCHKPK(cmPkTfuSrsRpt, tfuSrsRpt, mBuf);
13272       cmLListDelFrm(&param->srsRpt, &tfuSrsRpt->lnk);
13273       tfuSrsRpt->lnk.node = (PTR)NULLP;
13274    }
13275    CMCHKPK(SPkU32, count, mBuf);
13276    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13277    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13278    RETVALUE(ROK);
13279 }
13280
13281
13282 \f
13283 /***********************************************************
13284 *
13285 *     Func : cmUnpkTfuSrsIndInfo
13286 *
13287 *
13288 *     Desc : This structure conveys the Uplink SRS indication.
13289  * @details Uplink SRS is received by the physical layer, and this
13290  * information is provided to the scheduler. 
13291  * This data structure clubs together the UL SRS indications of all the UEs 
13292  * in the subframe.
13293 *
13294 *
13295 *     Ret  : S16
13296 *
13297 *     Notes:
13298 *
13299 *     File  : 
13300 *
13301 **********************************************************/
13302 #ifdef ANSI
13303 PUBLIC S16 cmUnpkTfuSrsIndInfo
13304 (
13305 TfuSrsIndInfo *param,
13306 Ptr memCp,
13307 Buffer *mBuf
13308 )
13309 #else
13310 PUBLIC S16 cmUnpkTfuSrsIndInfo(param, memCp, mBuf)
13311 TfuSrsIndInfo *param;
13312 Ptr memCp;
13313 Buffer *mBuf;
13314 #endif
13315 {
13316
13317    U32 count, loopCnt;
13318    TfuSrsRpt *tfuSrsRpt;
13319
13320    TRC3(cmUnpkTfuSrsIndInfo)
13321
13322    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13323    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13324    cmLListInit(&param->srsRpt);
13325    CMCHKUNPK(SUnpkU32, &count, mBuf);
13326    for (loopCnt=0; loopCnt<count; loopCnt++) {
13327       cmGetMem((Ptr)memCp, sizeof(*tfuSrsRpt), (Ptr *)&tfuSrsRpt);
13328       CMCHKUNPK(cmUnpkTfuSrsRpt, tfuSrsRpt, mBuf);
13329       cmLListAdd2Tail(&param->srsRpt, &tfuSrsRpt->lnk);
13330       tfuSrsRpt->lnk.node = (PTR)tfuSrsRpt;
13331    }
13332    RETVALUE(ROK);
13333 }
13334
13335
13336 \f
13337 /***********************************************************
13338 *
13339 *     Func : cmPkTfuRawCqiRpt
13340 *
13341 *
13342 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13343  * as transmitted by the UE. 
13344  * @details These bits shall be interpretted by MAC to derive the following 
13345  * -# Wideband CQI
13346  * -# Subband CQI
13347  * -# PMI
13348  * -# RI
13349 *
13350 *
13351 *     Ret  : S16
13352 *
13353 *     Notes:
13354 *
13355 *     File  : 
13356 *
13357 **********************************************************/
13358 #ifdef ANSI
13359 PUBLIC S16 cmPkTfuRawCqiRpt
13360 (
13361 TfuRawCqiRpt *param,
13362 Buffer *mBuf
13363 )
13364 #else
13365 PUBLIC S16 cmPkTfuRawCqiRpt(param, mBuf)
13366 TfuRawCqiRpt *param;
13367 Buffer *mBuf;
13368 #endif
13369 {
13370
13371    TRC3(cmPkTfuRawCqiRpt)
13372 #ifdef TFU_5GTF
13373    CMCHKPK(SPkU32, param->uciPayload, mBuf);
13374 #else
13375    S32 i;
13376    for (i=CM_LTE_MAX_CELLS-1; i >= 0; i--) {
13377       CMCHKPK(SPkU8, param->ri[i], mBuf);
13378    }
13379    for (i=TFU_MAX_CQI_BYTES-1; i >= 0; i--) {
13380       CMCHKPK(SPkU8, param->cqiBits[i], mBuf);
13381    }
13382 #endif
13383    CMCHKPK(SPkU8, param->numBits, mBuf);
13384    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
13385    RETVALUE(ROK);
13386 }
13387
13388
13389 \f
13390 /***********************************************************
13391 *
13392 *     Func : cmUnpkTfuRawCqiRpt
13393 *
13394 *
13395 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13396  * as transmitted by the UE. 
13397  * @details These bits shall be interpretted by MAC to derive the following 
13398  * -# Wideband CQI
13399  * -# Subband CQI
13400  * -# PMI
13401  * -# RI
13402 *
13403 *
13404 *     Ret  : S16
13405 *
13406 *     Notes:
13407 *
13408 *     File  : 
13409 *
13410 **********************************************************/
13411 #ifdef ANSI
13412 PUBLIC S16 cmUnpkTfuRawCqiRpt
13413 (
13414 TfuRawCqiRpt *param,
13415 Buffer *mBuf
13416 )
13417 #else
13418 PUBLIC S16 cmUnpkTfuRawCqiRpt(param, mBuf)
13419 TfuRawCqiRpt *param;
13420 Buffer *mBuf;
13421 #endif
13422 {
13423
13424    TRC3(cmUnpkTfuRawCqiRpt)
13425
13426    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
13427    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
13428 #ifndef TFU_5GTF
13429    S32 i;
13430    for (i=0; i<TFU_MAX_CQI_BYTES; i++) {
13431       CMCHKUNPK(SUnpkU8, &param->cqiBits[i], mBuf);
13432    }
13433    for (i=0; i<CM_LTE_MAX_CELLS; i++) {
13434       CMCHKUNPK(SUnpkU8, &param->ri[i], mBuf);
13435    }
13436 #else
13437       CMCHKUNPK(SUnpkU32, &param->uciPayload, mBuf);
13438 #endif
13439    RETVALUE(ROK);
13440 }
13441
13442
13443 \f
13444 /***********************************************************
13445 *
13446 *     Func : cmPkTfuRawCqiIndInfo
13447 *
13448 *
13449 *     Desc : This structure contains the Raw CQI reports received for the
13450  * transmitting UEs in a single subframe. 
13451  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13452  * interpretation is upto the MAC layer.
13453 *
13454 *
13455 *     Ret  : S16
13456 *
13457 *     Notes:
13458 *
13459 *     File  : 
13460 *
13461 **********************************************************/
13462 #ifdef ANSI
13463 PUBLIC S16 cmPkTfuRawCqiIndInfo
13464 (
13465 TfuRawCqiIndInfo *param,
13466 Buffer *mBuf
13467 )
13468 #else
13469 PUBLIC S16 cmPkTfuRawCqiIndInfo(param, mBuf)
13470 TfuRawCqiIndInfo *param;
13471 Buffer *mBuf;
13472 #endif
13473 {
13474
13475    U32 count;
13476    TfuRawCqiRpt *tfuRawCqiRpt;
13477    CmLList *node;
13478
13479    TRC3(cmPkTfuRawCqiIndInfo)
13480
13481    count = param->rawCqiRpt.count;
13482    node = param->rawCqiRpt.last;
13483    while (node) {
13484       tfuRawCqiRpt = (TfuRawCqiRpt *)node->node;
13485       node=node->prev;
13486       CMCHKPK(cmPkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13487       cmLListDelFrm(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13488       tfuRawCqiRpt->lnk.node = (PTR)NULLP;
13489    }
13490    CMCHKPK(SPkU32, count, mBuf);
13491    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13492    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13493    RETVALUE(ROK);
13494 }
13495
13496
13497 \f
13498 /***********************************************************
13499 *
13500 *     Func : cmUnpkTfuRawCqiIndInfo
13501 *
13502 *
13503 *     Desc : This structure contains the Raw CQI reports received for the
13504  * transmitting UEs in a single subframe. 
13505  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13506  * interpretation is upto the MAC layer.
13507 *
13508 *
13509 *     Ret  : S16
13510 *
13511 *     Notes:
13512 *
13513 *     File  : 
13514 *
13515 **********************************************************/
13516 #ifdef ANSI
13517 PUBLIC S16 cmUnpkTfuRawCqiIndInfo
13518 (
13519 TfuRawCqiIndInfo *param,
13520 Ptr memCp,
13521 Buffer *mBuf
13522 )
13523 #else
13524 PUBLIC S16 cmUnpkTfuRawCqiIndInfo(param, memCp, mBuf)
13525 TfuRawCqiIndInfo *param;
13526 Ptr memCp;
13527 Buffer *mBuf;
13528 #endif
13529 {
13530
13531    U32 count, loopCnt;
13532    TfuRawCqiRpt *tfuRawCqiRpt;
13533
13534    TRC3(cmUnpkTfuRawCqiIndInfo)
13535
13536    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13537    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13538    cmLListInit(&param->rawCqiRpt);
13539    CMCHKUNPK(SUnpkU32, &count, mBuf);
13540    for (loopCnt=0; loopCnt<count; loopCnt++) {
13541       cmGetMem((Ptr)memCp, sizeof(*tfuRawCqiRpt), (Ptr *)&tfuRawCqiRpt);
13542       CMCHKUNPK(cmUnpkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13543       cmLListAdd2Tail(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13544       tfuRawCqiRpt->lnk.node = (PTR)tfuRawCqiRpt;
13545    }
13546    RETVALUE(ROK);
13547 }
13548
13549
13550 #ifdef TFU_TDD
13551
13552 #ifdef TFU_TDD
13553
13554 \f
13555 /***********************************************************
13556 *
13557 *     Func : cmPkTfuUePucchHqRecpInfo
13558 *
13559 *
13560 *     Desc : This structure is sent from scheduler to PHY in order to request the
13561  * reception of harq information on PUCCH.
13562 *
13563 *
13564 *     Ret  : S16
13565 *
13566 *     Notes:
13567 *
13568 *     File  : 
13569 *
13570 **********************************************************/
13571 #ifdef ANSI
13572 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13573 (
13574 TfuUePucchHqRecpInfo *param,
13575 Buffer *mBuf
13576 )
13577 #else
13578 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13579 TfuUePucchHqRecpInfo *param;
13580 Buffer *mBuf;
13581 #endif
13582 {
13583
13584    S32 i;
13585    TRC3(cmPkTfuUePucchHqRecpInfo)
13586
13587    CMCHKPK(SPkU8, param->a, mBuf);
13588    for (i=TFU_MAX_HQ_RES-1; i >= 0; i--) {
13589       CMCHKPK(SPkU16, param->hqRes[i], mBuf);
13590    }
13591    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13592    CMCHKPK(SPkU8, param->hqSz, mBuf);
13593    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13594    RETVALUE(ROK);
13595 }
13596
13597
13598 \f
13599 /***********************************************************
13600 *
13601 *     Func : cmUnpkTfuUePucchHqRecpInfo
13602 *
13603 *
13604 *     Desc : This structure is sent from scheduler to PHY in order to request the
13605  * reception of harq information on PUCCH.
13606 *
13607 *
13608 *     Ret  : S16
13609 *
13610 *     Notes:
13611 *
13612 *     File  : 
13613 *
13614 **********************************************************/
13615 #ifdef ANSI
13616 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13617 (
13618 TfuUePucchHqRecpInfo *param,
13619 Buffer *mBuf
13620 )
13621 #else
13622 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13623 TfuUePucchHqRecpInfo *param;
13624 Buffer *mBuf;
13625 #endif
13626 {
13627
13628    S32 i;
13629    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13630
13631    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13632    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13633    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13634    for (i=0; i<TFU_MAX_HQ_RES; i++) {
13635       CMCHKUNPK(SUnpkU16, &param->hqRes[i], mBuf);
13636    }
13637    CMCHKUNPK(SUnpkU8, &param->a, mBuf);
13638    RETVALUE(ROK);
13639 }
13640
13641
13642 #endif
13643
13644 #endif
13645
13646 #ifndef TFU_TDD  /* else of TFU_TDD */
13647
13648 #ifndef TFU_TDD  /* else of TFU_TDD */
13649
13650 \f
13651 /***********************************************************
13652 *
13653 *     Func : cmPkTfuUePucchHqRecpInfo
13654 *
13655 *
13656 *     Desc : This structure is sent from scheduler to PHY in order to request the
13657  * reception of harq information on PUCCH.
13658 *
13659 *
13660 *     Ret  : S16
13661 *
13662 *     Notes:
13663 *
13664 *     File  : 
13665 *
13666 **********************************************************/
13667 #ifdef ANSI
13668 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13669 (
13670 TfuUePucchHqRecpInfo *param,
13671 Buffer *mBuf
13672 )
13673 #else
13674 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13675 TfuUePucchHqRecpInfo *param;
13676 Buffer *mBuf;
13677 #endif
13678 {
13679
13680    TRC3(cmPkTfuUePucchHqRecpInfo)
13681 #ifdef LTE_ADV
13682    S32 idx;
13683    for (idx=(TFU_MAX_HQ_RES-1); idx >= 0; idx--) {
13684       CMCHKPK(SPkU16, param->hqRes[idx], mBuf);
13685    }
13686 #else
13687    CMCHKPK(SPkU16, param->hqRes[0], mBuf);
13688 #endif
13689    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13690    CMCHKPK(SPkU8, param->hqSz, mBuf);
13691    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13692
13693    RETVALUE(ROK);
13694 }
13695
13696
13697 \f
13698 /***********************************************************
13699 *
13700 *     Func : cmUnpkTfuUePucchHqRecpInfo
13701 *
13702 *
13703 *     Desc : This structure is sent from scheduler to PHY in order to request the
13704  * reception of harq information on PUCCH.
13705 *
13706 *
13707 *     Ret  : S16
13708 *
13709 *     Notes:
13710 *
13711 *     File  : 
13712 *
13713 **********************************************************/
13714 #ifdef ANSI
13715 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13716 (
13717 TfuUePucchHqRecpInfo *param,
13718 Buffer *mBuf
13719 )
13720 #else
13721 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13722 TfuUePucchHqRecpInfo *param;
13723 Buffer *mBuf;
13724 #endif
13725 {
13726    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13727
13728    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13729    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13730    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13731 #ifdef LTE_ADV
13732    S32 idx;
13733    for (idx=0; idx<TFU_MAX_HQ_RES; idx++) {
13734       CMCHKUNPK(SUnpkU16, &param->hqRes[idx], mBuf);
13735    }
13736 #else
13737    CMCHKUNPK(SUnpkU16, &param->hqRes[0], mBuf);
13738 #endif
13739
13740    RETVALUE(ROK);
13741 }
13742
13743
13744 #endif
13745
13746 #endif
13747
13748 \f
13749 /***********************************************************
13750 *
13751 *     Func : cmPkTfuUePucchSrRecpInfo
13752 *
13753 *
13754 *     Desc : This structure is sent from scheduler to PHY in order to request the
13755  * reception of SR information on PUCCH.
13756 *
13757 *
13758 *     Ret  : S16
13759 *
13760 *     Notes:
13761 *
13762 *     File  : 
13763 *
13764 **********************************************************/
13765 #ifdef ANSI
13766 PUBLIC S16 cmPkTfuUePucchSrRecpInfo
13767 (
13768 TfuUePucchSrRecpInfo *param,
13769 Buffer *mBuf
13770 )
13771 #else
13772 PUBLIC S16 cmPkTfuUePucchSrRecpInfo(param, mBuf)
13773 TfuUePucchSrRecpInfo *param;
13774 Buffer *mBuf;
13775 #endif
13776 {
13777
13778    TRC3(cmPkTfuUePucchSrRecpInfo)
13779
13780    CMCHKPK(SPkU16, param->n1PucchIdx, mBuf);
13781    RETVALUE(ROK);
13782 }
13783
13784
13785 \f
13786 /***********************************************************
13787 *
13788 *     Func : cmUnpkTfuUePucchSrRecpInfo
13789 *
13790 *
13791 *     Desc : This structure is sent from scheduler to PHY in order to request the
13792  * reception of SR information on PUCCH.
13793 *
13794 *
13795 *     Ret  : S16
13796 *
13797 *     Notes:
13798 *
13799 *     File  : 
13800 *
13801 **********************************************************/
13802 #ifdef ANSI
13803 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo
13804 (
13805 TfuUePucchSrRecpInfo *param,
13806 Buffer *mBuf
13807 )
13808 #else
13809 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo(param, mBuf)
13810 TfuUePucchSrRecpInfo *param;
13811 Buffer *mBuf;
13812 #endif
13813 {
13814
13815    TRC3(cmUnpkTfuUePucchSrRecpInfo)
13816
13817    CMCHKUNPK(SUnpkU16, &param->n1PucchIdx, mBuf);
13818    RETVALUE(ROK);
13819 }
13820
13821
13822 \f
13823 /***********************************************************
13824 *
13825 *     Func : cmPkTfuUePucchCqiRecpInfo
13826 *
13827 *
13828 *     Desc : This structure is sent from scheduler to PHY in order to request the
13829  * reception of CQI information on PUCCH.
13830 *
13831 *
13832 *     Ret  : S16
13833 *
13834 *     Notes:
13835 *
13836 *     File  : 
13837 *
13838 **********************************************************/
13839 #ifdef ANSI
13840 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo
13841 (
13842 TfuUePucchCqiRecpInfo *param,
13843 Buffer *mBuf
13844 )
13845 #else
13846 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo(param, mBuf)
13847 TfuUePucchCqiRecpInfo *param;
13848 Buffer *mBuf;
13849 #endif
13850 {
13851
13852    TRC3(cmPkTfuUePucchCqiRecpInfo)
13853
13854    CMCHKPK(SPkU8, param->cqiPmiSz, mBuf);
13855    CMCHKPK(SPkU16, param->n2PucchIdx, mBuf);
13856    RETVALUE(ROK);
13857 }
13858
13859
13860 \f
13861 /***********************************************************
13862 *
13863 *     Func : cmUnpkTfuUePucchCqiRecpInfo
13864 *
13865 *
13866 *     Desc : This structure is sent from scheduler to PHY in order to request the
13867  * reception of CQI information on PUCCH.
13868 *
13869 *
13870 *     Ret  : S16
13871 *
13872 *     Notes:
13873 *
13874 *     File  : 
13875 *
13876 **********************************************************/
13877 #ifdef ANSI
13878 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo
13879 (
13880 TfuUePucchCqiRecpInfo *param,
13881 Buffer *mBuf
13882 )
13883 #else
13884 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo(param, mBuf)
13885 TfuUePucchCqiRecpInfo *param;
13886 Buffer *mBuf;
13887 #endif
13888 {
13889
13890    TRC3(cmUnpkTfuUePucchCqiRecpInfo)
13891
13892    CMCHKUNPK(SUnpkU16, &param->n2PucchIdx, mBuf);
13893    CMCHKUNPK(SUnpkU8, &param->cqiPmiSz, mBuf);
13894    RETVALUE(ROK);
13895 }
13896
13897
13898 \f
13899 /***********************************************************
13900 *
13901 *     Func : cmPkTfuUePucchSrsRecpInfo
13902 *
13903 *
13904 *     Desc : This structure is sent from scheduler to PHY in order to request the
13905  * reception of SRS information on PUCCH.
13906 *
13907 *
13908 *     Ret  : S16
13909 *
13910 *     Notes:
13911 *
13912 *     File  : 
13913 *
13914 **********************************************************/
13915 #ifdef ANSI
13916 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo
13917 (
13918 TfuUePucchSrsRecpInfo *param,
13919 Buffer *mBuf
13920 )
13921 #else
13922 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo(param, mBuf)
13923 TfuUePucchSrsRecpInfo *param;
13924 Buffer *mBuf;
13925 #endif
13926 {
13927
13928    TRC3(cmPkTfuUePucchSrsRecpInfo)
13929
13930    CMCHKPK(SPkU32, param->srsCyclicShft, mBuf);
13931    CMCHKPK(SPkU16, param->srsCfgIdx, mBuf);
13932    CMCHKPK(SPkU8, param->transComb, mBuf);
13933    CMCHKPK(SPkU32, param->srsHopBw, mBuf);
13934    CMCHKPK(SPkU8, param->nRrc, mBuf);
13935    CMCHKPK(SPkU32, param->srsBw, mBuf);
13936    RETVALUE(ROK);
13937 }
13938
13939 #ifdef TFU_5GTF
13940 #ifdef ANSI
13941 PUBLIC S16 cmPkTfuUePucchUciRecpInfo
13942 (
13943 TfuUePucchUciRecpInfo *param,
13944 Buffer *mBuf
13945 )
13946 #else
13947 PUBLIC S16 cmPkTfuUePucchUciRecpInfo(param, mBuf)
13948 TfuUePucchUciRecpInfo *param;
13949 Buffer *mBuf;
13950 #endif
13951 {
13952
13953    TRC3(cmPkTfuUePucchUciRecpInfo)
13954
13955    CMCHKPK(SPkU8, param->SCID, mBuf);
13956    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
13957    CMCHKPK(SPkU8, param->numBits, mBuf);
13958    RETVALUE(ROK);
13959 }
13960 #endif
13961
13962 \f
13963 /***********************************************************
13964 *
13965 *     Func : cmUnpkTfuUePucchSrsRecpInfo
13966 *
13967 *
13968 *     Desc : This structure is sent from scheduler to PHY in order to request the
13969  * reception of SRS information on PUCCH.
13970 *
13971 *
13972 *     Ret  : S16
13973 *
13974 *     Notes:
13975 *
13976 *     File  : 
13977 *
13978 **********************************************************/
13979 #ifdef ANSI
13980 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo
13981 (
13982 TfuUePucchSrsRecpInfo *param,
13983 Buffer *mBuf
13984 )
13985 #else
13986 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo(param, mBuf)
13987 TfuUePucchSrsRecpInfo *param;
13988 Buffer *mBuf;
13989 #endif
13990 {
13991
13992    TRC3(cmUnpkTfuUePucchSrsRecpInfo)
13993
13994    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsBw, mBuf);
13995    CMCHKUNPK(SUnpkU8, &param->nRrc, mBuf);
13996    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsHopBw, mBuf);
13997    CMCHKUNPK(SUnpkU8, &param->transComb, mBuf);
13998    CMCHKUNPK(SUnpkU16, &param->srsCfgIdx, mBuf);
13999    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsCyclicShft, mBuf);
14000    RETVALUE(ROK);
14001 }
14002
14003 #ifdef TFU_5GTF 
14004 /***********************************************************
14005 *
14006 *     Func : cmPkTfuUePucchBsiBriRecpInfo
14007 *
14008 *
14009 *     Desc : This structure is sent from scheduler to PHY in order to request the
14010  * reception of BSI_BRI information on PUCCH.
14011 *
14012 *
14013 *     Ret  : S16
14014 *
14015 *     Notes:
14016 *
14017 *     File  : 
14018 *
14019 **********************************************************/
14020 #ifdef ANSI
14021 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo
14022 (
14023 TfuUePucchBsiBriRecpInfo *param,
14024 Buffer *mBuf
14025 )
14026 #else
14027 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo(param, mBuf)
14028 TfuUePucchBsiBriRecpInfo *param;
14029 Buffer *mBuf;
14030 #endif
14031 {
14032
14033    TRC3(cmPkTfuUePucchBsiBriRecpInfo)
14034
14035    CMCHKPK(SPkU8, param->briRpt, mBuf);
14036    CMCHKPK(SPkU8, param->bsiRpt, mBuf);
14037    CMCHKPK(SPkU8, param->SCID, mBuf);
14038    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
14039    CMCHKPK(SPkU8, param->puschFlag, mBuf);
14040    RETVALUE(ROK);
14041 }
14042
14043 /***********************************************************
14044 *
14045 *     Func : cmUnpkTfuUePucchBsiBriRecpInfo
14046 *
14047 *
14048 *     Desc : This structure is sent from scheduler to PHY in order to request the
14049  * reception of BSI_BRI information on PUCCH.
14050 *
14051 *
14052 *     Ret  : S16
14053 *
14054 *     Notes:
14055 *
14056 *     File  : 
14057 *
14058 **********************************************************/
14059 #ifdef ANSI
14060 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo
14061 (
14062 TfuUePucchBsiBriRecpInfo *param,
14063 Buffer *mBuf
14064 )
14065 #else
14066 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo(param, mBuf)
14067 TfuUePucchBsiBriRecpInfo *param;
14068 Buffer *mBuf;
14069 #endif
14070 {
14071
14072    TRC3(cmUnpkTfuUePucchBsiBriRecpInfo)
14073
14074    CMCHKUNPK(SUnpkU8, &param->puschFlag, mBuf);
14075    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14076    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14077    CMCHKUNPK(SUnpkU8, &param->bsiRpt, mBuf);
14078    CMCHKUNPK(SUnpkU8, &param->briRpt, mBuf);
14079    RETVALUE(ROK);
14080 }
14081 #endif
14082
14083 #ifdef TFU_5GTF
14084 #ifdef ANSI
14085 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo
14086 (
14087 TfuUePucchUciRecpInfo *param,
14088 Buffer *mBuf
14089 )
14090 #else
14091 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo(param, mBuf)
14092 TfuUePucchUciRecpInfo *param;
14093 Buffer *mBuf;
14094 #endif
14095 {
14096
14097    TRC3(cmUnpkTfuUePucchUciRecpInfo)
14098
14099    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
14100    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14101    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14102
14103    RETVALUE(ROK);
14104 }
14105 #endif
14106
14107 \f
14108 /***********************************************************
14109 *
14110 *     Func : cmPkTfuUePucchRecpReq
14111 *
14112 *
14113 *     Desc : This structure is sent from scheduler to PHY in order to request the
14114   * reception of UCI on PUCCH. This may contain the following:
14115   * -# HARQ
14116   * -# SR
14117   * -# SRS
14118   * -# CQI
14119   * -# HARQ+SR
14120   * -# HARQ+SRS
14121   * -# HARQ+CQI
14122   * -# HARQ+SR+SRS
14123   * -# HARQ+SR+CQI
14124   * -# SR+SRS
14125   * -# SR+CQI
14126 *
14127 *
14128 *     Ret  : S16
14129 *
14130 *     Notes:
14131 *
14132 *     File  : 
14133 *
14134 **********************************************************/
14135 #ifdef ANSI
14136 PUBLIC S16 cmPkTfuUePucchRecpReq
14137 (
14138 TfuUePucchRecpReq *param,
14139 Buffer *mBuf
14140 )
14141 #else
14142 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14143 TfuUePucchRecpReq *param;
14144 Buffer *mBuf;
14145 #endif
14146 {
14147
14148    TRC3(cmPkTfuUePucchRecpReq)
14149
14150 #ifdef TFU_5GTF
14151    CMCHKPK(cmPkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14152    CMCHKPK(cmPkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14153 #endif /* TFU_5GTF */
14154    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14155    CMCHKPK(cmPkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14156    CMCHKPK(cmPkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14157    CMCHKPK(cmPkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14158    CMCHKPK(SPkU32, param->uciInfo, mBuf);
14159    RETVALUE(ROK);
14160 }
14161
14162
14163 \f
14164 /***********************************************************
14165 *
14166 *     Func : cmUnpkTfuUePucchRecpReq
14167 *
14168 *
14169 *     Desc : This structure is sent from scheduler to PHY in order to request the
14170   * reception of UCI on PUCCH. This may contain the following:
14171   * -# HARQ
14172   * -# SR
14173   * -# SRS
14174   * -# CQI
14175   * -# HARQ+SR
14176   * -# HARQ+SRS
14177   * -# HARQ+CQI
14178   * -# HARQ+SR+SRS
14179   * -# HARQ+SR+CQI
14180   * -# SR+SRS
14181   * -# SR+CQI
14182 *
14183 *
14184 *     Ret  : S16
14185 *
14186 *     Notes:
14187 *
14188 *     File  : 
14189 *
14190 **********************************************************/
14191 #ifdef ANSI
14192 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14193 (
14194 TfuUePucchRecpReq *param,
14195 Buffer *mBuf
14196 )
14197 #else
14198 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14199 TfuUePucchRecpReq *param;
14200 Buffer *mBuf;
14201 #endif
14202 {
14203
14204    TRC3(cmUnpkTfuUePucchRecpReq)
14205
14206    CMCHKUNPK(SUnpkU32, (U32 *)&param->uciInfo, mBuf);
14207    CMCHKUNPK(cmUnpkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14208    CMCHKUNPK(cmUnpkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14209    CMCHKUNPK(cmUnpkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14210    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14211 #ifdef TFU_5GTF
14212    CMCHKUNPK(cmUnpkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14213    CMCHKUNPK(cmUnpkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14214 #endif /* TFU_5GTF */
14215    RETVALUE(ROK);
14216 }
14217
14218
14219 \f
14220 /***********************************************************
14221 *
14222 *     Func : cmPkTfuUeUlSchRecpInfo
14223 *
14224 *
14225 *     Desc : This structure is sent from scheduler to PHY in order to request the
14226   * reception of UEs data on ULSCH.
14227 *
14228 *
14229 *     Ret  : S16
14230 *
14231 *     Notes:
14232 *
14233 *     File  : 
14234 *
14235 **********************************************************/
14236 #ifdef ANSI
14237 PUBLIC S16 cmPkTfuUeUlSchRecpInfo
14238 (
14239 TfuUeUlSchRecpInfo *param,
14240 Buffer *mBuf
14241 )
14242 #else
14243 PUBLIC S16 cmPkTfuUeUlSchRecpInfo(param, mBuf)
14244 TfuUeUlSchRecpInfo *param;
14245 Buffer *mBuf;
14246 #endif
14247 {
14248
14249    TRC3(cmPkTfuUeUlSchRecpInfo)
14250 #ifdef TFU_5GTF
14251    CMCHKPK(SPkU8, param->beamIndex, mBuf);
14252    CMCHKPK(SPkU8, param->uciWoTBFlag, mBuf);
14253    CMCHKPK(SPkU8, param->PMI, mBuf);
14254    CMCHKPK(SPkU8, param->SCID, mBuf);
14255    CMCHKPK(SPkU8, param->nAntPortLayer, mBuf);
14256    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
14257    CMCHKPK(SPkU8, param->numRbg, mBuf);
14258    CMCHKPK(SPkU8, param->rbgStart, mBuf);
14259 #endif
14260    CMCHKPK(SPkU8, param->mcs, mBuf);
14261    CMCHKPK(SPkU8, param->nSrs, mBuf);
14262    CMCHKPK(SPkU8, param->crntTxNb, mBuf);
14263    CMCHKPK(SPkU8, param->txMode, mBuf);
14264    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14265    CMCHKPK(SPkU8, param->rv, mBuf);
14266    CMCHKPK(SPkU8, param->ndi, mBuf);
14267    CMCHKPK(SPkU8, param->isRtx, mBuf);
14268    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
14269    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14270    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14271    CMCHKPK(SPkU32, param->modType, mBuf);
14272    CMCHKPK(SPkU8, param->numRb, mBuf);
14273    CMCHKPK(SPkU8, param->rbStart, mBuf);
14274    CMCHKPK(SPkU16, param->size, mBuf);
14275
14276    RETVALUE(ROK);
14277 }
14278
14279
14280 \f
14281 /***********************************************************
14282 *
14283 *     Func : cmUnpkTfuUeUlSchRecpInfo
14284 *
14285 *
14286 *     Desc : This structure is sent from scheduler to PHY in order to request the
14287   * reception of UEs data on ULSCH.
14288 *
14289 *
14290 *     Ret  : S16
14291 *
14292 *     Notes:
14293 *
14294 *     File  : 
14295 *
14296 **********************************************************/
14297 #ifdef ANSI
14298 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo
14299 (
14300 TfuUeUlSchRecpInfo *param,
14301 Buffer *mBuf
14302 )
14303 #else
14304 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo(param, mBuf)
14305 TfuUeUlSchRecpInfo *param;
14306 Buffer *mBuf;
14307 #endif
14308 {
14309
14310    TRC3(cmUnpkTfuUeUlSchRecpInfo)
14311
14312    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14313    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14314    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14315    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14316    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14317    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14318    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
14319    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14320    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14321    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14322    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14323    CMCHKUNPK(SUnpkU8, &param->txMode, mBuf);
14324    CMCHKUNPK(SUnpkU8, &param->crntTxNb, mBuf);
14325    CMCHKUNPK(SUnpkU8, &param->nSrs, mBuf);
14326    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14327 #ifdef TFU_5GTF 
14328    CMCHKUNPK(SUnpkU8, &param->rbgStart, mBuf);
14329    CMCHKUNPK(SUnpkU8, &param->numRbg, mBuf);
14330    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
14331    CMCHKUNPK(SUnpkU8, &param->nAntPortLayer, mBuf);
14332    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14333    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
14334    CMCHKUNPK(SUnpkU8, &param->uciWoTBFlag, mBuf);
14335    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
14336 #endif
14337    RETVALUE(ROK);
14338 }
14339
14340
14341 \f
14342 /***********************************************************
14343 *
14344 *     Func : cmPkTfuUePuschCqiRecpInfo
14345 *
14346 *
14347 *     Desc : This structure is sent from scheduler to PHY in order to request the
14348   * reception of CQI_RI info on PUSCH.
14349 *
14350 *
14351 *     Ret  : S16
14352 *
14353 *     Notes:
14354 *
14355 *     File  : 
14356 *
14357 **********************************************************/
14358 #ifdef ANSI
14359 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo
14360 (
14361 TfuUePuschCqiRecpInfo *param,
14362 Buffer *mBuf
14363 )
14364 #else
14365 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo(param, mBuf)
14366 TfuUePuschCqiRecpInfo *param;
14367 Buffer *mBuf;
14368 #endif
14369 {
14370
14371    U32 idx = 0;
14372    TRC3(cmPkTfuUePuschCqiRecpInfo)
14373
14374    CMCHKPK(SPkU8, param->riBetaOff, mBuf);
14375    CMCHKPK(SPkU8, param->cqiBetaOff, mBuf);
14376    for (idx = 0; idx < param->cCNum; idx++)
14377    {
14378       CMCHKPK(cmPkTknU8, &param->riSz[idx], mBuf);
14379       CMCHKPK(SPkU8, param->cqiPmiSzRn1[idx], mBuf);
14380       CMCHKPK(SPkU8, param->cqiPmiSzR1[idx], mBuf);
14381    }
14382    CMCHKPK(SPkU8, param->cCNum, mBuf);
14383    CMCHKPK(SPkU8, param->reportType, mBuf);
14384    RETVALUE(ROK);
14385 }
14386
14387
14388 \f
14389 /***********************************************************
14390 *
14391 *     Func : cmUnpkTfuUePuschCqiRecpInfo
14392 *
14393 *
14394 *     Desc : This structure is sent from scheduler to PHY in order to request the
14395   * reception of CQI_RI info on PUSCH.
14396 *
14397 *
14398 *     Ret  : S16
14399 *
14400 *     Notes:
14401 *
14402 *     File  : 
14403 *
14404 **********************************************************/
14405 #ifdef ANSI
14406 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo
14407 (
14408 TfuUePuschCqiRecpInfo *param,
14409 Buffer *mBuf
14410 )
14411 #else
14412 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo(param, mBuf)
14413 TfuUePuschCqiRecpInfo *param;
14414 Buffer *mBuf;
14415 #endif
14416 {
14417
14418    U32 idx;
14419    TRC3(cmUnpkTfuUePuschCqiRecpInfo)
14420
14421    CMCHKUNPK(SUnpkU8, &param->reportType, mBuf);
14422    CMCHKUNPK(SUnpkU8, &param->cCNum, mBuf);
14423    for (idx = param->cCNum; idx > 0; idx--)
14424    {
14425       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzR1[idx-1], mBuf);
14426       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzRn1[idx-1], mBuf);
14427       CMCHKUNPK(cmUnpkTknU8, &param->riSz[idx-1], mBuf);
14428    }
14429    CMCHKUNPK(SUnpkU8, &param->cqiBetaOff, mBuf);
14430    CMCHKUNPK(SUnpkU8, &param->riBetaOff, mBuf);
14431    RETVALUE(ROK);
14432 }
14433
14434
14435 \f
14436 /***********************************************************
14437 *
14438 *     Func : cmPkTfuUePuschHqRecpInfo
14439 *
14440 *
14441 *     Desc : This structure is sent from scheduler to PHY in order to request the
14442   * reception of Harq info on PUSCH.
14443 *
14444 *
14445 *     Ret  : S16
14446 *
14447 *     Notes:
14448 *
14449 *     File  : 
14450 *
14451 **********************************************************/
14452 #ifdef ANSI
14453 PUBLIC S16 cmPkTfuUePuschHqRecpInfo
14454 (
14455 TfuUePuschHqRecpInfo *param,
14456 Buffer *mBuf
14457 )
14458 #else
14459 PUBLIC S16 cmPkTfuUePuschHqRecpInfo(param, mBuf)
14460 TfuUePuschHqRecpInfo *param;
14461 Buffer *mBuf;
14462 #endif
14463 {
14464
14465    TRC3(cmPkTfuUePuschHqRecpInfo)
14466
14467
14468 #ifdef TFU_TDD
14469    CMCHKPK(SPkU8, param->ulDai, mBuf);
14470    CMCHKPK(SPkU8, param->nBundled, mBuf);
14471    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
14472 #endif
14473    CMCHKPK(SPkU8, param->hqBetaOff, mBuf);
14474    CMCHKPK(SPkU8, param->hqSz, mBuf);
14475    RETVALUE(ROK);
14476 }
14477
14478
14479 \f
14480 /***********************************************************
14481 *
14482 *     Func : cmUnpkTfuUePuschHqRecpInfo
14483 *
14484 *
14485 *     Desc : This structure is sent from scheduler to PHY in order to request the
14486   * reception of Harq info on PUSCH.
14487 *
14488 *
14489 *     Ret  : S16
14490 *
14491 *     Notes:
14492 *
14493 *     File  : 
14494 *
14495 **********************************************************/
14496 #ifdef ANSI
14497 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo
14498 (
14499 TfuUePuschHqRecpInfo *param,
14500 Buffer *mBuf
14501 )
14502 #else
14503 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo(param, mBuf)
14504 TfuUePuschHqRecpInfo *param;
14505 Buffer *mBuf;
14506 #endif
14507 {
14508
14509    TRC3(cmUnpkTfuUePuschHqRecpInfo)
14510
14511    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
14512    CMCHKUNPK(SUnpkU8, &param->hqBetaOff, mBuf);
14513
14514 #ifdef TFU_TDD
14515    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
14516    CMCHKUNPK(SUnpkU8, &param->nBundled, mBuf);
14517    CMCHKUNPK(SUnpkU8, &param->ulDai, mBuf);
14518 #endif
14519    RETVALUE(ROK);
14520 }
14521
14522
14523 \f
14524 /***********************************************************
14525 *
14526 *     Func : cmPkTfuUePuschRecpReq
14527 *
14528 *
14529 *     Desc : This structure is sent from scheduler to PHY in order to request the
14530   * reception of UEs data on PUSCH. This may contain the following: 
14531   * -# Data
14532   * -# Data + SRS
14533   * -# Data + HARQ
14534   * -# Data + HARQ + SRS
14535   * -# Data + CQI/RI
14536   * -# Data + CQI/RI + SRS
14537   * -# Data + CQI/RI + HARQ
14538   * -# Data + CQI/RI + HARQ + SRS
14539 *
14540 *
14541 *     Ret  : S16
14542 *
14543 *     Notes:
14544 *
14545 *     File  : 
14546 *
14547 **********************************************************/
14548 #ifdef ANSI
14549 PUBLIC S16 cmPkTfuUePuschRecpReq
14550 (
14551 TfuUePuschRecpReq *param,
14552 Buffer *mBuf
14553 )
14554 #else
14555 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
14556 TfuUePuschRecpReq *param;
14557 Buffer *mBuf;
14558 #endif
14559 {
14560
14561    TRC3(cmPkTfuUePuschRecpReq)
14562
14563    CMCHKPK(cmPkTknU8, &param->initialNumRbs, mBuf);
14564    CMCHKPK(cmPkTknU8, &param->initialNSrs, mBuf);
14565    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14566    CMCHKPK(cmPkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14567    CMCHKPK(cmPkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14568    CMCHKPK(cmPkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14569    CMCHKPK(SPkU32, param->rcpInfo, mBuf);
14570    RETVALUE(ROK);
14571 }
14572
14573
14574 \f
14575 /***********************************************************
14576 *
14577 *     Func : cmUnpkTfuUePuschRecpReq
14578 *
14579 *
14580 *     Desc : This structure is sent from scheduler to PHY in order to request the
14581   * reception of UEs data on PUSCH. This may contain the following: 
14582   * -# Data
14583   * -# Data + SRS
14584   * -# Data + HARQ
14585   * -# Data + HARQ + SRS
14586   * -# Data + CQI/RI
14587   * -# Data + CQI/RI + SRS
14588   * -# Data + CQI/RI + HARQ
14589   * -# Data + CQI/RI + HARQ + SRS
14590 *
14591 *
14592 *     Ret  : S16
14593 *
14594 *     Notes:
14595 *
14596 *     File  : 
14597 *
14598 **********************************************************/
14599 #ifdef ANSI
14600 PUBLIC S16 cmUnpkTfuUePuschRecpReq
14601 (
14602 TfuUePuschRecpReq *param,
14603 Buffer *mBuf
14604 )
14605 #else
14606 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14607 TfuUePuschRecpReq *param;
14608 Buffer *mBuf;
14609 #endif
14610 {
14611
14612    TRC3(cmUnpkTfuUePuschRecpReq)
14613
14614    CMCHKUNPK(SUnpkU32, (U32 *)&param->rcpInfo, mBuf);
14615    CMCHKUNPK(cmUnpkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14616    CMCHKUNPK(cmUnpkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14617    CMCHKUNPK(cmUnpkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14618    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14619    CMCHKUNPK(cmUnpkTknU8, &param->initialNSrs, mBuf);
14620    CMCHKUNPK(cmUnpkTknU8, &param->initialNumRbs, mBuf);
14621    RETVALUE(ROK);
14622 }
14623
14624
14625 \f
14626 /***********************************************************
14627 *
14628 *     Func : cmPkTfuUeRecpReqInfo
14629 *
14630 *
14631 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14632  * data. This contains information needed by PHY to decode the data sent by the
14633  * UE.
14634 *
14635 *
14636 *     Ret  : S16
14637 *
14638 *     Notes:
14639 *
14640 *     File  : 
14641 *
14642 **********************************************************/
14643 #ifdef ANSI
14644 PUBLIC S16 cmPkTfuUeRecpReqInfo
14645 (
14646 TfuUeRecpReqInfo *param,
14647 Buffer *mBuf
14648 )
14649 #else
14650 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14651 TfuUeRecpReqInfo *param;
14652 Buffer *mBuf;
14653 #endif
14654 {
14655
14656    TRC3(cmPkTfuUeRecpReqInfo)
14657
14658       switch(param->type) {
14659          case TFU_RECP_REQ_PUSCH:
14660             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14661             break;
14662          case TFU_RECP_REQ_PUCCH:
14663             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14664             break;
14665          default :
14666             RETVALUE(RFAILED);
14667       }
14668    CMCHKPK(SPkU32, param->type, mBuf);
14669 #ifdef TFU_5GTF
14670    CMCHKPK(SPkU8, param->groupId, mBuf);
14671 #endif /* TFU_5GTF */
14672    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14673    RETVALUE(ROK);
14674 }
14675
14676
14677 \f
14678 /***********************************************************
14679 *
14680 *     Func : cmUnpkTfuUeRecpReqInfo
14681 *
14682 *
14683 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14684  * data. This contains information needed by PHY to decode the data sent by the
14685  * UE.
14686 *
14687 *
14688 *     Ret  : S16
14689 *
14690 *     Notes:
14691 *
14692 *     File  : 
14693 *
14694 **********************************************************/
14695 #ifdef ANSI
14696 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
14697 (
14698 TfuUeRecpReqInfo *param,
14699 Buffer *mBuf
14700 )
14701 #else
14702 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14703 TfuUeRecpReqInfo *param;
14704 Buffer *mBuf;
14705 #endif
14706 {
14707
14708    TRC3(cmUnpkTfuUeRecpReqInfo)
14709
14710    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14711 #ifdef TFU_5GTF
14712    CMCHKUNPK(SUnpkU8, &param->groupId, mBuf);
14713 #endif /* TFU_5GTF */
14714    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14715       switch(param->type) {
14716          case TFU_RECP_REQ_PUCCH:
14717             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14718             break;
14719          case TFU_RECP_REQ_PUSCH:
14720             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14721             break;
14722          default :
14723             RETVALUE(RFAILED);
14724       }
14725    RETVALUE(ROK);
14726 }
14727 #endif /* TFU_UPGRADE */
14728 #ifndef TFU_UPGRADE  /* TFU_UPGRADE */
14729 /***********************************************************
14730 *
14731 *     Func : cmPkTfuUePucchRecpReq
14732 *
14733 *
14734 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14735   * reception of an UEs data on PUCCH. This may contain the following: 
14736   * -# HARQ-ACK 
14737   * -# Scheduling Request (SR)
14738   * -# HARQ-ACK and SR
14739   * -# CQI
14740   * -# CQI and HARQ-ACK
14741 *
14742 *
14743 *     Ret  : S16
14744 *
14745 *     Notes:
14746 *
14747 *     File  : 
14748 *
14749 **********************************************************/
14750 #ifdef ANSI
14751 PUBLIC S16 cmPkTfuUePucchRecpReq
14752 (
14753 TfuUePucchRecpReq *param,
14754 Buffer *mBuf
14755 )
14756 #else
14757 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14758 TfuUePucchRecpReq *param;
14759 Buffer *mBuf;
14760 #endif
14761 {
14762
14763 #ifdef TFU_TDD
14764    S32 i;
14765 #endif
14766    TRC3(cmPkTfuUePucchRecpReq)
14767
14768
14769 #ifdef TFU_TDD
14770    for (i=TFU_MAX_M-1; i >= 0; i--) {
14771       CMCHKPK(SPkU8, param->p[i], mBuf);
14772    }
14773    for (i=TFU_MAX_M-1; i >= 0; i--) {
14774       CMCHKPK(SPkU8, param->m[i], mBuf);
14775    }
14776    CMCHKPK(SPkU8, param->M, mBuf);
14777    CMCHKPK(SPkU8, param->multCnt, mBuf);
14778
14779 #endif
14780    CMCHKPK(SPkU32, param->type, mBuf);
14781       switch(param->hqType) {
14782          case TFU_HQ_RECP_REQ_N1PUCCH:
14783             CMCHKPK(SPkU16, param->t.n1Pucch, mBuf);
14784             break;
14785    
14786 #ifdef TFU_TDD
14787          case TFU_HQ_RECP_REQ_NORMAL:
14788             for (i=TFU_MAX_M-1; i >= 0; i--) {
14789                CMCHKPK(SPkU16, param->t.nCce[i], mBuf);
14790             }
14791             break;
14792    
14793 #endif
14794    
14795 #ifndef TFU_TDD
14796          case TFU_HQ_RECP_REQ_NORMAL:
14797             CMCHKPK(SPkU16, param->t.nCce, mBuf);
14798             break;
14799    
14800 #endif
14801          default :
14802             RETVALUE(RFAILED);
14803       }
14804    CMCHKPK(SPkU32, param->hqType, mBuf);
14805    RETVALUE(ROK);
14806 }
14807
14808
14809 \f
14810 /***********************************************************
14811 *
14812 *     Func : cmUnpkTfuUePucchRecpReq
14813 *
14814 *
14815 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14816   * reception of an UEs data on PUCCH. This may contain the following: 
14817   * -# HARQ-ACK 
14818   * -# Scheduling Request (SR)
14819   * -# HARQ-ACK and SR
14820   * -# CQI
14821   * -# CQI and HARQ-ACK
14822 *
14823 *
14824 *     Ret  : S16
14825 *
14826 *     Notes:
14827 *
14828 *     File  : 
14829 *
14830 **********************************************************/
14831 #ifdef ANSI
14832 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14833 (
14834 TfuUePucchRecpReq *param,
14835 Buffer *mBuf
14836 )
14837 #else
14838 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14839 TfuUePucchRecpReq *param;
14840 Buffer *mBuf;
14841 #endif
14842 {
14843
14844 #ifdef TFU_TDD
14845    S32 i;
14846 #endif
14847    TRC3(cmUnpkTfuUePucchRecpReq)
14848
14849    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqType, mBuf);
14850       switch(param->hqType) {
14851    
14852 #ifndef TFU_TDD
14853          case TFU_HQ_RECP_REQ_NORMAL:
14854             CMCHKUNPK(SUnpkU16, &param->t.nCce, mBuf);
14855             break;
14856    
14857 #endif
14858    
14859 #ifdef TFU_TDD
14860          case TFU_HQ_RECP_REQ_NORMAL:
14861             for (i=0; i<TFU_MAX_M; i++) {
14862                CMCHKUNPK(SUnpkU16, &param->t.nCce[i], mBuf);
14863             }
14864             break;
14865    
14866 #endif
14867          case TFU_HQ_RECP_REQ_N1PUCCH:
14868             CMCHKUNPK(SUnpkU16, &param->t.n1Pucch, mBuf);
14869             break;
14870          default :
14871             RETVALUE(RFAILED);
14872       }
14873    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14874
14875 #ifdef TFU_TDD
14876    CMCHKUNPK(SUnpkU8, &param->multCnt, mBuf);
14877    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
14878    for (i=0; i<TFU_MAX_M; i++) {
14879       CMCHKUNPK(SUnpkU8, &param->m[i], mBuf);
14880    }
14881    for (i=0; i<TFU_MAX_M; i++) {
14882       CMCHKUNPK(SUnpkU8, &param->p[i], mBuf);
14883    }
14884
14885 #endif
14886    RETVALUE(ROK);
14887 }
14888
14889
14890 \f
14891 /***********************************************************
14892 *
14893 *     Func : cmPkTfuUeMsg3RecpReq
14894 *
14895 *
14896 *     Desc : This structure is sent from scheduler to PHY in order to request the
14897   * reception of UEs data sent as MSG3 for Random access.
14898 *
14899 *
14900 *     Ret  : S16
14901 *
14902 *     Notes:
14903 *
14904 *     File  : 
14905 *
14906 **********************************************************/
14907 #ifdef ANSI
14908 PUBLIC S16 cmPkTfuUeMsg3RecpReq
14909 (
14910 TfuUeMsg3RecpReq *param,
14911 Buffer *mBuf
14912 )
14913 #else
14914 PUBLIC S16 cmPkTfuUeMsg3RecpReq(param, mBuf)
14915 TfuUeMsg3RecpReq *param;
14916 Buffer *mBuf;
14917 #endif
14918 {
14919
14920    TRC3(cmPkTfuUeMsg3RecpReq)
14921
14922    CMCHKPK(SPkU32, param->modType, mBuf);
14923    CMCHKPK(SPkU16, param->size, mBuf);
14924    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14925    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14926    CMCHKPK(SPkU8, param->rv, mBuf);
14927    CMCHKPK(SPkU8, param->ndi, mBuf);
14928    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14929    CMCHKPK(SPkU8, param->isRtx, mBuf);
14930    CMCHKPK(SPkU8, param->ulDelay, mBuf);
14931    CMCHKPK(SPkU8, param->expCqi, mBuf);
14932    CMCHKPK(SPkU8, param->mcs, mBuf);
14933    CMCHKPK(SPkU8, param->numRb, mBuf);
14934    CMCHKPK(SPkU8, param->rbStart, mBuf);
14935    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14936    RETVALUE(ROK);
14937 }
14938
14939
14940 \f
14941 /***********************************************************
14942 *
14943 *     Func : cmUnpkTfuUeMsg3RecpReq
14944 *
14945 *
14946 *     Desc : This structure is sent from scheduler to PHY in order to request the
14947   * reception of UEs data sent as MSG3 for Random access.
14948 *
14949 *
14950 *     Ret  : S16
14951 *
14952 *     Notes:
14953 *
14954 *     File  : 
14955 *
14956 **********************************************************/
14957 #ifdef ANSI
14958 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq
14959 (
14960 TfuUeMsg3RecpReq *param,
14961 Buffer *mBuf
14962 )
14963 #else
14964 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq(param, mBuf)
14965 TfuUeMsg3RecpReq *param;
14966 Buffer *mBuf;
14967 #endif
14968 {
14969
14970    TRC3(cmUnpkTfuUeMsg3RecpReq)
14971
14972    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14973    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14974    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14975    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14976    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
14977    CMCHKUNPK(SUnpkU8, &param->ulDelay, mBuf);
14978    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14979    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14980    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14981    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14982    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14983    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14984    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14985    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14986    RETVALUE(ROK);
14987 }
14988
14989
14990 \f
14991 /***********************************************************
14992 *
14993 *     Func : cmPkTfuUePuschRecpReq
14994 *
14995 *
14996 *     Desc : This structure is sent from scheduler to PHY in order to request the
14997   * reception of UEs data on PUSCH. This may contain the following: 
14998   * -# Data
14999   * -# Data + CQI and RI
15000   * -# Data + CQI and HARQ
15001 *
15002 *
15003 *     Ret  : S16
15004 *
15005 *     Notes:
15006 *
15007 *     File  : 
15008 *
15009 **********************************************************/
15010 #ifdef ANSI
15011 PUBLIC S16 cmPkTfuUePuschRecpReq
15012 (
15013 TfuUePuschRecpReq *param,
15014 Buffer *mBuf
15015 )
15016 #else
15017 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
15018 TfuUePuschRecpReq *param;
15019 Buffer *mBuf;
15020 #endif
15021 {
15022
15023    TRC3(cmPkTfuUePuschRecpReq)
15024
15025    CMCHKPK(SPkU32, param->modType, mBuf);
15026    CMCHKPK(SPkU16, param->size, mBuf);
15027    CMCHKPK(SPkU32, param->mode, mBuf);
15028    CMCHKPK(SPkU8, param->expHarq, mBuf);
15029    CMCHKPK(SPkU8, param->expCqi, mBuf);
15030    CMCHKPK(SPkU8, param->nDmrs, mBuf);
15031    CMCHKPK(SPkU8, param->rv, mBuf);
15032    CMCHKPK(SPkU8, param->isRtx, mBuf);
15033    CMCHKPK(SPkU8, param->ndi, mBuf);
15034    CMCHKPK(SPkU8, param->harqProcId, mBuf);
15035    CMCHKPK(SPkU8, param->mcs, mBuf);
15036    CMCHKPK(SPkU8, param->numRb, mBuf);
15037    CMCHKPK(SPkU8, param->rbStart, mBuf);
15038    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
15039    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
15040    RETVALUE(ROK);
15041 }
15042
15043
15044 \f
15045 /***********************************************************
15046 *
15047 *     Func : cmUnpkTfuUePuschRecpReq
15048 *
15049 *
15050 *     Desc : This structure is sent from scheduler to PHY in order to request the
15051   * reception of UEs data on PUSCH. This may contain the following: 
15052   * -# Data
15053   * -# Data + CQI and RI
15054   * -# Data + CQI and HARQ
15055 *
15056 *
15057 *     Ret  : S16
15058 *
15059 *     Notes:
15060 *
15061 *     File  : 
15062 *
15063 **********************************************************/
15064 #ifdef ANSI
15065 PUBLIC S16 cmUnpkTfuUePuschRecpReq
15066 (
15067 TfuUePuschRecpReq *param,
15068 Buffer *mBuf
15069 )
15070 #else
15071 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
15072 TfuUePuschRecpReq *param;
15073 Buffer *mBuf;
15074 #endif
15075 {
15076
15077    TRC3(cmUnpkTfuUePuschRecpReq)
15078
15079    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
15080    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
15081    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
15082    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
15083    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
15084    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
15085    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
15086    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
15087    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
15088    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
15089    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
15090    CMCHKUNPK(SUnpkU8, &param->expHarq, mBuf);
15091    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
15092    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
15093    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
15094    RETVALUE(ROK);
15095 }
15096
15097
15098 \f
15099 /***********************************************************
15100 *
15101 *     Func : cmPkTfuUeRecpReqInfo
15102 *
15103 *
15104 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15105  * data. This contains information needed by PHY to decode the data sent by the
15106  * UE.
15107 *
15108 *
15109 *     Ret  : S16
15110 *
15111 *     Notes:
15112 *
15113 *     File  : 
15114 *
15115 **********************************************************/
15116 #ifdef ANSI
15117 PUBLIC S16 cmPkTfuUeRecpReqInfo
15118 (
15119 TfuUeRecpReqInfo *param,
15120 Buffer *mBuf
15121 )
15122 #else
15123 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
15124 TfuUeRecpReqInfo *param;
15125 Buffer *mBuf;
15126 #endif
15127 {
15128
15129    TRC3(cmPkTfuUeRecpReqInfo)
15130
15131       switch(param->type) {
15132          case TFU_RECP_REQ_PUSCH:
15133             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15134             break;
15135          case TFU_RECP_REQ_MSG3:
15136             CMCHKPK(cmPkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15137             break;
15138          case TFU_RECP_REQ_PUCCH:
15139             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15140             break;
15141          default :
15142             RETVALUE(RFAILED);
15143       }
15144    CMCHKPK(SPkU32, param->type, mBuf);
15145    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
15146    RETVALUE(ROK);
15147 }
15148
15149
15150 \f
15151 /***********************************************************
15152 *
15153 *     Func : cmUnpkTfuUeRecpReqInfo
15154 *
15155 *
15156 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15157  * data. This contains information needed by PHY to decode the data sent by the
15158  * UE.
15159 *
15160 *
15161 *     Ret  : S16
15162 *
15163 *     Notes:
15164 *
15165 *     File  : 
15166 *
15167 **********************************************************/
15168 #ifdef ANSI
15169 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
15170 (
15171 TfuUeRecpReqInfo *param,
15172 Buffer *mBuf
15173 )
15174 #else
15175 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
15176 TfuUeRecpReqInfo *param;
15177 Buffer *mBuf;
15178 #endif
15179 {
15180
15181    TRC3(cmUnpkTfuUeRecpReqInfo)
15182
15183    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
15184    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
15185       switch(param->type) {
15186          case TFU_RECP_REQ_PUCCH:
15187             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15188             break;
15189          case TFU_RECP_REQ_MSG3:
15190             CMCHKUNPK(cmUnpkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15191             break;
15192          case TFU_RECP_REQ_PUSCH:
15193             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15194             break;
15195          default :
15196             RETVALUE(RFAILED);
15197       }
15198    RETVALUE(ROK);
15199 }
15200
15201
15202 #endif /* ifndef TFU_UPGRADE */
15203 /*LAA: Packing and Unpacking*/
15204
15205 /***********************************************************
15206 *
15207 *     Func : cmPkTfuErrIndInfo
15208 *
15209 *
15210 *     Desc : This structure contains information that is passed as a part of
15211 *     the ERR indication sent from PHY to MAC.
15212 *
15213 *
15214 *     Ret  : S16
15215 *
15216 *     Notes:
15217 *
15218 *     File  : 
15219 *
15220 **********************************************************/
15221 #ifdef ANSI
15222 PRIVATE S16 cmPkTfuErrIndInfo
15223 (
15224 TfuErrIndInfo *param,
15225 Buffer *mBuf
15226 )
15227 #else
15228 PRIVATE S16 cmPkTfuErrIndInfo(param, mBuf)
15229 TfuErrIndInfo *param;
15230 Buffer *mBuf;
15231 #endif
15232 {
15233
15234    TRC3(cmPkTfuErrIndInfo)
15235
15236    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
15237    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
15238    RETVALUE(ROK);
15239 }
15240 /***********************************************************
15241 *
15242 *     Func : cmUnpkTfuErrIndInfo
15243 *
15244 *
15245 *     Desc : This structure contains information that is passed as a part of the ERR
15246  * indication sent from PHY to MAC.
15247 *
15248 *
15249 *     Ret  : S16
15250 *
15251 *     Notes:
15252 *
15253 *     File  : 
15254 *
15255 **********************************************************/
15256 #ifdef ANSI
15257 PRIVATE S16 cmUnpkTfuErrIndInfo
15258 (
15259 TfuErrIndInfo *param,
15260 Buffer *mBuf
15261 )
15262 #else
15263 PRIVATE S16 cmUnpkTfuErrIndInfo(param, mBuf)
15264 TfuErrIndInfo *param;
15265 Buffer *mBuf;
15266 #endif
15267 {
15268
15269    TRC3(cmUnpkTfuErrIndInfo)
15270
15271    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
15272    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
15273    RETVALUE(ROK);
15274 }
15275
15276 /***********************************************************
15277 *
15278 *     Func : cmPkTfuErrInd
15279 *
15280 *
15281  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15282  *      Currently invoked in the cases when the Unlicensed SCell transmission
15283  *      fails.
15284  *      This API contains the Cell and subframe information for which the
15285  *      transmission failed. 
15286  *           
15287  *  @param[in]  Pst                *pst
15288  *  @param[in]  SuId               suId 
15289  *  @param[in]  TfuErrIndInfo      *errIndInfo 
15290  *  @return  S16
15291  *      -# ROK 
15292  *      -# RFAILED 
15293 *
15294 *
15295 *     Ret  : S16
15296 *
15297 *     Notes:
15298 *
15299 *     File  : 
15300 *
15301 **********************************************************/
15302 #ifdef ANSI
15303 PUBLIC S16 cmPkTfuErrInd
15304 (
15305 Pst * pst,
15306 SuId suId,
15307 TfuErrIndInfo * errInd
15308 )
15309 #else
15310 PUBLIC S16 cmPkTfuErrInd(pst, suId, errInd)
15311 Pst * pst;
15312 SuId suId;
15313 TfuErrIndInfo * errInd;
15314 #endif
15315 {
15316    Buffer *mBuf = NULLP;
15317    TRC3(cmPkTfuErrInd)
15318
15319    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
15320 #if (ERRCLASS & ERRCLS_ADD_RES)
15321       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15322          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15323          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
15324 #endif
15325       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15326       RETVALUE(RFAILED);
15327    }
15328    if (pst->selector == ODU_SELECTOR_LC) {
15329       if (cmPkTfuErrIndInfo(errInd, mBuf) != ROK) {
15330 #if (ERRCLASS & ERRCLS_ADD_RES)
15331          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15332             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15333             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
15334 #endif
15335          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15336          TFU_FREE_MSG(mBuf);
15337          RETVALUE(RFAILED);
15338       }
15339    }
15340    else if(pst->selector == ODU_SELECTOR_LWLC)
15341    {
15342       if (cmPkPtr((PTR)errInd, mBuf) != ROK)
15343       {
15344 #if (ERRCLASS & ERRCLS_ADD_RES)
15345          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15346             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15347             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
15348 #endif
15349          
15350          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
15351          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15352          TFU_FREE_MSG(mBuf);
15353          RETVALUE(RFAILED);
15354       }
15355    }
15356
15357    if (SPkS16(suId, mBuf) != ROK) {
15358 #if (ERRCLASS & ERRCLS_ADD_RES)
15359       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15360          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15361          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
15362 #endif
15363       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15364       TFU_FREE_MSG(mBuf);
15365       RETVALUE(RFAILED);
15366    }
15367    if (pst->selector != ODU_SELECTOR_LWLC) {
15368       if (SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo)) != ROK) {
15369 #if (ERRCLASS & ERRCLS_ADD_RES)
15370       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15371          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15372          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
15373 #endif
15374          TFU_FREE_MSG(mBuf);
15375          RETVALUE(RFAILED);
15376       }
15377    }
15378
15379    pst->event = (Event) EVTTFUERRIND;
15380    RETVALUE(SPstTsk(pst,mBuf));
15381 }
15382
15383 \f
15384 /***********************************************************
15385 *
15386 *     Func : cmUnpkTfuErrInd
15387 *
15388 *
15389  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15390  *      Currently invoked in the cases when the Unlicensed SCell transmission
15391  *      fails.
15392  *      This API contains the Cell and subframe information for which the
15393  *      transmission failed. 
15394  * @param pst Pointer to the post structure.
15395  * @param suId SAP ID of the service user.
15396  * @param errInd Pointer to the TfuErrIndInfo.
15397  * @return ROK/RFAILED
15398 *
15399 *
15400 *     Ret  : S16
15401 *
15402 *     Notes:
15403 *
15404 *     File  : 
15405 *
15406 **********************************************************/
15407 #ifdef ANSI
15408 PUBLIC S16 cmUnpkTfuErrInd
15409 (
15410 TfuErrInd func,
15411 Pst *pst,
15412 Buffer *mBuf
15413 )
15414 #else
15415 PUBLIC S16 cmUnpkTfuErrInd(func, pst, mBuf)
15416 TfuErrInd func;
15417 Pst *pst;
15418 Buffer *mBuf;
15419 #endif
15420 {
15421    SuId suId;
15422    TfuErrIndInfo *errInd;
15423    
15424    TRC3(cmUnpkTfuErrInd)
15425
15426    if (SUnpkS16(&suId, mBuf) != ROK) {
15427       TFU_FREE_MSG(mBuf);
15428 #if (ERRCLASS & ERRCLS_ADD_RES)
15429       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15430          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15431          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
15432 #endif
15433       RETVALUE(RFAILED);
15434    }
15435    if (pst->selector != ODU_SELECTOR_LWLC) {
15436       if ((SGetSBuf(pst->region, pst->pool, (Data **)&errInd, sizeof(TfuErrIndInfo))) != ROK) {
15437 #if (ERRCLASS & ERRCLS_ADD_RES)
15438          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15439             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15440             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
15441 #endif
15442          TFU_FREE_MSG(mBuf);
15443          RETVALUE(RFAILED);
15444       }
15445    }
15446
15447    if (pst->selector == ODU_SELECTOR_LC) 
15448    {
15449       if (cmUnpkTfuErrIndInfo(errInd, mBuf) != ROK) {
15450          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15451          TFU_FREE_MSG(mBuf);
15452 #if (ERRCLASS & ERRCLS_ADD_RES)
15453          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15454                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15455                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
15456 #endif
15457          RETVALUE(RFAILED);
15458       }
15459    }
15460    else if(pst->selector == ODU_SELECTOR_LWLC)
15461    {
15462       if (cmUnpkPtr((PTR *)&errInd, mBuf) != ROK)
15463       {
15464 #if (ERRCLASS & ERRCLS_ADD_RES)
15465          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15466             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15467             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
15468 #endif
15469          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15470          TFU_FREE_MSG(mBuf);
15471          RETVALUE(RFAILED);
15472       }
15473    }
15474    TFU_FREE_MSG(mBuf);
15475    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
15476    (*func)(pst, suId, errInd);
15477    SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15478    RETVALUE(ROK);
15479
15480 }
15481 #endif /* if defined(LCTFU) */
15482
15483 /**********************************************************************
15484          End of file
15485  **********************************************************************/