6e2c7500af85db96ed5ef9914ea8af678e20ed37
[o-du/l2.git] / src / cm / tfu.c
1 /*******************************************************************************
2 ################################################################################
3 #   Copyright (c) [2017-2019] [Radisys]                                        #
4 #                                                                              #
5 #   Licensed under the Apache License, Version 2.0 (the "License");            #
6 #   you may not use this file except in compliance with the License.           #
7 #   You may obtain a copy of the License at                                    #
8 #                                                                              #
9 #       http://www.apache.org/licenses/LICENSE-2.0                             #
10 #                                                                              #
11 #   Unless required by applicable law or agreed to in writing, software        #
12 #   distributed under the License is distributed on an "AS IS" BASIS,          #
13 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.   #
14 #   See the License for the specific language governing permissions and        #
15 #   limitations under the License.                                             #
16 ################################################################################
17 *******************************************************************************/
18 \f
19
20 /************************************************************************
21  
22      Name:     LTE-MAC layer
23   
24      Type:     C source file
25   
26      Desc:     C source code for pack/unpack of TFU interface primitives. 
27   
28      File:     tfu.c 
29   
30 **********************************************************************/
31
32 /** @file tfu.c
33 @brief This file contains the packing/unpacking code for the TFU interface 
34        primitives.
35 */
36
37 /* header include files (.h) */
38 #include "envopt.h"        /* environment options */
39 #include "envdep.h"        /* environment dependent */
40 #include "envind.h"        /* environment independent */
41 #include "gen.h"           /* general */
42 #include "ssi.h"           /* system services */
43 #include "cm_tkns.h"       /* Common Token Defines */
44 #include "cm_llist.h"      /* Common Link List Defines */
45 #include "cm_hash.h"       /* Common Hash List Defines */
46 #include "cm_lte.h"        /* Common LTE Defines */
47 #include "cm_mblk.h"        /* Common LTE Defines */
48 #include "tfu.h"           /* RGU Interface defines */
49
50 /* header/extern include files (.x) */
51 #include "gen.x"           /* general */
52 #include "ssi.x"           /* system services */
53 #include "cm_tkns.x"       /* Common Token Definitions */
54 #include "cm_llist.x"      /* Common Link List Definitions */
55 #include "cm_lib.x"        /* Common Library Definitions */
56 #include "cm_hash.x"       /* Common Hash List Definitions */
57 #include "cm_lte.x"        /* Common LTE Defines */
58 #include "cm_mblk.x"        /* Common LTE Defines */
59 #include "tfu.x"           /* RGU Interface includes */
60
61 #include "du_app_mac_inf.h"
62 //#include "mac_sch_interface.h"
63
64 #if (defined(LCTFU))
65
66 \f
67 /***********************************************************
68 *
69 *     Func : cmPkTfuBndReq
70 *
71 *
72 *     Desc : This API is used to send a Bind Request from MAC to PHY.
73  * @param pst Pointer to the post structure.
74  * @param suId SAP ID of the service user.
75  * @param spId SAP ID of the service provider.
76  * @return ROK/RFAILED
77 *
78 *
79 *     Ret  : S16
80 *
81 *     Notes:
82 *
83 *     File  : 
84 *
85 **********************************************************/
86 #ifdef ANSI
87 PUBLIC S16 cmPkTfuBndReq
88 (
89 Pst * pst,
90 SuId suId,
91 SpId spId
92 )
93 #else
94 PUBLIC S16 cmPkTfuBndReq(pst, suId, spId)
95 Pst * pst;
96 SuId suId;
97 SpId spId;
98 #endif
99 {
100    Buffer *mBuf = NULLP;
101    TRC3(cmPkTfuBndReq)
102
103    if (SGetMsg(pst->region, pst->pool, &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)ETFU001, (ErrVal)0, "Packing failed");
108 #endif
109       RETVALUE(RFAILED);
110    }
111    if (SPkS16(spId, mBuf) != ROK) {
112 #if (ERRCLASS & ERRCLS_ADD_RES)
113       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
114          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
115          (ErrVal)ETFU002, (ErrVal)0, "Packing failed");
116 #endif
117       TFU_FREE_MSG(mBuf);
118       RETVALUE(RFAILED);
119    }
120    if (SPkS16(suId, mBuf) != ROK) {
121 #if (ERRCLASS & ERRCLS_ADD_RES)
122       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
123          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
124          (ErrVal)ETFU003, (ErrVal)0, "Packing failed");
125 #endif
126       TFU_FREE_MSG(mBuf);
127       RETVALUE(RFAILED);
128    }
129    pst->event = (Event) EVTTFUBNDREQ;
130    RETVALUE(SPstTsk(pst,mBuf));
131 }
132
133 \f
134 /***********************************************************
135 *
136 *     Func : cmUnpkTfuBndReq
137 *
138 *
139 *     Desc : This API is used to send a Bind Request from MAC to PHY.
140  * @param pst Pointer to the post structure.
141  * @param suId SAP ID of the service user.
142  * @param spId SAP ID of the service provider.
143  * @return ROK/RFAILED
144 *
145 *
146 *     Ret  : S16
147 *
148 *     Notes:
149 *
150 *     File  : 
151 *
152 **********************************************************/
153 #ifdef ANSI
154 PUBLIC S16 cmUnpkTfuBndReq
155 (
156 TfuBndReq func,
157 Pst *pst,
158 Buffer *mBuf
159 )
160 #else
161 PUBLIC S16 cmUnpkTfuBndReq(func, pst, mBuf)
162 TfuBndReq func;
163 Pst *pst;
164 Buffer *mBuf;
165 #endif
166 {
167    SuId suId;
168    SpId spId;
169    
170    TRC3(cmUnpkTfuBndReq)
171
172    if (SUnpkS16(&suId, mBuf) != ROK) {
173       TFU_FREE_MSG(mBuf);
174 #if (ERRCLASS & ERRCLS_ADD_RES)
175       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
176          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
177          (ErrVal)ETFU004, (ErrVal)0, "Packing failed");
178 #endif
179       RETVALUE(RFAILED);
180    }
181    if (SUnpkS16(&spId, mBuf) != ROK) {
182       TFU_FREE_MSG(mBuf);
183 #if (ERRCLASS & ERRCLS_ADD_RES)
184       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
185          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
186          (ErrVal)ETFU005, (ErrVal)0, "Packing failed");
187 #endif
188       RETVALUE(RFAILED);
189    }
190    TFU_FREE_MSG(mBuf);
191    RETVALUE((*func)(pst, suId, spId));
192 }
193
194 \f
195 /***********************************************************
196 *
197 *     Func : cmPkTfuBndCfm
198 *
199 *
200 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
201  * @param pst Pointer to the post structure.
202  * @param suId SAP ID of the service user.
203  * @param status Status of the bind request.
204  * @return ROK/RFAILED
205 *
206 *
207 *     Ret  : S16
208 *
209 *     Notes:
210 *
211 *     File  : 
212 *
213 **********************************************************/
214 #ifdef ANSI
215 PUBLIC S16 cmPkTfuBndCfm
216 (
217 Pst * pst,
218 SuId suId,
219 U8 status
220 )
221 #else
222 PUBLIC S16 cmPkTfuBndCfm(pst, suId, status)
223 Pst * pst;
224 SuId suId;
225 U8 status;
226 #endif
227 {
228    Buffer *mBuf = NULLP;
229    TRC3(cmPkTfuBndCfm)
230
231    if (SGetMsg(pst->region, pst->pool, &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)ETFU006, (ErrVal)0, "Packing failed");
236 #endif
237       RETVALUE(RFAILED);
238    }
239    if (SPkU8(status, mBuf) != ROK) {
240 #if (ERRCLASS & ERRCLS_ADD_RES)
241       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
242          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
243          (ErrVal)ETFU007, (ErrVal)0, "Packing failed");
244 #endif
245       TFU_FREE_MSG(mBuf);
246       RETVALUE(RFAILED);
247    }
248    if (SPkS16(suId, mBuf) != ROK) {
249 #if (ERRCLASS & ERRCLS_ADD_RES)
250       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
251          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
252          (ErrVal)ETFU008, (ErrVal)0, "Packing failed");
253 #endif
254       TFU_FREE_MSG(mBuf);
255       RETVALUE(RFAILED);
256    }
257    pst->event = (Event) EVTTFUBNDCFM;
258    RETVALUE(SPstTsk(pst,mBuf));
259 }
260
261 \f
262 /***********************************************************
263 *
264 *     Func : cmUnpkTfuBndCfm
265 *
266 *
267 *     Desc : This API is used to receive a Bind Confirm from PHY to MAC.
268  * @param pst Pointer to the post structure.
269  * @param suId SAP ID of the service user.
270  * @param status Status of the bind request.
271  * @return ROK/RFAILED
272 *
273 *
274 *     Ret  : S16
275 *
276 *     Notes:
277 *
278 *     File  : 
279 *
280 **********************************************************/
281 #ifdef ANSI
282 PUBLIC S16 cmUnpkTfuBndCfm
283 (
284 TfuBndCfm func,
285 Pst *pst,
286 Buffer *mBuf
287 )
288 #else
289 PUBLIC S16 cmUnpkTfuBndCfm(func, pst, mBuf)
290 TfuBndCfm func;
291 Pst *pst;
292 Buffer *mBuf;
293 #endif
294 {
295    SuId suId;
296    U8 status;
297    
298    TRC3(cmUnpkTfuBndCfm)
299
300    if (SUnpkS16(&suId, mBuf) != ROK) {
301       TFU_FREE_MSG(mBuf);
302 #if (ERRCLASS & ERRCLS_ADD_RES)
303       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
304          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
305          (ErrVal)ETFU009, (ErrVal)0, "Packing failed");
306 #endif
307       RETVALUE(RFAILED);
308    }
309    if (SUnpkU8(&status, mBuf) != ROK) {
310       TFU_FREE_MSG(mBuf);
311 #if (ERRCLASS & ERRCLS_ADD_RES)
312       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
313          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
314          (ErrVal)ETFU010, (ErrVal)0, "Packing failed");
315 #endif
316       RETVALUE(RFAILED);
317    }
318    TFU_FREE_MSG(mBuf);
319    RETVALUE((*func)(pst, suId, status));
320 }
321
322 \f
323 /***********************************************************
324 *
325 *     Func : cmPkTfuUbndReq
326 *
327 *
328 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
329  * @param pst Pointer to the post structure.
330  * @param suId SAP ID of the service provider.
331  * @param reason Reason for Unbind request.
332  * @return ROK/RFAILED
333 *
334 *
335 *     Ret  : S16
336 *
337 *     Notes:
338 *
339 *     File  : 
340 *
341 **********************************************************/
342 #ifdef ANSI
343 PUBLIC S16 cmPkTfuUbndReq
344 (
345 Pst * pst,
346 SpId spId,
347 Reason reason
348 )
349 #else
350 PUBLIC S16 cmPkTfuUbndReq(pst, spId, reason)
351 Pst * pst;
352 SpId spId;
353 Reason reason;
354 #endif
355 {
356    Buffer *mBuf = NULLP;
357    TRC3(cmPkTfuUbndReq)
358
359    if (SGetMsg(pst->region, pst->pool, &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)ETFU011, (ErrVal)0, "Packing failed");
364 #endif
365       RETVALUE(RFAILED);
366    }
367    if (SPkS16(reason, mBuf) != ROK) {
368 #if (ERRCLASS & ERRCLS_ADD_RES)
369       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
370          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
371          (ErrVal)ETFU012, (ErrVal)0, "Packing failed");
372 #endif
373       TFU_FREE_MSG(mBuf);
374       RETVALUE(RFAILED);
375    }
376    if (SPkS16(spId, mBuf) != ROK) {
377 #if (ERRCLASS & ERRCLS_ADD_RES)
378       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
379          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
380          (ErrVal)ETFU013, (ErrVal)0, "Packing failed");
381 #endif
382       TFU_FREE_MSG(mBuf);
383       RETVALUE(RFAILED);
384    }
385    pst->event = (Event) EVTTFUUBNDREQ;
386    RETVALUE(SPstTsk(pst,mBuf));
387 }
388
389 \f
390 /***********************************************************
391 *
392 *     Func : cmUnpkTfuUbndReq
393 *
394 *
395 *     Desc : This API is used to send an Unbind Request from MAC to PHY.
396  * @param pst Pointer to the post structure.
397  * @param suId SAP ID of the service provider.
398  * @param reason Reason for Unbind request.
399  * @return ROK/RFAILED
400 *
401 *
402 *     Ret  : S16
403 *
404 *     Notes:
405 *
406 *     File  : 
407 *
408 **********************************************************/
409 #ifdef ANSI
410 PUBLIC S16 cmUnpkTfuUbndReq
411 (
412 TfuUbndReq func,
413 Pst *pst,
414 Buffer *mBuf
415 )
416 #else
417 PUBLIC S16 cmUnpkTfuUbndReq(func, pst, mBuf)
418 TfuUbndReq func;
419 Pst *pst;
420 Buffer *mBuf;
421 #endif
422 {
423    SpId spId;
424    Reason reason;
425    
426    TRC3(cmUnpkTfuUbndReq)
427
428    if (SUnpkS16(&spId, mBuf) != ROK) {
429       TFU_FREE_MSG(mBuf);
430 #if (ERRCLASS & ERRCLS_ADD_RES)
431       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
432          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
433          (ErrVal)ETFU014, (ErrVal)0, "Packing failed");
434 #endif
435       RETVALUE(RFAILED);
436    }
437    if (SUnpkS16(&reason, mBuf) != ROK) {
438       TFU_FREE_MSG(mBuf);
439 #if (ERRCLASS & ERRCLS_ADD_RES)
440       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
441          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
442          (ErrVal)ETFU015, (ErrVal)0, "Packing failed");
443 #endif
444       RETVALUE(RFAILED);
445    }
446    TFU_FREE_MSG(mBuf);
447    RETVALUE((*func)(pst, spId, reason));
448 }
449
450 \f
451 /***********************************************************
452 *
453 *     Func : cmPkTfuSchBndReq
454 *
455 *
456 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
457  * @param pst Pointer to the post structure.
458  * @param suId SAP ID of the service user.
459  * @param spId SAP ID of the service provider.
460  * @return ROK/RFAILED
461 *
462 *
463 *     Ret  : S16
464 *
465 *     Notes:
466 *
467 *     File  : 
468 *
469 **********************************************************/
470 #ifdef ANSI
471 PUBLIC S16 cmPkTfuSchBndReq
472 (
473 Pst * pst,
474 SuId suId,
475 SpId spId
476 )
477 #else
478 PUBLIC S16 cmPkTfuSchBndReq(pst, suId, spId)
479 Pst * pst;
480 SuId suId;
481 SpId spId;
482 #endif
483 {
484    Buffer *mBuf = NULLP;
485    TRC3(cmPkTfuSchBndReq)
486
487    if (SGetMsg(pst->region, pst->pool, &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)ETFU016, (ErrVal)0, "Packing failed");
492 #endif
493       RETVALUE(RFAILED);
494    }
495    if (SPkS16(spId, mBuf) != ROK) {
496 #if (ERRCLASS & ERRCLS_ADD_RES)
497       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
498          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
499          (ErrVal)ETFU017, (ErrVal)0, "Packing failed");
500 #endif
501       TFU_FREE_MSG(mBuf);
502       RETVALUE(RFAILED);
503    }
504    if (SPkS16(suId, mBuf) != ROK) {
505 #if (ERRCLASS & ERRCLS_ADD_RES)
506       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
507          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
508          (ErrVal)ETFU018, (ErrVal)0, "Packing failed");
509 #endif
510       TFU_FREE_MSG(mBuf);
511       RETVALUE(RFAILED);
512    }
513    pst->event = (Event) EVTTFUSCHBNDREQ;
514    RETVALUE(SPstTsk(pst,mBuf));
515 }
516
517 \f
518 /***********************************************************
519 *
520 *     Func : cmUnpkTfuSchBndReq
521 *
522 *
523 *     Desc : This API is used to send a Bind Request from Scheduler to PHY.
524  * @param pst Pointer to the post structure.
525  * @param suId SAP ID of the service user.
526  * @param spId SAP ID of the service provider.
527  * @return ROK/RFAILED
528 *
529 *
530 *     Ret  : S16
531 *
532 *     Notes:
533 *
534 *     File  : 
535 *
536 **********************************************************/
537 #ifdef ANSI
538 PUBLIC S16 cmUnpkTfuSchBndReq
539 (
540 TfuSchBndReq func,
541 Pst *pst,
542 Buffer *mBuf
543 )
544 #else
545 PUBLIC S16 cmUnpkTfuSchBndReq(func, pst, mBuf)
546 TfuSchBndReq func;
547 Pst *pst;
548 Buffer *mBuf;
549 #endif
550 {
551    SuId suId;
552    SpId spId;
553    
554    TRC3(cmUnpkTfuSchBndReq)
555
556    if (SUnpkS16(&suId, mBuf) != ROK) {
557       TFU_FREE_MSG(mBuf);
558 #if (ERRCLASS & ERRCLS_ADD_RES)
559       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
560          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
561          (ErrVal)ETFU019, (ErrVal)0, "Packing failed");
562 #endif
563       RETVALUE(RFAILED);
564    }
565    if (SUnpkS16(&spId, mBuf) != ROK) {
566       TFU_FREE_MSG(mBuf);
567 #if (ERRCLASS & ERRCLS_ADD_RES)
568       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
569          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
570          (ErrVal)ETFU020, (ErrVal)0, "Packing failed");
571 #endif
572       RETVALUE(RFAILED);
573    }
574    TFU_FREE_MSG(mBuf);
575    RETVALUE((*func)(pst, suId, spId));
576 }
577
578 \f
579 /***********************************************************
580 *
581 *     Func : cmPkTfuSchBndCfm
582 *
583 *
584 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
585  * @param pst Pointer to the post structure.
586  * @param suId SAP ID of the service user.
587  * @param status Status of the bind request.
588  * @return ROK/RFAILED
589 *
590 *
591 *     Ret  : S16
592 *
593 *     Notes:
594 *
595 *     File  : 
596 *
597 **********************************************************/
598 #ifdef ANSI
599 PUBLIC S16 cmPkTfuSchBndCfm
600 (
601 Pst * pst,
602 SuId suId,
603 U8 status
604 )
605 #else
606 PUBLIC S16 cmPkTfuSchBndCfm(pst, suId, status)
607 Pst * pst;
608 SuId suId;
609 U8 status;
610 #endif
611 {
612    Buffer *mBuf = NULLP;
613    TRC3(cmPkTfuSchBndCfm)
614
615    if (SGetMsg(pst->region, pst->pool, &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)ETFU021, (ErrVal)0, "Packing failed");
620 #endif
621       RETVALUE(RFAILED);
622    }
623    if (SPkU8(status, mBuf) != ROK) {
624 #if (ERRCLASS & ERRCLS_ADD_RES)
625       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
626          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
627          (ErrVal)ETFU022, (ErrVal)0, "Packing failed");
628 #endif
629       TFU_FREE_MSG(mBuf);
630       RETVALUE(RFAILED);
631    }
632    if (SPkS16(suId, mBuf) != ROK) {
633 #if (ERRCLASS & ERRCLS_ADD_RES)
634       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
635          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
636          (ErrVal)ETFU023, (ErrVal)0, "Packing failed");
637 #endif
638       TFU_FREE_MSG(mBuf);
639       RETVALUE(RFAILED);
640    }
641    pst->event = (Event) EVTTFUSCHBNDCFM;
642    RETVALUE(SPstTsk(pst,mBuf));
643 }
644
645 \f
646 /***********************************************************
647 *
648 *     Func : cmUnpkTfuSchBndCfm
649 *
650 *
651 *     Desc : This API is used to receive a Bind Confirm from PHY to Scheduler.
652  * @param pst Pointer to the post structure.
653  * @param suId SAP ID of the service user.
654  * @param status Status of the bind request.
655  * @return ROK/RFAILED
656 *
657 *
658 *     Ret  : S16
659 *
660 *     Notes:
661 *
662 *     File  : 
663 *
664 **********************************************************/
665 #ifdef ANSI
666 PUBLIC S16 cmUnpkTfuSchBndCfm
667 (
668 TfuSchBndCfm func,
669 Pst *pst,
670 Buffer *mBuf
671 )
672 #else
673 PUBLIC S16 cmUnpkTfuSchBndCfm(func, pst, mBuf)
674 TfuSchBndCfm func;
675 Pst *pst;
676 Buffer *mBuf;
677 #endif
678 {
679    SuId suId;
680    U8 status;
681    
682    TRC3(cmUnpkTfuSchBndCfm)
683
684    if (SUnpkS16(&suId, mBuf) != ROK) {
685       TFU_FREE_MSG(mBuf);
686 #if (ERRCLASS & ERRCLS_ADD_RES)
687       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
688          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
689          (ErrVal)ETFU024, (ErrVal)0, "Packing failed");
690 #endif
691       RETVALUE(RFAILED);
692    }
693    if (SUnpkU8(&status, mBuf) != ROK) {
694       TFU_FREE_MSG(mBuf);
695 #if (ERRCLASS & ERRCLS_ADD_RES)
696       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
697          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
698          (ErrVal)ETFU025, (ErrVal)0, "Packing failed");
699 #endif
700       RETVALUE(RFAILED);
701    }
702    TFU_FREE_MSG(mBuf);
703    RETVALUE((*func)(pst, suId, status));
704 }
705
706 \f
707 /***********************************************************
708 *
709 *     Func : cmPkTfuSchUbndReq
710 *
711 *
712 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
713  * @param pst Pointer to the post structure.
714  * @param suId SAP ID of the service provider.
715  * @param reason Reason for Unbind request.
716  * @return ROK/RFAILED
717 *
718 *
719 *     Ret  : S16
720 *
721 *     Notes:
722 *
723 *     File  : 
724 *
725 **********************************************************/
726 #ifdef ANSI
727 PUBLIC S16 cmPkTfuSchUbndReq
728 (
729 Pst * pst,
730 SpId spId,
731 Reason reason
732 )
733 #else
734 PUBLIC S16 cmPkTfuSchUbndReq(pst, spId, reason)
735 Pst * pst;
736 SpId spId;
737 Reason reason;
738 #endif
739 {
740    Buffer *mBuf = NULLP;
741    TRC3(cmPkTfuSchUbndReq)
742
743    if (SGetMsg(pst->region, pst->pool, &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)ETFU026, (ErrVal)0, "Packing failed");
748 #endif
749       RETVALUE(RFAILED);
750    }
751    if (SPkS16(reason, mBuf) != ROK) {
752 #if (ERRCLASS & ERRCLS_ADD_RES)
753       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
754          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
755          (ErrVal)ETFU027, (ErrVal)0, "Packing failed");
756 #endif
757       TFU_FREE_MSG(mBuf);
758       RETVALUE(RFAILED);
759    }
760    if (SPkS16(spId, mBuf) != ROK) {
761 #if (ERRCLASS & ERRCLS_ADD_RES)
762       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
763          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
764          (ErrVal)ETFU028, (ErrVal)0, "Packing failed");
765 #endif
766       TFU_FREE_MSG(mBuf);
767       RETVALUE(RFAILED);
768    }
769    pst->event = (Event) EVTTFUSCHUBNDREQ;
770    RETVALUE(SPstTsk(pst,mBuf));
771 }
772
773 \f
774 /***********************************************************
775 *
776 *     Func : cmUnpkTfuSchUbndReq
777 *
778 *
779 *     Desc : This API is used to send an Unbind Request from Scheduler to PHY.
780  * @param pst Pointer to the post structure.
781  * @param suId SAP ID of the service provider.
782  * @param reason Reason for Unbind request.
783  * @return ROK/RFAILED
784 *
785 *
786 *     Ret  : S16
787 *
788 *     Notes:
789 *
790 *     File  : 
791 *
792 **********************************************************/
793 #ifdef ANSI
794 PUBLIC S16 cmUnpkTfuSchUbndReq
795 (
796 TfuSchUbndReq func,
797 Pst *pst,
798 Buffer *mBuf
799 )
800 #else
801 PUBLIC S16 cmUnpkTfuSchUbndReq(func, pst, mBuf)
802 TfuSchUbndReq func;
803 Pst *pst;
804 Buffer *mBuf;
805 #endif
806 {
807    SpId spId;
808    Reason reason;
809    
810    TRC3(cmUnpkTfuSchUbndReq)
811
812    if (SUnpkS16(&spId, mBuf) != ROK) {
813       TFU_FREE_MSG(mBuf);
814 #if (ERRCLASS & ERRCLS_ADD_RES)
815       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
816          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
817          (ErrVal)ETFU029, (ErrVal)0, "Packing failed");
818 #endif
819       RETVALUE(RFAILED);
820    }
821    if (SUnpkS16(&reason, mBuf) != ROK) {
822       TFU_FREE_MSG(mBuf);
823 #if (ERRCLASS & ERRCLS_ADD_RES)
824       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
825          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
826          (ErrVal)ETFU030, (ErrVal)0, "Packing failed");
827 #endif
828       RETVALUE(RFAILED);
829    }
830    TFU_FREE_MSG(mBuf);
831    RETVALUE((*func)(pst, spId, reason));
832 }
833
834 \f
835 /***********************************************************
836 *
837 *     Func : cmPkTfuRaReqInd
838 *
839 *
840 *     Desc : This API is used to indication Random Access Request reception from
841  * PHY to Scheduler.
842  * @details This primitive is used by physical layer to indicate the reception
843  * of a Random Access Request from a set of UEs. The information passed consists
844  * of the RA-RNTI and the list of preambles received. 
845  * @param pst Pointer to the post structure.
846  * @param suId SAP ID of the service user.
847  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
848  * @return ROK/RFAILED
849 *
850 *
851 *     Ret  : S16
852 *
853 *     Notes:
854 *
855 *     File  : 
856 *
857 **********************************************************/
858 #ifdef ANSI
859 PUBLIC S16 cmPkTfuRaReqInd
860 (
861 Pst * pst,
862 SuId suId,
863 TfuRaReqIndInfo * raReqInd
864 )
865 #else
866 PUBLIC S16 cmPkTfuRaReqInd(pst, suId, raReqInd)
867 Pst * pst;
868 SuId suId;
869 TfuRaReqIndInfo * raReqInd;
870 #endif
871 {
872    Buffer *mBuf = NULLP;
873    TRC3(cmPkTfuRaReqInd)
874
875    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
876 #if (ERRCLASS & ERRCLS_ADD_RES)
877       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
878          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
879          (ErrVal)ETFU031, (ErrVal)0, "Packing failed");
880 #endif
881       TFU_FREE_MEM(raReqInd);
882       RETVALUE(RFAILED);
883    }
884    if (pst->selector == TFU_SEL_LC) {
885       if (cmPkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
886 #if (ERRCLASS & ERRCLS_ADD_RES)
887          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
888             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
889             (ErrVal)ETFU032, (ErrVal)0, "Packing failed");
890 #endif
891          TFU_FREE_MEM(raReqInd);
892          TFU_FREE_MSG(mBuf);
893          RETVALUE(RFAILED);
894       }
895    }
896    else if(pst->selector == TFU_SEL_LWLC)
897    {
898       if (cmPkPtr((PTR)raReqInd, mBuf) != ROK)
899       {
900 #if (ERRCLASS & ERRCLS_ADD_RES)
901          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
902             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
903             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
904 #endif
905          TFU_FREE_MEM(raReqInd);
906          TFU_FREE_MSG(mBuf);
907          RETVALUE(RFAILED);
908       }
909    }
910
911    if (SPkS16(suId, mBuf) != ROK) {
912 #if (ERRCLASS & ERRCLS_ADD_RES)
913       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
914          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
915          (ErrVal)ETFU033, (ErrVal)0, "Packing failed");
916 #endif
917       TFU_FREE_MEM(raReqInd);
918       TFU_FREE_MSG(mBuf);
919       RETVALUE(RFAILED);
920    }
921    if (pst->selector != TFU_SEL_LWLC) {
922       TFU_FREE_MEM(raReqInd);
923    }
924
925    pst->event = (Event) EVTTFURAREQIND;
926    RETVALUE(SPstTsk(pst,mBuf));
927 }
928
929 \f
930 /***********************************************************
931 *
932 *     Func : cmUnpkTfuRaReqInd
933 *
934 *
935 *     Desc : This API is used to indication Random Access Request reception from
936  * PHY to Scheduler.
937  * @details This primitive is used by physical layer to indicate the reception
938  * of a Random Access Request from a set of UEs. The information passed consists
939  * of the RA-RNTI and the list of preambles received. 
940  * @param pst Pointer to the post structure.
941  * @param suId SAP ID of the service user.
942  * @param raReqInd Pointer to the TfuRaReqIndInfo structure.
943  * @return ROK/RFAILED
944 *
945 *
946 *     Ret  : S16
947 *
948 *     Notes:
949 *
950 *     File  : 
951 *
952 **********************************************************/
953 #ifdef ANSI
954 PUBLIC S16 cmUnpkTfuRaReqInd
955 (
956 TfuRaReqInd func,
957 Pst *pst,
958 Buffer *mBuf
959 )
960 #else
961 PUBLIC S16 cmUnpkTfuRaReqInd(func, pst, mBuf)
962 TfuRaReqInd func;
963 Pst *pst;
964 Buffer *mBuf;
965 #endif
966 {
967    SuId suId;
968    TfuRaReqIndInfo *raReqInd;
969    
970    TRC3(cmUnpkTfuRaReqInd)
971
972    if (SUnpkS16(&suId, mBuf) != ROK) {
973       TFU_FREE_MSG(mBuf);
974 #if (ERRCLASS & ERRCLS_ADD_RES)
975       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
976          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
977          (ErrVal)ETFU034, (ErrVal)0, "Packing failed");
978 #endif
979       RETVALUE(RFAILED);
980    }
981    if (pst->selector != TFU_SEL_LWLC) {
982       Mem   sMem;
983       sMem.region = pst->region;
984       sMem.pool = pst->pool;
985       if ((cmAllocEvnt(sizeof(TfuRaReqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&raReqInd)) != ROK)            {
986 #if (ERRCLASS & ERRCLS_ADD_RES)
987          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
988             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
989             (ErrVal)ETFU035, (ErrVal)0, "Packing failed");
990 #endif
991          TFU_FREE_MSG(mBuf);
992          RETVALUE(RFAILED);
993       }
994    }
995
996
997    if (pst->selector == TFU_SEL_LC) 
998    {
999       if (cmUnpkTfuRaReqIndInfo(raReqInd, mBuf) != ROK) {
1000          TFU_FREE_MEM(raReqInd);
1001          TFU_FREE_MSG(mBuf);
1002 #if (ERRCLASS & ERRCLS_ADD_RES)
1003          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1004                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1005                (ErrVal)ETFU036, (ErrVal)0, "Packing failed");
1006 #endif
1007          RETVALUE(RFAILED);
1008       }
1009    }
1010    else if(pst->selector == TFU_SEL_LWLC)
1011    {
1012       if (cmUnpkPtr((PTR *)&raReqInd, mBuf) != ROK)
1013       {
1014 #if (ERRCLASS & ERRCLS_ADD_RES)
1015          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1016             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1017             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1018 #endif
1019          TFU_FREE_MEM(raReqInd);
1020          TFU_FREE_MSG(mBuf);
1021          RETVALUE(RFAILED);
1022       }
1023    }
1024    TFU_FREE_MSG(mBuf);
1025    RETVALUE((*func)(pst, suId, raReqInd));
1026 }
1027
1028 \f
1029 /***********************************************************
1030 *
1031 *     Func : cmPkTfuRecpReq
1032 *
1033 *
1034 *     Desc : This primitive is sent from Scheduler to PHY.
1035  * @details This primitive provides PHY with all the information required by 
1036  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1037  * -# On PUCCH UE can transmit the following
1038  *    -# SR
1039  *    -# HARQ feedback
1040  *    -# CQI report
1041  *    -# HARQ + CQI
1042  *    -# HARQ + SR
1043  * -# On PUSCH UE can transmit the following
1044  *    -# Data
1045  *    -# Data + CQI
1046  *    -# Data + HARQ Feedback
1047  * This primitive carries all the information for the expected subframe for all
1048  * the UEs that have been scheduled to transmit.
1049  * @param pst Pointer to the post structure.
1050  * @param spId SAP ID of the service provider.
1051  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1052  * @return ROK/RFAILED
1053 *
1054 *
1055 *     Ret  : S16
1056 *
1057 *     Notes:
1058 *
1059 *     File  : 
1060 *
1061 **********************************************************/
1062 #ifdef ANSI
1063 PUBLIC S16 cmPkTfuRecpReq
1064 (
1065 Pst * pst,
1066 SpId spId,
1067 TfuRecpReqInfo * recpReq
1068 )
1069 #else
1070 PUBLIC S16 cmPkTfuRecpReq(pst, spId, recpReq)
1071 Pst * pst;
1072 SpId spId;
1073 TfuRecpReqInfo * recpReq;
1074 #endif
1075 {
1076    Buffer *mBuf = NULLP;
1077    TRC3(cmPkTfuRecpReq)
1078
1079    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1080 #if (ERRCLASS & ERRCLS_ADD_RES)
1081       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1082          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1083          (ErrVal)ETFU037, (ErrVal)0, "Packing failed");
1084 #endif
1085       TFU_FREE_MEM(recpReq);
1086       RETVALUE(RFAILED);
1087    }
1088    if (pst->selector == TFU_SEL_LC) {
1089       if (cmPkTfuRecpReqInfo(recpReq, mBuf) != ROK) {
1090 #if (ERRCLASS & ERRCLS_ADD_RES)
1091          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1092             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1093             (ErrVal)ETFU038, (ErrVal)0, "Packing failed");
1094 #endif
1095          TFU_FREE_MEM(recpReq);
1096          TFU_FREE_MSG(mBuf);
1097          RETVALUE(RFAILED);
1098       }
1099    }
1100    else if(pst->selector == TFU_SEL_LWLC)
1101    {
1102       if (cmPkPtr((PTR)recpReq, mBuf) != ROK)
1103       {
1104 #if (ERRCLASS & ERRCLS_ADD_RES)
1105          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1106             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1107             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1108 #endif
1109          TFU_FREE_MEM(recpReq);
1110          TFU_FREE_MSG(mBuf);
1111          RETVALUE(RFAILED);
1112       }
1113    }
1114
1115
1116    if (SPkS16(spId, mBuf) != ROK) {
1117 #if (ERRCLASS & ERRCLS_ADD_RES)
1118       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1119          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1120          (ErrVal)ETFU039, (ErrVal)0, "Packing failed");
1121 #endif
1122       TFU_FREE_MEM(recpReq);
1123       TFU_FREE_MSG(mBuf);
1124       RETVALUE(RFAILED);
1125    }
1126    if (pst->selector != TFU_SEL_LWLC) {
1127       TFU_FREE_MEM(recpReq);
1128    }
1129
1130    pst->event = (Event) EVTTFURECPREQ;
1131    RETVALUE(SPstTsk(pst,mBuf));
1132 }
1133
1134 \f
1135 /***********************************************************
1136 *
1137 *     Func : cmUnpkTfuRecpReq
1138 *
1139 *
1140 *     Desc : This primitive is sent from Scheduler to PHY.
1141  * @details This primitive provides PHY with all the information required by 
1142  * PHY to decode transmissions from the UE on either PUCCH or PUSCH.
1143  * -# On PUCCH UE can transmit the following
1144  *    -# SR
1145  *    -# HARQ feedback
1146  *    -# CQI report
1147  *    -# HARQ + CQI
1148  *    -# HARQ + SR
1149  * -# On PUSCH UE can transmit the following
1150  *    -# Data
1151  *    -# Data + CQI
1152  *    -# Data + HARQ Feedback
1153  * This primitive carries all the information for the expected subframe for all
1154  * the UEs that have been scheduled to transmit.
1155  * @param pst Pointer to the post structure.
1156  * @param spId SAP ID of the service provider.
1157  * @param recpReq Pointer to the TfuRecpReqInfo structure.
1158  * @return ROK/RFAILED
1159 *
1160 *
1161 *     Ret  : S16
1162 *
1163 *     Notes:
1164 *
1165 *     File  : 
1166 *
1167 **********************************************************/
1168 #ifdef ANSI
1169 PUBLIC S16 cmUnpkTfuRecpReq
1170 (
1171 TfuRecpReq func,
1172 Pst *pst,
1173 Buffer *mBuf
1174 )
1175 #else
1176 PUBLIC S16 cmUnpkTfuRecpReq(func, pst, mBuf)
1177 TfuRecpReq func;
1178 Pst *pst;
1179 Buffer *mBuf;
1180 #endif
1181 {
1182    SpId spId;
1183    TfuRecpReqInfo *recpReq;
1184    
1185    TRC3(cmUnpkTfuRecpReq)
1186
1187    if (SUnpkS16(&spId, mBuf) != ROK) {
1188       TFU_FREE_MSG(mBuf);
1189 #if (ERRCLASS & ERRCLS_ADD_RES)
1190       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1191          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1192          (ErrVal)ETFU040, (ErrVal)0, "Packing failed");
1193 #endif
1194       RETVALUE(RFAILED);
1195    }
1196    if (pst->selector != TFU_SEL_LWLC) {
1197       Mem   sMem;
1198       sMem.region = pst->region;
1199       sMem.pool = pst->pool;
1200       if ((cmAllocEvnt(sizeof(TfuRecpReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&recpReq)) != ROK)            {
1201 #if (ERRCLASS & ERRCLS_ADD_RES)
1202          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1203             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1204             (ErrVal)ETFU041, (ErrVal)0, "Packing failed");
1205 #endif
1206          TFU_FREE_MSG(mBuf);
1207          RETVALUE(RFAILED);
1208       }
1209    }
1210    else if(pst->selector == TFU_SEL_LWLC)
1211    {
1212       if (cmUnpkPtr((PTR *)&recpReq, mBuf) != ROK)
1213       {
1214 #if (ERRCLASS & ERRCLS_ADD_RES)
1215          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1216             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1217             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1218 #endif
1219          TFU_FREE_MEM(recpReq);
1220          TFU_FREE_MSG(mBuf);
1221          RETVALUE(RFAILED);
1222       }
1223    }
1224
1225    if (pst->selector == TFU_SEL_LC) 
1226    {
1227       if (cmUnpkTfuRecpReqInfo(recpReq, (Ptr)&recpReq->memCp, mBuf) != ROK) {
1228          TFU_FREE_MEM(recpReq);
1229          TFU_FREE_MSG(mBuf);
1230 #if (ERRCLASS & ERRCLS_ADD_RES)
1231          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1232                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1233                (ErrVal)ETFU042, (ErrVal)0, "Packing failed");
1234 #endif
1235          RETVALUE(RFAILED);
1236       }
1237    }
1238    else if(pst->selector == TFU_SEL_LWLC)
1239    {
1240       if (cmUnpkPtr((PTR*)&recpReq, mBuf) != ROK)
1241       {
1242 #if (ERRCLASS & ERRCLS_ADD_RES)
1243          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1244             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1245             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1246 #endif
1247          TFU_FREE_MEM(recpReq);
1248          TFU_FREE_MSG(mBuf);
1249          RETVALUE(RFAILED);
1250       }
1251    }
1252
1253    TFU_FREE_MSG(mBuf);
1254    RETVALUE((*func)(pst, spId, recpReq));
1255 }
1256
1257 \f
1258 /***********************************************************
1259 *
1260 *     Func : cmPkTfuUlCqiInd
1261 *
1262 *
1263 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1264  * @details This primitive carries an estimate of the uplink Channel quality
1265  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1266  * quality i.e. the transmission from UE as calculated at the Physical layer at
1267  * the eNodeB. 
1268  * It carries a list of subband CQIs for each UE. 
1269  * @param pst Pointer to the post structure.
1270  * @param suId SAP ID of the service user.
1271  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1272  * @return ROK/RFAILED
1273 *
1274 *
1275 *     Ret  : S16
1276 *
1277 *     Notes:
1278 *
1279 *     File  : 
1280 *
1281 **********************************************************/
1282 #ifdef ANSI
1283 PUBLIC S16 cmPkTfuUlCqiInd
1284 (
1285 Pst * pst,
1286 SuId suId,
1287 TfuUlCqiIndInfo * ulCqiInd
1288 )
1289 #else
1290 PUBLIC S16 cmPkTfuUlCqiInd(pst, suId, ulCqiInd)
1291 Pst * pst;
1292 SuId suId;
1293 TfuUlCqiIndInfo * ulCqiInd;
1294 #endif
1295 {
1296    Buffer *mBuf = NULLP;
1297    TRC3(cmPkTfuUlCqiInd)
1298
1299    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1300 #if (ERRCLASS & ERRCLS_ADD_RES)
1301       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1302          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1303          (ErrVal)ETFU043, (ErrVal)0, "Packing failed");
1304 #endif
1305       TFU_FREE_MEM(ulCqiInd);
1306       RETVALUE(RFAILED);
1307    }
1308    if (pst->selector == TFU_SEL_LC) {
1309       if (cmPkTfuUlCqiIndInfo(ulCqiInd, mBuf) != ROK) {
1310 #if (ERRCLASS & ERRCLS_ADD_RES)
1311          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1312             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1313             (ErrVal)ETFU044, (ErrVal)0, "Packing failed");
1314 #endif
1315          TFU_FREE_MEM(ulCqiInd);
1316          TFU_FREE_MSG(mBuf);
1317          RETVALUE(RFAILED);
1318       }
1319    }
1320    else if(pst->selector == TFU_SEL_LWLC)
1321    {
1322       if (cmPkPtr((PTR)ulCqiInd, mBuf) != ROK)
1323       {
1324 #if (ERRCLASS & ERRCLS_ADD_RES)
1325          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1326             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1327             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1328 #endif
1329          TFU_FREE_MEM(ulCqiInd);
1330          TFU_FREE_MSG(mBuf);
1331          RETVALUE(RFAILED);
1332       }
1333    }
1334
1335    if (SPkS16(suId, mBuf) != ROK) {
1336 #if (ERRCLASS & ERRCLS_ADD_RES)
1337       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1338          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1339          (ErrVal)ETFU045, (ErrVal)0, "Packing failed");
1340 #endif
1341       TFU_FREE_MEM(ulCqiInd);
1342       TFU_FREE_MSG(mBuf);
1343       RETVALUE(RFAILED);
1344    }
1345    if (pst->selector != TFU_SEL_LWLC) {
1346       TFU_FREE_MEM(ulCqiInd);
1347    }
1348
1349    pst->event = (Event) EVTTFUULCQIIND;
1350    RETVALUE(SPstTsk(pst,mBuf));
1351 }
1352
1353 \f
1354 /***********************************************************
1355 *
1356 *     Func : cmUnpkTfuUlCqiInd
1357 *
1358 *
1359 *     Desc : This API is used to indicate CQI reporting from PHY to Scheduler
1360  * @details This primitive carries an estimate of the uplink Channel quality
1361  * index (CQI) for a list of UEs. This is an extimate of the uplink channel
1362  * quality i.e. the transmission from UE as calculated at the Physical layer at
1363  * the eNodeB. 
1364  * It carries a list of subband CQIs for each UE. 
1365  * @param pst Pointer to the post structure.
1366  * @param suId SAP ID of the service user.
1367  * @param ulCqiInd Pointer to the TfuUlCqiIndInfo structure.
1368  * @return ROK/RFAILED
1369 *
1370 *
1371 *     Ret  : S16
1372 *
1373 *     Notes:
1374 *
1375 *     File  : 
1376 *
1377 **********************************************************/
1378 #ifdef ANSI
1379 PUBLIC S16 cmUnpkTfuUlCqiInd
1380 (
1381 TfuUlCqiInd func,
1382 Pst *pst,
1383 Buffer *mBuf
1384 )
1385 #else
1386 PUBLIC S16 cmUnpkTfuUlCqiInd(func, pst, mBuf)
1387 TfuUlCqiInd func;
1388 Pst *pst;
1389 Buffer *mBuf;
1390 #endif
1391 {
1392    SuId suId;
1393    TfuUlCqiIndInfo *ulCqiInd;
1394    
1395    TRC3(cmUnpkTfuUlCqiInd)
1396
1397    if (SUnpkS16(&suId, mBuf) != ROK) {
1398       TFU_FREE_MSG(mBuf);
1399 #if (ERRCLASS & ERRCLS_ADD_RES)
1400       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1401          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1402          (ErrVal)ETFU046, (ErrVal)0, "Packing failed");
1403 #endif
1404       RETVALUE(RFAILED);
1405    }
1406    if (pst->selector != TFU_SEL_LWLC) {
1407       Mem   sMem;
1408       sMem.region = pst->region;
1409       sMem.pool = pst->pool;
1410       if ((cmAllocEvnt(sizeof(TfuUlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&ulCqiInd)) != ROK)            {
1411 #if (ERRCLASS & ERRCLS_ADD_RES)
1412          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1413             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1414             (ErrVal)ETFU047, (ErrVal)0, "Packing failed");
1415 #endif
1416          TFU_FREE_MSG(mBuf);
1417          RETVALUE(RFAILED);
1418       }
1419    }
1420
1421
1422    if (pst->selector == TFU_SEL_LC) 
1423    {
1424       if (cmUnpkTfuUlCqiIndInfo(ulCqiInd, (Ptr)&ulCqiInd->memCp, mBuf) != ROK) {
1425          TFU_FREE_MEM(ulCqiInd);
1426          TFU_FREE_MSG(mBuf);
1427 #if (ERRCLASS & ERRCLS_ADD_RES)
1428          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1429                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1430                (ErrVal)ETFU048, (ErrVal)0, "Packing failed");
1431 #endif
1432          RETVALUE(RFAILED);
1433       }
1434    }
1435    else if(pst->selector == TFU_SEL_LWLC)
1436    {
1437       if (cmUnpkPtr((PTR *)&ulCqiInd, mBuf) != ROK)
1438       {
1439 #if (ERRCLASS & ERRCLS_ADD_RES)
1440          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1441             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1442             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1443 #endif
1444          TFU_FREE_MEM(ulCqiInd);
1445          TFU_FREE_MSG(mBuf);
1446          RETVALUE(RFAILED);
1447       }
1448    }
1449    TFU_FREE_MSG(mBuf);
1450    RETVALUE((*func)(pst, suId, ulCqiInd));
1451 }
1452
1453 \f
1454 /***********************************************************
1455 *
1456 *     Func : cmPkTfuHqInd
1457 *
1458 *
1459 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1460  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1461  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1462  * sent. This feedback is utilized by MAC for further scheduling, for instance
1463  * it could schedule an adaptive retransmission of the same data. 
1464  * @param pst 
1465  * @param spId
1466  * @param tfuHqInd pointer to TfuHqIndInfo
1467  * @return
1468 *
1469 *
1470 *     Ret  : S16
1471 *
1472 *     Notes:
1473 *
1474 *     File  : 
1475 *
1476 **********************************************************/
1477 #ifdef ANSI
1478 PUBLIC S16 cmPkTfuHqInd
1479 (
1480 Pst * pst,
1481 SpId spId,
1482 TfuHqIndInfo * hqInd
1483 )
1484 #else
1485 PUBLIC S16 cmPkTfuHqInd(pst, spId, hqInd)
1486 Pst * pst;
1487 SpId spId;
1488 TfuHqIndInfo * hqInd;
1489 #endif
1490 {
1491    Buffer *mBuf = NULLP;
1492    TRC3(cmPkTfuHqInd)
1493
1494    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1495 #if (ERRCLASS & ERRCLS_ADD_RES)
1496       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1497          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1498          (ErrVal)ETFU049, (ErrVal)0, "Packing failed");
1499 #endif
1500       TFU_FREE_MEM(hqInd);
1501       RETVALUE(RFAILED);
1502    }
1503    if (pst->selector == TFU_SEL_LC) {
1504       if (cmPkTfuHqIndInfo(hqInd, mBuf) != ROK) {
1505 #if (ERRCLASS & ERRCLS_ADD_RES)
1506          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1507             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1508             (ErrVal)ETFU050, (ErrVal)0, "Packing failed");
1509 #endif
1510          TFU_FREE_MEM(hqInd);
1511          TFU_FREE_MSG(mBuf);
1512          RETVALUE(RFAILED);
1513       }
1514    }
1515    else if(pst->selector == TFU_SEL_LWLC)
1516    {
1517       if (cmPkPtr((PTR)hqInd, mBuf) != ROK)
1518       {
1519 #if (ERRCLASS & ERRCLS_ADD_RES)
1520          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1521             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1522             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1523 #endif
1524          TFU_FREE_MEM(hqInd);
1525          TFU_FREE_MSG(mBuf);
1526          RETVALUE(RFAILED);
1527       }
1528    }
1529
1530    if (SPkS16(spId, mBuf) != ROK) {
1531 #if (ERRCLASS & ERRCLS_ADD_RES)
1532       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1533          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1534          (ErrVal)ETFU051, (ErrVal)0, "Packing failed");
1535 #endif
1536       TFU_FREE_MEM(hqInd);
1537       TFU_FREE_MSG(mBuf);
1538       RETVALUE(RFAILED);
1539    }
1540    if (pst->selector != TFU_SEL_LWLC) {
1541       TFU_FREE_MEM(hqInd);
1542    }
1543
1544    pst->event = (Event) EVTTFUHQIND;
1545    RETVALUE(SPstTsk(pst,mBuf));
1546 }
1547
1548 \f
1549 /***********************************************************
1550 *
1551 *     Func : cmUnpkTfuHqInd
1552 *
1553 *
1554 *     Desc : This Primitive carries the HARQ Feedback from PHY to scheduler
1555  * @details HARQ feedback is sent by the UE to the eNodeB, an ACK is sent if UE
1556  * could successfully recieve the data transmitted by the eNodeB, else a NACK is
1557  * sent. This feedback is utilized by MAC for further scheduling, for instance
1558  * it could schedule an adaptive retransmission of the same data. 
1559  * @param pst 
1560  * @param spId
1561  * @param tfuHqInd pointer to TfuHqIndInfo
1562  * @return
1563 *
1564 *
1565 *     Ret  : S16
1566 *
1567 *     Notes:
1568 *
1569 *     File  : 
1570 *
1571 **********************************************************/
1572 #ifdef ANSI
1573 PUBLIC S16 cmUnpkTfuHqInd
1574 (
1575 TfuHqInd func,
1576 Pst *pst,
1577 Buffer *mBuf
1578 )
1579 #else
1580 PUBLIC S16 cmUnpkTfuHqInd(func, pst, mBuf)
1581 TfuHqInd func;
1582 Pst *pst;
1583 Buffer *mBuf;
1584 #endif
1585 {
1586    SpId spId;
1587    TfuHqIndInfo *hqInd;
1588    
1589    TRC3(cmUnpkTfuHqInd)
1590
1591    if (SUnpkS16(&spId, mBuf) != ROK) {
1592       TFU_FREE_MSG(mBuf);
1593 #if (ERRCLASS & ERRCLS_ADD_RES)
1594       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1595          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1596          (ErrVal)ETFU052, (ErrVal)0, "Packing failed");
1597 #endif
1598       RETVALUE(RFAILED);
1599    }
1600    if (pst->selector != TFU_SEL_LWLC) {
1601       Mem   sMem;
1602       sMem.region = pst->region;
1603       sMem.pool = pst->pool;
1604       if ((cmAllocEvnt(sizeof(TfuHqIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&hqInd)) != ROK)            {
1605 #if (ERRCLASS & ERRCLS_ADD_RES)
1606          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1607             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1608             (ErrVal)ETFU053, (ErrVal)0, "Packing failed");
1609 #endif
1610          TFU_FREE_MSG(mBuf);
1611          RETVALUE(RFAILED);
1612       }
1613    }
1614
1615
1616    if (pst->selector == TFU_SEL_LC) 
1617    {
1618       if (cmUnpkTfuHqIndInfo(hqInd, (Ptr)&hqInd->memCp, mBuf) != ROK) {
1619          TFU_FREE_MEM(hqInd);
1620          TFU_FREE_MSG(mBuf);
1621 #if (ERRCLASS & ERRCLS_ADD_RES)
1622          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1623                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1624                (ErrVal)ETFU054, (ErrVal)0, "Packing failed");
1625 #endif
1626          RETVALUE(RFAILED);
1627       }
1628    }
1629    else if(pst->selector == TFU_SEL_LWLC)
1630    {
1631       if (cmUnpkPtr((PTR *)&hqInd, mBuf) != ROK)
1632       {
1633 #if (ERRCLASS & ERRCLS_ADD_RES)
1634          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1635             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1636             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1637 #endif
1638          TFU_FREE_MEM(hqInd);
1639          TFU_FREE_MSG(mBuf);
1640          RETVALUE(RFAILED);
1641       }
1642    }
1643    TFU_FREE_MSG(mBuf);
1644    RETVALUE((*func)(pst, spId, hqInd));
1645 }
1646
1647 \f
1648 /***********************************************************
1649 *
1650 *     Func : cmPkTfuSrInd
1651 *
1652 *
1653 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1654  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1655  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1656  * UEs received in the indicated subframe. 
1657  * @param pst 
1658  * @param spId
1659  * @param tfqSrInd pointer to TfuSrIndInfo
1660  * @return
1661 *
1662 *
1663 *     Ret  : S16
1664 *
1665 *     Notes:
1666 *
1667 *     File  : 
1668 *
1669 **********************************************************/
1670 #ifdef ANSI
1671 PUBLIC S16 cmPkTfuSrInd
1672 (
1673 Pst * pst,
1674 SpId spId,
1675 TfuSrIndInfo * srInd
1676 )
1677 #else
1678 PUBLIC S16 cmPkTfuSrInd(pst, spId, srInd)
1679 Pst * pst;
1680 SpId spId;
1681 TfuSrIndInfo * srInd;
1682 #endif
1683 {
1684    Buffer *mBuf = NULLP;
1685    TRC3(cmPkTfuSrInd)
1686
1687    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1688 #if (ERRCLASS & ERRCLS_ADD_RES)
1689       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1690          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1691          (ErrVal)ETFU055, (ErrVal)0, "Packing failed");
1692 #endif
1693       TFU_FREE_MEM(srInd);
1694       RETVALUE(RFAILED);
1695    }
1696    if (pst->selector == TFU_SEL_LC) {
1697       if (cmPkTfuSrIndInfo(srInd, mBuf) != ROK) {
1698 #if (ERRCLASS & ERRCLS_ADD_RES)
1699          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1700             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1701             (ErrVal)ETFU056, (ErrVal)0, "Packing failed");
1702 #endif
1703          TFU_FREE_MEM(srInd);
1704          TFU_FREE_MSG(mBuf);
1705          RETVALUE(RFAILED);
1706       }
1707    }
1708    else if(pst->selector == TFU_SEL_LWLC)
1709    {
1710       if (cmPkPtr((PTR)srInd, mBuf) != ROK)
1711       {
1712 #if (ERRCLASS & ERRCLS_ADD_RES)
1713          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1714             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1715             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1716 #endif
1717          TFU_FREE_MEM(srInd);
1718          TFU_FREE_MSG(mBuf);
1719          RETVALUE(RFAILED);
1720       }
1721    }
1722
1723    if (SPkS16(spId, mBuf) != ROK) {
1724 #if (ERRCLASS & ERRCLS_ADD_RES)
1725       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1726          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1727          (ErrVal)ETFU057, (ErrVal)0, "Packing failed");
1728 #endif
1729       TFU_FREE_MEM(srInd);
1730       TFU_FREE_MSG(mBuf);
1731       RETVALUE(RFAILED);
1732    }
1733    if (pst->selector != TFU_SEL_LWLC) {
1734       TFU_FREE_MEM(srInd);
1735    }
1736
1737    pst->event = (Event) EVTTFUSRIND;
1738    RETVALUE(SPstTsk(pst,mBuf));
1739 }
1740
1741 \f
1742 /***********************************************************
1743 *
1744 *     Func : cmUnpkTfuSrInd
1745 *
1746 *
1747 *     Desc : This Primitive carries the SR Indication from PHY to scheduler. 
1748  * @details Scheduling Request (SR) is sent by the UE to the eNodeB to request
1749  * for Uplink (UL) grant. This primitive carries a list of SRs for a number of
1750  * UEs received in the indicated subframe. 
1751  * @param pst 
1752  * @param spId
1753  * @param tfqSrInd pointer to TfuSrIndInfo
1754  * @return
1755 *
1756 *
1757 *     Ret  : S16
1758 *
1759 *     Notes:
1760 *
1761 *     File  : 
1762 *
1763 **********************************************************/
1764 #ifdef ANSI
1765 PUBLIC S16 cmUnpkTfuSrInd
1766 (
1767 TfuSrInd func,
1768 Pst *pst,
1769 Buffer *mBuf
1770 )
1771 #else
1772 PUBLIC S16 cmUnpkTfuSrInd(func, pst, mBuf)
1773 TfuSrInd func;
1774 Pst *pst;
1775 Buffer *mBuf;
1776 #endif
1777 {
1778    SpId spId;
1779    TfuSrIndInfo *srInd;
1780    
1781    TRC3(cmUnpkTfuSrInd)
1782
1783    if (SUnpkS16(&spId, mBuf) != ROK) {
1784       TFU_FREE_MSG(mBuf);
1785 #if (ERRCLASS & ERRCLS_ADD_RES)
1786       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1787          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1788          (ErrVal)ETFU058, (ErrVal)0, "Packing failed");
1789 #endif
1790       RETVALUE(RFAILED);
1791    }
1792    if (pst->selector != TFU_SEL_LWLC) {
1793       Mem   sMem;
1794       sMem.region = pst->region;
1795       sMem.pool = pst->pool;
1796       if ((cmAllocEvnt(sizeof(TfuSrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srInd)) != ROK)            {
1797 #if (ERRCLASS & ERRCLS_ADD_RES)
1798          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1799             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1800             (ErrVal)ETFU059, (ErrVal)0, "Packing failed");
1801 #endif
1802          TFU_FREE_MSG(mBuf);
1803          RETVALUE(RFAILED);
1804       }
1805    }
1806
1807
1808    if (pst->selector == TFU_SEL_LC) 
1809    {
1810       if (cmUnpkTfuSrIndInfo(srInd, (Ptr)&srInd->memCp, mBuf) != ROK) {
1811          TFU_FREE_MEM(srInd);
1812          TFU_FREE_MSG(mBuf);
1813 #if (ERRCLASS & ERRCLS_ADD_RES)
1814          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1815                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1816                (ErrVal)ETFU060, (ErrVal)0, "Packing failed");
1817 #endif
1818          RETVALUE(RFAILED);
1819       }
1820    }
1821    else if(pst->selector == TFU_SEL_LWLC)
1822    {
1823       if (cmUnpkPtr((PTR *)&srInd, mBuf) != ROK)
1824       {
1825 #if (ERRCLASS & ERRCLS_ADD_RES)
1826          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1827             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1828             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
1829 #endif
1830          TFU_FREE_MEM(srInd);
1831          TFU_FREE_MSG(mBuf);
1832          RETVALUE(RFAILED);
1833       }
1834    }
1835    TFU_FREE_MSG(mBuf);
1836    RETVALUE((*func)(pst, spId, srInd));
1837 }
1838
1839 \f
1840 /***********************************************************
1841 *
1842 *     Func : cmPkTfuDlCqiInd
1843 *
1844 *
1845 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1846  * Scheduler, also carries the RI.
1847  * @param pst Pointer to the post structure.
1848  * @param suId SAP ID of the service user.
1849  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1850  * @return ROK/RFAILED
1851 *
1852 *
1853 *     Ret  : S16
1854 *
1855 *     Notes:
1856 *
1857 *     File  : 
1858 *
1859 **********************************************************/
1860 #ifdef ANSI
1861 PUBLIC S16 cmPkTfuDlCqiInd
1862 (
1863 Pst * pst,
1864 SuId suId,
1865 TfuDlCqiIndInfo * dlCqiInd
1866 )
1867 #else
1868 PUBLIC S16 cmPkTfuDlCqiInd(pst, suId, dlCqiInd)
1869 Pst * pst;
1870 SuId suId;
1871 TfuDlCqiIndInfo * dlCqiInd;
1872 #endif
1873 {
1874    Buffer *mBuf = NULLP;
1875    TRC3(cmPkTfuDlCqiInd)
1876
1877    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
1878 #if (ERRCLASS & ERRCLS_ADD_RES)
1879       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1880          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1881          (ErrVal)ETFU061, (ErrVal)0, "Packing failed");
1882 #endif
1883       TFU_FREE_MEM(dlCqiInd);
1884       RETVALUE(RFAILED);
1885    }
1886    if (pst->selector == TFU_SEL_LC) {
1887       if (cmPkTfuDlCqiIndInfo(dlCqiInd, mBuf) != ROK) {
1888 #if (ERRCLASS & ERRCLS_ADD_RES)
1889          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1890             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1891             (ErrVal)ETFU062, (ErrVal)0, "Packing failed");
1892 #endif
1893          TFU_FREE_MEM(dlCqiInd);
1894          TFU_FREE_MSG(mBuf);
1895          RETVALUE(RFAILED);
1896       }
1897    }
1898    else if(pst->selector == TFU_SEL_LWLC)
1899    {
1900       if (cmPkPtr((PTR)dlCqiInd, mBuf) != ROK)
1901       {
1902 #if (ERRCLASS & ERRCLS_ADD_RES)
1903          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1904             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1905             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
1906 #endif
1907          TFU_FREE_MEM(dlCqiInd);
1908          TFU_FREE_MSG(mBuf);
1909          RETVALUE(RFAILED);
1910       }
1911    }
1912
1913    if (SPkS16(suId, mBuf) != ROK) {
1914 #if (ERRCLASS & ERRCLS_ADD_RES)
1915       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1916          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1917          (ErrVal)ETFU063, (ErrVal)0, "Packing failed");
1918 #endif
1919       TFU_FREE_MEM(dlCqiInd);
1920       TFU_FREE_MSG(mBuf);
1921       RETVALUE(RFAILED);
1922    }
1923    if (pst->selector != TFU_SEL_LWLC) {
1924       TFU_FREE_MEM(dlCqiInd);
1925    }
1926    pst->event = (Event) EVTTFUDLCQIIND;
1927    RETVALUE(SPstTsk(pst,mBuf));
1928 }
1929
1930 \f
1931 /***********************************************************
1932 *
1933 *     Func : cmUnpkTfuDlCqiInd
1934 *
1935 *
1936 *     Desc : This API is used to indicate the reception of CQI report from PHY to
1937  * Scheduler, also carries the RI.
1938  * @param pst Pointer to the post structure.
1939  * @param suId SAP ID of the service user.
1940  * @param dlCqiInd Pointer to the TfuDlCqiIndInfo structure.
1941  * @return ROK/RFAILED
1942 *
1943 *
1944 *     Ret  : S16
1945 *
1946 *     Notes:
1947 *
1948 *     File  : 
1949 *
1950 **********************************************************/
1951 #ifdef ANSI
1952 PUBLIC S16 cmUnpkTfuDlCqiInd
1953 (
1954 TfuDlCqiInd func,
1955 Pst *pst,
1956 Buffer *mBuf
1957 )
1958 #else
1959 PUBLIC S16 cmUnpkTfuDlCqiInd(func, pst, mBuf)
1960 TfuDlCqiInd func;
1961 Pst *pst;
1962 Buffer *mBuf;
1963 #endif
1964 {
1965    SuId suId;
1966    TfuDlCqiIndInfo *dlCqiInd;
1967    
1968    TRC3(cmUnpkTfuDlCqiInd)
1969
1970    if (SUnpkS16(&suId, mBuf) != ROK) {
1971       TFU_FREE_MSG(mBuf);
1972 #if (ERRCLASS & ERRCLS_ADD_RES)
1973       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1974          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1975          (ErrVal)ETFU064, (ErrVal)0, "Packing failed");
1976 #endif
1977       RETVALUE(RFAILED);
1978    }
1979    if (pst->selector != TFU_SEL_LWLC) {
1980       Mem   sMem;
1981       sMem.region = pst->region;
1982       sMem.pool = pst->pool;
1983       if ((cmAllocEvnt(sizeof(TfuDlCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&dlCqiInd)) != ROK)            {
1984 #if (ERRCLASS & ERRCLS_ADD_RES)
1985          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
1986             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
1987             (ErrVal)ETFU065, (ErrVal)0, "Packing failed");
1988 #endif
1989          TFU_FREE_MSG(mBuf);
1990          RETVALUE(RFAILED);
1991       }
1992    }
1993
1994
1995    if (pst->selector == TFU_SEL_LC) 
1996    {
1997       if (cmUnpkTfuDlCqiIndInfo(dlCqiInd, (Ptr)&dlCqiInd->memCp, mBuf) != ROK) {
1998          TFU_FREE_MEM(dlCqiInd);
1999          TFU_FREE_MSG(mBuf);
2000 #if (ERRCLASS & ERRCLS_ADD_RES)
2001          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2002                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2003                (ErrVal)ETFU066, (ErrVal)0, "Packing failed");
2004 #endif
2005          RETVALUE(RFAILED);
2006       }
2007    }
2008    else if(pst->selector == TFU_SEL_LWLC)
2009    {
2010       if (cmUnpkPtr((PTR *)&dlCqiInd, mBuf) != ROK)
2011       {
2012 #if (ERRCLASS & ERRCLS_ADD_RES)
2013          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2014             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2015             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2016 #endif
2017          TFU_FREE_MEM(dlCqiInd);
2018          TFU_FREE_MSG(mBuf);
2019          RETVALUE(RFAILED);
2020       }
2021    }
2022    TFU_FREE_MSG(mBuf);
2023    RETVALUE((*func)(pst, suId, dlCqiInd));
2024 }
2025
2026
2027 #ifdef TFU_UPGRADE
2028
2029 \f
2030 /***********************************************************
2031 *
2032 *     Func : cmPkTfuRawCqiInd
2033 *
2034 *
2035 *     Desc : This Primitive is used to convey the Raw CQI information 
2036  * transmitted by the UE.
2037  * @details Raw CQI report is the actual bits transmitted by the UE when
2038  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2039  * etc. shall be done by MAC.
2040  * 
2041  * @param pst Pointer to the post structure.
2042  * @param suId SAP ID of the service user.
2043  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2044  * @return ROK/RFAILED
2045 *
2046 *
2047 *     Ret  : S16
2048 *
2049 *     Notes:
2050 *
2051 *     File  : 
2052 *
2053 **********************************************************/
2054 #ifdef ANSI
2055 PUBLIC S16 cmPkTfuRawCqiInd
2056 (
2057 Pst * pst,
2058 SuId suId,
2059 TfuRawCqiIndInfo * rawCqiInd
2060 )
2061 #else
2062 PUBLIC S16 cmPkTfuRawCqiInd(pst, suId, rawCqiInd)
2063 Pst * pst;
2064 SuId suId;
2065 TfuRawCqiIndInfo * rawCqiInd;
2066 #endif
2067 {
2068    Buffer *mBuf = NULLP;
2069    TRC3(cmPkTfuRawCqiInd)
2070
2071    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2072 #if (ERRCLASS & ERRCLS_ADD_RES)
2073       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2074          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2075          (ErrVal)ETFU067, (ErrVal)0, "Packing failed");
2076 #endif
2077       TFU_FREE_MEM(rawCqiInd);
2078       RETVALUE(RFAILED);
2079    }
2080       cmPkTfuRawCqiIndInfo(rawCqiInd, mBuf);
2081    if (SPkS16(suId, mBuf) != ROK) {
2082 #if (ERRCLASS & ERRCLS_ADD_RES)
2083       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2084          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2085          (ErrVal)ETFU068, (ErrVal)0, "Packing failed");
2086 #endif
2087       TFU_FREE_MEM(rawCqiInd);
2088       TFU_FREE_MSG(mBuf);
2089       RETVALUE(RFAILED);
2090    }
2091    TFU_FREE_MEM(rawCqiInd);
2092    pst->event = (Event) EVTTFURAWCQIIND;
2093    RETVALUE(SPstTsk(pst,mBuf));
2094 }
2095
2096 \f
2097 /***********************************************************
2098 *
2099 *     Func : cmUnpkTfuRawCqiInd
2100 *
2101 *
2102 *     Desc : This Primitive is used to convey the Raw CQI information 
2103  * transmitted by the UE.
2104  * @details Raw CQI report is the actual bits transmitted by the UE when
2105  * reporting CQI/PMI/RI. The interpretation of these bits to CQI/subband CQI
2106  * etc. shall be done by MAC.
2107  * 
2108  * @param pst Pointer to the post structure.
2109  * @param suId SAP ID of the service user.
2110  * @param  cqiInd Pointer to the TfuRawCqiIndInfo structure.
2111  * @return ROK/RFAILED
2112 *
2113 *
2114 *     Ret  : S16
2115 *
2116 *     Notes:
2117 *
2118 *     File  : 
2119 *
2120 **********************************************************/
2121 #ifdef ANSI
2122 PUBLIC S16 cmUnpkTfuRawCqiInd
2123 (
2124 TfuRawCqiInd func,
2125 Pst *pst,
2126 Buffer *mBuf
2127 )
2128 #else
2129 PUBLIC S16 cmUnpkTfuRawCqiInd(func, pst, mBuf)
2130 TfuRawCqiInd func;
2131 Pst *pst;
2132 Buffer *mBuf;
2133 #endif
2134 {
2135    SuId suId;
2136    TfuRawCqiIndInfo *rawCqiInd;
2137    
2138    TRC3(cmUnpkTfuRawCqiInd)
2139
2140    if (SUnpkS16(&suId, mBuf) != ROK) {
2141       TFU_FREE_MSG(mBuf);
2142 #if (ERRCLASS & ERRCLS_ADD_RES)
2143       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2144          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2145          (ErrVal)ETFU069, (ErrVal)0, "Packing failed");
2146 #endif
2147       RETVALUE(RFAILED);
2148    }
2149    {
2150       Mem   sMem;
2151       sMem.region = pst->region;
2152       sMem.pool = pst->pool;
2153       if ((cmAllocEvnt(sizeof(TfuRawCqiIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&rawCqiInd)) != ROK)            {
2154 #if (ERRCLASS & ERRCLS_ADD_RES)
2155          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2156             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2157             (ErrVal)ETFU070, (ErrVal)0, "Packing failed");
2158 #endif
2159          TFU_FREE_MSG(mBuf);
2160          RETVALUE(RFAILED);
2161       }
2162    }
2163       cmUnpkTfuRawCqiIndInfo(rawCqiInd, (Ptr)&rawCqiInd->memCp, mBuf);
2164    TFU_FREE_MSG(mBuf);
2165    RETVALUE((*func)(pst, suId, rawCqiInd));
2166 }
2167
2168 \f
2169 /***********************************************************
2170 *
2171 *     Func : cmPkTfuSrsInd
2172 *
2173 *
2174 *     Desc : This Primitive is used to convey the information derived by the
2175  * physical layer from the SRS transmission from the UE.
2176  * @details This primitive carries information derived from the SRS transmission
2177  * from the UE. 
2178  * 
2179  * @param pst Pointer to the post structure.
2180  * @param suId SAP ID of the service user.
2181  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2182  * @return ROK/RFAILED
2183 *
2184 *
2185 *     Ret  : S16
2186 *
2187 *     Notes:
2188 *
2189 *     File  : 
2190 *
2191 **********************************************************/
2192 #ifdef ANSI
2193 PUBLIC S16 cmPkTfuSrsInd
2194 (
2195 Pst * pst,
2196 SuId suId,
2197 TfuSrsIndInfo * srsInd
2198 )
2199 #else
2200 PUBLIC S16 cmPkTfuSrsInd(pst, suId, srsInd)
2201 Pst * pst;
2202 SuId suId;
2203 TfuSrsIndInfo * srsInd;
2204 #endif
2205 {
2206    Buffer *mBuf = NULLP;
2207    TRC3(cmPkTfuSrsInd)
2208
2209    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2210 #if (ERRCLASS & ERRCLS_ADD_RES)
2211       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2212          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2213          (ErrVal)ETFU071, (ErrVal)0, "Packing failed");
2214 #endif
2215       TFU_FREE_MEM(srsInd);
2216       RETVALUE(RFAILED);
2217    }
2218       cmPkTfuSrsIndInfo(srsInd, mBuf);
2219    if (SPkS16(suId, mBuf) != ROK) {
2220 #if (ERRCLASS & ERRCLS_ADD_RES)
2221       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2222          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2223          (ErrVal)ETFU072, (ErrVal)0, "Packing failed");
2224 #endif
2225       TFU_FREE_MEM(srsInd);
2226       TFU_FREE_MSG(mBuf);
2227       RETVALUE(RFAILED);
2228    }
2229    TFU_FREE_MEM(srsInd);
2230    pst->event = (Event) EVTTFUSRSIND;
2231    RETVALUE(SPstTsk(pst,mBuf));
2232 }
2233
2234 \f
2235 /***********************************************************
2236 *
2237 *     Func : cmUnpkTfuSrsInd
2238 *
2239 *
2240 *     Desc : This Primitive is used to convey the information derived by the
2241  * physical layer from the SRS transmission from the UE.
2242  * @details This primitive carries information derived from the SRS transmission
2243  * from the UE. 
2244  * 
2245  * @param pst Pointer to the post structure.
2246  * @param suId SAP ID of the service user.
2247  * @param  srsInd Pointer to the TfuSrIndInfo structure.
2248  * @return ROK/RFAILED
2249 *
2250 *
2251 *     Ret  : S16
2252 *
2253 *     Notes:
2254 *
2255 *     File  : 
2256 *
2257 **********************************************************/
2258 #ifdef ANSI
2259 PUBLIC S16 cmUnpkTfuSrsInd
2260 (
2261 TfuSrsInd func,
2262 Pst *pst,
2263 Buffer *mBuf
2264 )
2265 #else
2266 PUBLIC S16 cmUnpkTfuSrsInd(func, pst, mBuf)
2267 TfuSrsInd func;
2268 Pst *pst;
2269 Buffer *mBuf;
2270 #endif
2271 {
2272    SuId suId;
2273    TfuSrsIndInfo *srsInd;
2274    
2275    TRC3(cmUnpkTfuSrsInd)
2276
2277    if (SUnpkS16(&suId, mBuf) != ROK) {
2278       TFU_FREE_MSG(mBuf);
2279 #if (ERRCLASS & ERRCLS_ADD_RES)
2280       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2281          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2282          (ErrVal)ETFU073, (ErrVal)0, "Packing failed");
2283 #endif
2284       RETVALUE(RFAILED);
2285    }
2286    {
2287       Mem   sMem;
2288       sMem.region = pst->region;
2289       sMem.pool = pst->pool;
2290       if ((cmAllocEvnt(sizeof(TfuSrsIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&srsInd)) != ROK)            {
2291 #if (ERRCLASS & ERRCLS_ADD_RES)
2292          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2293             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2294             (ErrVal)ETFU074, (ErrVal)0, "Packing failed");
2295 #endif
2296          TFU_FREE_MSG(mBuf);
2297          RETVALUE(RFAILED);
2298       }
2299    }
2300       cmUnpkTfuSrsIndInfo(srsInd, (Ptr)&srsInd->memCp, mBuf);
2301    TFU_FREE_MSG(mBuf);
2302    RETVALUE((*func)(pst, suId, srsInd));
2303 }
2304 #endif
2305
2306
2307 \f
2308 /***********************************************************
2309 *
2310 *     Func : cmPkTfuDatInd
2311 *
2312 *
2313 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2314  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2315  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2316  * is relayed to MAC using this primitive. 
2317  * @param pst 
2318  * @param spId
2319  * @param tfuDatInd pointer to TfuDatIndInfo
2320  * @return
2321 *
2322 *
2323 *     Ret  : S16
2324 *
2325 *     Notes:
2326 *
2327 *     File  : 
2328 *
2329 **********************************************************/
2330 #ifdef ANSI
2331 PUBLIC S16 cmPkTfuDatInd
2332 (
2333 Pst * pst,
2334 SpId spId,
2335 TfuDatIndInfo * datInd
2336 )
2337 #else
2338 PUBLIC S16 cmPkTfuDatInd(pst, spId, datInd)
2339 Pst * pst;
2340 SpId spId;
2341 TfuDatIndInfo * datInd;
2342 #endif
2343 {
2344    Buffer *mBuf = NULLP;
2345    TRC3(cmPkTfuDatInd)
2346
2347    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2348 #if (ERRCLASS & ERRCLS_ADD_RES)
2349       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2350          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2351          (ErrVal)ETFU075, (ErrVal)0, "Packing failed");
2352 #endif
2353       TFU_FREE_MEM(datInd);
2354       RETVALUE(RFAILED);
2355    }
2356    if (pst->selector == TFU_SEL_LC) {
2357       if (cmPkTfuDatIndInfo(datInd, mBuf) != ROK) {
2358 #if (ERRCLASS & ERRCLS_ADD_RES)
2359          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2360             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2361             (ErrVal)ETFU076, (ErrVal)0, "Packing failed");
2362 #endif
2363          TFU_FREE_MEM(datInd);
2364          TFU_FREE_MSG(mBuf);
2365          RETVALUE(RFAILED);
2366       }
2367    }
2368    else if(pst->selector == TFU_SEL_LWLC)
2369    {
2370       if(cmPkPtr((PTR)datInd, mBuf) != ROK)
2371       {
2372 #if (ERRCLASS & ERRCLS_ADD_RES)
2373          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2374                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2375                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2376 #endif
2377          TFU_FREE_MEM(datInd);
2378          TFU_FREE_MSG(mBuf);
2379          RETVALUE(RFAILED);
2380       }
2381    }
2382
2383    if (SPkS16(spId, mBuf) != ROK) {
2384 #if (ERRCLASS & ERRCLS_ADD_RES)
2385       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2386          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2387          (ErrVal)ETFU077, (ErrVal)0, "Packing failed");
2388 #endif
2389       TFU_FREE_MEM(datInd);
2390       TFU_FREE_MSG(mBuf);
2391       RETVALUE(RFAILED);
2392    }
2393    if (pst->selector != TFU_SEL_LWLC) {
2394       TFU_FREE_MEM(datInd);
2395    }
2396
2397    pst->event = (Event) EVTTFUDATIND;
2398    RETVALUE(SPstTsk(pst,mBuf));
2399 }
2400
2401 \f
2402 /***********************************************************
2403 *
2404 *     Func : cmUnpkTfuDatInd
2405 *
2406 *
2407 *     Desc : This Primitive carries the Data PDUs from PHY to MAC.
2408  * @details The uplink Data i.e. the data transmitted by the UEs received by the
2409  * physical layer at the eNodeB in the subframe (indicated by the timingInfo),
2410  * is relayed to MAC using this primitive. 
2411  * @param pst 
2412  * @param spId
2413  * @param tfuDatInd pointer to TfuDatIndInfo
2414  * @return
2415 *
2416 *
2417 *     Ret  : S16
2418 *
2419 *     Notes:
2420 *
2421 *     File  : 
2422 *
2423 **********************************************************/
2424 #ifdef ANSI
2425 PUBLIC S16 cmUnpkTfuDatInd
2426 (
2427 TfuDatInd func,
2428 Pst *pst,
2429 Buffer *mBuf
2430 )
2431 #else
2432 PUBLIC S16 cmUnpkTfuDatInd(func, pst, mBuf)
2433 TfuDatInd func;
2434 Pst *pst;
2435 Buffer *mBuf;
2436 #endif
2437 {
2438    SpId spId;
2439    TfuDatIndInfo *datInd;
2440    
2441    TRC3(cmUnpkTfuDatInd)
2442
2443    if (SUnpkS16(&spId, mBuf) != ROK) {
2444       TFU_FREE_MSG(mBuf);
2445 #if (ERRCLASS & ERRCLS_ADD_RES)
2446       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2447          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2448          (ErrVal)ETFU078, (ErrVal)0, "Packing failed");
2449 #endif
2450       RETVALUE(RFAILED);
2451    }
2452    if (pst->selector != TFU_SEL_LWLC) {
2453       Mem   sMem;
2454       sMem.region = pst->region;
2455       sMem.pool = pst->pool;
2456       if ((cmAllocEvnt(sizeof(TfuDatIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&datInd)) != ROK)            {
2457 #if (ERRCLASS & ERRCLS_ADD_RES)
2458          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2459             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2460             (ErrVal)ETFU079, (ErrVal)0, "Packing failed");
2461 #endif
2462          TFU_FREE_MSG(mBuf);
2463          RETVALUE(RFAILED);
2464       }
2465    }
2466
2467
2468    if (pst->selector == TFU_SEL_LC) 
2469    {
2470       if (cmUnpkTfuDatIndInfo(datInd, (Ptr)&datInd->memCp, mBuf) != ROK) {
2471          TFU_FREE_MEM(datInd);
2472          TFU_FREE_MSG(mBuf);
2473 #if (ERRCLASS & ERRCLS_ADD_RES)
2474          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2475                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2476                (ErrVal)ETFU080, (ErrVal)0, "Packing failed");
2477 #endif
2478          RETVALUE(RFAILED);
2479       }
2480    }
2481    else if(pst->selector == TFU_SEL_LWLC)
2482    {
2483       if(cmUnpkPtr((PTR *)&datInd, mBuf) != ROK)
2484       {
2485 #if (ERRCLASS & ERRCLS_ADD_RES)
2486          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2487                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2488                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2489 #endif
2490          TFU_FREE_MEM(datInd);
2491          TFU_FREE_MSG(mBuf);
2492          RETVALUE(RFAILED);
2493       }
2494    }
2495    TFU_FREE_MSG(mBuf);
2496    RETVALUE((*func)(pst, spId, datInd));
2497 }
2498
2499 \f
2500 /***********************************************************
2501 *
2502 *     Func : cmPkTfuCrcInd
2503 *
2504 *
2505 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2506  * on the PUSCH Data was successful or not.
2507  * @details This primitive carries CRC indication for a list of UEs. This
2508  * is utilized in the scenario where MAC requested the reception of uplink data
2509  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2510  * failed. This CRC failure is indicated to MAC, which would utillize this
2511  * information for further scheduling. 
2512  * Physical layer would indicate failure or success for each PUSCH transmission.
2513  * @param pst Pointer to the post structure.
2514  * @param suId SAP ID of the service user.
2515  * @param crcInd Pointer to the TfuCrcIndInfo.
2516  * @return ROK/RFAILED
2517 *
2518 *
2519 *     Ret  : S16
2520 *
2521 *     Notes:
2522 *
2523 *     File  : 
2524 *
2525 **********************************************************/
2526 #ifdef ANSI
2527 PUBLIC S16 cmPkTfuCrcInd
2528 (
2529 Pst * pst,
2530 SuId suId,
2531 TfuCrcIndInfo * crcIndInfo
2532 )
2533 #else
2534 PUBLIC S16 cmPkTfuCrcInd(pst, suId, crcIndInfo)
2535 Pst * pst;
2536 SuId suId;
2537 TfuCrcIndInfo * crcIndInfo;
2538 #endif
2539 {
2540    Buffer *mBuf = NULLP;
2541    TRC3(cmPkTfuCrcInd)
2542
2543    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2544 #if (ERRCLASS & ERRCLS_ADD_RES)
2545       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2546          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2547          (ErrVal)ETFU081, (ErrVal)0, "Packing failed");
2548 #endif
2549       TFU_FREE_MEM(crcIndInfo);
2550       RETVALUE(RFAILED);
2551    }
2552    if (pst->selector == TFU_SEL_LC) {
2553       if (cmPkTfuCrcIndInfo(crcIndInfo, mBuf) != ROK) {
2554 #if (ERRCLASS & ERRCLS_ADD_RES)
2555          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2556             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2557             (ErrVal)ETFU082, (ErrVal)0, "Packing failed");
2558 #endif
2559          TFU_FREE_MEM(crcIndInfo);
2560          TFU_FREE_MSG(mBuf);
2561          RETVALUE(RFAILED);
2562       }
2563    }
2564    else if(pst->selector == TFU_SEL_LWLC)
2565    {
2566       if (cmPkPtr((PTR)crcIndInfo, mBuf) != ROK)
2567       {
2568 #if (ERRCLASS & ERRCLS_ADD_RES)
2569          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2570             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2571             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2572 #endif
2573          TFU_FREE_MEM(crcIndInfo);
2574          TFU_FREE_MSG(mBuf);
2575          RETVALUE(RFAILED);
2576       }
2577    }
2578
2579
2580    if (SPkS16(suId, mBuf) != ROK) {
2581 #if (ERRCLASS & ERRCLS_ADD_RES)
2582       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2583          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2584          (ErrVal)ETFU083, (ErrVal)0, "Packing failed");
2585 #endif
2586       TFU_FREE_MEM(crcIndInfo);
2587       TFU_FREE_MSG(mBuf);
2588       RETVALUE(RFAILED);
2589    }
2590    if (pst->selector != TFU_SEL_LWLC) {
2591       TFU_FREE_MEM(crcIndInfo);
2592    }
2593
2594    pst->event = (Event) EVTTFUCRCIND;
2595    RETVALUE(SPstTsk(pst,mBuf));
2596 }
2597
2598 \f
2599 /***********************************************************
2600 *
2601 *     Func : cmUnpkTfuCrcInd
2602 *
2603 *
2604 *     Desc : This API is used by the Physical layer to indicate if the CRC Check
2605  * on the PUSCH Data was successful or not.
2606  * @details This primitive carries CRC indication for a list of UEs. This
2607  * is utilized in the scenario where MAC requested the reception of uplink data
2608  * for a particular UE. On reception of the PUSCH data, the CRC check on it
2609  * failed. This CRC failure is indicated to MAC, which would utillize this
2610  * information for further scheduling. 
2611  * Physical layer would indicate failure or success for each PUSCH transmission.
2612  * @param pst Pointer to the post structure.
2613  * @param suId SAP ID of the service user.
2614  * @param crcInd Pointer to the TfuCrcIndInfo.
2615  * @return ROK/RFAILED
2616 *
2617 *
2618 *     Ret  : S16
2619 *
2620 *     Notes:
2621 *
2622 *     File  : 
2623 *
2624 **********************************************************/
2625 #ifdef ANSI
2626 PUBLIC S16 cmUnpkTfuCrcInd
2627 (
2628 TfuCrcInd func,
2629 Pst *pst,
2630 Buffer *mBuf
2631 )
2632 #else
2633 PUBLIC S16 cmUnpkTfuCrcInd(func, pst, mBuf)
2634 TfuCrcInd func;
2635 Pst *pst;
2636 Buffer *mBuf;
2637 #endif
2638 {
2639    SuId suId;
2640    TfuCrcIndInfo *crcIndInfo;
2641    
2642    TRC3(cmUnpkTfuCrcInd)
2643
2644    if (SUnpkS16(&suId, mBuf) != ROK) {
2645       TFU_FREE_MSG(mBuf);
2646 #if (ERRCLASS & ERRCLS_ADD_RES)
2647       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2648          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2649          (ErrVal)ETFU084, (ErrVal)0, "Packing failed");
2650 #endif
2651       RETVALUE(RFAILED);
2652    }
2653    if (pst->selector != TFU_SEL_LWLC) {
2654       Mem   sMem;
2655       sMem.region = pst->region;
2656       sMem.pool = pst->pool;
2657       if ((cmAllocEvnt(sizeof(TfuCrcIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&crcIndInfo)) != ROK)            {
2658 #if (ERRCLASS & ERRCLS_ADD_RES)
2659          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2660             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2661             (ErrVal)ETFU085, (ErrVal)0, "Packing failed");
2662 #endif
2663          TFU_FREE_MSG(mBuf);
2664          RETVALUE(RFAILED);
2665       }
2666    }
2667
2668
2669    if (pst->selector == TFU_SEL_LC) 
2670    {
2671       if (cmUnpkTfuCrcIndInfo(crcIndInfo, (Ptr)&crcIndInfo->memCp, mBuf) != ROK) {
2672          TFU_FREE_MEM(crcIndInfo);
2673          TFU_FREE_MSG(mBuf);
2674 #if (ERRCLASS & ERRCLS_ADD_RES)
2675          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2676                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2677                (ErrVal)ETFU086, (ErrVal)0, "Packing failed");
2678 #endif
2679          RETVALUE(RFAILED);
2680       }
2681    }
2682    else if(pst->selector == TFU_SEL_LWLC)
2683    {
2684       if (cmUnpkPtr((PTR *)&crcIndInfo, mBuf) != ROK)
2685       {
2686 #if (ERRCLASS & ERRCLS_ADD_RES)
2687          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2688             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2689             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2690 #endif
2691          TFU_FREE_MEM(crcIndInfo);
2692          TFU_FREE_MSG(mBuf);
2693          RETVALUE(RFAILED);
2694       }
2695    }
2696    TFU_FREE_MSG(mBuf);
2697    RETVALUE((*func)(pst, suId, crcIndInfo));
2698 }
2699
2700 \f
2701 /***********************************************************
2702 *
2703 *     Func : cmPkTfuTimingAdvInd
2704 *
2705 *
2706 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2707  * @details This primitive carries timing advance information for a number of
2708  * UEs that may need timing advance. Timing advance information is an estimate
2709  * of the timing adjustment that a UE would need to apply in order to be
2710  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2711  * @param pst Pointer to the post structure.
2712  * @param suId SAP ID of the service user.
2713  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2714  * @return ROK/RFAILED
2715 *
2716 *
2717 *     Ret  : S16
2718 *
2719 *     Notes:
2720 *
2721 *     File  : 
2722 *
2723 **********************************************************/
2724 #ifdef ANSI
2725 PUBLIC S16 cmPkTfuTimingAdvInd
2726 (
2727 Pst * pst,
2728 SuId suId,
2729 TfuTimingAdvIndInfo * timingAdvInd
2730 )
2731 #else
2732 PUBLIC S16 cmPkTfuTimingAdvInd(pst, suId, timingAdvInd)
2733 Pst * pst;
2734 SuId suId;
2735 TfuTimingAdvIndInfo * timingAdvInd;
2736 #endif
2737 {
2738    Buffer *mBuf = NULLP;
2739    TRC3(cmPkTfuTimingAdvInd)
2740
2741    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2742 #if (ERRCLASS & ERRCLS_ADD_RES)
2743       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2744          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2745          (ErrVal)ETFU087, (ErrVal)0, "Packing failed");
2746 #endif
2747       TFU_FREE_MEM(timingAdvInd);
2748       RETVALUE(RFAILED);
2749    }
2750    if (pst->selector == TFU_SEL_LC) {
2751       if (cmPkTfuTimingAdvIndInfo(timingAdvInd, mBuf) != ROK) {
2752 #if (ERRCLASS & ERRCLS_ADD_RES)
2753          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2754             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2755             (ErrVal)ETFU088, (ErrVal)0, "Packing failed");
2756 #endif
2757          TFU_FREE_MEM(timingAdvInd);
2758          TFU_FREE_MSG(mBuf);
2759          RETVALUE(RFAILED);
2760       }
2761    }
2762    else if(pst->selector == TFU_SEL_LWLC)
2763    {
2764       if (cmPkPtr((PTR)timingAdvInd, mBuf) != ROK)
2765       {
2766 #if (ERRCLASS & ERRCLS_ADD_RES)
2767          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2768             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2769             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2770 #endif
2771          TFU_FREE_MEM(timingAdvInd);
2772          TFU_FREE_MSG(mBuf);
2773          RETVALUE(RFAILED);
2774       }
2775    }
2776
2777    if (SPkS16(suId, mBuf) != ROK) {
2778 #if (ERRCLASS & ERRCLS_ADD_RES)
2779       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2780          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2781          (ErrVal)ETFU089, (ErrVal)0, "Packing failed");
2782 #endif
2783       TFU_FREE_MEM(timingAdvInd);
2784       TFU_FREE_MSG(mBuf);
2785       RETVALUE(RFAILED);
2786    }
2787    if (pst->selector != TFU_SEL_LWLC) {
2788       TFU_FREE_MEM(timingAdvInd);
2789    }
2790
2791    pst->event = (Event) EVTTFUTIMINGADVIND;
2792    RETVALUE(SPstTsk(pst,mBuf));
2793 }
2794
2795 \f
2796 /***********************************************************
2797 *
2798 *     Func : cmUnpkTfuTimingAdvInd
2799 *
2800 *
2801 *     Desc : This API is used to indicate a Timing Advance from PHY to Scheduler .
2802  * @details This primitive carries timing advance information for a number of
2803  * UEs that may need timing advance. Timing advance information is an estimate
2804  * of the timing adjustment that a UE would need to apply in order to be
2805  * synchronized in uplink. This estimate is to be calculated by physical layer. 
2806  * @param pst Pointer to the post structure.
2807  * @param suId SAP ID of the service user.
2808  * @param timingAdvInd Pointer to the TfuTimingAdvIndInfo structure.
2809  * @return ROK/RFAILED
2810 *
2811 *
2812 *     Ret  : S16
2813 *
2814 *     Notes:
2815 *
2816 *     File  : 
2817 *
2818 **********************************************************/
2819 #ifdef ANSI
2820 PUBLIC S16 cmUnpkTfuTimingAdvInd
2821 (
2822 TfuTimingAdvInd func,
2823 Pst *pst,
2824 Buffer *mBuf
2825 )
2826 #else
2827 PUBLIC S16 cmUnpkTfuTimingAdvInd(func, pst, mBuf)
2828 TfuTimingAdvInd func;
2829 Pst *pst;
2830 Buffer *mBuf;
2831 #endif
2832 {
2833    SuId suId;
2834    TfuTimingAdvIndInfo *timingAdvInd;
2835    
2836    TRC3(cmUnpkTfuTimingAdvInd)
2837
2838    if (SUnpkS16(&suId, mBuf) != ROK) {
2839       TFU_FREE_MSG(mBuf);
2840 #if (ERRCLASS & ERRCLS_ADD_RES)
2841       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2842          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2843          (ErrVal)ETFU090, (ErrVal)0, "Packing failed");
2844 #endif
2845       RETVALUE(RFAILED);
2846    }
2847    if (pst->selector != TFU_SEL_LWLC) {
2848       Mem   sMem;
2849       sMem.region = pst->region;
2850       sMem.pool = pst->pool;
2851       if ((cmAllocEvnt(sizeof(TfuTimingAdvIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&timingAdvInd)) != ROK)            {
2852 #if (ERRCLASS & ERRCLS_ADD_RES)
2853          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2854             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2855             (ErrVal)ETFU091, (ErrVal)0, "Packing failed");
2856 #endif
2857          TFU_FREE_MSG(mBuf);
2858          RETVALUE(RFAILED);
2859       }
2860    }
2861
2862
2863    if (pst->selector == TFU_SEL_LC) 
2864    {
2865       if (cmUnpkTfuTimingAdvIndInfo(timingAdvInd, (Ptr)&timingAdvInd->memCp, mBuf) != ROK) {
2866          TFU_FREE_MEM(timingAdvInd);
2867          TFU_FREE_MSG(mBuf);
2868 #if (ERRCLASS & ERRCLS_ADD_RES)
2869          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2870                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2871                (ErrVal)ETFU092, (ErrVal)0, "Packing failed");
2872 #endif
2873          RETVALUE(RFAILED);
2874       }
2875    }
2876    else if(pst->selector == TFU_SEL_LWLC)
2877    {
2878       if (cmUnpkPtr((PTR *)&timingAdvInd, mBuf) != ROK)
2879       {
2880 #if (ERRCLASS & ERRCLS_ADD_RES)
2881          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2882             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2883             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
2884 #endif
2885          TFU_FREE_MEM(timingAdvInd);
2886          TFU_FREE_MSG(mBuf);
2887          RETVALUE(RFAILED);
2888       }
2889    }
2890    TFU_FREE_MSG(mBuf);
2891    RETVALUE((*func)(pst, suId, timingAdvInd));
2892 }
2893
2894 \f
2895 /***********************************************************
2896 *
2897 *     Func : cmPkTfuDatReq
2898 *
2899 *
2900 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2901   * transmission. 
2902   * @details The data being sent in this primitive is meant to be transmitted on
2903   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
2904   * layer processing, requisite control information is also sent along with the
2905   * data. 
2906   * @sa TfUiTfuCntrlReq
2907   * @param pst 
2908   * @param spId
2909   * @param tfuDatReq pointer to TfuDatReqInfo
2910   * @return
2911 *
2912 *
2913 *     Ret  : S16
2914 *
2915 *     Notes:
2916 *
2917 *     File  : 
2918 *
2919 **********************************************************/
2920 #ifdef ANSI
2921 PUBLIC S16 cmPkTfuDatReq
2922 (
2923 Pst * pst,
2924 SpId spId,
2925 TfuDatReqInfo * datReq
2926 )
2927 #else
2928 PUBLIC S16 cmPkTfuDatReq(pst, spId, datReq)
2929 Pst * pst;
2930 SpId spId;
2931 TfuDatReqInfo * datReq;
2932 #endif
2933 {
2934    Buffer *mBuf = NULLP;
2935    TRC3(cmPkTfuDatReq)
2936
2937    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
2938 #if (ERRCLASS & ERRCLS_ADD_RES)
2939       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2940          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2941          (ErrVal)ETFU093, (ErrVal)0, "Packing failed");
2942 #endif
2943       TFU_FREE_MEM(datReq);
2944       RETVALUE(RFAILED);
2945    }
2946    if (pst->selector == TFU_SEL_LC) {
2947       if (cmPkTfuDatReqInfo(datReq, mBuf) != ROK) {
2948 #if (ERRCLASS & ERRCLS_ADD_RES)
2949          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2950             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2951             (ErrVal)ETFU094, (ErrVal)0, "Packing failed");
2952 #endif
2953          TFU_FREE_MEM(datReq);
2954          TFU_FREE_MSG(mBuf);
2955          RETVALUE(RFAILED);
2956       }
2957    }
2958    else if(pst->selector == TFU_SEL_LWLC)
2959    {
2960       if(cmPkPtr((PTR)datReq, mBuf) != ROK)
2961       {
2962 #if (ERRCLASS & ERRCLS_ADD_RES)
2963          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2964             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2965             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
2966 #endif
2967          TFU_FREE_MEM(datReq);
2968          TFU_FREE_MSG(mBuf);
2969          RETVALUE(RFAILED);
2970       }
2971    }
2972
2973    if (SPkS16(spId, mBuf) != ROK) {
2974 #if (ERRCLASS & ERRCLS_ADD_RES)
2975       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
2976          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
2977          (ErrVal)ETFU095, (ErrVal)0, "Packing failed");
2978 #endif
2979       TFU_FREE_MEM(datReq);
2980       TFU_FREE_MSG(mBuf);
2981       RETVALUE(RFAILED);
2982    }
2983    if (pst->selector != TFU_SEL_LWLC) {
2984       TFU_FREE_MEM(datReq);
2985    }
2986
2987    pst->event = (Event) EVTTFUDATREQ;
2988    RETVALUE(SPstTsk(pst,mBuf));
2989 }
2990
2991 \f
2992 /***********************************************************
2993 *
2994 *     Func : cmUnpkTfuDatReq
2995 *
2996 *
2997 *     Desc : This Primitive carries the Data PDUs from MAC to PHY for
2998   * transmission. 
2999   * @details The data being sent in this primitive is meant to be transmitted on
3000   * the downlink channel PDSCH and PBCH (if present). To facilitate physical
3001   * layer processing, requisite control information is also sent along with the
3002   * data. 
3003   * @sa TfUiTfuCntrlReq
3004   * @param pst 
3005   * @param spId
3006   * @param tfuDatReq pointer to TfuDatReqInfo
3007   * @return
3008 *
3009 *
3010 *     Ret  : S16
3011 *
3012 *     Notes:
3013 *
3014 *     File  : 
3015 *
3016 **********************************************************/
3017 #ifdef ANSI
3018 PUBLIC S16 cmUnpkTfuDatReq
3019 (
3020 TfuDatReq func,
3021 Pst *pst,
3022 Buffer *mBuf
3023 )
3024 #else
3025 PUBLIC S16 cmUnpkTfuDatReq(func, pst, mBuf)
3026 TfuDatReq func;
3027 Pst *pst;
3028 Buffer *mBuf;
3029 #endif
3030 {
3031    SpId spId;
3032    TfuDatReqInfo *datReq;
3033    
3034    TRC3(cmUnpkTfuDatReq)
3035
3036    if (SUnpkS16(&spId, mBuf) != ROK) {
3037       TFU_FREE_MSG(mBuf);
3038 #if (ERRCLASS & ERRCLS_ADD_RES)
3039       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3040          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3041          (ErrVal)ETFU096, (ErrVal)0, "Packing failed");
3042 #endif
3043       RETVALUE(RFAILED);
3044    }
3045    if (pst->selector != TFU_SEL_LWLC) {
3046       Mem   sMem;
3047       sMem.region = pst->region;
3048       sMem.pool = pst->pool;
3049       if ((cmAllocEvnt(sizeof(TfuDatReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&datReq)) != ROK)            {
3050 #if (ERRCLASS & ERRCLS_ADD_RES)
3051          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3052             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3053             (ErrVal)ETFU097, (ErrVal)0, "Packing failed");
3054 #endif
3055          TFU_FREE_MSG(mBuf);
3056          RETVALUE(RFAILED);
3057       }
3058    }
3059
3060
3061    if (pst->selector == TFU_SEL_LC) 
3062    {
3063       if (cmUnpkTfuDatReqInfo(datReq, (Ptr)&datReq->memCp, mBuf) != ROK) {
3064          TFU_FREE_MEM(datReq);
3065          TFU_FREE_MSG(mBuf);
3066 #if (ERRCLASS & ERRCLS_ADD_RES)
3067          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3068                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3069                (ErrVal)ETFU098, (ErrVal)0, "Unpacking failed");
3070 #endif
3071          RETVALUE(RFAILED);
3072       }
3073    }
3074    else if (pst->selector == TFU_SEL_LWLC)
3075    {
3076       if(cmUnpkPtr((PTR *)&datReq, mBuf) != ROK)
3077       {
3078          TFU_FREE_MEM(datReq);
3079          TFU_FREE_MSG(mBuf);
3080 #if (ERRCLASS & ERRCLS_ADD_RES)
3081          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3082                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3083                (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Un-Packing failed");
3084 #endif
3085          RETVALUE(RFAILED);
3086       }
3087    }
3088    TFU_FREE_MSG(mBuf);
3089    RETVALUE((*func)(pst, spId, datReq));
3090 }
3091
3092 \f
3093 /***********************************************************
3094 *
3095 *     Func : cmPkTfuCntrlReq
3096 *
3097 *
3098 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3099   * all the control information
3100   * @details This primitive carries the information sent on the following
3101   * channels - 
3102   * -# PDCCH
3103   * -# PHICH
3104   * -# PCFICH
3105   * 
3106   * @param pst
3107   * @param spId
3108   * @param cntrlReq pointer to TfuCntrlReqInfo
3109   * @return ROK/RFAILED
3110 *
3111 *
3112 *     Ret  : S16
3113 *
3114 *     Notes:
3115 *
3116 *     File  : 
3117 *
3118 **********************************************************/
3119 #ifdef ANSI
3120 PUBLIC S16 cmPkTfuCntrlReq
3121 (
3122 Pst * pst,
3123 SpId spId,
3124 TfuCntrlReqInfo * cntrlReq
3125 )
3126 #else
3127 PUBLIC S16 cmPkTfuCntrlReq(pst, spId, cntrlReq)
3128 Pst * pst;
3129 SpId spId;
3130 TfuCntrlReqInfo * cntrlReq;
3131 #endif
3132 {
3133    Buffer *mBuf = NULLP;
3134    TRC3(cmPkTfuCntrlReq)
3135
3136    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3137 #if (ERRCLASS & ERRCLS_ADD_RES)
3138       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3139          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3140          (ErrVal)ETFU099, (ErrVal)0, "Packing failed");
3141 #endif
3142       TFU_FREE_MEM(cntrlReq);
3143       RETVALUE(RFAILED);
3144    }
3145    if (pst->selector == TFU_SEL_LC) {
3146       if (cmPkTfuCntrlReqInfo(cntrlReq, mBuf) != ROK) {
3147 #if (ERRCLASS & ERRCLS_ADD_RES)
3148          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3149             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3150             (ErrVal)ETFU100, (ErrVal)0, "Packing failed");
3151 #endif
3152          TFU_FREE_MEM(cntrlReq);
3153          TFU_FREE_MSG(mBuf);
3154          RETVALUE(RFAILED);
3155       }
3156    }
3157    else if(pst->selector == TFU_SEL_LWLC)
3158    {
3159       if (cmPkPtr((PTR)cntrlReq, mBuf) != ROK)
3160       {
3161 #if (ERRCLASS & ERRCLS_ADD_RES)
3162          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3163             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3164             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3165 #endif
3166          TFU_FREE_MEM(cntrlReq);
3167          TFU_FREE_MSG(mBuf);
3168          RETVALUE(RFAILED);
3169       }
3170    }
3171
3172
3173    if (SPkS16(spId, mBuf) != ROK) {
3174 #if (ERRCLASS & ERRCLS_ADD_RES)
3175       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3176          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3177          (ErrVal)ETFU101, (ErrVal)0, "Packing failed");
3178 #endif
3179       TFU_FREE_MEM(cntrlReq);
3180       TFU_FREE_MSG(mBuf);
3181       RETVALUE(RFAILED);
3182    }
3183    if (pst->selector != TFU_SEL_LWLC) {
3184       TFU_FREE_MEM(cntrlReq);
3185    }
3186
3187    pst->event = (Event) EVTTFUCNTRLREQ;
3188    RETVALUE(SPstTsk(pst,mBuf));
3189 }
3190
3191 \f
3192 /***********************************************************
3193 *
3194 *     Func : cmUnpkTfuCntrlReq
3195 *
3196 *
3197 *     Desc : This Primitive is sent from Scheduler to PHY. It provides PHY with
3198   * all the control information
3199   * @details This primitive carries the information sent on the following
3200   * channels - 
3201   * -# PDCCH
3202   * -# PHICH
3203   * -# PCFICH
3204   * 
3205   * @param pst
3206   * @param spId
3207   * @param cntrlReq pointer to TfuCntrlReqInfo
3208   * @return ROK/RFAILED
3209 *
3210 *
3211 *     Ret  : S16
3212 *
3213 *     Notes:
3214 *
3215 *     File  : 
3216 *
3217 **********************************************************/
3218 #ifdef ANSI
3219 PUBLIC S16 cmUnpkTfuCntrlReq
3220 (
3221 TfuCntrlReq func,
3222 Pst *pst,
3223 Buffer *mBuf
3224 )
3225 #else
3226 PUBLIC S16 cmUnpkTfuCntrlReq(func, pst, mBuf)
3227 TfuCntrlReq func;
3228 Pst *pst;
3229 Buffer *mBuf;
3230 #endif
3231 {
3232    SpId spId;
3233    TfuCntrlReqInfo *cntrlReq;
3234    
3235    TRC3(cmUnpkTfuCntrlReq)
3236
3237    if (SUnpkS16(&spId, mBuf) != ROK) {
3238       TFU_FREE_MSG(mBuf);
3239 #if (ERRCLASS & ERRCLS_ADD_RES)
3240       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3241          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3242          (ErrVal)ETFU102, (ErrVal)0, "Packing failed");
3243 #endif
3244       RETVALUE(RFAILED);
3245    }
3246    if (pst->selector != TFU_SEL_LWLC) {
3247       Mem   sMem;
3248       sMem.region = pst->region;
3249       sMem.pool = pst->pool;
3250       if ((cmAllocEvnt(sizeof(TfuCntrlReqInfo), TFU_BLKSZ, &sMem, (Ptr *)&cntrlReq)) != ROK)            {
3251 #if (ERRCLASS & ERRCLS_ADD_RES)
3252          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3253             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3254             (ErrVal)ETFU103, (ErrVal)0, "Packing failed");
3255 #endif
3256          TFU_FREE_MSG(mBuf);
3257          RETVALUE(RFAILED);
3258       }
3259    }
3260
3261
3262    if (pst->selector == TFU_SEL_LC) 
3263    {
3264       if (cmUnpkTfuCntrlReqInfo(cntrlReq, (Ptr)&cntrlReq->memCp, mBuf) != ROK) {
3265          TFU_FREE_MEM(cntrlReq);
3266          TFU_FREE_MSG(mBuf);
3267 #if (ERRCLASS & ERRCLS_ADD_RES)
3268          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3269                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3270                (ErrVal)ETFU104, (ErrVal)0, "Packing failed");
3271 #endif
3272          RETVALUE(RFAILED);
3273       }
3274    }
3275    else if(pst->selector == TFU_SEL_LWLC)
3276    {
3277       if (cmUnpkPtr((PTR *)&cntrlReq, mBuf) != ROK)
3278       {
3279 #if (ERRCLASS & ERRCLS_ADD_RES)
3280          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3281             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3282             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3283 #endif
3284          TFU_FREE_MEM(cntrlReq);
3285          TFU_FREE_MSG(mBuf);
3286          RETVALUE(RFAILED);
3287       }
3288    }
3289    TFU_FREE_MSG(mBuf);
3290    RETVALUE((*func)(pst, spId, cntrlReq));
3291 }
3292
3293
3294 \f
3295 /***********************************************************
3296 *
3297 *     Func : cmPkTfuTtiInd
3298 *
3299 *
3300 *     Desc : This API is the TTI indication from PHY to MAC . 
3301  * @details This primitive provides the timing information (SFN and subframe)
3302  * which is currently running on the physical layer. 
3303  * @param pst Pointer to the post structure.
3304  * @param suId SAP ID of the service user.
3305  * @param ttiInd Pointer to the TfuTtiIndInfo.
3306  * @return ROK/RFAILED
3307 *
3308 *
3309 *     Ret  : S16
3310 *
3311 *     Notes:
3312 *
3313 *     File  : 
3314 *
3315 **********************************************************/
3316 #ifdef ANSI
3317 PUBLIC S16 cmPkTfuTtiInd
3318 (
3319 Pst * pst,
3320 SuId suId,
3321 TfuTtiIndInfo * ttiInd
3322 )
3323 #else
3324 PUBLIC S16 cmPkTfuTtiInd(pst, suId, ttiInd)
3325 Pst * pst;
3326 SuId suId;
3327 TfuTtiIndInfo * ttiInd;
3328 #endif
3329 {
3330    Buffer *mBuf = NULLP;
3331    TRC3(cmPkTfuTtiInd)
3332
3333    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3334 #if (ERRCLASS & ERRCLS_ADD_RES)
3335       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3336          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3337          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3338 #endif
3339       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3340       RETVALUE(RFAILED);
3341    }
3342    if (pst->selector == TFU_SEL_LC) {
3343       if (cmPkTfuTtiIndInfo(ttiInd, mBuf) != ROK) {
3344 #if (ERRCLASS & ERRCLS_ADD_RES)
3345          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3346             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3347             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
3348 #endif
3349          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3350          TFU_FREE_MSG(mBuf);
3351          RETVALUE(RFAILED);
3352       }
3353    }
3354    else if(pst->selector == TFU_SEL_LWLC)
3355    {
3356       if (cmPkPtr((PTR)ttiInd, mBuf) != ROK)
3357       {
3358 #if (ERRCLASS & ERRCLS_ADD_RES)
3359          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3360             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3361             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3362 #endif
3363          
3364          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
3365          SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3366          TFU_FREE_MSG(mBuf);
3367          RETVALUE(RFAILED);
3368       }
3369    }
3370
3371    if (SPkS16(suId, mBuf) != ROK) {
3372 #if (ERRCLASS & ERRCLS_ADD_RES)
3373       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3374          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3375          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3376 #endif
3377       SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo));
3378       TFU_FREE_MSG(mBuf);
3379       RETVALUE(RFAILED);
3380    }
3381    if (pst->selector != TFU_SEL_LWLC) {
3382       if (SPutSBuf(pst->region, pst->pool, (Data *)ttiInd, sizeof(TfuTtiIndInfo)) != ROK) {
3383 #if (ERRCLASS & ERRCLS_ADD_RES)
3384       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3385          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3386          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
3387 #endif
3388          TFU_FREE_MSG(mBuf);
3389          RETVALUE(RFAILED);
3390       }
3391    }
3392
3393    pst->event = (Event) EVENT_SLOT_IND_TO_MAC;
3394    RETVALUE(SPstTsk(pst,mBuf));
3395 }
3396
3397 \f
3398 /***********************************************************
3399 *
3400 *     Func : cmUnpackSlotInd
3401 *
3402 *
3403 *     Desc : This API is the TTI indication from PHY to MAC . 
3404  * @details This primitive provides the timing information (SFN and subframe)
3405  * which is currently running on the physical layer. 
3406  * @param pst Pointer to the post structure.
3407  * @param suId SAP ID of the service user.
3408  * @param ttiInd Pointer to the TfuTtiIndInfo.
3409  * @return ROK/RFAILED
3410 *
3411 *
3412 *     Ret  : S16
3413 *
3414 *     Notes:
3415 *
3416 *     File  : 
3417 *
3418 **********************************************************/
3419 PUBLIC S16 cmUnpackSlotInd
3420 (
3421 TfuTtiInd func,
3422 Pst *pst,
3423 Buffer *mBuf
3424 )
3425 {
3426    SuId suId;
3427    SlotIndInfo *slotInd;
3428    
3429    TRC3(cmUnpackSlotInd)
3430
3431    if (SUnpkS16(&suId, mBuf) != ROK) {
3432       TFU_FREE_MSG(mBuf);
3433 #if (ERRCLASS & ERRCLS_ADD_RES)
3434       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3435          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3436          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3437 #endif
3438       RETVALUE(RFAILED);
3439    }
3440    if (pst->selector != TFU_SEL_LWLC) {
3441       if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
3442 #if (ERRCLASS & ERRCLS_ADD_RES)
3443          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3444             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3445             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
3446 #endif
3447          TFU_FREE_MSG(mBuf);
3448          RETVALUE(RFAILED);
3449       }
3450    }
3451
3452    if (pst->selector == TFU_SEL_LC) 
3453    {
3454       if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
3455          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3456          TFU_FREE_MSG(mBuf);
3457 #if (ERRCLASS & ERRCLS_ADD_RES)
3458          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3459                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3460                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
3461 #endif
3462          RETVALUE(RFAILED);
3463       }
3464    }
3465    else if(pst->selector == TFU_SEL_LWLC)
3466    {
3467       if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
3468       {
3469 #if (ERRCLASS & ERRCLS_ADD_RES)
3470          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3471             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3472             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3473 #endif
3474          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3475          TFU_FREE_MSG(mBuf);
3476          RETVALUE(RFAILED);
3477       }
3478    }
3479    TFU_FREE_MSG(mBuf);
3480
3481    RETVALUE((*func)(pst, slotInd));
3482 }
3483
3484 #if defined(TENB_T2K3K_SPECIFIC_CHANGES) && defined(LTE_TDD)
3485 /***********************************************************
3486  *
3487  *     Func : cmPkTfuNonRtInd
3488  *
3489  *
3490  *     Desc : This API is the Non-Rt indication from CL to MAC . 
3491  * @param pst Pointer to the post structure.
3492  * @param suId SAP ID of the service user.
3493  * @return ROK/RFAILED
3494  *
3495  *
3496  *     Ret  : S16
3497  *
3498  *     Notes:
3499  *
3500  *     File  : 
3501  *
3502 **********************************************************/
3503 #ifdef ANSI
3504 PUBLIC S16 cmPkTfuNonRtInd
3505 (
3506 Pst * pst,
3507 SuId suId
3508 )
3509 #else
3510 PUBLIC S16 cmPkTfuNonRtInd(pst, suId)
3511 Pst * pst;
3512 SuId suId;
3513 #endif
3514 {
3515    Buffer *mBuf = NULLP;
3516    TRC3(cmPkTfuNonRtInd)
3517
3518    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3519 #if (ERRCLASS & ERRCLS_ADD_RES)
3520       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3521          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3522          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
3523 #endif
3524       RETVALUE(RFAILED);
3525   }
3526   if (SPkS16(suId, mBuf) != ROK) {
3527 #if (ERRCLASS & ERRCLS_ADD_RES)
3528       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3529          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3530          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
3531 #endif
3532       TFU_FREE_MSG(mBuf);
3533       RETVALUE(RFAILED);
3534   }
3535   pst->event = (Event) EVTTFUNONRTIND;
3536   RETVALUE(SPstTsk(pst,mBuf));
3537 }
3538
3539 /***********************************************************
3540 *
3541 *     Func : cmUnpkTfuNonRtInd
3542 *
3543 *
3544 *     Desc : This API is the Non Rt indication from PHY to MAC . 
3545 * @param pst Pointer to the post structure.
3546 * @param suId SAP ID of the service user.
3547 * @return ROK/RFAILED
3548 *
3549 *
3550 *     Ret  : S16
3551 *
3552 *     Notes:
3553 *
3554 *     File  : 
3555 *
3556 **********************************************************/
3557 #ifdef ANSI
3558 PUBLIC S16 cmUnpkTfuNonRtInd
3559 (
3560 TfuNonRtInd func,
3561 Pst *pst,
3562 Buffer *mBuf
3563 )
3564 #else
3565 PUBLIC S16 cmUnpkTfuNonRtInd(func, pst, mBuf)
3566 TfuNonRtInd func;
3567 Pst *pst;
3568 Buffer *mBuf;
3569 #endif
3570 {
3571    SuId suId;
3572    TRC3(cmUnpkTfuNonRtInd)
3573
3574    if (SUnpkS16(&suId, mBuf) != ROK) {
3575       TFU_FREE_MSG(mBuf);
3576 #if (ERRCLASS & ERRCLS_ADD_RES)
3577       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3578          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3579          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
3580 #endif
3581       RETVALUE(RFAILED);
3582    }
3583    TFU_FREE_MSG(mBuf);
3584    RETVALUE((*func)(pst, suId));
3585 }
3586
3587 #endif
3588
3589 /***********************************************************
3590 *
3591 *     Func : cmUnpackMacSchSlotInd
3592 *
3593 *
3594 *     Desc : This API is the TTI indication from PHY to scheduler. 
3595  * @details This primitive provides the timing information (SFN and subframe)
3596  * which is currently running on the physical layer. 
3597  * @param pst Pointer to the post structure.
3598  * @param suId SAP ID of the service user.
3599  * @param ttiInd Pointer to the TfuTtiIndInfo.
3600  * @return ROK/RFAILED
3601 *
3602 *
3603 *     Ret  : S16
3604 *
3605 *     Notes:
3606 *
3607 *     File  : 
3608 *
3609 **********************************************************/
3610 PUBLIC S16 cmUnpackMacSchSlotInd
3611 (
3612 MacSchSlotIndFunc func,
3613 Pst *pst,
3614 Buffer *mBuf
3615 )
3616 {
3617 #if 0
3618    SuId suId;
3619    SlotIndInfo *slotInd;
3620    
3621    TRC3(cmUnpackMacSchSlotInd)
3622
3623    if (SUnpkS16(&suId, mBuf) != ROK) {
3624       TFU_FREE_MSG(mBuf);
3625 #if (ERRCLASS & ERRCLS_ADD_RES)
3626       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3627          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3628          (ErrVal)ETFU116, (ErrVal)0, "Packing failed");
3629 #endif
3630       RETVALUE(RFAILED);
3631    }
3632    if (pst->selector != TFU_SEL_LWLC) {
3633       if ((SGetSBuf(pst->region, pst->pool, (Data **)&slotInd, sizeof(SlotIndInfo))) != ROK) {
3634 #if (ERRCLASS & ERRCLS_ADD_RES)
3635          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3636             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3637             (ErrVal)ETFU117, (ErrVal)0, "Packing failed");
3638 #endif
3639          TFU_FREE_MSG(mBuf);
3640          RETVALUE(RFAILED);
3641       }
3642    }
3643
3644    if (pst->selector == TFU_SEL_LC) 
3645    {
3646       if (cmUnpackSlotIndInfo(slotInd, mBuf) != ROK) {
3647          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3648          TFU_FREE_MSG(mBuf);
3649 #if (ERRCLASS & ERRCLS_ADD_RES)
3650          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3651                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3652                (ErrVal)ETFU118, (ErrVal)0, "Packing failed");
3653 #endif
3654          RETVALUE(RFAILED);
3655       }
3656    }
3657    else if(pst->selector == TFU_SEL_LWLC)
3658    {
3659       if (cmUnpkPtr((PTR *)&slotInd, mBuf) != ROK)
3660       {
3661 #if (ERRCLASS & ERRCLS_ADD_RES)
3662          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3663             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3664             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3665 #endif
3666          SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3667          TFU_FREE_MSG(mBuf);
3668          RETVALUE(RFAILED);
3669       }
3670    }
3671    TFU_FREE_MSG(mBuf);
3672    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
3673 //   (*func)(pst, suId, slotInd);
3674    (*func)(pst, slotInd);
3675    SPutSBuf(pst->region, pst->pool, (Data *)slotInd, sizeof(SlotIndInfo));
3676 #endif
3677    return ROK;
3678 }
3679
3680 \f
3681 /***********************************************************
3682 *
3683 *     Func : cmPkTfuPucchDeltaPwr
3684 *
3685 *
3686 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3687  * Physical layer.
3688  * This information is utilized by Scheduler for power control. 
3689  * @param pst Pointer to the post structure.
3690  * @param suId SAP ID of the service user.
3691  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3692  * @return ROK/RFAILED
3693 *
3694 *
3695 *     Ret  : S16
3696 *
3697 *     Notes:
3698 *
3699 *     File  : 
3700 *
3701 **********************************************************/
3702 #ifdef ANSI
3703 PUBLIC S16 cmPkTfuPucchDeltaPwr
3704 (
3705 Pst * pst,
3706 SuId suId,
3707 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr
3708 )
3709 #else
3710 PUBLIC S16 cmPkTfuPucchDeltaPwr(pst, suId, pucchDeltaPwr)
3711 Pst * pst;
3712 SuId suId;
3713 TfuPucchDeltaPwrIndInfo * pucchDeltaPwr;
3714 #endif
3715 {
3716    Buffer *mBuf = NULLP;
3717    TRC3(cmPkTfuPucchDeltaPwr)
3718
3719    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
3720 #if (ERRCLASS & ERRCLS_ADD_RES)
3721       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3722          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3723          (ErrVal)ETFU119, (ErrVal)0, "Packing failed");
3724 #endif
3725       SPutSBuf(pst->region, pst->pool, (Data *)pucchDeltaPwr, sizeof(TfuPucchDeltaPwrIndInfo));
3726       RETVALUE(RFAILED);
3727    }
3728    if (pst->selector == TFU_SEL_LC) {
3729       if (cmPkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, mBuf) != ROK) {
3730 #if (ERRCLASS & ERRCLS_ADD_RES)
3731          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3732             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3733             (ErrVal)ETFU120, (ErrVal)0, "Packing failed");
3734 #endif
3735          TFU_FREE_MEM(pucchDeltaPwr);
3736          TFU_FREE_MSG(mBuf);
3737          RETVALUE(RFAILED);
3738       }
3739    }
3740    else if(pst->selector == TFU_SEL_LWLC)
3741    {
3742       if (cmPkPtr((PTR)pucchDeltaPwr, mBuf) != ROK)
3743       {
3744 #if (ERRCLASS & ERRCLS_ADD_RES)
3745          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3746             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3747             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
3748 #endif
3749          TFU_FREE_MEM(pucchDeltaPwr);
3750          TFU_FREE_MSG(mBuf);
3751          RETVALUE(RFAILED);
3752       }
3753    }
3754
3755    if (SPkS16(suId, mBuf) != ROK) {
3756 #if (ERRCLASS & ERRCLS_ADD_RES)
3757       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3758          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3759          (ErrVal)ETFU121, (ErrVal)0, "Packing failed");
3760 #endif
3761       TFU_FREE_MEM(pucchDeltaPwr);
3762       TFU_FREE_MSG(mBuf);
3763       RETVALUE(RFAILED);
3764    }
3765    if (pst->selector != TFU_SEL_LWLC) {
3766       TFU_FREE_MEM(pucchDeltaPwr);
3767    }
3768    pst->event = (Event) EVTTFUPUCCHDELPWR;
3769    RETVALUE(SPstTsk(pst,mBuf));
3770 }
3771
3772 \f
3773 /***********************************************************
3774 *
3775 *     Func : cmUnpkTfuPucchDeltaPwr
3776 *
3777 *
3778 *     Desc : This Primitive is used to convey PUCCH Delta power calculated by the
3779  * Physical layer.
3780  * This information is utilized by Scheduler for power control. 
3781  * @param pst Pointer to the post structure.
3782  * @param suId SAP ID of the service user.
3783  * @param  Pointer to the TfuPucchDeltaPwrIndInfo structure.
3784  * @return ROK/RFAILED
3785 *
3786 *
3787 *     Ret  : S16
3788 *
3789 *     Notes:
3790 *
3791 *     File  : 
3792 *
3793 **********************************************************/
3794 #ifdef ANSI
3795 PUBLIC S16 cmUnpkTfuPucchDeltaPwr
3796 (
3797 TfuPucchDeltaPwrInd func,
3798 Pst *pst,
3799 Buffer *mBuf
3800 )
3801 #else
3802 PUBLIC S16 cmUnpkTfuPucchDeltaPwr(func, pst, mBuf)
3803 TfuPucchDeltaPwrInd func;
3804 Pst *pst;
3805 Buffer *mBuf;
3806 #endif
3807 {
3808    SuId suId;
3809    TfuPucchDeltaPwrIndInfo *pucchDeltaPwr;
3810    
3811    TRC3(cmUnpkTfuPucchDeltaPwr)
3812
3813    if (SUnpkS16(&suId, mBuf) != ROK) {
3814       TFU_FREE_MSG(mBuf);
3815 #if (ERRCLASS & ERRCLS_ADD_RES)
3816       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3817          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3818          (ErrVal)ETFU122, (ErrVal)0, "Packing failed");
3819 #endif
3820       RETVALUE(RFAILED);
3821    }
3822    if (pst->selector != TFU_SEL_LWLC) {
3823       Mem   sMem;
3824       sMem.region = pst->region;
3825       sMem.pool = pst->pool;
3826       if ((cmAllocEvnt(sizeof(TfuPucchDeltaPwrIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&pucchDeltaPwr)) != ROK)            {
3827 #if (ERRCLASS & ERRCLS_ADD_RES)
3828          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3829             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3830             (ErrVal)ETFU123, (ErrVal)0, "Packing failed");
3831 #endif
3832          TFU_FREE_MSG(mBuf);
3833          RETVALUE(RFAILED);
3834       }
3835    }
3836
3837    if (pst->selector == TFU_SEL_LC) 
3838    {
3839       if (cmUnpkTfuPucchDeltaPwrIndInfo(pucchDeltaPwr, (Ptr)&pucchDeltaPwr->memCp, mBuf) != ROK) {
3840          TFU_FREE_MEM(pucchDeltaPwr);
3841          TFU_FREE_MSG(mBuf);
3842 #if (ERRCLASS & ERRCLS_ADD_RES)
3843          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3844                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3845                (ErrVal)ETFU124, (ErrVal)0, "Packing failed");
3846 #endif
3847          RETVALUE(RFAILED);
3848       }
3849    }
3850    else if(pst->selector == TFU_SEL_LWLC)
3851    {
3852       if (cmUnpkPtr((PTR *)&pucchDeltaPwr, mBuf) != ROK)
3853       {
3854 #if (ERRCLASS & ERRCLS_ADD_RES)
3855          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
3856             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
3857             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
3858 #endif
3859          TFU_FREE_MEM(pucchDeltaPwr);
3860          TFU_FREE_MSG(mBuf);
3861          RETVALUE(RFAILED);
3862       }
3863    }
3864    TFU_FREE_MSG(mBuf);
3865    RETVALUE((*func)(pst, suId, pucchDeltaPwr));
3866 }
3867
3868 #ifdef TFU_5GTF
3869 \f
3870 /***********************************************************
3871 *
3872 *     Func : cmPkTfuRbAssignA1Val324
3873 *
3874 *
3875 *     Desc : This structure contains the information needed to convey  RIV value 324.
3876 *
3877 *
3878 *     Ret  : S16
3879 *
3880 *     Notes:
3881 *
3882 *     File  : 
3883 *
3884 **********************************************************/
3885 #ifdef ANSI
3886 PUBLIC S16 cmPkTfuRbAssignA1Val324
3887 (
3888 TfuRbAssignA1Val324 *param,
3889 Buffer *mBuf
3890 )
3891 #else
3892 PUBLIC S16 cmPkTfuRbAssignA1Val324(param, mBuf)
3893 TfuRbAssignA1Val324 *param;
3894 Buffer *mBuf;
3895 #endif
3896 {
3897
3898    TRC3(cmPkTfuRbAssignA1Val324)
3899
3900    CMCHKPK(SPkU8, param->ndi, mBuf);
3901    CMCHKPK(SPkU8, param->mcs, mBuf);
3902    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3903 #ifdef UL_ADPT_DBG   
3904    printf("cmPkTfuRbAssignA1Val324 param->ndi %d mcs %d param->hqProcId %d \n",param->ndi,param->mcs,param->hqProcId);
3905 #endif   
3906    RETVALUE(ROK);
3907 }
3908
3909 \f
3910 /***********************************************************
3911 *
3912 *     Func : cmPkTfuRbAssignB1Val324
3913 *
3914 *
3915 *     Desc : This structure contains the information needed to convey  RIV value 324.
3916 *
3917 *
3918 *     Ret  : S16
3919 *
3920 *     Notes:
3921 *
3922 *     File  : 
3923 *
3924 **********************************************************/
3925 #ifdef ANSI
3926 PUBLIC S16 cmPkTfuRbAssignB1Val324
3927 (
3928 TfuRbAssignB1Val324 *param,
3929 Buffer *mBuf
3930 )
3931 #else
3932 PUBLIC S16 cmPkTfuRbAssignB1Val324(param, mBuf)
3933 TfuRbAssignB1Val324 *param;
3934 Buffer *mBuf;
3935 #endif
3936 {
3937
3938    TRC3(cmPkTfuRbAssignB1Val324)
3939
3940    CMCHKPK(SPkU8, param->bmiHqAckNack, mBuf);
3941    CMCHKPK(SPkU8, param->RV, mBuf);
3942    CMCHKPK(SPkU8, param->ndi, mBuf);
3943    CMCHKPK(SPkU8, param->mcs, mBuf);
3944    CMCHKPK(SPkU8, param->hqProcId, mBuf);
3945    RETVALUE(ROK);
3946 }
3947
3948 \f
3949 /***********************************************************
3950 *
3951 *     Func : cmPkTfuRbAssignVal326
3952 *
3953 *
3954 *     Desc : This structure contains the information needed to convey  RIV value 326.
3955 *
3956 *
3957 *     Ret  : S16
3958 *
3959 *     Notes:
3960 *
3961 *     File  : 
3962 *
3963 **********************************************************/
3964 #ifdef ANSI
3965 PUBLIC S16 cmPkTfuRbAssignVal326
3966 (
3967 TfuRbAssignVal326 *param,
3968 Buffer *mBuf
3969 )
3970 #else
3971 PUBLIC S16 cmPkTfuRbAssignVal326(param, mBuf)
3972 TfuRbAssignVal326 *param;
3973 Buffer *mBuf;
3974 #endif
3975 {
3976
3977    TRC3(cmPkTfuRbAssignVal326)
3978
3979    CMCHKPK(SPkU8, param->CyclicShiftInd, mBuf);
3980    CMCHKPK(SPkU8, param->OCCInd, mBuf);
3981    CMCHKPK(SPkU8, param->FreqBandIdx, mBuf);
3982    RETVALUE(ROK);
3983 }
3984
3985 \f
3986 /***********************************************************
3987 *
3988 *     Func : cmUnpkTfuRbAssignA1Val324
3989 *
3990 *
3991 *     Desc : This structure contains the information needed to convey  RIV value 324.
3992 *
3993 *
3994 *     Ret  : S16
3995 *
3996 *     Notes:
3997 *
3998 *     File  : 
3999 *
4000 **********************************************************/
4001 #ifdef ANSI
4002 PUBLIC S16 cmUnpkTfuRbAssignA1Val324
4003 (
4004 TfuRbAssignA1Val324 *param,
4005 Buffer *mBuf
4006 )
4007 #else
4008 PUBLIC S16 cmUnpkTfuRbAssignA1Val324(param, mBuf)
4009 TfuRbAssignA1Val324 *param;
4010 Buffer *mBuf;
4011 #endif
4012 {
4013
4014    TRC3(cmUnpkTfuRbAssignA1Val324)
4015
4016    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4017    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4018    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4019    RETVALUE(ROK);
4020 }
4021
4022 \f
4023 /***********************************************************
4024 *
4025 *     Func : cmUnpkTfuRbAssignB1Val324
4026 *
4027 *
4028 *     Desc : This structure contains the information needed to convey  RIV value 324.
4029 *
4030 *
4031 *     Ret  : S16
4032 *
4033 *     Notes:
4034 *
4035 *     File  : 
4036 *
4037 **********************************************************/
4038 #ifdef ANSI
4039 PUBLIC S16 cmUnpkTfuRbAssignB1Val324
4040 (
4041 TfuRbAssignB1Val324 *param,
4042 Buffer *mBuf
4043 )
4044 #else
4045 PUBLIC S16 cmUnpkTfuRbAssignB1Val324(param, mBuf)
4046 TfuRbAssignB1Val324 *param;
4047 Buffer *mBuf;
4048 #endif
4049 {
4050
4051    TRC3(cmUnpkTfuRbAssignB1Val324)
4052
4053    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4054    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4055    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4056    CMCHKUNPK(SUnpkU8, &param->RV, mBuf);
4057    CMCHKUNPK(SUnpkU8, &param->bmiHqAckNack, mBuf);
4058    RETVALUE(ROK);
4059 }
4060
4061 \f
4062 /***********************************************************
4063 *
4064 *     Func : cmUnpkTfuRbAssignVal326
4065 *
4066 *
4067 *     Desc : This structure contains the information needed to convey  RIV value 326.
4068 *
4069 *
4070 *     Ret  : S16
4071 *
4072 *     Notes:
4073 *
4074 *     File  : 
4075 *
4076 **********************************************************/
4077 #ifdef ANSI
4078 PUBLIC S16 cmUnpkTfuRbAssignVal326
4079 (
4080 TfuRbAssignVal326 *param,
4081 Buffer *mBuf
4082 )
4083 #else
4084 PUBLIC S16 cmUnpkTfuRbAssignVal326(param, mBuf)
4085 TfuRbAssignVal326 *param;
4086 Buffer *mBuf;
4087 #endif
4088 {
4089
4090    TRC3(cmUnpkTfuRbAssignVal326)
4091
4092    CMCHKUNPK(SUnpkU8, &param->FreqBandIdx, mBuf);
4093    CMCHKUNPK(SUnpkU8, &param->OCCInd, mBuf);
4094    CMCHKUNPK(SUnpkU8, &param->CyclicShiftInd, mBuf);
4095    RETVALUE(ROK);
4096 }
4097
4098
4099 \f
4100 /***********************************************************
4101 *
4102 *     Func : cmPkTfuDciFormatA1A2Info
4103 *
4104 *
4105 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4106 *
4107 *
4108 *     Ret  : S16
4109 *
4110 *     Notes:
4111 *
4112 *     File  : 
4113 *
4114 **********************************************************/
4115 #ifdef ANSI
4116 PUBLIC S16 cmPkTfuDciFormatA1A2Info
4117 (
4118 TfuDciFormatA1Info *param,
4119 Buffer *mBuf
4120 )
4121 #else
4122 PUBLIC S16 cmPkTfuDciFormatA1A2Info(param, mBuf)
4123 TfuDciFormatA1Info *param;
4124 Buffer *mBuf;
4125 #endif
4126 {
4127
4128    TRC3(cmPkTfuDciFormatA1A2Info)
4129
4130    //printf("5GTF_DBG: cmPkTfuDciFormatA1Info() called by eNB\n");   
4131    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4132    CMCHKPK(SPkU8, param->UL_PCRS, mBuf);
4133    CMCHKPK(SPkU8, param->PMI, mBuf);
4134    CMCHKPK(SPkU8, param->SCID, mBuf);
4135
4136    CMCHKPK(SPkU8, param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4137    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4138    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4139    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4140    CMCHKPK(SPkU8, param->uciOnxPUSCH, mBuf);
4141
4142    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4143    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4144    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4145    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4146    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4147    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4148
4149    if(param->RBAssign <= TFU_RIV_324)
4150    {
4151       CMCHKPK(cmPkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4152    }
4153    else if (param->RBAssign == TFU_RIV_326)
4154    {
4155       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4156    }
4157
4158    CMCHKPK(SPkU8, param->rv, mBuf);
4159    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4160    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4161    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4162    CMCHKPK(SPkU8, param->xPUSCH_TxTiming, mBuf);
4163    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
4164    CMCHKPK(SPkU8, param->formatType, mBuf);
4165    RETVALUE(ROK);
4166 }
4167
4168 \f
4169 /***********************************************************
4170 *
4171 *     Func : cmPkTfuDciFormatB1B2Info
4172 *
4173 *
4174 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4175 *
4176 *
4177 *     Ret  : S16
4178 *
4179 *     Notes:
4180 *
4181 *     File  : 
4182 *
4183 **********************************************************/
4184 #ifdef ANSI
4185 PUBLIC S16 cmPkTfuDciFormatB1B2Info
4186 (
4187 TfuDciFormatB1Info *param,
4188 Buffer *mBuf
4189 )
4190 #else
4191 PUBLIC S16 cmPkTfuDciFormatB1B2Info(param, mBuf)
4192 TfuDciFormatB1Info *param;
4193 Buffer *mBuf;
4194 #endif
4195 {
4196
4197    TRC3(cmPkTfuDciFormatB1B2Info)
4198
4199    CMCHKPK(SPkU8, param->DL_PCRS, mBuf);
4200    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4201    CMCHKPK(SPkU8, param->SCID, mBuf);
4202
4203    CMCHKPK(SPkU8, param->AntPorts_numLayers, mBuf);
4204    CMCHKPK(SPkU8, param->SRS_Symbol, mBuf);
4205    CMCHKPK(SPkU8, param->SRS_Config, mBuf);
4206    CMCHKPK(SPkU8, param->beamSwitch, mBuf);
4207    CMCHKPK(SPkU8, param->freqResIdx_xPUCCH, mBuf);
4208
4209    CMCHKPK(SPkU8, param->xPUCCH_TxTiming, mBuf);
4210
4211    CMCHKPK(SPkU8, param->numBSI_Reports, mBuf);
4212    CMCHKPK(SPkU8, param->CSIRS_BRRS_ProcInd, mBuf);
4213    CMCHKPK(SPkU8, param->CSI_BRRS_Indicator, mBuf);
4214    CMCHKPK(SPkU8, param->CSIRS_BRRS_SymbIdx, mBuf);
4215    CMCHKPK(SPkU8, param->CSIRS_BRRS_TxTiming, mBuf);
4216    CMCHKPK(SPkU8, param->CSI_BSI_BRI_Req, mBuf);
4217
4218    if(param->RBAssign <= TFU_RIV_324)
4219    {
4220       CMCHKPK(cmPkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4221    }
4222    else if (param->RBAssign == TFU_RIV_326)
4223    {
4224       CMCHKPK(cmPkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4225    }
4226   
4227    CMCHKPK(SPkU8, param->symbIdx, mBuf);
4228    CMCHKPK(SPkU8, param->beamIndex, mBuf);
4229    CMCHKPK(SPkU16, param->RBAssign, mBuf);
4230    CMCHKPK(SPkU8, param->xPDSCHRange, mBuf);
4231    CMCHKPK(SPkU8, param->formatType, mBuf);
4232    RETVALUE(ROK);
4233 }
4234
4235
4236 \f
4237 /***********************************************************
4238 *
4239 *     Func : cmUnpkTfuDciFormatA1A2Info
4240 *
4241 *
4242 *     Desc : This structure contains the information needed to convey DCI format A1/A2.
4243 *
4244 *
4245 *     Ret  : S16
4246 *
4247 *     Notes:
4248 *
4249 *     File  : 
4250 *
4251 **********************************************************/
4252 #ifdef ANSI
4253 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info
4254 (
4255 TfuDciFormatA1Info *param,
4256 Buffer *mBuf
4257 )
4258 #else
4259 PUBLIC S16 cmUnpkTfuDciFormatA1A2Info(param, mBuf)
4260 TfuDciFormatA1Info *param;
4261 Buffer *mBuf;
4262 #endif
4263 {
4264
4265    TRC3(cmUnpkTfuDciFormatA1A2Info)
4266
4267    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4268    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
4269    CMCHKUNPK(SUnpkU8, &param->xPUSCH_TxTiming, mBuf);
4270    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4271    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4272    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4273    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4274
4275    if(param->RBAssign <= TFU_RIV_324)
4276    {
4277       CMCHKUNPK(cmUnpkTfuRbAssignA1Val324, &param->u.rbAssignA1Val324, mBuf);
4278    }
4279    else if(param->RBAssign == TFU_RIV_326)
4280    {
4281       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4282    }
4283
4284    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4285    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4286    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4287    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4288    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4289    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4290
4291    CMCHKUNPK(SUnpkU8, &param->uciOnxPUSCH, mBuf);
4292    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4293    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4294    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4295    CMCHKUNPK(SUnpkU8, &param->REMapIdx_DMRS_PCRS_numLayers, mBuf);
4296
4297    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4298    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
4299    CMCHKUNPK(SUnpkU8, &param->UL_PCRS, mBuf);
4300    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4301
4302    RETVALUE(ROK);
4303 }
4304
4305 \f
4306 /***********************************************************
4307 *
4308 *     Func : cmUnpkTfuDciFormatB1B2Info
4309 *
4310 *
4311 *     Desc : This structure contains the information needed to convey DCI format B1/B2.
4312 *
4313 *
4314 *     Ret  : S16
4315 *
4316 *     Notes:
4317 *
4318 *     File  : 
4319 *
4320 **********************************************************/
4321 #ifdef ANSI
4322 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info
4323 (
4324 TfuDciFormatB1Info *param,
4325 Buffer *mBuf
4326 )
4327 #else
4328 PUBLIC S16 cmUnpkTfuDciFormatB1B2Info(param, mBuf)
4329 TfuDciFormatB1Info *param;
4330 Buffer *mBuf;
4331 #endif
4332 {
4333
4334    TRC3(cmUnpkTfuDciFormatB1B2Info)
4335
4336    CMCHKUNPK(SUnpkU8, &param->formatType, mBuf);
4337    CMCHKUNPK(SUnpkU8, &param->xPDSCHRange, mBuf);
4338    CMCHKUNPK(SUnpkU16, &param->RBAssign, mBuf);
4339    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
4340    CMCHKUNPK(SUnpkU8, &param->symbIdx, mBuf);
4341
4342    if(param->RBAssign <= TFU_RIV_324)
4343    {
4344       CMCHKUNPK(cmUnpkTfuRbAssignB1Val324, &param->u.rbAssignB1Val324, mBuf);
4345    }
4346    else if (param->RBAssign == TFU_RIV_326)
4347    {
4348       CMCHKUNPK(cmUnpkTfuRbAssignVal326, &param->u.rbAssignVal326, mBuf);
4349    }
4350
4351    CMCHKUNPK(SUnpkU8, &param->CSI_BSI_BRI_Req, mBuf);
4352    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_TxTiming, mBuf);
4353    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_SymbIdx, mBuf);
4354    CMCHKUNPK(SUnpkU8, &param->CSI_BRRS_Indicator, mBuf);
4355    CMCHKUNPK(SUnpkU8, &param->CSIRS_BRRS_ProcInd, mBuf);
4356    CMCHKUNPK(SUnpkU8, &param->numBSI_Reports, mBuf);
4357
4358    CMCHKUNPK(SUnpkU8, &param->xPUCCH_TxTiming, mBuf);
4359    CMCHKUNPK(SUnpkU8, &param->freqResIdx_xPUCCH, mBuf);
4360    CMCHKUNPK(SUnpkU8, &param->beamSwitch, mBuf);
4361    CMCHKUNPK(SUnpkU8, &param->SRS_Config, mBuf);
4362    CMCHKUNPK(SUnpkU8, &param->SRS_Symbol, mBuf);
4363    CMCHKUNPK(SUnpkU8, &param->AntPorts_numLayers, mBuf);
4364    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
4365    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4366    CMCHKUNPK(SUnpkU8, &param->DL_PCRS, mBuf);
4367
4368    RETVALUE(ROK);
4369 }
4370
4371
4372 #endif /* TFU_5GTF */
4373
4374 \f
4375 /***********************************************************
4376 *
4377 *     Func : cmPkTfuDciFormat0Info
4378 *
4379 *
4380 *     Desc : This structure contains the information needed to convey DCI format 0.
4381 *
4382 *
4383 *     Ret  : S16
4384 *
4385 *     Notes:
4386 *
4387 *     File  : 
4388 *
4389 **********************************************************/
4390 #ifdef ANSI
4391 PUBLIC S16 cmPkTfuDciFormat0Info
4392 (
4393 TfuDciFormat0Info *param,
4394 Buffer *mBuf
4395 )
4396 #else
4397 PUBLIC S16 cmPkTfuDciFormat0Info(param, mBuf)
4398 TfuDciFormat0Info *param;
4399 Buffer *mBuf;
4400 #endif
4401 {
4402
4403    TRC3(cmPkTfuDciFormat0Info)
4404
4405    /* tfu_c_001.main_3: Adding pack for hqProcId */
4406    CMCHKPK(SPkU8, param->hqProcId, mBuf);
4407    CMCHKPK(SPkU8, param->txAntenna, mBuf);
4408    CMCHKPK(SPkU8, param->numCqiBit, mBuf);
4409    CMCHKPK(SPkU8, param->cqiReq, mBuf);
4410    CMCHKPK(SPkU8, param->nDmrs, mBuf);
4411
4412 #ifdef TFU_TDD
4413    CMCHKPK(SPkU8, param->dai, mBuf);
4414    CMCHKPK(SPkU8, param->ulIdx, mBuf);
4415
4416 #endif
4417    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4418    CMCHKPK(SPkU8, param->ndi, mBuf);
4419    CMCHKPK(SPkU8, param->mcs, mBuf);
4420    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
4421 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
4422 #ifdef TFU_UPGRADE
4423    CMCHKPK(SPkU32, param->riv, mBuf);
4424 #endif
4425    CMCHKPK(SPkU8, param->numRb, mBuf);
4426    CMCHKPK(SPkU8, param->rbStart, mBuf);
4427    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
4428    RETVALUE(ROK);
4429 }
4430
4431
4432 \f
4433 /***********************************************************
4434 *
4435 *     Func : cmUnpkTfuDciFormat0Info
4436 *
4437 *
4438 *     Desc : This structure contains the information needed to convey DCI format 0.
4439 *
4440 *
4441 *     Ret  : S16
4442 *
4443 *     Notes:
4444 *
4445 *     File  : 
4446 *
4447 **********************************************************/
4448 #ifdef ANSI
4449 PUBLIC S16 cmUnpkTfuDciFormat0Info
4450 (
4451 TfuDciFormat0Info *param,
4452 Buffer *mBuf
4453 )
4454 #else
4455 PUBLIC S16 cmUnpkTfuDciFormat0Info(param, mBuf)
4456 TfuDciFormat0Info *param;
4457 Buffer *mBuf;
4458 #endif
4459 {
4460
4461    TRC3(cmUnpkTfuDciFormat0Info)
4462
4463    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
4464    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
4465    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
4466 #ifdef TFU_UPGRADE
4467    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
4468 #endif /* TFU_UPGRADE */
4469    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
4470    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4471    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4472    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4473
4474 #ifdef TFU_TDD
4475    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
4476    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4477
4478 #endif
4479    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
4480    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
4481    CMCHKUNPK(SUnpkU8, &param->numCqiBit, mBuf);
4482    CMCHKUNPK(SUnpkU8, &param->txAntenna, mBuf);
4483    /* tfu_c_001.main_3: Adding unpack for hqProcId */
4484    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
4485
4486    RETVALUE(ROK);
4487 }
4488
4489
4490 \f
4491 /***********************************************************
4492 *
4493 *     Func : cmPkTfuAllocMapOrRiv
4494 *
4495 *
4496 *     Desc : This Structure could either contain a resource allocation bit map OR a
4497  * RIV Value as defined in 213 - 7.1.6.
4498 *
4499 *
4500 *     Ret  : S16
4501 *
4502 *     Notes:
4503 *
4504 *     File  : 
4505 *
4506 **********************************************************/
4507 #ifdef ANSI
4508 PUBLIC S16 cmPkTfuAllocMapOrRiv
4509 (
4510 TfuAllocMapOrRiv *param,
4511 Buffer *mBuf
4512 )
4513 #else
4514 PUBLIC S16 cmPkTfuAllocMapOrRiv(param, mBuf)
4515 TfuAllocMapOrRiv *param;
4516 Buffer *mBuf;
4517 #endif
4518 {
4519
4520    S32 i;
4521    TRC3(cmPkTfuAllocMapOrRiv)
4522
4523       switch(param->type) {
4524       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4525 #ifdef TFU_RESMAP_CHANGE
4526          case UnKnown:
4527             CMCHKPK(cmPkTfuAllocMap, &param->u.allocMap, mBuf);
4528             break;
4529    
4530 #endif
4531    
4532       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4533 #ifndef TFU_RESMAP_CHANGE
4534          case TFU_ALLOC_TYPE_MAP:
4535             for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4536                CMCHKPK(SPkU8, param->u.resAllocMap[i], mBuf);
4537             }
4538             break;
4539    
4540 #endif
4541          case TFU_ALLOC_TYPE_RIV:
4542             CMCHKPK(SPkU32, param->u.riv, mBuf);
4543             break;
4544          default :
4545             RETVALUE(RFAILED);
4546       }
4547    CMCHKPK(SPkU32, param->type, mBuf);
4548    RETVALUE(ROK);
4549 }
4550
4551
4552 \f
4553 /***********************************************************
4554 *
4555 *     Func : cmUnpkTfuAllocMapOrRiv
4556 *
4557 *
4558 *     Desc : This Structure could either contain a resource allocation bit map OR a
4559  * RIV Value as defined in 213 - 7.1.6.
4560 *
4561 *
4562 *     Ret  : S16
4563 *
4564 *     Notes:
4565 *
4566 *     File  : 
4567 *
4568 **********************************************************/
4569 #ifdef ANSI
4570 PUBLIC S16 cmUnpkTfuAllocMapOrRiv
4571 (
4572 TfuAllocMapOrRiv *param,
4573 Buffer *mBuf
4574 )
4575 #else
4576 PUBLIC S16 cmUnpkTfuAllocMapOrRiv(param, mBuf)
4577 TfuAllocMapOrRiv *param;
4578 Buffer *mBuf;
4579 #endif
4580 {
4581
4582    S32 i;
4583    TRC3(cmUnpkTfuAllocMapOrRiv)
4584
4585    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
4586       switch(param->type) {
4587          case TFU_ALLOC_TYPE_RIV:
4588             CMCHKUNPK(SUnpkU32, &param->u.riv, mBuf);
4589             break;
4590    
4591       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4592 #ifndef TFU_RESMAP_CHANGE
4593          case TFU_ALLOC_TYPE_MAP:
4594             for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4595                CMCHKUNPK(SUnpkU8, &param->u.resAllocMap[i], mBuf);
4596             }
4597             break;
4598    
4599 #endif
4600    
4601       /*tfu_c_001.main_7 - ADD - TFU_RESMAP_CHANGE support */
4602 #ifdef TFU_RESMAP_CHANGE
4603          case UnKnown:
4604             CMCHKUNPK(cmUnpkTfuAllocMap, &param->u.allocMap, mBuf);
4605             break;
4606    
4607 #endif
4608          default :
4609             RETVALUE(RFAILED);
4610       }
4611    RETVALUE(ROK);
4612 }
4613
4614
4615 \f
4616 /***********************************************************
4617 *
4618 *     Func : cmPkTfuDciFormat1AllocInfo
4619 *
4620 *
4621 *     Desc : This structure contains only the allocation information, thats part
4622  * of DCI format 1. 
4623  * @details Allocation information also contains parameters necessary
4624  * for Physical layer to process Downlink Data. This structure accompanies the
4625  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4626  * @sa TfuDciFormat1Info
4627 *
4628 *
4629 *     Ret  : S16
4630 *
4631 *     Notes:
4632 *
4633 *     File  : 
4634 *
4635 **********************************************************/
4636 #ifdef ANSI
4637 PUBLIC S16 cmPkTfuDciFormat1AllocInfo
4638 (
4639 TfuDciFormat1AllocInfo *param,
4640 Buffer *mBuf
4641 )
4642 #else
4643 PUBLIC S16 cmPkTfuDciFormat1AllocInfo(param, mBuf)
4644 TfuDciFormat1AllocInfo *param;
4645 Buffer *mBuf;
4646 #endif
4647 {
4648
4649    S32 i;
4650    TRC3(cmPkTfuDciFormat1AllocInfo)
4651
4652    CMCHKPK(SPkU8, param->rv, mBuf);
4653    CMCHKPK(SPkU8, param->mcs, mBuf);
4654    CMCHKPK(SPkU8, param->ndi, mBuf);
4655    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4656    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4657       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4658    }
4659    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4660    RETVALUE(ROK);
4661 }
4662
4663
4664 \f
4665 /***********************************************************
4666 *
4667 *     Func : cmUnpkTfuDciFormat1AllocInfo
4668 *
4669 *
4670 *     Desc : This structure contains only the allocation information, thats part
4671  * of DCI format 1. 
4672  * @details Allocation information also contains parameters necessary
4673  * for Physical layer to process Downlink Data. This structure accompanies the
4674  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4675  * @sa TfuDciFormat1Info
4676 *
4677 *
4678 *     Ret  : S16
4679 *
4680 *     Notes:
4681 *
4682 *     File  : 
4683 *
4684 **********************************************************/
4685 #ifdef ANSI
4686 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo
4687 (
4688 TfuDciFormat1AllocInfo *param,
4689 Buffer *mBuf
4690 )
4691 #else
4692 PUBLIC S16 cmUnpkTfuDciFormat1AllocInfo(param, mBuf)
4693 TfuDciFormat1AllocInfo *param;
4694 Buffer *mBuf;
4695 #endif
4696 {
4697
4698    S32 i;
4699    TRC3(cmUnpkTfuDciFormat1AllocInfo)
4700
4701    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4702    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4703       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4704    }
4705    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4706    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
4707    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
4708    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
4709    RETVALUE(ROK);
4710 }
4711
4712 \f
4713 /***********************************************************
4714 *
4715 *     Func : cmPkTfuDciFormat1Info
4716 *
4717 *
4718 *     Desc : This structure contains the information needed to convey DCI format 1.
4719  * @details Allocation information is separated from the other control
4720  * information carried in this format. This separation is needed as Data shall
4721  * also carry some control information, essentially allocation information,
4722  * along with it, in order to aid physical layer processing of the data.
4723 *
4724 *
4725 *     Ret  : S16
4726 *
4727 *     Notes:
4728 *
4729 *     File  : 
4730 *
4731 **********************************************************/
4732 #ifdef ANSI
4733 PUBLIC S16 cmPkTfuDciFormat1Info
4734 (
4735 TfuDciFormat1Info *param,
4736 Buffer *mBuf
4737 )
4738 #else
4739 PUBLIC S16 cmPkTfuDciFormat1Info(param, mBuf)
4740 TfuDciFormat1Info *param;
4741 Buffer *mBuf;
4742 #endif
4743 {
4744
4745    TRC3(cmPkTfuDciFormat1Info)
4746
4747    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
4748
4749 #ifdef TFU_TDD
4750    CMCHKPK(SPkU8, param->dai, mBuf);
4751
4752 #endif
4753    CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4754    RETVALUE(ROK);
4755 }
4756
4757
4758 \f
4759 /***********************************************************
4760 *
4761 *     Func : cmUnpkTfuDciFormat1Info
4762 *
4763 *
4764 *     Desc : This structure contains the information needed to convey DCI format 1.
4765  * @details Allocation information is separated from the other control
4766  * information carried in this format. This separation is needed as Data shall
4767  * also carry some control information, essentially allocation information,
4768  * along with it, in order to aid physical layer processing of the data.
4769 *
4770 *
4771 *     Ret  : S16
4772 *
4773 *     Notes:
4774 *
4775 *     File  : 
4776 *
4777 **********************************************************/
4778 #ifdef ANSI
4779 PUBLIC S16 cmUnpkTfuDciFormat1Info
4780 (
4781 TfuDciFormat1Info *param,
4782 Buffer *mBuf
4783 )
4784 #else
4785 PUBLIC S16 cmUnpkTfuDciFormat1Info(param, mBuf)
4786 TfuDciFormat1Info *param;
4787 Buffer *mBuf;
4788 #endif
4789 {
4790
4791    TRC3(cmUnpkTfuDciFormat1Info)
4792
4793    CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->allocInfo, mBuf);
4794
4795 #ifdef TFU_TDD
4796    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
4797
4798 #endif
4799    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
4800    RETVALUE(ROK);
4801 }
4802
4803
4804 \f
4805 /***********************************************************
4806 *
4807 *     Func : cmPkTfuDciFormat2AAllocInfo
4808 *
4809 *
4810 *     Desc : This structure contains only the allocation information, that is part
4811   * of DCI format 2A. 
4812   * @details Allocation information also contains parameters necessary
4813   * for Physical layer to process Downlink data. This structure accompanies the
4814   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4815   * @sa TfuDciFormat2AInfo
4816 *
4817 *
4818 *     Ret  : S16
4819 *
4820 *     Notes:
4821 *
4822 *     File  : 
4823 *
4824 **********************************************************/
4825 #ifdef ANSI
4826 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo
4827 (
4828 TfuDciFormat2AAllocInfo *param,
4829 Buffer *mBuf
4830 )
4831 #else
4832 PUBLIC S16 cmPkTfuDciFormat2AAllocInfo(param, mBuf)
4833 TfuDciFormat2AAllocInfo *param;
4834 Buffer *mBuf;
4835 #endif
4836 {
4837
4838    S32 i;
4839    TRC3(cmPkTfuDciFormat2AAllocInfo)
4840
4841    CMCHKPK(SPkU8, param->transSwap, mBuf);
4842    CMCHKPK(SPkU8, param->precoding, mBuf);
4843
4844    for (i=1; i >= 0; i--) {
4845       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4846    }
4847
4848    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4849    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
4850       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
4851    }
4852
4853    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
4854
4855    RETVALUE(ROK);
4856 }
4857
4858
4859 \f
4860 /***********************************************************
4861 *
4862 *     Func : cmUnpkTfuDciFormat2AAllocInfo
4863 *
4864 *
4865 *     Desc : This structure contains only the allocation information, that is part
4866   * of DCI format 2A. 
4867   * @details Allocation information also contains parameters necessary
4868   * for Physical layer to process Downlink data. This structure accompanies the
4869   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4870   * @sa TfuDciFormat2AInfo
4871 *
4872 *
4873 *     Ret  : S16
4874 *
4875 *     Notes:
4876 *
4877 *     File  : 
4878 *
4879 **********************************************************/
4880 #ifdef ANSI
4881 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo
4882 (
4883 TfuDciFormat2AAllocInfo *param,
4884 Buffer *mBuf
4885 )
4886 #else
4887 PUBLIC S16 cmUnpkTfuDciFormat2AAllocInfo(param, mBuf)
4888 TfuDciFormat2AAllocInfo *param;
4889 Buffer *mBuf;
4890 #endif
4891 {
4892
4893    S32 i;
4894    TRC3(cmUnpkTfuDciFormat2AAllocInfo)
4895
4896
4897 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4898 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4899    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
4900
4901
4902 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4903 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4904    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
4905       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
4906    }
4907    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
4908
4909 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4910 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4911
4912 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
4913 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
4914    for (i=0; i<=1; i++) {
4915       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
4916    }
4917
4918    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
4919    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
4920    RETVALUE(ROK);
4921 }
4922
4923 #ifdef EMTC_ENABLE
4924 /***********************************************************
4925 *
4926 *     Func : cmPkTfuDciFormat6AAllocInfo
4927 *
4928 *
4929 *     Desc : This structure contains only the allocation information, that is part
4930   * of DCI format 6-1A. 
4931   * @details Allocation information also contains parameters necessary
4932   * for Physical layer to process Downlink data. This structure accompanies the
4933   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4934   * @sa TfuDciFormat61aInfo
4935 *
4936 *
4937 *     Ret  : S16
4938 *
4939 *     Notes:
4940 *
4941 *     File  : 
4942 *
4943 **********************************************************/
4944 #ifdef ANSI
4945 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo
4946 (
4947 TfuDciFormat61AllocInfo *param,
4948 Buffer *mBuf
4949 )
4950 #else
4951 PUBLIC S16 cmPkTfuDciFormat6AAllocInfo(param, mBuf)
4952 TfuDciFormat61AllocInfo *param;
4953 Buffer *mBuf;
4954 #endif
4955 {
4956
4957    TRC3(cmPkTfuDciFormat6AAllocInfo)
4958
4959    CMCHKPK(SPkU8, param->rv, mBuf);
4960    CMCHKPK(SPkU8, param->mcs, mBuf);
4961    CMCHKPK(SPkU8, param->ndi, mBuf);
4962    CMCHKPK(SPkU8, param->harqProcId, mBuf);
4963    CMCHKPK(SPkU32, param->riv, mBuf);
4964
4965    RETVALUE(ROK);
4966 }
4967
4968
4969 \f
4970 /***********************************************************
4971 *
4972 *     Func : cmUnpkTfuDciFormat6AAllocInfo
4973 *
4974 *
4975 *     Desc : This structure contains only the allocation information, that is part
4976   * of DCI format 6-1A. 
4977   * @details Allocation information also contains parameters necessary
4978   * for Physical layer to process Downlink data. This structure accompanies the
4979   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
4980   * @sa TfuDciFormat61aInfo
4981 *
4982 *
4983 *     Ret  : S16
4984 *
4985 *     Notes:
4986 *
4987 *     File  : 
4988 *
4989 **********************************************************/
4990 #ifdef ANSI
4991 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo
4992 (
4993 TfuDciFormat61AllocInfo *param,
4994 Buffer *mBuf
4995 )
4996 #else
4997 PUBLIC S16 cmUnpkTfuDciFormat6AAllocInfo(param, mBuf)
4998 TfuDciFormat61AllocInfo *param;
4999 Buffer *mBuf;
5000 #endif
5001 {
5002
5003    TRC3(cmUnpkTfuDciFormat6AAllocInfo)
5004
5005    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5006    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5007    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5008    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5009    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5010    printf("In cmUnpkTfuDciFormat6AAllocInfo :: Passed \n");
5011    RETVALUE(ROK);
5012 }
5013 #endif
5014
5015
5016 \f
5017 /***********************************************************
5018 *
5019 *     Func : cmPkTfuDciFormat2AInfo
5020 *
5021 *
5022 *     Desc : This structure contains the information carried by DCI format 2A. 
5023  * @details It carries the allocation information and other control information.
5024 *
5025 *
5026 *     Ret  : S16
5027 *
5028 *     Notes:
5029 *
5030 *     File  : 
5031 *
5032 **********************************************************/
5033 #ifdef ANSI
5034 PUBLIC S16 cmPkTfuDciFormat2AInfo
5035 (
5036 TfuDciFormat2AInfo *param,
5037 Buffer *mBuf
5038 )
5039 #else
5040 PUBLIC S16 cmPkTfuDciFormat2AInfo(param, mBuf)
5041 TfuDciFormat2AInfo *param;
5042 Buffer *mBuf;
5043 #endif
5044 {
5045
5046    TRC3(cmPkTfuDciFormat2AInfo)
5047
5048    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5049
5050 #ifdef TFU_TDD
5051    CMCHKPK(SPkU8, param->dai, mBuf);
5052
5053 #endif
5054    CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5055    RETVALUE(ROK);
5056 }
5057
5058
5059 \f
5060 /***********************************************************
5061 *
5062 *     Func : cmUnpkTfuDciFormat2AInfo
5063 *
5064 *
5065 *     Desc : This structure contains the information carried by DCI format 2A. 
5066  * @details It carries the allocation information and other control information.
5067 *
5068 *
5069 *     Ret  : S16
5070 *
5071 *     Notes:
5072 *
5073 *     File  : 
5074 *
5075 **********************************************************/
5076 #ifdef ANSI
5077 PUBLIC S16 cmUnpkTfuDciFormat2AInfo
5078 (
5079 TfuDciFormat2AInfo *param,
5080 Buffer *mBuf
5081 )
5082 #else
5083 PUBLIC S16 cmUnpkTfuDciFormat2AInfo(param, mBuf)
5084 TfuDciFormat2AInfo *param;
5085 Buffer *mBuf;
5086 #endif
5087 {
5088
5089    TRC3(cmUnpkTfuDciFormat2AInfo)
5090
5091    CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->allocInfo, mBuf);
5092
5093 #ifdef TFU_TDD
5094    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5095
5096 #endif
5097    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5098    RETVALUE(ROK);
5099 }
5100
5101
5102 \f
5103 /***********************************************************
5104 *
5105 *     Func : cmPkTfuDciFormat2AllocInfo
5106 *
5107 *
5108 *     Desc : This structure contains only the allocation information, that is part
5109   * of DCI format 2. 
5110   * @details Allocation information also contains parameters necessary
5111   * for Physical layer to process Downlink data. This structure accompanies the
5112   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5113   * @sa TfuDciFormat2Info
5114 *
5115 *
5116 *     Ret  : S16
5117 *
5118 *     Notes:
5119 *
5120 *     File  : 
5121 *
5122 **********************************************************/
5123 #ifdef ANSI
5124 PUBLIC S16 cmPkTfuDciFormat2AllocInfo
5125 (
5126 TfuDciFormat2AllocInfo *param,
5127 Buffer *mBuf
5128 )
5129 #else
5130 PUBLIC S16 cmPkTfuDciFormat2AllocInfo(param, mBuf)
5131 TfuDciFormat2AllocInfo *param;
5132 Buffer *mBuf;
5133 #endif
5134 {
5135
5136    S32 i;
5137    TRC3(cmPkTfuDciFormat2AllocInfo)
5138
5139
5140 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5141 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5142    for (i=1; i >= 0; i--) {
5143       CMCHKPK(cmPkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5144    }
5145    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5146
5147    CMCHKPK(SPkU8, param->precoding, mBuf);
5148    CMCHKPK(SPkU8, param->transSwap, mBuf);
5149
5150 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5151 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5152
5153 #ifdef TFU_TDD
5154    CMCHKPK(SPkU8, param->dai, mBuf);
5155
5156 #endif
5157    for (i=TFU_MAX_ALLOC_BYTES-1; i >= 0; i--) {
5158       CMCHKPK(SPkU8, param->resAllocMap[i], mBuf);
5159    }
5160
5161 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5162 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5163
5164 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5165 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5166    CMCHKPK(SPkU8, param->isAllocType0, mBuf);
5167
5168    RETVALUE(ROK);
5169 }
5170
5171
5172 \f
5173 /***********************************************************
5174 *
5175 *     Func : cmUnpkTfuDciFormat2AllocInfo
5176 *
5177 *
5178 *     Desc : This structure contains only the allocation information, that is part
5179   * of DCI format 2. 
5180   * @details Allocation information also contains parameters necessary
5181   * for Physical layer to process Downlink data. This structure accompanies the
5182   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5183   * @sa TfuDciFormat2Info
5184 *
5185 *
5186 *     Ret  : S16
5187 *
5188 *     Notes:
5189 *
5190 *     File  : 
5191 *
5192 **********************************************************/
5193 #ifdef ANSI
5194 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo
5195 (
5196 TfuDciFormat2AllocInfo *param,
5197 Buffer *mBuf
5198 )
5199 #else
5200 PUBLIC S16 cmUnpkTfuDciFormat2AllocInfo(param, mBuf)
5201 TfuDciFormat2AllocInfo *param;
5202 Buffer *mBuf;
5203 #endif
5204 {
5205
5206    S32 i;
5207    TRC3(cmUnpkTfuDciFormat2AllocInfo)
5208
5209
5210 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5211 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5212    CMCHKUNPK(SUnpkU8, &param->isAllocType0, mBuf);
5213
5214
5215 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5216 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5217    for (i=0; i<TFU_MAX_ALLOC_BYTES; i++) {
5218       CMCHKUNPK(SUnpkU8, &param->resAllocMap[i], mBuf);
5219    }
5220
5221 #ifdef TFU_TDD
5222    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5223
5224 #endif
5225
5226 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5227 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5228    CMCHKUNPK(SUnpkU8, &param->transSwap, mBuf);
5229    CMCHKUNPK(SUnpkU8, &param->precoding, mBuf);
5230
5231 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5232 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5233    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
5234    for (i=0; i<=1; i++) {
5235       CMCHKUNPK(cmUnpkTfuDciFormatTbInfo, &param->tbInfo[i], mBuf);
5236    }
5237
5238    RETVALUE(ROK);
5239 }
5240
5241
5242 \f
5243 /***********************************************************
5244 *
5245 *     Func : cmPkTfuDciFormat2Info
5246 *
5247 *
5248 *     Desc : This structure contains the information carried by DCI format 2.
5249  * @details Allocation information is separated from the other control
5250  * information carried in this format. This separation is needed as Data must
5251  * also carry some control information, essentially, allocation information
5252  * along with it, in order to aid physical layer processing of the data.
5253 *
5254 *
5255 *     Ret  : S16
5256 *
5257 *     Notes:
5258 *
5259 *     File  : 
5260 *
5261 **********************************************************/
5262 #ifdef ANSI
5263 PUBLIC S16 cmPkTfuDciFormat2Info
5264 (
5265 TfuDciFormat2Info *param,
5266 Buffer *mBuf
5267 )
5268 #else
5269 PUBLIC S16 cmPkTfuDciFormat2Info(param, mBuf)
5270 TfuDciFormat2Info *param;
5271 Buffer *mBuf;
5272 #endif
5273 {
5274
5275    TRC3(cmPkTfuDciFormat2Info)
5276
5277
5278 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5279 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5280
5281 #ifdef TFU_TDD
5282    CMCHKPK(SPkU8, param->dai, mBuf);
5283
5284 #endif
5285
5286    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5287
5288 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5289 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5290    CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5291    RETVALUE(ROK);
5292 }
5293
5294
5295 \f
5296 /***********************************************************
5297 *
5298 *     Func : cmUnpkTfuDciFormat2Info
5299 *
5300 *
5301 *     Desc : This structure contains the information carried by DCI format 2.
5302  * @details Allocation information is separated from the other control
5303  * information carried in this format. This separation is needed as Data must
5304  * also carry some control information, essentially, allocation information
5305  * along with it, in order to aid physical layer processing of the data.
5306 *
5307 *
5308 *     Ret  : S16
5309 *
5310 *     Notes:
5311 *
5312 *     File  : 
5313 *
5314 **********************************************************/
5315 #ifdef ANSI
5316 PUBLIC S16 cmUnpkTfuDciFormat2Info
5317 (
5318 TfuDciFormat2Info *param,
5319 Buffer *mBuf
5320 )
5321 #else
5322 PUBLIC S16 cmUnpkTfuDciFormat2Info(param, mBuf)
5323 TfuDciFormat2Info *param;
5324 Buffer *mBuf;
5325 #endif
5326 {
5327
5328    TRC3(cmUnpkTfuDciFormat2Info)
5329
5330    CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->allocInfo, mBuf);
5331
5332 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5333 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5334    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5335
5336 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
5337 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
5338
5339 #ifdef TFU_TDD
5340    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5341
5342 #endif
5343
5344    RETVALUE(ROK);
5345 }
5346
5347
5348 \f
5349 /***********************************************************
5350 *
5351 *     Func : cmPkTfuDciFormat3Info
5352 *
5353 *
5354 *     Desc : This structure contains the information carried in DCI format 3.
5355 *
5356 *
5357 *     Ret  : S16
5358 *
5359 *     Notes:
5360 *
5361 *     File  : 
5362 *
5363 **********************************************************/
5364 #ifdef ANSI
5365 PUBLIC S16 cmPkTfuDciFormat3Info
5366 (
5367 TfuDciFormat3Info *param,
5368 Buffer *mBuf
5369 )
5370 #else
5371 PUBLIC S16 cmPkTfuDciFormat3Info(param, mBuf)
5372 TfuDciFormat3Info *param;
5373 Buffer *mBuf;
5374 #endif
5375 {
5376
5377    S32 i;
5378    TRC3(cmPkTfuDciFormat3Info)
5379
5380    CMCHKPK(SPkU8, param->isPucch, mBuf);
5381    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5382       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5383    }
5384    RETVALUE(ROK);
5385 }
5386
5387
5388 \f
5389 /***********************************************************
5390 *
5391 *     Func : cmUnpkTfuDciFormat3Info
5392 *
5393 *
5394 *     Desc : This structure contains the information carried in DCI format 3.
5395 *
5396 *
5397 *     Ret  : S16
5398 *
5399 *     Notes:
5400 *
5401 *     File  : 
5402 *
5403 **********************************************************/
5404 #ifdef ANSI
5405 PUBLIC S16 cmUnpkTfuDciFormat3Info
5406 (
5407 TfuDciFormat3Info *param,
5408 Buffer *mBuf
5409 )
5410 #else
5411 PUBLIC S16 cmUnpkTfuDciFormat3Info(param, mBuf)
5412 TfuDciFormat3Info *param;
5413 Buffer *mBuf;
5414 #endif
5415 {
5416
5417    S32 i;
5418    TRC3(cmUnpkTfuDciFormat3Info)
5419
5420    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5421       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5422    }
5423    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5424    RETVALUE(ROK);
5425 }
5426
5427
5428 \f
5429 /***********************************************************
5430 *
5431 *     Func : cmPkTfuDciFormat3AInfo
5432 *
5433 *
5434 *     Desc : This structure contains the information carried by DCI format 3A.
5435 *
5436 *
5437 *     Ret  : S16
5438 *
5439 *     Notes:
5440 *
5441 *     File  : 
5442 *
5443 **********************************************************/
5444 #ifdef ANSI
5445 PUBLIC S16 cmPkTfuDciFormat3AInfo
5446 (
5447 TfuDciFormat3AInfo *param,
5448 Buffer *mBuf
5449 )
5450 #else
5451 PUBLIC S16 cmPkTfuDciFormat3AInfo(param, mBuf)
5452 TfuDciFormat3AInfo *param;
5453 Buffer *mBuf;
5454 #endif
5455 {
5456
5457    S32 i;
5458    TRC3(cmPkTfuDciFormat3AInfo)
5459    CMCHKPK(SPkU8, param->isPucch, mBuf);
5460    for (i=TFU_MAX_2BIT_TPC-1; i >= 0; i--) {
5461       CMCHKPK(SPkU8, param->tpcCmd[i], mBuf);
5462    }
5463    RETVALUE(ROK);
5464 }
5465
5466
5467 \f
5468 /***********************************************************
5469 *
5470 *     Func : cmUnpkTfuDciFormat3AInfo
5471 *
5472 *
5473 *     Desc : This structure contains the information carried by DCI format 3A.
5474 *
5475 *
5476 *     Ret  : S16
5477 *
5478 *     Notes:
5479 *
5480 *     File  : 
5481 *
5482 **********************************************************/
5483 #ifdef ANSI
5484 PUBLIC S16 cmUnpkTfuDciFormat3AInfo
5485 (
5486 TfuDciFormat3AInfo *param,
5487 Buffer *mBuf
5488 )
5489 #else
5490 PUBLIC S16 cmUnpkTfuDciFormat3AInfo(param, mBuf)
5491 TfuDciFormat3AInfo *param;
5492 Buffer *mBuf;
5493 #endif
5494 {
5495
5496    S32 i;
5497    TRC3(cmUnpkTfuDciFormat3AInfo)
5498
5499    for (i=0; i<TFU_MAX_2BIT_TPC; i++) {
5500       CMCHKUNPK(SUnpkU8, &param->tpcCmd[i], mBuf);
5501    }
5502    CMCHKUNPK(SUnpkU8, &param->isPucch, mBuf);
5503    RETVALUE(ROK);
5504 }
5505
5506 #ifdef EMTC_ENABLE
5507
5508
5509 /***********************************************************
5510 *
5511 *     Func : cmPkTfuDciFormat60aInfo 
5512 *
5513 *
5514 *     Desc : This structure contains the information that is carried in DCI
5515   * format 6-0A
5516 *
5517 *
5518 *     Ret  : S16
5519 *
5520 *     Notes:
5521 *
5522 *     File  :
5523 *
5524 ************************************************************/
5525
5526 #ifdef ANSI
5527 PRIVATE S16 cmPkTfuDciFormat60aInfo
5528 (
5529 TfuDciFormat60aInfo *param,
5530 Buffer *mBuf
5531 )
5532 #else
5533 PRIVATE S16 cmPkTfuDciFormat60aInfo(param, mBuf)
5534 TfuDciFormat60aInfo *param;
5535 Buffer *mBuf;
5536 #endif
5537 {
5538
5539    TRC3(cmPkTfuDciFormat60aInfo)
5540
5541    CMCHKPK(SPkU8, param->dciRep, mBuf);
5542    CMCHKPK(SPkU8, param->isSrs, mBuf);
5543    CMCHKPK(SPkU8, param->cqiReq, mBuf);
5544 #ifdef TFU_TDD
5545    CMCHKPK(SPkU8, param->dai, mBuf);
5546    CMCHKPK(SPkU8, param->ulIdx, mBuf);
5547 #endif
5548    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5549    CMCHKPK(SPkU8, param->rv, mBuf);
5550    CMCHKPK(SPkU8, param->ndi, mBuf);
5551    CMCHKPK(SPkU8, param->hqProcId, mBuf);
5552    CMCHKPK(SPkU8, param->rep, mBuf);
5553    CMCHKPK(SPkU8, param->mcs, mBuf);
5554    CMCHKPK(SPkU32, param->riv, mBuf);
5555    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5556    RETVALUE(ROK);
5557 }
5558 /***********************************************************
5559 *
5560 *     Func : cmPkTfuPdcchOrderInfoEmtc
5561 *
5562 *
5563 *     Desc : This structure contains the information that is carried in DCI
5564   * format 6-1A in the case of a PDCCH order.
5565 *
5566 *
5567 *     Ret  : S16
5568 *
5569 *     Notes:
5570 *
5571 *     File  : 
5572 *
5573 **********************************************************/
5574 #ifdef ANSI
5575 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc
5576 (
5577 TfuPdcchOrderInfoEmtc *param,
5578 Buffer *mBuf
5579 )
5580 #else
5581 PRIVATE S16 cmPkTfuPdcchOrderInfoEmtc(param, mBuf)
5582 TfuPdcchOrderInfoEmtc *param;
5583 Buffer *mBuf;
5584 #endif
5585 {
5586
5587    TRC3(cmPkTfuPdcchOrderInfoEmtc)
5588
5589    CMCHKPK(SPkU8, param->ceLevel, mBuf);
5590    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
5591    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
5592    CMCHKPK(SPkU32, param->riv, mBuf);
5593    RETVALUE(ROK);
5594 }
5595
5596 /***********************************************************
5597 *
5598 *     Func : cmPkTfudciformat61aPdsch
5599 *
5600 *
5601 *     Desc : This structure contains the information carried in DCI format 6-1A
5602   * when it is NOT used for a PDCCH order.
5603 *
5604 *
5605 *     Ret  : S16
5606 *
5607 *     Notes:
5608 *
5609 *     File  : 
5610 *
5611 **********************************************************/
5612 #ifdef ANSI
5613 PRIVATE S16 cmPkTfudciformat61aPdsch
5614 (
5615 Tfudciformat61aPdsch *param,
5616 Buffer *mBuf
5617 )
5618 #else
5619 PRIVATE S16 cmPkTfudciformat61aPdsch(param, mBuf)
5620 Tfudciformat61aPdsch *param;
5621 Buffer *mBuf;
5622 #endif
5623 {
5624
5625    TRC3(cmPkTfudciformat61aPdsch)
5626
5627    CMCHKPK(SPkU8, param->isTBMsg4, mBuf);
5628    CMCHKPK(SPkU8, param->dciRep, mBuf);
5629    CMCHKPK(SPkU8, param->harqAckOffst, mBuf);
5630    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
5631    CMCHKPK(SPkU8, param->tPmi, mBuf);
5632    CMCHKPK(SPkU8, param->isSrs, mBuf);
5633    CMCHKPK(SPkU8, param->antPortAndScrId, mBuf);
5634
5635 #ifdef TFU_TDD
5636    CMCHKPK(SPkU8, param->dai, mBuf);
5637 #endif
5638    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5639    CMCHKPK(SPkU8, param->rep, mBuf);
5640    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
5641    CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
5642    RETVALUE(ROK);
5643 }
5644
5645
5646 /***********************************************************
5647 *
5648 *     Func : cmPkTfuDciFormat61aInfo
5649 *
5650 *
5651 *     Desc : This structure contains the information needed to convey DCI format 6-1A.
5652  * @details Format can possibly carry PDSCH allocation or information needed for
5653  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
5654  * sync with eNodeB.
5655 *
5656 *
5657 *     Ret  : S16
5658 *
5659 *     Notes:
5660 *
5661 *     File  : 
5662 *
5663 **********************************************************/
5664 #ifdef ANSI
5665 PUBLIC S16 cmPkTfuDciFormat61aInfo
5666 (
5667 TfuDciFormat61aInfo *param,
5668 Buffer *mBuf
5669 )
5670 #else
5671 PUBLIC S16 cmPkTfuDciFormat61aInfo(param, mBuf)
5672 TfuDciFormat61aInfo *param;
5673 Buffer *mBuf;
5674 #endif
5675 {
5676
5677    TRC3(cmPkTfuDciFormat61aInfo)
5678
5679    switch(param->isPdcchOrder) {
5680       case FALSE:
5681          CMCHKPK(cmPkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5682          break;
5683       case TRUE:
5684          CMCHKPK(cmPkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5685          break;
5686       default :
5687          RETVALUE(RFAILED);
5688       }
5689    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
5690
5691    RETVALUE(ROK);
5692 }
5693
5694 /***********************************************************
5695 *
5696 *     Func : cmUnpkTfuDciFormat60aInfo
5697 *
5698 *
5699 *     Desc : This structure contains the information that is carried in DCI
5700   * format 6-0A.
5701 *
5702 *
5703 *     Ret  : S16
5704 *
5705 *     Notes:
5706 *
5707 *     File  : 
5708 *
5709 * **********************************************************/
5710
5711 #ifdef ANSI
5712 PRIVATE S16 cmUnpkTfuDciFormat60aInfo 
5713 (
5714 TfuDciFormat60aInfo *param,
5715 Buffer *mBuf
5716 )
5717 #else
5718 PRIVATE S16 cmUnpkTfuDciFormat60aInfo(param, mBuf)
5719 TfuDciFormat60aInfo *param;
5720 Buffer *mBuf;
5721 #endif
5722 {
5723
5724    TRC3(cmUnpkTfuDciFormat60aInfo)
5725
5726    printf("In cmUnpkTfuDciFormat60aInfo :: Entry \n");
5727    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
5728    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5729    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5730    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
5731    CMCHKUNPK(SUnpkU8, &param->hqProcId, mBuf);
5732    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
5733    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5734    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
5735 #ifdef TFU_TDD
5736    CMCHKUNPK(SUnpkU8, &param->ulIdx, mBuf);
5737    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
5738 #endif
5739    CMCHKUNPK(SUnpkU8, &param->cqiReq, mBuf);
5740    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
5741    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
5742    printf("In cmUnpkTfuDciFormat60aInfo :: Exit \n");
5743    RETVALUE(ROK);
5744 }
5745 /***********************************************************
5746 *
5747 *     Func : cmUnpkTfuPdcchOrderInfoEmtc
5748 *
5749 *
5750 *     Desc : This structure contains the information that is carried in DCI
5751   * format 6-1A in the case of a PDCCH order.
5752 *
5753 *
5754 *     Ret  : S16
5755 *
5756 *     Notes:
5757 *
5758 *     File  : 
5759 *
5760 **********************************************************/
5761 #ifdef ANSI
5762 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc
5763 (
5764 TfuPdcchOrderInfoEmtc *param,
5765 Buffer *mBuf
5766 )
5767 #else
5768 PRIVATE S16 cmUnpkTfuPdcchOrderInfoEmtc(param, mBuf)
5769 TfuPdcchOrderInfoEmtc *param;
5770 Buffer *mBuf;
5771 #endif
5772 {
5773
5774    TRC3(cmUnpkTfuPdcchOrderInfoEmtc)
5775
5776    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Entry \n");
5777    CMCHKUNPK(SUnpkU32, &param->riv, mBuf);
5778    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
5779    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
5780    CMCHKUNPK(SUnpkU8, &param->ceLevel, mBuf);
5781    printf("In cmUnpkTfuPdcchOrderInfoEmtc :: Passed \n");
5782    RETVALUE(ROK);
5783 }
5784
5785 /***********************************************************
5786 *
5787 *     Func : cmUnpkTfuDciFormat61aInfo
5788 *
5789 *
5790 *     Desc : This structure contains the information carried by DCI format 6-1A.
5791 *
5792 *
5793 *     Ret  : S16
5794 *
5795 *     Notes:
5796 *
5797 *     File  : 
5798 *
5799 **********************************************************/
5800 #ifdef ANSI
5801 PUBLIC S16 cmUnpkTfuDciFormat61aInfo
5802 (
5803 TfuDciFormat61aInfo *param,
5804 Buffer *mBuf
5805 )
5806 #else
5807 PUBLIC S16 cmUnpkTfuDciFormat61aInfo(param, mBuf)
5808 TfuDciFormat61aInfo *param;
5809 Buffer *mBuf;
5810 #endif
5811 {
5812
5813    TRC3(cmUnpkTfuDciFormat61aInfo)
5814
5815    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
5816    printf("1. cmUnpkTfuDciFormat61aInfo ::  isPdcchOrder %d \n", param->isPdcchOrder); 
5817    switch(param->isPdcchOrder) {
5818       case TRUE:
5819          CMCHKUNPK(cmUnpkTfuPdcchOrderInfoEmtc, &param->t.pdcchOrder, mBuf);
5820          break;
5821       case FALSE:
5822          CMCHKUNPK(cmUnpkTfudciformat61aPdsch, &param->t.pdschInfo, mBuf);
5823          break;
5824       default :
5825          RETVALUE(RFAILED);
5826       }
5827    RETVALUE(ROK);
5828 }
5829 #endif
5830 \f
5831 /***********************************************************
5832 *
5833 *     Func : cmPkTfuDciFormat1dAllocInfo
5834 *
5835 *
5836 *     Desc : This structure contains only the allocation information, thats part
5837   * of DCI format 1D. 
5838   * @details Allocation information also contains parameters necessary
5839   * for Physical layer to process Downlink Data. This structure accompanies the
5840   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5841   * @sa TfuDciFormat1dInfo
5842 *
5843 *
5844 *     Ret  : S16
5845 *
5846 *     Notes:
5847 *
5848 *     File  : 
5849 *
5850 **********************************************************/
5851 #ifdef ANSI
5852 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo
5853 (
5854 TfuDciFormat1dAllocInfo *param,
5855 Buffer *mBuf
5856 )
5857 #else
5858 PUBLIC S16 cmPkTfuDciFormat1dAllocInfo(param, mBuf)
5859 TfuDciFormat1dAllocInfo *param;
5860 Buffer *mBuf;
5861 #endif
5862 {
5863
5864    TRC3(cmPkTfuDciFormat1dAllocInfo)
5865
5866    CMCHKPK(SPkU8, param->tPmi, mBuf);
5867    CMCHKPK(SPkU8, param->rv, mBuf);
5868    CMCHKPK(SPkU8, param->mcs, mBuf);
5869    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
5870    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
5871    CMCHKPK(SPkU8, param->isLocal, mBuf);
5872    RETVALUE(ROK);
5873 }
5874
5875
5876 \f
5877 /***********************************************************
5878 *
5879 *     Func : cmUnpkTfuDciFormat1dAllocInfo
5880 *
5881 *
5882 *     Desc : This structure contains only the allocation information, thats part
5883   * of DCI format 1D. 
5884   * @details Allocation information also contains parameters necessary
5885   * for Physical layer to process Downlink Data. This structure accompanies the
5886   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
5887   * @sa TfuDciFormat1dInfo
5888 *
5889 *
5890 *     Ret  : S16
5891 *
5892 *     Notes:
5893 *
5894 *     File  : 
5895 *
5896 **********************************************************/
5897 #ifdef ANSI
5898 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo
5899 (
5900 TfuDciFormat1dAllocInfo *param,
5901 Buffer *mBuf
5902 )
5903 #else
5904 PUBLIC S16 cmUnpkTfuDciFormat1dAllocInfo(param, mBuf)
5905 TfuDciFormat1dAllocInfo *param;
5906 Buffer *mBuf;
5907 #endif
5908 {
5909
5910    TRC3(cmUnpkTfuDciFormat1dAllocInfo)
5911
5912    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
5913    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
5914    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
5915    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
5916    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
5917    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
5918    RETVALUE(ROK);
5919 }
5920
5921
5922 \f
5923 /***********************************************************
5924 *
5925 *     Func : cmPkTfuDciFormat1dInfo
5926 *
5927 *
5928 *     Desc : This structure contains the information carried by DCI format 1D.
5929  * @details Allocation information is separated from the other control
5930  * information carried in this format. This separation is needed as Data shall
5931  * also carry some control information, essentially allocation information,
5932  * along with it, in order to aid physical layer processing of the data.
5933 *
5934 *
5935 *     Ret  : S16
5936 *
5937 *     Notes:
5938 *
5939 *     File  : 
5940 *
5941 **********************************************************/
5942 #ifdef ANSI
5943 PUBLIC S16 cmPkTfuDciFormat1dInfo
5944 (
5945 TfuDciFormat1dInfo *param,
5946 Buffer *mBuf
5947 )
5948 #else
5949 PUBLIC S16 cmPkTfuDciFormat1dInfo(param, mBuf)
5950 TfuDciFormat1dInfo *param;
5951 Buffer *mBuf;
5952 #endif
5953 {
5954
5955    TRC3(cmPkTfuDciFormat1dInfo)
5956
5957    CMCHKPK(SPkU8, param->dlPwrOffset, mBuf);
5958
5959 #ifdef TFU_TDD
5960    CMCHKPK(SPkU8, param->dai, mBuf);
5961
5962 #endif
5963    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
5964    CMCHKPK(SPkU8, param->ndi, mBuf);
5965    CMCHKPK(SPkU8, param->harqProcId, mBuf);
5966    CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
5967    RETVALUE(ROK);
5968 }
5969
5970
5971 \f
5972 /***********************************************************
5973 *
5974 *     Func : cmUnpkTfuDciFormat1dInfo
5975 *
5976 *
5977 *     Desc : This structure contains the information carried by DCI format 1D.
5978  * @details Allocation information is separated from the other control
5979  * information carried in this format. This separation is needed as Data shall
5980  * also carry some control information, essentially allocation information,
5981  * along with it, in order to aid physical layer processing of the data.
5982 *
5983 *
5984 *     Ret  : S16
5985 *
5986 *     Notes:
5987 *
5988 *     File  : 
5989 *
5990 **********************************************************/
5991 #ifdef ANSI
5992 PUBLIC S16 cmUnpkTfuDciFormat1dInfo
5993 (
5994 TfuDciFormat1dInfo *param,
5995 Buffer *mBuf
5996 )
5997 #else
5998 PUBLIC S16 cmUnpkTfuDciFormat1dInfo(param, mBuf)
5999 TfuDciFormat1dInfo *param;
6000 Buffer *mBuf;
6001 #endif
6002 {
6003
6004    TRC3(cmUnpkTfuDciFormat1dInfo)
6005
6006    CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->allocInfo, mBuf);
6007    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6008    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6009    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6010
6011 #ifdef TFU_TDD
6012    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6013
6014 #endif
6015    CMCHKUNPK(SUnpkU8, &param->dlPwrOffset, mBuf);
6016    RETVALUE(ROK);
6017 }
6018
6019
6020 \f
6021 /***********************************************************
6022 *
6023 *     Func : cmPkTfuDciFormat1cInfo
6024 *
6025 *
6026 *     Desc : This structure contains only the allocation information, thats part
6027   * of DCI format 1C. 
6028   * @details Allocation information also contains parameters necessary
6029   * for Physical layer to process Downlink Data. This structure accompanies the
6030   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6031   * @sa TfuDciFormat1CInfo
6032 *
6033 *
6034 *     Ret  : S16
6035 *
6036 *     Notes:
6037 *
6038 *     File  : 
6039 *
6040 **********************************************************/
6041 #ifdef ANSI
6042 PUBLIC S16 cmPkTfuDciFormat1cInfo
6043 (
6044 TfuDciFormat1cInfo *param,
6045 Buffer *mBuf
6046 )
6047 #else
6048 PUBLIC S16 cmPkTfuDciFormat1cInfo(param, mBuf)
6049 TfuDciFormat1cInfo *param;
6050 Buffer *mBuf;
6051 #endif
6052 {
6053
6054    TRC3(cmPkTfuDciFormat1cInfo)
6055
6056    CMCHKPK(SPkU8, param->iTbs, mBuf);
6057    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6058    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6059    RETVALUE(ROK);
6060 }
6061
6062
6063 \f
6064 /***********************************************************
6065 *
6066 *     Func : cmUnpkTfuDciFormat1cInfo
6067 *
6068 *
6069 *     Desc : This structure contains only the allocation information, thats part
6070   * of DCI format 1C. 
6071   * @details Allocation information also contains parameters necessary
6072   * for Physical layer to process Downlink Data. This structure accompanies the
6073   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6074   * @sa TfuDciFormat1CInfo
6075 *
6076 *
6077 *     Ret  : S16
6078 *
6079 *     Notes:
6080 *
6081 *     File  : 
6082 *
6083 **********************************************************/
6084 #ifdef ANSI
6085 PUBLIC S16 cmUnpkTfuDciFormat1cInfo
6086 (
6087 TfuDciFormat1cInfo *param,
6088 Buffer *mBuf
6089 )
6090 #else
6091 PUBLIC S16 cmUnpkTfuDciFormat1cInfo(param, mBuf)
6092 TfuDciFormat1cInfo *param;
6093 Buffer *mBuf;
6094 #endif
6095 {
6096
6097    TRC3(cmUnpkTfuDciFormat1cInfo)
6098
6099    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6100    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6101    CMCHKUNPK(SUnpkU8, &param->iTbs, mBuf);
6102    RETVALUE(ROK);
6103 }
6104
6105
6106 \f
6107 /***********************************************************
6108 *
6109 *     Func : cmPkTfuDciFormat1bAllocInfo
6110 *
6111 *
6112 *     Desc : This structure contains only the allocation information, thats part
6113   * of DCI format 1 B. 
6114   * @details Allocation information also contains parameters necessary
6115   * for Physical layer to process Downlink Data. This structure accompanies the
6116   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6117   * @sa TfuDciFormat1BInfo
6118 *
6119 *
6120 *     Ret  : S16
6121 *
6122 *     Notes:
6123 *
6124 *     File  : 
6125 *
6126 **********************************************************/
6127 #ifdef ANSI
6128 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo
6129 (
6130 TfuDciFormat1bAllocInfo *param,
6131 Buffer *mBuf
6132 )
6133 #else
6134 PUBLIC S16 cmPkTfuDciFormat1bAllocInfo(param, mBuf)
6135 TfuDciFormat1bAllocInfo *param;
6136 Buffer *mBuf;
6137 #endif
6138 {
6139
6140    TRC3(cmPkTfuDciFormat1bAllocInfo)
6141
6142    CMCHKPK(SPkU8, param->pmiCfm, mBuf);
6143    CMCHKPK(SPkU8, param->tPmi, mBuf);
6144    CMCHKPK(SPkU8, param->ndi, mBuf);
6145    CMCHKPK(SPkU8, param->harqProcId, mBuf);
6146    CMCHKPK(SPkU8, param->rv, mBuf);
6147    CMCHKPK(SPkU8, param->mcs, mBuf);
6148    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6149    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6150    CMCHKPK(SPkU8, param->isLocal, mBuf);
6151    RETVALUE(ROK);
6152 }
6153
6154
6155 \f
6156 /***********************************************************
6157 *
6158 *     Func : cmUnpkTfuDciFormat1bAllocInfo
6159 *
6160 *
6161 *     Desc : This structure contains only the allocation information, thats part
6162   * of DCI format 1 B. 
6163   * @details Allocation information also contains parameters necessary
6164   * for Physical layer to process Downlink Data. This structure accompanies the
6165   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6166   * @sa TfuDciFormat1BInfo
6167 *
6168 *
6169 *     Ret  : S16
6170 *
6171 *     Notes:
6172 *
6173 *     File  : 
6174 *
6175 **********************************************************/
6176 #ifdef ANSI
6177 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo
6178 (
6179 TfuDciFormat1bAllocInfo *param,
6180 Buffer *mBuf
6181 )
6182 #else
6183 PUBLIC S16 cmUnpkTfuDciFormat1bAllocInfo(param, mBuf)
6184 TfuDciFormat1bAllocInfo *param;
6185 Buffer *mBuf;
6186 #endif
6187 {
6188
6189    TRC3(cmUnpkTfuDciFormat1bAllocInfo)
6190
6191    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6192    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6193    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6194    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6195    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6196    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
6197    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6198    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6199    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6200    RETVALUE(ROK);
6201 }
6202
6203
6204 \f
6205 /***********************************************************
6206 *
6207 *     Func : cmPkTfuPdcchOrderInfo
6208 *
6209 *
6210 *     Desc : This structure contains the information that is carried in DCI
6211   * format 1A in the case of a PDCCH order.
6212 *
6213 *
6214 *     Ret  : S16
6215 *
6216 *     Notes:
6217 *
6218 *     File  : 
6219 *
6220 **********************************************************/
6221 #ifdef ANSI
6222 PUBLIC S16 cmPkTfuPdcchOrderInfo
6223 (
6224 TfuPdcchOrderInfo *param,
6225 Buffer *mBuf
6226 )
6227 #else
6228 PUBLIC S16 cmPkTfuPdcchOrderInfo(param, mBuf)
6229 TfuPdcchOrderInfo *param;
6230 Buffer *mBuf;
6231 #endif
6232 {
6233
6234    TRC3(cmPkTfuPdcchOrderInfo)
6235
6236    CMCHKPK(SPkU8, param->prachMaskIdx, mBuf);
6237    CMCHKPK(SPkU8, param->preambleIdx, mBuf);
6238    RETVALUE(ROK);
6239 }
6240
6241
6242 \f
6243 /***********************************************************
6244 *
6245 *     Func : cmUnpkTfuPdcchOrderInfo
6246 *
6247 *
6248 *     Desc : This structure contains the information that is carried in DCI
6249   * format 1A in the case of a PDCCH order.
6250 *
6251 *
6252 *     Ret  : S16
6253 *
6254 *     Notes:
6255 *
6256 *     File  : 
6257 *
6258 **********************************************************/
6259 #ifdef ANSI
6260 PUBLIC S16 cmUnpkTfuPdcchOrderInfo
6261 (
6262 TfuPdcchOrderInfo *param,
6263 Buffer *mBuf
6264 )
6265 #else
6266 PUBLIC S16 cmUnpkTfuPdcchOrderInfo(param, mBuf)
6267 TfuPdcchOrderInfo *param;
6268 Buffer *mBuf;
6269 #endif
6270 {
6271
6272    TRC3(cmUnpkTfuPdcchOrderInfo)
6273
6274    CMCHKUNPK(SUnpkU8, &param->preambleIdx, mBuf);
6275    CMCHKUNPK(SUnpkU8, &param->prachMaskIdx, mBuf);
6276    RETVALUE(ROK);
6277 }
6278
6279
6280 \f
6281 /***********************************************************
6282 *
6283 *     Func : cmPkTfuDciFormat1aAllocInfo
6284 *
6285 *
6286 *     Desc : This structure contains only the allocation information, thats part
6287   * of DCI format 1A. 
6288   * @details Allocation information also contains parameters necessary
6289   * for Physical layer to process Downlink Data. This structure accompanies the
6290   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6291   * @sa TfuDciFormat1AInfo
6292 *
6293 *
6294 *     Ret  : S16
6295 *
6296 *     Notes:
6297 *
6298 *     File  : 
6299 *
6300 **********************************************************/
6301 #ifdef ANSI
6302 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo
6303 (
6304 TfuDciFormat1aAllocInfo *param,
6305 Buffer *mBuf
6306 )
6307 #else
6308 PUBLIC S16 cmPkTfuDciFormat1aAllocInfo(param, mBuf)
6309 TfuDciFormat1aAllocInfo *param;
6310 Buffer *mBuf;
6311 #endif
6312 {
6313
6314    TRC3(cmPkTfuDciFormat1aAllocInfo)
6315
6316    CMCHKPK(SPkU8, param->ndi, mBuf);
6317    CMCHKPK(cmPkTknU8, &param->harqProcId, mBuf);
6318    CMCHKPK(SPkU8, param->rv, mBuf);
6319    CMCHKPK(SPkU8, param->mcs, mBuf);
6320    CMCHKPK(cmPkTfuAllocMapOrRiv, &param->alloc, mBuf);
6321    CMCHKPK(cmPkTknU8, &param->nGap2, mBuf);
6322    CMCHKPK(SPkU8, param->isLocal, mBuf);
6323    RETVALUE(ROK);
6324 }
6325
6326
6327 \f
6328 /***********************************************************
6329 *
6330 *     Func : cmUnpkTfuDciFormat1aAllocInfo
6331 *
6332 *
6333 *     Desc : This structure contains only the allocation information, thats part
6334   * of DCI format 1A. 
6335   * @details Allocation information also contains parameters necessary
6336   * for Physical layer to process Downlink Data. This structure accompanies the
6337   * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6338   * @sa TfuDciFormat1AInfo
6339 *
6340 *
6341 *     Ret  : S16
6342 *
6343 *     Notes:
6344 *
6345 *     File  : 
6346 *
6347 **********************************************************/
6348 #ifdef ANSI
6349 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo
6350 (
6351 TfuDciFormat1aAllocInfo *param,
6352 Buffer *mBuf
6353 )
6354 #else
6355 PUBLIC S16 cmUnpkTfuDciFormat1aAllocInfo(param, mBuf)
6356 TfuDciFormat1aAllocInfo *param;
6357 Buffer *mBuf;
6358 #endif
6359 {
6360
6361    TRC3(cmUnpkTfuDciFormat1aAllocInfo)
6362
6363    CMCHKUNPK(SUnpkU8, &param->isLocal, mBuf);
6364    CMCHKUNPK(cmUnpkTknU8, &param->nGap2, mBuf);
6365    CMCHKUNPK(cmUnpkTfuAllocMapOrRiv, &param->alloc, mBuf);
6366    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6367    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6368    CMCHKUNPK(cmUnpkTknU8, &param->harqProcId, mBuf);
6369    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
6370    RETVALUE(ROK);
6371 }
6372
6373
6374 \f
6375 /***********************************************************
6376 *
6377 *     Func : cmPkTfudciformat1aPdsch
6378 *
6379 *
6380 *     Desc : This structure contains the information carried in DCI format 1A
6381   * when it is NOT used for a PDCCH order.
6382 *
6383 *
6384 *     Ret  : S16
6385 *
6386 *     Notes:
6387 *
6388 *     File  : 
6389 *
6390 **********************************************************/
6391 #ifdef ANSI
6392 PUBLIC S16 cmPkTfudciformat1aPdsch
6393 (
6394 Tfudciformat1aPdsch *param,
6395 Buffer *mBuf
6396 )
6397 #else
6398 PUBLIC S16 cmPkTfudciformat1aPdsch(param, mBuf)
6399 Tfudciformat1aPdsch *param;
6400 Buffer *mBuf;
6401 #endif
6402 {
6403
6404    TRC3(cmPkTfudciformat1aPdsch)
6405
6406    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
6407
6408 #ifdef TFU_TDD
6409    CMCHKPK(cmPkTknU8, &param->dai, mBuf);
6410
6411 #endif
6412    CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6413    RETVALUE(ROK);
6414 }
6415
6416
6417 \f
6418 /***********************************************************
6419 *
6420 *     Func : cmUnpkTfudciformat1aPdsch
6421 *
6422 *
6423 *     Desc : This structure contains the information carried in DCI format 1A
6424   * when it is NOT used for a PDCCH order.
6425 *
6426 *
6427 *     Ret  : S16
6428 *
6429 *     Notes:
6430 *
6431 *     File  : 
6432 *
6433 **********************************************************/
6434 #ifdef ANSI
6435 PUBLIC S16 cmUnpkTfudciformat1aPdsch
6436 (
6437 Tfudciformat1aPdsch *param,
6438 Buffer *mBuf
6439 )
6440 #else
6441 PUBLIC S16 cmUnpkTfudciformat1aPdsch(param, mBuf)
6442 Tfudciformat1aPdsch *param;
6443 Buffer *mBuf;
6444 #endif
6445 {
6446
6447    TRC3(cmUnpkTfudciformat1aPdsch)
6448
6449    CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->allocInfo, mBuf);
6450
6451 #ifdef TFU_TDD
6452    CMCHKUNPK(cmUnpkTknU8, &param->dai, mBuf);
6453
6454 #endif
6455    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6456    RETVALUE(ROK);
6457 }
6458
6459 #ifdef EMTC_ENABLE
6460
6461 \f
6462 /***********************************************************
6463 *
6464 *     Func : cmUnpkTfudciformat61aPdsch
6465 *
6466 *
6467 *     Desc : This structure contains the information carried in DCI format 6-1A
6468   * when it is NOT used for a PDCCH order.
6469 *
6470 *
6471 *     Ret  : S16
6472 *
6473 *     Notes:
6474 *
6475 *     File  : 
6476 *
6477 **********************************************************/
6478 #ifdef ANSI
6479 PUBLIC S16 cmUnpkTfudciformat61aPdsch
6480 (
6481 Tfudciformat61aPdsch *param,
6482 Buffer *mBuf
6483 )
6484 #else
6485 PUBLIC S16 cmUnpkTfudciformat61aPdsch(param, mBuf)
6486 Tfudciformat61aPdsch *param;
6487 Buffer *mBuf;
6488 #endif
6489 {
6490
6491    TRC3(cmUnpkTfudciformat61aPdsch)
6492
6493    printf("1. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6494    CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->allocInfo, mBuf);
6495    printf("2. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6496    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
6497    printf("3. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6498    CMCHKUNPK(SUnpkU8, &param->rep, mBuf);
6499    printf("4. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6500    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
6501    printf("5. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6502 #ifdef TFU_TDD
6503    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
6504    printf("6. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6505 #endif
6506    CMCHKUNPK(SUnpkU8, &param->antPortAndScrId, mBuf);
6507    printf("7. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6508    CMCHKUNPK(SUnpkU8, &param->isSrs, mBuf);
6509    printf("8. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6510    CMCHKUNPK(SUnpkU8, &param->tPmi, mBuf);
6511    printf("9. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6512    CMCHKUNPK(SUnpkU8, &param->pmiCfm, mBuf);
6513    printf("10. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6514    CMCHKUNPK(SUnpkU8, &param->harqAckOffst, mBuf);
6515    printf("11. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6516    CMCHKUNPK(SUnpkU8, &param->dciRep, mBuf);
6517    printf("12. cmUnpkTfudciformat61aPdsch ::  Entry \n"); 
6518    CMCHKUNPK(SUnpkU8, &param->isTBMsg4, mBuf);
6519    printf("1. cmUnpkTfudciformat61aPdsch ::  Passed \n"); 
6520    RETVALUE(ROK);
6521 }
6522 /***********************************************************
6523  *
6524  *     Func : cmUnpkTfuDirectIndication
6525  *
6526  *
6527  *     Desc : This structure contains the information that is carried in DCI
6528  *       format 6-2 in the case of a Direct information indication.
6529  *
6530  *
6531  *     Ret  : S16
6532  *
6533  *     Notes:
6534  *
6535  *     File  : 
6536  *
6537  **********************************************************/
6538 #ifdef ANSI
6539 PRIVATE S16 cmUnpkTfuDirectIndication
6540 (
6541  TfuDirectIndication *param,
6542  Buffer *mBuf
6543  )
6544 #else
6545 PRIVATE S16 cmUnpkTfuDirectIndication(param, mBuf)
6546    TfuDirectIndication *param;
6547    Buffer *mBuf;
6548 #endif
6549 {
6550
6551    TRC3(cmUnpkTfuDirectIndication)
6552    CMCHKUNPK(SUnpkU8, &param->directInd, mBuf);
6553
6554
6555
6556    RETVALUE(ROK);
6557 }
6558 /***********************************************************
6559  *
6560  *     Func : cmUnpkTfuDciFormat62AllocInfo
6561  *
6562  *
6563  *     Desc : This structure contains only the allocation information, that is part
6564  * of DCI format 6-2. 
6565  * @details Allocation information also contains parameters necessary
6566  * for Physical layer to process Downlink data. This structure accompanies the
6567  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6568  * @sa TfuDciFormat62Info
6569  *
6570  *
6571  *     Ret  : S16
6572  *
6573  *     Notes:
6574  *
6575  *     File  : 
6576  *
6577  **********************************************************/
6578 #ifdef ANSI
6579 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo
6580 (
6581  TfuDciFormat62AllocInfo *param,
6582  Buffer *mBuf
6583  )
6584 #else
6585 PUBLIC S16 cmUnpkTfuDciFormat62AllocInfo(param, mBuf)
6586    TfuDciFormat62AllocInfo *param;
6587    Buffer *mBuf;
6588 #endif
6589 {
6590    TRC3(cmUnpkTfuDciFormat62AllocInfo)
6591    CMCHKUNPK(SUnpkU8, &param->riv, mBuf);
6592    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
6593    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
6594
6595    RETVALUE(ROK);
6596 }
6597
6598 /***********************************************************
6599  *
6600  *     Func : cmUnpkTfudciformat62Pdsch
6601  *
6602  *
6603  *     Desc : This structure contains the information carried in DCI format 6-2
6604  *            when It is used for Paging message.
6605  *
6606  *
6607  *     Ret  : S16
6608  *
6609  *     Notes:
6610  *
6611  *     File  : 
6612  *
6613  **********************************************************/
6614 #ifdef ANSI
6615 PRIVATE S16 cmUnpkTfudciformat62Pdsch
6616 (
6617  Tfudciformat62Pdsch *param,
6618  Buffer *mBuf
6619  )
6620 #else
6621 PRIVATE S16 cmUnpkTfudciformat62Pdsch(param, mBuf)
6622    Tfudciformat62Pdsch *param;
6623    Buffer *mBuf;
6624 #endif
6625 {
6626
6627    TRC3(cmUnpkTfudciformat62Pdsch)
6628
6629
6630    CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6631    CMCHKUNPK(SUnpkU8, &param->repNum, mBuf);
6632    CMCHKUNPK(SUnpkU8, &param->dciSubRepNum, mBuf);
6633    RETVALUE(ROK);
6634 }
6635
6636
6637 /***********************************************************
6638  *
6639  *     Func : cmUnpkTfuDciFormat62Info
6640  *
6641  *
6642  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6643  *     @details Format can possibly carry PDSCH allocation or information needed for
6644  *     a Direct information Indication.
6645  * 
6646  *
6647  *
6648  *     Ret  : S16
6649  *
6650  *     Notes:
6651  *
6652  *     File  : 
6653  *
6654  **********************************************************/
6655 #ifdef ANSI
6656 PUBLIC S16 cmUnpkTfuDciFormat62Info
6657 (
6658  TfuDciFormat62Info *param,
6659  Buffer *mBuf
6660  )
6661 #else
6662 PUBLIC S16 cmUnpkTfuDciFormat62Info(param, mBuf)
6663    TfuDciFormat62Info *param;
6664    Buffer *mBuf;
6665 #endif
6666 {
6667
6668    TRC3(cmUnpkTfuDciFormat62Info)
6669       CMCHKUNPK(SUnpkU8, &param->isPaging, mBuf);
6670    switch(param->isPaging) {
6671       case FALSE:
6672          CMCHKUNPK(cmUnpkTfuDirectIndication, &param->t.directIndication, mBuf);
6673          break;
6674       case TRUE:
6675          CMCHKUNPK(cmUnpkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6676          break;
6677       default :
6678          RETVALUE(RFAILED);
6679    }
6680
6681
6682    RETVALUE(ROK);
6683 }
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696 /***********************************************************
6697  *
6698  *     Func : cmPkTfuDirectIndication
6699  *
6700  *
6701  *     Desc : This structure contains the information that is carried in DCI
6702  *       format 6-2 in the case of a Direct information indication.
6703  *
6704  *
6705  *     Ret  : S16
6706  *
6707  *     Notes:
6708  *
6709  *     File  : 
6710  *
6711  **********************************************************/
6712 #ifdef ANSI
6713 PRIVATE S16 cmPkTfuDirectIndication
6714 (
6715  TfuDirectIndication *param,
6716  Buffer *mBuf
6717  )
6718 #else
6719 PRIVATE S16 cmPkTfuDirectIndication(param, mBuf)
6720    TfuDirectIndication *param;
6721    Buffer *mBuf;
6722 #endif
6723 {
6724
6725    TRC3(cmPkTfuDirectIndication)
6726    CMCHKPK(SPkU8, param->directInd, mBuf);
6727
6728
6729    RETVALUE(ROK);
6730 }
6731
6732
6733
6734 /***********************************************************
6735  *
6736  *     Func : cmPkTfuDciFormat62AllocInfo
6737  *
6738  *
6739  *     Desc : This structure contains only the allocation information, that is part
6740  * of DCI format 6-2. 
6741  * @details Allocation information also contains parameters necessary
6742  * for Physical layer to process Downlink data. This structure accompanies the
6743  * Data that is sent from MAC to PHY in the TfUiTfuDatReq primitive.
6744  * @sa TfuDciFormat62Info
6745  *
6746  *
6747  *     Ret  : S16
6748  *
6749  *     Notes:
6750  *
6751  *     File  : 
6752  *
6753  **********************************************************/
6754 #ifdef ANSI
6755 PUBLIC S16 cmPkTfuDciFormat62AllocInfo
6756 (
6757  TfuDciFormat62AllocInfo *param,
6758  Buffer *mBuf
6759  )
6760 #else
6761 PUBLIC S16 cmPkTfuDciFormat62AllocInfo(param, mBuf)
6762    TfuDciFormat62AllocInfo *param;
6763    Buffer *mBuf;
6764 #endif
6765 {
6766
6767    TRC3(cmPkTfuDciFormat6AAllocInfo)
6768
6769    CMCHKPK(SPkU8, param->rv, mBuf);
6770    CMCHKPK(SPkU8, param->mcs, mBuf);
6771    CMCHKPK(SPkU8, param->riv, mBuf);
6772
6773    RETVALUE(ROK);
6774 }
6775
6776
6777
6778 /***********************************************************
6779  *
6780  *     Func : cmPkTfudciformat62Pdsch
6781  *
6782  *
6783  *     Desc : This structure contains the information carried in DCI format 6-2
6784  *            when It is used for Paging message.
6785  *
6786  *
6787  *     Ret  : S16
6788  *
6789  *     Notes:
6790  *
6791  *     File  : 
6792  *
6793  **********************************************************/
6794 #ifdef ANSI
6795 PRIVATE S16 cmPkTfudciformat62Pdsch
6796 (
6797  Tfudciformat62Pdsch *param,
6798  Buffer *mBuf
6799  )
6800 #else
6801 PRIVATE S16 cmPkTfudciformat62Pdsch(param, mBuf)
6802    Tfudciformat62Pdsch *param;
6803    Buffer *mBuf;
6804 #endif
6805 {
6806
6807    TRC3(cmPkTfudciformat62Pdsch)
6808    CMCHKPK(SPkU8, param->dciSubRepNum, mBuf);
6809    CMCHKPK(SPkU8, param->repNum, mBuf);
6810    CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->format62AllocInfo, mBuf);
6811    RETVALUE(ROK);
6812 }
6813
6814
6815
6816
6817 /***********************************************************
6818  *
6819  *     Func : cmPkTfuDciFormat62Info
6820  *
6821  *
6822  *     Desc : This structure contains the information needed to convey DCI format 6-2.
6823  *      @details Format can possibly carry PDSCH allocation or information needed for
6824  *      a Direct information Indication.
6825  * 
6826  *
6827  *
6828  *     Ret  : S16
6829  *
6830  *     Notes:
6831  *
6832  *     File  : 
6833  *
6834  **********************************************************/
6835 #ifdef ANSI
6836 PUBLIC S16 cmPkTfuDciFormat62Info
6837 (
6838  TfuDciFormat62Info *param,
6839  Buffer *mBuf
6840  )
6841 #else
6842 PUBLIC S16 cmPkTfuDciFormat62Info(param, mBuf)
6843    TfuDciFormat62Info *param;
6844    Buffer *mBuf;
6845 #endif
6846 {
6847
6848    TRC3(cmPkTfuDciFormat62Info)
6849
6850       switch(param->isPaging) {
6851          case TRUE:
6852             CMCHKPK(cmPkTfudciformat62Pdsch, &param->t.pdschInfo, mBuf);
6853             break;
6854          case FALSE:
6855             CMCHKPK(cmPkTfuDirectIndication, &param->t.directIndication, mBuf);
6856             break;
6857          default :
6858             RETVALUE(RFAILED);
6859       }
6860    CMCHKPK(SPkU8, param->isPaging, mBuf);
6861
6862    RETVALUE(ROK);
6863 }
6864
6865
6866
6867
6868
6869
6870 #endif
6871
6872 \f
6873 /***********************************************************
6874 *
6875 *     Func : cmPkTfuDciFormat1aInfo
6876 *
6877 *
6878 *     Desc : This structure contains the information needed to convey DCI format 1A.
6879  * @details Format can possibly carry PDSCH allocation or information needed for
6880  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6881  * sync with eNodeB.
6882 *
6883 *
6884 *     Ret  : S16
6885 *
6886 *     Notes:
6887 *
6888 *     File  : 
6889 *
6890 **********************************************************/
6891 #ifdef ANSI
6892 PUBLIC S16 cmPkTfuDciFormat1aInfo
6893 (
6894 TfuDciFormat1aInfo *param,
6895 Buffer *mBuf
6896 )
6897 #else
6898 PUBLIC S16 cmPkTfuDciFormat1aInfo(param, mBuf)
6899 TfuDciFormat1aInfo *param;
6900 Buffer *mBuf;
6901 #endif
6902 {
6903
6904    TRC3(cmPkTfuDciFormat1aInfo)
6905
6906    switch(param->isPdcchOrder) {
6907       case FALSE:
6908          CMCHKPK(cmPkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6909          break;
6910       case TRUE:
6911          CMCHKPK(cmPkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6912          break;
6913       default :
6914          RETVALUE(RFAILED);
6915       }
6916    CMCHKPK(SPkU8, param->isPdcchOrder, mBuf);
6917
6918    RETVALUE(ROK);
6919 }
6920
6921
6922 \f
6923 /***********************************************************
6924 *
6925 *     Func : cmUnpkTfuDciFormat1aInfo
6926 *
6927 *
6928 *     Desc : This structure contains the information needed to convey DCI format 1A.
6929  * @details Format can possibly carry PDSCH allocation or information needed for
6930  * a PDCCH order, used to initiate a RACH procedure in cases where UE looses
6931  * sync with eNodeB.
6932 *
6933 *
6934 *     Ret  : S16
6935 *
6936 *     Notes:
6937 *
6938 *     File  : 
6939 *
6940 **********************************************************/
6941 #ifdef ANSI
6942 PUBLIC S16 cmUnpkTfuDciFormat1aInfo
6943 (
6944 TfuDciFormat1aInfo *param,
6945 Buffer *mBuf
6946 )
6947 #else
6948 PUBLIC S16 cmUnpkTfuDciFormat1aInfo(param, mBuf)
6949 TfuDciFormat1aInfo *param;
6950 Buffer *mBuf;
6951 #endif
6952 {
6953
6954    TRC3(cmUnpkTfuDciFormat1aInfo)
6955
6956    CMCHKUNPK(SUnpkU8, &param->isPdcchOrder, mBuf);
6957    switch(param->isPdcchOrder) {
6958       case TRUE:
6959          CMCHKUNPK(cmUnpkTfuPdcchOrderInfo, &param->t.pdcchOrder, mBuf);
6960          break;
6961       case FALSE:
6962          CMCHKUNPK(cmUnpkTfudciformat1aPdsch, &param->t.pdschInfo, mBuf);
6963          break;
6964       default :
6965          RETVALUE(RFAILED);
6966       }
6967    RETVALUE(ROK);
6968 }
6969
6970
6971 \f
6972 /***********************************************************
6973 *
6974 *     Func : cmPkTfuDciFormat1bInfo
6975 *
6976 *
6977 *     Desc : This structure contains the information needed to convey DCI format 1A.
6978  * @details Allocation information is separated from the other control
6979  * information carried in this format. This separation is needed as Data shall
6980  * also carry some control information, essentially allocation information,
6981  * along with it, in order to aid physical layer processing of the data.
6982 *
6983 *
6984 *     Ret  : S16
6985 *
6986 *     Notes:
6987 *
6988 *     File  : 
6989 *
6990 **********************************************************/
6991 #ifdef ANSI
6992 PUBLIC S16 cmPkTfuDciFormat1bInfo
6993 (
6994 TfuDciFormat1bInfo *param,
6995 Buffer *mBuf
6996 )
6997 #else
6998 PUBLIC S16 cmPkTfuDciFormat1bInfo(param, mBuf)
6999 TfuDciFormat1bInfo *param;
7000 Buffer *mBuf;
7001 #endif
7002 {
7003
7004    TRC3(cmPkTfuDciFormat1bInfo)
7005
7006    CMCHKPK(SPkU8, param->tpcCmd, mBuf);
7007
7008 #ifdef TFU_TDD
7009    CMCHKPK(SPkU8, param->dai, mBuf);
7010
7011 #endif
7012    CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
7013    RETVALUE(ROK);
7014 }
7015
7016
7017 \f
7018 /***********************************************************
7019 *
7020 *     Func : cmUnpkTfuDciFormat1bInfo
7021 *
7022 *
7023 *     Desc : This structure contains the information needed to convey DCI format 1A.
7024  * @details Allocation information is separated from the other control
7025  * information carried in this format. This separation is needed as Data shall
7026  * also carry some control information, essentially allocation information,
7027  * along with it, in order to aid physical layer processing of the data.
7028 *
7029 *
7030 *     Ret  : S16
7031 *
7032 *     Notes:
7033 *
7034 *     File  : 
7035 *
7036 **********************************************************/
7037 #ifdef ANSI
7038 PUBLIC S16 cmUnpkTfuDciFormat1bInfo
7039 (
7040 TfuDciFormat1bInfo *param,
7041 Buffer *mBuf
7042 )
7043 #else
7044 PUBLIC S16 cmUnpkTfuDciFormat1bInfo(param, mBuf)
7045 TfuDciFormat1bInfo *param;
7046 Buffer *mBuf;
7047 #endif
7048 {
7049
7050    TRC3(cmUnpkTfuDciFormat1bInfo)
7051
7052    CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->allocInfo, mBuf);
7053
7054 #ifdef TFU_TDD
7055    CMCHKUNPK(SUnpkU8, &param->dai, mBuf);
7056
7057 #endif
7058    CMCHKUNPK(SUnpkU8, &param->tpcCmd, mBuf);
7059    RETVALUE(ROK);
7060 }
7061
7062
7063 \f
7064 /***********************************************************
7065 *
7066 *     Func : cmPkTfuDciInfo
7067 *
7068 *
7069 *     Desc : This structure contains the information needed to convey the possible DCI
7070  * formats. The following are the supported formats - 
7071  * -# Format 0    - used for PUSCH scheduling
7072  * -# Format 1    - used for PDSCH scheduling
7073  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7074  *                   intitiated by a PDCCH order.
7075  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7076  *                   information.
7077  * -# Format 1C   - used for very compact scheduling of PDSCH.
7078  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7079  *                   information with power offset.
7080  * -# Format 2    - used for PDSCH Scheduling
7081  * -# Format 2A   - used for PDSCH Scheduling
7082  * -# Format 3    - used for power control 
7083  * -# Format 3A   - used for power control
7084 *
7085 *
7086 *     Ret  : S16
7087 *
7088 *     Notes:
7089 *
7090 *     File  : 
7091 *
7092 **********************************************************/
7093 #ifdef ANSI
7094 PUBLIC S16 cmPkTfuDciInfo
7095 (
7096 TfuDciInfo *param,
7097 Buffer *mBuf
7098 )
7099 #else
7100 PUBLIC S16 cmPkTfuDciInfo(param, mBuf)
7101 TfuDciInfo *param;
7102 Buffer *mBuf;
7103 #endif
7104 {
7105
7106    TRC3(cmPkTfuDciInfo)
7107
7108       switch(param->dciFormat) {
7109 #ifdef TFU_5GTF
7110          case TFU_DCI_FORMAT_B1:
7111             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7112             break;
7113          case TFU_DCI_FORMAT_B2:
7114             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7115             break;
7116          case TFU_DCI_FORMAT_A1:
7117             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7118             break;
7119          case TFU_DCI_FORMAT_A2:
7120             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7121             break;
7122 #endif
7123 #ifdef EMTC_ENABLE            
7124          case TFU_DCI_FORMAT_6_2:
7125             CMCHKPK(cmPkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7126             break;
7127          case TFU_DCI_FORMAT_6_1A:
7128             CMCHKPK(cmPkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7129             break;
7130          case TFU_DCI_FORMAT_6_0A:
7131             CMCHKPK(cmPkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7132             break;
7133 #endif            
7134          case TFU_DCI_FORMAT_3A:
7135             CMCHKPK(cmPkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7136             break;
7137          case TFU_DCI_FORMAT_3:
7138             CMCHKPK(cmPkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7139             break;
7140          case TFU_DCI_FORMAT_2A:
7141             CMCHKPK(cmPkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7142             break;
7143          case TFU_DCI_FORMAT_2:
7144             CMCHKPK(cmPkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7145             break;
7146          case TFU_DCI_FORMAT_1D:
7147             CMCHKPK(cmPkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7148             break;
7149          case TFU_DCI_FORMAT_1C:
7150             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7151             break;
7152          case TFU_DCI_FORMAT_1B:
7153             CMCHKPK(cmPkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7154             break;
7155          case TFU_DCI_FORMAT_1A:
7156             CMCHKPK(cmPkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7157             break;
7158          case TFU_DCI_FORMAT_1:
7159             CMCHKPK(cmPkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7160             break;
7161          case TFU_DCI_FORMAT_0:
7162             CMCHKPK(cmPkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7163             break;
7164          default :
7165             RETVALUE(RFAILED);
7166       }
7167    CMCHKPK(SPkU32, param->dciFormat, mBuf);
7168    RETVALUE(ROK);
7169 }
7170
7171
7172 \f
7173 /***********************************************************
7174 *
7175 *     Func : cmUnpkTfuDciInfo
7176 *
7177 *
7178 *     Desc : This structure contains the information needed to convey the possible DCI
7179  * formats. The following are the supported formats - 
7180  * -# Format 0    - used for PUSCH scheduling
7181  * -# Format 1    - used for PDSCH scheduling
7182  * -# Format 1A   - used for compact scheduling of PDSCH or RA procedure
7183  *                   intitiated by a PDCCH order.
7184  * -# Format 1B   - used for compact scheduling of PDSCH with precoding
7185  *                   information.
7186  * -# Format 1C   - used for very compact scheduling of PDSCH.
7187  * -# Format 1D   - used for compact scheduling for PDSCH with precoding
7188  *                   information with power offset.
7189  * -# Format 2    - used for PDSCH Scheduling
7190  * -# Format 2A   - used for PDSCH Scheduling
7191  * -# Format 3    - used for power control 
7192  * -# Format 3A   - used for power control
7193 *
7194 *
7195 *     Ret  : S16
7196 *
7197 *     Notes:
7198 *
7199 *     File  : 
7200 *
7201 **********************************************************/
7202 #ifdef ANSI
7203 PUBLIC S16 cmUnpkTfuDciInfo
7204 (
7205 TfuDciInfo *param,
7206 Buffer *mBuf
7207 )
7208 #else
7209 PUBLIC S16 cmUnpkTfuDciInfo(param, mBuf)
7210 TfuDciInfo *param;
7211 Buffer *mBuf;
7212 #endif
7213 {
7214
7215    TRC3(cmUnpkTfuDciInfo)
7216
7217
7218    CMCHKUNPK(SUnpkU32, (U32 *)&param->dciFormat, mBuf);
7219       switch(param->dciFormat) {
7220          case TFU_DCI_FORMAT_0:
7221             CMCHKUNPK(cmUnpkTfuDciFormat0Info, &param->u.format0Info, mBuf);
7222             break;
7223          case TFU_DCI_FORMAT_1:
7224             CMCHKUNPK(cmUnpkTfuDciFormat1Info, &param->u.format1Info, mBuf);
7225             break;
7226          case TFU_DCI_FORMAT_1A:
7227             CMCHKUNPK(cmUnpkTfuDciFormat1aInfo, &param->u.format1aInfo, mBuf);
7228             break;
7229          case TFU_DCI_FORMAT_1B:
7230             CMCHKUNPK(cmUnpkTfuDciFormat1bInfo, &param->u.format1bInfo, mBuf);
7231             break;
7232          case TFU_DCI_FORMAT_1C:
7233             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cInfo, mBuf);
7234             break;
7235          case TFU_DCI_FORMAT_1D:
7236             CMCHKUNPK(cmUnpkTfuDciFormat1dInfo, &param->u.format1dInfo, mBuf);
7237             break;
7238          case TFU_DCI_FORMAT_2:
7239             CMCHKUNPK(cmUnpkTfuDciFormat2Info, &param->u.format2Info, mBuf);
7240             break;
7241          case TFU_DCI_FORMAT_2A:
7242             CMCHKUNPK(cmUnpkTfuDciFormat2AInfo, &param->u.format2AInfo, mBuf);
7243             break;
7244          case TFU_DCI_FORMAT_3:
7245             CMCHKUNPK(cmUnpkTfuDciFormat3Info, &param->u.format3Info, mBuf);
7246             break;
7247          case TFU_DCI_FORMAT_3A:
7248             CMCHKUNPK(cmUnpkTfuDciFormat3AInfo, &param->u.format3AInfo, mBuf);
7249             break;
7250 #ifdef EMTC_ENABLE            
7251          case TFU_DCI_FORMAT_6_0A:
7252             CMCHKUNPK(cmUnpkTfuDciFormat60aInfo, &param->u.format60aInfo, mBuf);
7253             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7254             break;
7255          case TFU_DCI_FORMAT_6_1A:
7256             CMCHKUNPK(cmUnpkTfuDciFormat61aInfo, &param->u.format61aInfo, mBuf);
7257             printf("2. cmUnpkTfuDciInfo ::  dciFormat %d \n", param->dciFormat); 
7258             break;
7259          case TFU_DCI_FORMAT_6_2:
7260             CMCHKUNPK(cmUnpkTfuDciFormat62Info, &param->u.format62Info, mBuf);
7261             break;
7262
7263 #endif            
7264 #ifdef TFU_5GTF
7265          case TFU_DCI_FORMAT_A1:
7266             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
7267             break;
7268                         case TFU_DCI_FORMAT_A2:
7269             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
7270             break;
7271          case TFU_DCI_FORMAT_B1:
7272             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
7273             break;
7274                         case TFU_DCI_FORMAT_B2:
7275             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
7276             break;
7277 #endif
7278          default :
7279             RETVALUE(RFAILED);
7280       }
7281    RETVALUE(ROK);
7282 }
7283
7284
7285 \f
7286 /***********************************************************
7287 *
7288 *     Func : cmPkTfuSubbandInfo
7289 *
7290 *
7291 *     Desc : This structure contains the information needed to convey the start and size
7292  * of the subband in the CQI report.
7293 *
7294 *
7295 *     Ret  : S16
7296 *
7297 *     Notes:
7298 *
7299 *     File  : 
7300 *
7301 **********************************************************/
7302 #ifdef ANSI
7303 PUBLIC S16 cmPkTfuSubbandInfo
7304 (
7305 TfuSubbandInfo *param,
7306 Buffer *mBuf
7307 )
7308 #else
7309 PUBLIC S16 cmPkTfuSubbandInfo(param, mBuf)
7310 TfuSubbandInfo *param;
7311 Buffer *mBuf;
7312 #endif
7313 {
7314
7315    TRC3(cmPkTfuSubbandInfo)
7316
7317    CMCHKPK(SPkU8, param->numRb, mBuf);
7318    CMCHKPK(SPkU8, param->rbStart, mBuf);
7319    RETVALUE(ROK);
7320 }
7321
7322
7323 \f
7324 /***********************************************************
7325 *
7326 *     Func : cmUnpkTfuSubbandInfo
7327 *
7328 *
7329 *     Desc : This structure contains the information needed to convey the start and size
7330  * of the subband in the CQI report.
7331 *
7332 *
7333 *     Ret  : S16
7334 *
7335 *     Notes:
7336 *
7337 *     File  : 
7338 *
7339 **********************************************************/
7340 #ifdef ANSI
7341 PUBLIC S16 cmUnpkTfuSubbandInfo
7342 (
7343 TfuSubbandInfo *param,
7344 Buffer *mBuf
7345 )
7346 #else
7347 PUBLIC S16 cmUnpkTfuSubbandInfo(param, mBuf)
7348 TfuSubbandInfo *param;
7349 Buffer *mBuf;
7350 #endif
7351 {
7352
7353    TRC3(cmUnpkTfuSubbandInfo)
7354
7355    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
7356    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
7357    RETVALUE(ROK);
7358 }
7359
7360
7361
7362 \f
7363 /***********************************************************
7364 *
7365 *     Func : cmPkTfuSubbandCqiInfo
7366 *
7367 *
7368 *     Desc : This structure is used to convey the subbannd CQI reported.
7369 *
7370 *
7371 *     Ret  : S16
7372 *
7373 *     Notes:
7374 *
7375 *     File  : 
7376 *
7377 **********************************************************/
7378 #ifdef ANSI
7379 PUBLIC S16 cmPkTfuSubbandCqiInfo
7380 (
7381 TfuSubbandCqiInfo *param,
7382 Buffer *mBuf
7383 )
7384 #else
7385 PUBLIC S16 cmPkTfuSubbandCqiInfo(param, mBuf)
7386 TfuSubbandCqiInfo *param;
7387 Buffer *mBuf;
7388 #endif
7389 {
7390
7391    TRC3(cmPkTfuSubbandCqiInfo)
7392
7393    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
7394    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
7395    RETVALUE(ROK);
7396 }
7397
7398
7399 \f
7400 /***********************************************************
7401 *
7402 *     Func : cmUnpkTfuSubbandCqiInfo
7403 *
7404 *
7405 *     Desc : This structure is used to convey the subbannd CQI reported.
7406 *
7407 *
7408 *     Ret  : S16
7409 *
7410 *     Notes:
7411 *
7412 *     File  : 
7413 *
7414 **********************************************************/
7415 #ifdef ANSI
7416 PUBLIC S16 cmUnpkTfuSubbandCqiInfo
7417 (
7418 TfuSubbandCqiInfo *param,
7419 Buffer *mBuf
7420 )
7421 #else
7422 PUBLIC S16 cmUnpkTfuSubbandCqiInfo(param, mBuf)
7423 TfuSubbandCqiInfo *param;
7424 Buffer *mBuf;
7425 #endif
7426 {
7427
7428    TRC3(cmUnpkTfuSubbandCqiInfo)
7429
7430    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
7431    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
7432    RETVALUE(ROK);
7433 }
7434
7435
7436 \f
7437 /***********************************************************
7438 *
7439 *     Func : cmPkTfuPdcchCceInfo
7440 *
7441 *
7442 *     Desc : This structure conveys the CCE information.
7443 *
7444 *
7445 *     Ret  : S16
7446 *
7447 *     Notes:
7448 *
7449 *     File  : 
7450 *
7451 **********************************************************/
7452 #ifdef ANSI
7453 PUBLIC S16 cmPkTfuPdcchCceInfo
7454 (
7455 TfuPdcchCceInfo *param,
7456 Buffer *mBuf
7457 )
7458 #else
7459 PUBLIC S16 cmPkTfuPdcchCceInfo(param, mBuf)
7460 TfuPdcchCceInfo *param;
7461 Buffer *mBuf;
7462 #endif
7463 {
7464
7465    TRC3(cmPkTfuPdcchCceInfo)
7466
7467    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
7468    CMCHKPK(SPkU8, param->cceIdx, mBuf);
7469    RETVALUE(ROK);
7470 }
7471
7472
7473 \f
7474 /***********************************************************
7475 *
7476 *     Func : cmUnpkTfuPdcchCceInfo
7477 *
7478 *
7479 *     Desc : This structure conveys the CCE information.
7480 *
7481 *
7482 *     Ret  : S16
7483 *
7484 *     Notes:
7485 *
7486 *     File  : 
7487 *
7488 **********************************************************/
7489 #ifdef ANSI
7490 PUBLIC S16 cmUnpkTfuPdcchCceInfo
7491 (
7492 TfuPdcchCceInfo *param,
7493 Buffer *mBuf
7494 )
7495 #else
7496 PUBLIC S16 cmUnpkTfuPdcchCceInfo(param, mBuf)
7497 TfuPdcchCceInfo *param;
7498 Buffer *mBuf;
7499 #endif
7500 {
7501
7502    TRC3(cmUnpkTfuPdcchCceInfo)
7503
7504    CMCHKUNPK(SUnpkU8, &param->cceIdx, mBuf);
7505    CMCHKUNPK(cmUnpkLteAggrLvl,(U32 *)&param->aggrLvl, mBuf);
7506    RETVALUE(ROK);
7507 }
7508
7509
7510 \f
7511 /***********************************************************
7512 *
7513 *     Func : cmPkTfuCqiPucchMode10
7514 *
7515 *
7516 *     Desc : This structure maps to the CQI mode 10. The report could either
7517   * convey a Rank index or a wideband CQI.
7518 *
7519 *
7520 *     Ret  : S16
7521 *
7522 *     Notes:
7523 *
7524 *     File  : 
7525 *
7526 **********************************************************/
7527 #ifdef ANSI
7528 PUBLIC S16 cmPkTfuCqiPucchMode10
7529 (
7530 TfuCqiPucchMode10 *param,
7531 Buffer *mBuf
7532 )
7533 #else
7534 PUBLIC S16 cmPkTfuCqiPucchMode10(param, mBuf)
7535 TfuCqiPucchMode10 *param;
7536 Buffer *mBuf;
7537 #endif
7538 {
7539
7540    TRC3(cmPkTfuCqiPucchMode10)
7541
7542       switch(param->type) {
7543          case TFU_RPT_CQI:
7544             CMCHKPK(SPkU8, param->u.cqi, mBuf);
7545             break;
7546          case TFU_RPT_RI:
7547             CMCHKPK(SPkU8, param->u.ri, mBuf);
7548             break;
7549          default :
7550             RETVALUE(RFAILED);
7551       }
7552    CMCHKPK(SPkU32, param->type, mBuf);
7553    RETVALUE(ROK);
7554 }
7555
7556
7557 \f
7558 /***********************************************************
7559 *
7560 *     Func : cmUnpkTfuCqiPucchMode10
7561 *
7562 *
7563 *     Desc : This structure maps to the CQI mode 10. The report could either
7564   * convey a Rank index or a wideband CQI.
7565 *
7566 *
7567 *     Ret  : S16
7568 *
7569 *     Notes:
7570 *
7571 *     File  : 
7572 *
7573 **********************************************************/
7574 #ifdef ANSI
7575 PUBLIC S16 cmUnpkTfuCqiPucchMode10
7576 (
7577 TfuCqiPucchMode10 *param,
7578 Buffer *mBuf
7579 )
7580 #else
7581 PUBLIC S16 cmUnpkTfuCqiPucchMode10(param, mBuf)
7582 TfuCqiPucchMode10 *param;
7583 Buffer *mBuf;
7584 #endif
7585 {
7586
7587    TRC3(cmUnpkTfuCqiPucchMode10)
7588
7589    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7590       switch(param->type) {
7591          case TFU_RPT_RI:
7592             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7593             break;
7594          case TFU_RPT_CQI:
7595             CMCHKUNPK(SUnpkU8, &param->u.cqi, mBuf);
7596             break;
7597          default :
7598             RETVALUE(RFAILED);
7599       }
7600    RETVALUE(ROK);
7601 }
7602
7603
7604 \f
7605 /***********************************************************
7606 *
7607 *     Func : cmPkTfuCqiMode11Cqi
7608 *
7609 *
7610 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7611   * wideband differential CQI.
7612 *
7613 *
7614 *     Ret  : S16
7615 *
7616 *     Notes:
7617 *
7618 *     File  : 
7619 *
7620 **********************************************************/
7621 #ifdef ANSI
7622 PUBLIC S16 cmPkTfuCqiMode11Cqi
7623 (
7624 TfuCqiMode11Cqi *param,
7625 Buffer *mBuf
7626 )
7627 #else
7628 PUBLIC S16 cmPkTfuCqiMode11Cqi(param, mBuf)
7629 TfuCqiMode11Cqi *param;
7630 Buffer *mBuf;
7631 #endif
7632 {
7633
7634    TRC3(cmPkTfuCqiMode11Cqi)
7635
7636    CMCHKPK(cmPkTknU8, &param->wideDiffCqi, mBuf);
7637    CMCHKPK(SPkU8, param->pmi, mBuf);
7638    CMCHKPK(SPkU8, param->cqi, mBuf);
7639    RETVALUE(ROK);
7640 }
7641
7642
7643 \f
7644 /***********************************************************
7645 *
7646 *     Func : cmUnpkTfuCqiMode11Cqi
7647 *
7648 *
7649 *     Desc : This structure contains a wideband CQI, PMI and optionally a
7650   * wideband differential CQI.
7651 *
7652 *
7653 *     Ret  : S16
7654 *
7655 *     Notes:
7656 *
7657 *     File  : 
7658 *
7659 **********************************************************/
7660 #ifdef ANSI
7661 PUBLIC S16 cmUnpkTfuCqiMode11Cqi
7662 (
7663 TfuCqiMode11Cqi *param,
7664 Buffer *mBuf
7665 )
7666 #else
7667 PUBLIC S16 cmUnpkTfuCqiMode11Cqi(param, mBuf)
7668 TfuCqiMode11Cqi *param;
7669 Buffer *mBuf;
7670 #endif
7671 {
7672
7673    TRC3(cmUnpkTfuCqiMode11Cqi)
7674
7675    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7676    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
7677    CMCHKUNPK(cmUnpkTknU8, &param->wideDiffCqi, mBuf);
7678    RETVALUE(ROK);
7679 }
7680
7681
7682 \f
7683 /***********************************************************
7684 *
7685 *     Func : cmPkTfuCqiPucchMode11
7686 *
7687 *
7688 *     Desc : This structure maps to the CQI mode 11. The report could either
7689   * convey a Rank index or a CQI report.
7690 *
7691 *
7692 *     Ret  : S16
7693 *
7694 *     Notes:
7695 *
7696 *     File  : 
7697 *
7698 **********************************************************/
7699 #ifdef ANSI
7700 PUBLIC S16 cmPkTfuCqiPucchMode11
7701 (
7702 TfuCqiPucchMode11 *param,
7703 Buffer *mBuf
7704 )
7705 #else
7706 PUBLIC S16 cmPkTfuCqiPucchMode11(param, mBuf)
7707 TfuCqiPucchMode11 *param;
7708 Buffer *mBuf;
7709 #endif
7710 {
7711
7712    TRC3(cmPkTfuCqiPucchMode11)
7713
7714       switch(param->type) {
7715          case TFU_RPT_CQI:
7716             CMCHKPK(cmPkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7717             break;
7718          case TFU_RPT_RI:
7719             CMCHKPK(SPkU8, param->u.ri, mBuf);
7720             break;
7721          default :
7722             RETVALUE(RFAILED);
7723       }
7724    CMCHKPK(SPkU32, param->type, mBuf);
7725    RETVALUE(ROK);
7726 }
7727
7728
7729 \f
7730 /***********************************************************
7731 *
7732 *     Func : cmUnpkTfuCqiPucchMode11
7733 *
7734 *
7735 *     Desc : This structure maps to the CQI mode 11. The report could either
7736   * convey a Rank index or a CQI report.
7737 *
7738 *
7739 *     Ret  : S16
7740 *
7741 *     Notes:
7742 *
7743 *     File  : 
7744 *
7745 **********************************************************/
7746 #ifdef ANSI
7747 PUBLIC S16 cmUnpkTfuCqiPucchMode11
7748 (
7749 TfuCqiPucchMode11 *param,
7750 Buffer *mBuf
7751 )
7752 #else
7753 PUBLIC S16 cmUnpkTfuCqiPucchMode11(param, mBuf)
7754 TfuCqiPucchMode11 *param;
7755 Buffer *mBuf;
7756 #endif
7757 {
7758
7759    TRC3(cmUnpkTfuCqiPucchMode11)
7760
7761    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
7762       switch(param->type) {
7763          case TFU_RPT_RI:
7764             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
7765             break;
7766          case TFU_RPT_CQI:
7767             CMCHKUNPK(cmUnpkTfuCqiMode11Cqi, &param->u.cqi, mBuf);
7768             break;
7769          default :
7770             RETVALUE(RFAILED);
7771       }
7772    RETVALUE(ROK);
7773 }
7774
7775
7776 \f
7777 /***********************************************************
7778 *
7779 *     Func : cmPkTfuCqiMode20SubCqi
7780 *
7781 *
7782 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7783 *
7784 *
7785 *     Ret  : S16
7786 *
7787 *     Notes:
7788 *
7789 *     File  : 
7790 *
7791 **********************************************************/
7792 #ifdef ANSI
7793 PUBLIC S16 cmPkTfuCqiMode20SubCqi
7794 (
7795 TfuCqiMode20SubCqi *param,
7796 Buffer *mBuf
7797 )
7798 #else
7799 PUBLIC S16 cmPkTfuCqiMode20SubCqi(param, mBuf)
7800 TfuCqiMode20SubCqi *param;
7801 Buffer *mBuf;
7802 #endif
7803 {
7804
7805    TRC3(cmPkTfuCqiMode20SubCqi)
7806
7807    CMCHKPK(SPkU8, param->l, mBuf);
7808    CMCHKPK(SPkU8, param->cqi, mBuf);
7809    RETVALUE(ROK);
7810 }
7811
7812
7813 \f
7814 /***********************************************************
7815 *
7816 *     Func : cmUnpkTfuCqiMode20SubCqi
7817 *
7818 *
7819 *     Desc : This structure contains the SubBand CQI for mode 2-0.
7820 *
7821 *
7822 *     Ret  : S16
7823 *
7824 *     Notes:
7825 *
7826 *     File  : 
7827 *
7828 **********************************************************/
7829 #ifdef ANSI
7830 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi
7831 (
7832 TfuCqiMode20SubCqi *param,
7833 Buffer *mBuf
7834 )
7835 #else
7836 PUBLIC S16 cmUnpkTfuCqiMode20SubCqi(param, mBuf)
7837 TfuCqiMode20SubCqi *param;
7838 Buffer *mBuf;
7839 #endif
7840 {
7841
7842    TRC3(cmUnpkTfuCqiMode20SubCqi)
7843
7844    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
7845    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
7846    RETVALUE(ROK);
7847 }
7848
7849
7850 \f
7851 /***********************************************************
7852 *
7853 *     Func : cmPkTfuCqiMode20Cqi
7854 *
7855 *
7856 *     Desc : This structure contains Mode20 CQI report. It could either be a
7857   * wideband CQI or a sub-band CQI.
7858 *
7859 *
7860 *     Ret  : S16
7861 *
7862 *     Notes:
7863 *
7864 *     File  : 
7865 *
7866 **********************************************************/
7867 #ifdef ANSI
7868 PUBLIC S16 cmPkTfuCqiMode20Cqi
7869 (
7870 TfuCqiMode20Cqi *param,
7871 Buffer *mBuf
7872 )
7873 #else
7874 PUBLIC S16 cmPkTfuCqiMode20Cqi(param, mBuf)
7875 TfuCqiMode20Cqi *param;
7876 Buffer *mBuf;
7877 #endif
7878 {
7879
7880    TRC3(cmPkTfuCqiMode20Cqi)
7881
7882       switch(param->isWideband) {
7883          case FALSE:
7884             CMCHKPK(cmPkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7885             break;
7886          case TRUE:
7887             CMCHKPK(SPkU8, param->u.wideCqi, mBuf);
7888             break;
7889          default :
7890             RETVALUE(RFAILED);
7891       }
7892    CMCHKPK(SPkU8, param->isWideband, mBuf);
7893    RETVALUE(ROK);
7894 }
7895
7896
7897 \f
7898 /***********************************************************
7899 *
7900 *     Func : cmUnpkTfuCqiMode20Cqi
7901 *
7902 *
7903 *     Desc : This structure contains Mode20 CQI report. It could either be a
7904   * wideband CQI or a sub-band CQI.
7905 *
7906 *
7907 *     Ret  : S16
7908 *
7909 *     Notes:
7910 *
7911 *     File  : 
7912 *
7913 **********************************************************/
7914 #ifdef ANSI
7915 PUBLIC S16 cmUnpkTfuCqiMode20Cqi
7916 (
7917 TfuCqiMode20Cqi *param,
7918 Buffer *mBuf
7919 )
7920 #else
7921 PUBLIC S16 cmUnpkTfuCqiMode20Cqi(param, mBuf)
7922 TfuCqiMode20Cqi *param;
7923 Buffer *mBuf;
7924 #endif
7925 {
7926
7927    TRC3(cmUnpkTfuCqiMode20Cqi)
7928
7929    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
7930       switch(param->isWideband) {
7931          case TRUE:
7932             CMCHKUNPK(SUnpkU8, &param->u.wideCqi, mBuf);
7933             break;
7934          case FALSE:
7935             CMCHKUNPK(cmUnpkTfuCqiMode20SubCqi, &param->u.subCqi, mBuf);
7936             break;
7937          default :
7938             RETVALUE(RFAILED);
7939       }
7940    RETVALUE(ROK);
7941 }
7942
7943
7944 \f
7945 /***********************************************************
7946 *
7947 *     Func : cmPkTfuCqiPucchMode20
7948 *
7949 *
7950 *     Desc : This structure maps to CQI mode 20. The report either contains a
7951   * Rank Index or a CQI report.
7952 *
7953 *
7954 *     Ret  : S16
7955 *
7956 *     Notes:
7957 *
7958 *     File  : 
7959 *
7960 **********************************************************/
7961 #ifdef ANSI
7962 PUBLIC S16 cmPkTfuCqiPucchMode20
7963 (
7964 TfuCqiPucchMode20 *param,
7965 Buffer *mBuf
7966 )
7967 #else
7968 PUBLIC S16 cmPkTfuCqiPucchMode20(param, mBuf)
7969 TfuCqiPucchMode20 *param;
7970 Buffer *mBuf;
7971 #endif
7972 {
7973
7974    TRC3(cmPkTfuCqiPucchMode20)
7975
7976       switch(param->type) {
7977          case TFU_RPT_CQI:
7978             CMCHKPK(cmPkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
7979             break;
7980          case TFU_RPT_RI:
7981             CMCHKPK(SPkU8, param->u.ri, mBuf);
7982             break;
7983          default :
7984             RETVALUE(RFAILED);
7985       }
7986    CMCHKPK(SPkU32, param->type, mBuf);
7987    RETVALUE(ROK);
7988 }
7989
7990
7991 \f
7992 /***********************************************************
7993 *
7994 *     Func : cmUnpkTfuCqiPucchMode20
7995 *
7996 *
7997 *     Desc : This structure maps to CQI mode 20. The report either contains a
7998   * Rank Index or a CQI report.
7999 *
8000 *
8001 *     Ret  : S16
8002 *
8003 *     Notes:
8004 *
8005 *     File  : 
8006 *
8007 **********************************************************/
8008 #ifdef ANSI
8009 PUBLIC S16 cmUnpkTfuCqiPucchMode20
8010 (
8011 TfuCqiPucchMode20 *param,
8012 Buffer *mBuf
8013 )
8014 #else
8015 PUBLIC S16 cmUnpkTfuCqiPucchMode20(param, mBuf)
8016 TfuCqiPucchMode20 *param;
8017 Buffer *mBuf;
8018 #endif
8019 {
8020
8021    TRC3(cmUnpkTfuCqiPucchMode20)
8022
8023    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8024       switch(param->type) {
8025          case TFU_RPT_RI:
8026             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8027             break;
8028          case TFU_RPT_CQI:
8029             CMCHKUNPK(cmUnpkTfuCqiMode20Cqi, &param->u.cqi, mBuf);
8030             break;
8031          default :
8032             RETVALUE(RFAILED);
8033       }
8034    RETVALUE(ROK);
8035 }
8036
8037
8038 \f
8039 /***********************************************************
8040 *
8041 *     Func : cmPkTfuCqiMode21SubCqi
8042 *
8043 *
8044 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8045   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8046 *
8047 *
8048 *     Ret  : S16
8049 *
8050 *     Notes:
8051 *
8052 *     File  : 
8053 *
8054 **********************************************************/
8055 #ifdef ANSI
8056 PUBLIC S16 cmPkTfuCqiMode21SubCqi
8057 (
8058 TfuCqiMode21SubCqi *param,
8059 Buffer *mBuf
8060 )
8061 #else
8062 PUBLIC S16 cmPkTfuCqiMode21SubCqi(param, mBuf)
8063 TfuCqiMode21SubCqi *param;
8064 Buffer *mBuf;
8065 #endif
8066 {
8067
8068    TRC3(cmPkTfuCqiMode21SubCqi)
8069
8070    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8071    CMCHKPK(SPkU8, param->l, mBuf);
8072    CMCHKPK(SPkU8, param->cqi, mBuf);
8073    RETVALUE(ROK);
8074 }
8075
8076
8077 \f
8078 /***********************************************************
8079 *
8080 *     Func : cmUnpkTfuCqiMode21SubCqi
8081 *
8082 *
8083 *     Desc : This structure contains the sub-band CQI report for mode 2-1. 
8084   * It carries a CQI, 'L' bit sub-band label, and optionally a differential CQI.
8085 *
8086 *
8087 *     Ret  : S16
8088 *
8089 *     Notes:
8090 *
8091 *     File  : 
8092 *
8093 **********************************************************/
8094 #ifdef ANSI
8095 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi
8096 (
8097 TfuCqiMode21SubCqi *param,
8098 Buffer *mBuf
8099 )
8100 #else
8101 PUBLIC S16 cmUnpkTfuCqiMode21SubCqi(param, mBuf)
8102 TfuCqiMode21SubCqi *param;
8103 Buffer *mBuf;
8104 #endif
8105 {
8106
8107    TRC3(cmUnpkTfuCqiMode21SubCqi)
8108
8109    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8110    CMCHKUNPK(SUnpkU8, &param->l, mBuf);
8111    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8112    RETVALUE(ROK);
8113 }
8114
8115
8116 \f
8117 /***********************************************************
8118 *
8119 *     Func : cmPkTfuCqiMode21WideCqi
8120 *
8121 *
8122 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8123   * It carries a wideband CQI, PMI and optionally a differential CQI.
8124 *
8125 *
8126 *     Ret  : S16
8127 *
8128 *     Notes:
8129 *
8130 *     File  : 
8131 *
8132 **********************************************************/
8133 #ifdef ANSI
8134 PUBLIC S16 cmPkTfuCqiMode21WideCqi
8135 (
8136 TfuCqiMode21WideCqi *param,
8137 Buffer *mBuf
8138 )
8139 #else
8140 PUBLIC S16 cmPkTfuCqiMode21WideCqi(param, mBuf)
8141 TfuCqiMode21WideCqi *param;
8142 Buffer *mBuf;
8143 #endif
8144 {
8145
8146    TRC3(cmPkTfuCqiMode21WideCqi)
8147
8148    CMCHKPK(cmPkTknU8, &param->diffCqi, mBuf);
8149    CMCHKPK(SPkU8, param->pmi, mBuf);
8150    CMCHKPK(SPkU8, param->cqi, mBuf);
8151    RETVALUE(ROK);
8152 }
8153
8154
8155 \f
8156 /***********************************************************
8157 *
8158 *     Func : cmUnpkTfuCqiMode21WideCqi
8159 *
8160 *
8161 *     Desc : This structure contains the wideband CQI report for mode 2-1.
8162   * It carries a wideband CQI, PMI and optionally a differential CQI.
8163 *
8164 *
8165 *     Ret  : S16
8166 *
8167 *     Notes:
8168 *
8169 *     File  : 
8170 *
8171 **********************************************************/
8172 #ifdef ANSI
8173 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi
8174 (
8175 TfuCqiMode21WideCqi *param,
8176 Buffer *mBuf
8177 )
8178 #else
8179 PUBLIC S16 cmUnpkTfuCqiMode21WideCqi(param, mBuf)
8180 TfuCqiMode21WideCqi *param;
8181 Buffer *mBuf;
8182 #endif
8183 {
8184
8185    TRC3(cmUnpkTfuCqiMode21WideCqi)
8186
8187    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8188    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8189    CMCHKUNPK(cmUnpkTknU8, &param->diffCqi, mBuf);
8190    RETVALUE(ROK);
8191 }
8192
8193
8194 \f
8195 /***********************************************************
8196 *
8197 *     Func : cmPkTfuCqiMode21Cqi
8198 *
8199 *
8200 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8201   * could either be wideband or sub-band.
8202 *
8203 *
8204 *     Ret  : S16
8205 *
8206 *     Notes:
8207 *
8208 *     File  : 
8209 *
8210 **********************************************************/
8211 #ifdef ANSI
8212 PUBLIC S16 cmPkTfuCqiMode21Cqi
8213 (
8214 TfuCqiMode21Cqi *param,
8215 Buffer *mBuf
8216 )
8217 #else
8218 PUBLIC S16 cmPkTfuCqiMode21Cqi(param, mBuf)
8219 TfuCqiMode21Cqi *param;
8220 Buffer *mBuf;
8221 #endif
8222 {
8223
8224    TRC3(cmPkTfuCqiMode21Cqi)
8225
8226       switch(param->isWideband) {
8227          case FALSE:
8228             CMCHKPK(cmPkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8229             break;
8230          case TRUE:
8231             CMCHKPK(cmPkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8232             break;
8233          default :
8234             RETVALUE(RFAILED);
8235       }
8236    CMCHKPK(SPkU8, param->isWideband, mBuf);
8237    RETVALUE(ROK);
8238 }
8239
8240
8241 \f
8242 /***********************************************************
8243 *
8244 *     Func : cmUnpkTfuCqiMode21Cqi
8245 *
8246 *
8247 *     Desc : This structure conveys CQI report for mode 2-1. The reported value
8248   * could either be wideband or sub-band.
8249 *
8250 *
8251 *     Ret  : S16
8252 *
8253 *     Notes:
8254 *
8255 *     File  : 
8256 *
8257 **********************************************************/
8258 #ifdef ANSI
8259 PUBLIC S16 cmUnpkTfuCqiMode21Cqi
8260 (
8261 TfuCqiMode21Cqi *param,
8262 Buffer *mBuf
8263 )
8264 #else
8265 PUBLIC S16 cmUnpkTfuCqiMode21Cqi(param, mBuf)
8266 TfuCqiMode21Cqi *param;
8267 Buffer *mBuf;
8268 #endif
8269 {
8270
8271    TRC3(cmUnpkTfuCqiMode21Cqi)
8272
8273    CMCHKUNPK(SUnpkU8, &param->isWideband, mBuf);
8274       switch(param->isWideband) {
8275          case TRUE:
8276             CMCHKUNPK(cmUnpkTfuCqiMode21WideCqi, &param->u.wideCqi, mBuf);
8277             break;
8278          case FALSE:
8279             CMCHKUNPK(cmUnpkTfuCqiMode21SubCqi, &param->u.subCqi, mBuf);
8280             break;
8281          default :
8282             RETVALUE(RFAILED);
8283       }
8284    RETVALUE(ROK);
8285 }
8286
8287
8288 \f
8289 /***********************************************************
8290 *
8291 *     Func : cmPkTfuCqiPucchMode21
8292 *
8293 *
8294 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8295   * conveys a Rank Indicator or a CQI report.
8296 *
8297 *
8298 *     Ret  : S16
8299 *
8300 *     Notes:
8301 *
8302 *     File  : 
8303 *
8304 **********************************************************/
8305 #ifdef ANSI
8306 PUBLIC S16 cmPkTfuCqiPucchMode21
8307 (
8308 TfuCqiPucchMode21 *param,
8309 Buffer *mBuf
8310 )
8311 #else
8312 PUBLIC S16 cmPkTfuCqiPucchMode21(param, mBuf)
8313 TfuCqiPucchMode21 *param;
8314 Buffer *mBuf;
8315 #endif
8316 {
8317
8318    TRC3(cmPkTfuCqiPucchMode21)
8319
8320       switch(param->type) {
8321          case TFU_RPT_CQI:
8322             CMCHKPK(cmPkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8323             break;
8324          case TFU_RPT_RI:
8325             CMCHKPK(SPkU8, param->u.ri, mBuf);
8326             break;
8327          default :
8328             RETVALUE(RFAILED);
8329       }
8330    CMCHKPK(SPkU32, param->type, mBuf);
8331    RETVALUE(ROK);
8332 }
8333
8334
8335 \f
8336 /***********************************************************
8337 *
8338 *     Func : cmUnpkTfuCqiPucchMode21
8339 *
8340 *
8341 *     Desc : This structure maps to the CQI reporting mode 2-1. The report either
8342   * conveys a Rank Indicator or a CQI report.
8343 *
8344 *
8345 *     Ret  : S16
8346 *
8347 *     Notes:
8348 *
8349 *     File  : 
8350 *
8351 **********************************************************/
8352 #ifdef ANSI
8353 PUBLIC S16 cmUnpkTfuCqiPucchMode21
8354 (
8355 TfuCqiPucchMode21 *param,
8356 Buffer *mBuf
8357 )
8358 #else
8359 PUBLIC S16 cmUnpkTfuCqiPucchMode21(param, mBuf)
8360 TfuCqiPucchMode21 *param;
8361 Buffer *mBuf;
8362 #endif
8363 {
8364
8365    TRC3(cmUnpkTfuCqiPucchMode21)
8366
8367    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
8368       switch(param->type) {
8369          case TFU_RPT_RI:
8370             CMCHKUNPK(SUnpkU8, &param->u.ri, mBuf);
8371             break;
8372          case TFU_RPT_CQI:
8373             CMCHKUNPK(cmUnpkTfuCqiMode21Cqi, &param->u.cqi, mBuf);
8374             break;
8375          default :
8376             RETVALUE(RFAILED);
8377       }
8378    RETVALUE(ROK);
8379 }
8380
8381
8382 \f
8383 /***********************************************************
8384 *
8385 *     Func : cmPkTfuDlCqiPucch
8386 *
8387 *
8388 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8389 *
8390 *
8391 *     Ret  : S16
8392 *
8393 *     Notes:
8394 *
8395 *     File  : 
8396 *
8397 **********************************************************/
8398 #ifdef ANSI
8399 PUBLIC S16 cmPkTfuDlCqiPucch
8400 (
8401 TfuDlCqiPucch *param,
8402 Buffer *mBuf
8403 )
8404 #else
8405 PUBLIC S16 cmPkTfuDlCqiPucch(param, mBuf)
8406 TfuDlCqiPucch *param;
8407 Buffer *mBuf;
8408 #endif
8409 {
8410
8411    TRC3(cmPkTfuDlCqiPucch)
8412
8413       switch(param->mode) {
8414          case TFU_PUCCH_CQI_MODE21:
8415             CMCHKPK(cmPkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8416             break;
8417          case TFU_PUCCH_CQI_MODE20:
8418             CMCHKPK(cmPkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8419             break;
8420          case TFU_PUCCH_CQI_MODE11:
8421             CMCHKPK(cmPkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8422             break;
8423          case TFU_PUCCH_CQI_MODE10:
8424             CMCHKPK(cmPkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8425             break;
8426          default :
8427             RETVALUE(RFAILED);
8428       }
8429    CMCHKPK(SPkU32, param->mode, mBuf);
8430    CMCHKPK(SPkU8, param->cellIdx, mBuf);
8431    RETVALUE(ROK);
8432 }
8433
8434
8435 \f
8436 /***********************************************************
8437 *
8438 *     Func : cmUnpkTfuDlCqiPucch
8439 *
8440 *
8441 *     Desc : This structure conveys the Downlink CQI reported on PUCCH.
8442 *
8443 *
8444 *     Ret  : S16
8445 *
8446 *     Notes:
8447 *
8448 *     File  : 
8449 *
8450 **********************************************************/
8451 #ifdef ANSI
8452 PUBLIC S16 cmUnpkTfuDlCqiPucch
8453 (
8454 TfuDlCqiPucch *param,
8455 Buffer *mBuf
8456 )
8457 #else
8458 PUBLIC S16 cmUnpkTfuDlCqiPucch(param, mBuf)
8459 TfuDlCqiPucch *param;
8460 Buffer *mBuf;
8461 #endif
8462 {
8463
8464    TRC3(cmUnpkTfuDlCqiPucch)
8465
8466    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
8467    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
8468       switch(param->mode) {
8469          case TFU_PUCCH_CQI_MODE10:
8470             CMCHKUNPK(cmUnpkTfuCqiPucchMode10, &param->u.mode10Info, mBuf);
8471             break;
8472          case TFU_PUCCH_CQI_MODE11:
8473             CMCHKUNPK(cmUnpkTfuCqiPucchMode11, &param->u.mode11Info, mBuf);
8474             break;
8475          case TFU_PUCCH_CQI_MODE20:
8476             CMCHKUNPK(cmUnpkTfuCqiPucchMode20, &param->u.mode20Info, mBuf);
8477             break;
8478          case TFU_PUCCH_CQI_MODE21:
8479             CMCHKUNPK(cmUnpkTfuCqiPucchMode21, &param->u.mode21Info, mBuf);
8480             break;
8481          default :
8482             RETVALUE(RFAILED);
8483       }
8484    RETVALUE(ROK);
8485 }
8486
8487
8488 \f
8489 /***********************************************************
8490 *
8491 *     Func : cmPkTfuSubbandMode12
8492 *
8493 *
8494 *     Desc : This structure carries subband information and PMI, in the CQI
8495   * reporting format 1-2.
8496 *
8497 *
8498 *     Ret  : S16
8499 *
8500 *     Notes:
8501 *
8502 *     File  : 
8503 *
8504 **********************************************************/
8505 #ifdef ANSI
8506 PUBLIC S16 cmPkTfuSubbandMode12
8507 (
8508 TfuSubbandMode12 *param,
8509 Buffer *mBuf
8510 )
8511 #else
8512 PUBLIC S16 cmPkTfuSubbandMode12(param, mBuf)
8513 TfuSubbandMode12 *param;
8514 Buffer *mBuf;
8515 #endif
8516 {
8517
8518    TRC3(cmPkTfuSubbandMode12)
8519
8520    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8521    CMCHKPK(SPkU8, param->pmi, mBuf);
8522    RETVALUE(ROK);
8523 }
8524
8525
8526 \f
8527 /***********************************************************
8528 *
8529 *     Func : cmUnpkTfuSubbandMode12
8530 *
8531 *
8532 *     Desc : This structure carries subband information and PMI, in the CQI
8533   * reporting format 1-2.
8534 *
8535 *
8536 *     Ret  : S16
8537 *
8538 *     Notes:
8539 *
8540 *     File  : 
8541 *
8542 **********************************************************/
8543 #ifdef ANSI
8544 PUBLIC S16 cmUnpkTfuSubbandMode12
8545 (
8546 TfuSubbandMode12 *param,
8547 Buffer *mBuf
8548 )
8549 #else
8550 PUBLIC S16 cmUnpkTfuSubbandMode12(param, mBuf)
8551 TfuSubbandMode12 *param;
8552 Buffer *mBuf;
8553 #endif
8554 {
8555
8556    TRC3(cmUnpkTfuSubbandMode12)
8557
8558    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8559    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8560    RETVALUE(ROK);
8561 }
8562
8563
8564 \f
8565 /***********************************************************
8566 *
8567 *     Func : cmPkTfuCqiPuschMode12
8568 *
8569 *
8570 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8571  * over PUSCH.
8572 *
8573 *
8574 *     Ret  : S16
8575 *
8576 *     Notes:
8577 *
8578 *     File  : 
8579 *
8580 **********************************************************/
8581 #ifdef ANSI
8582 PUBLIC S16 cmPkTfuCqiPuschMode12
8583 (
8584 TfuCqiPuschMode12 *param,
8585 Buffer *mBuf
8586 )
8587 #else
8588 PUBLIC S16 cmPkTfuCqiPuschMode12(param, mBuf)
8589 TfuCqiPuschMode12 *param;
8590 Buffer *mBuf;
8591 #endif
8592 {
8593
8594    S32 i;
8595    TRC3(cmPkTfuCqiPuschMode12)
8596
8597    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8598       CMCHKPK(cmPkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8599    }
8600    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8601       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
8602    }
8603    CMCHKPK(SPkU8, param->numSubband, mBuf);
8604    RETVALUE(ROK);
8605 }
8606
8607
8608 \f
8609 /***********************************************************
8610 *
8611 *     Func : cmUnpkTfuCqiPuschMode12
8612 *
8613 *
8614 *     Desc : This structure conveys information present in CQI reporting mode 1-2 received
8615  * over PUSCH.
8616 *
8617 *
8618 *     Ret  : S16
8619 *
8620 *     Notes:
8621 *
8622 *     File  : 
8623 *
8624 **********************************************************/
8625 #ifdef ANSI
8626 PUBLIC S16 cmUnpkTfuCqiPuschMode12
8627 (
8628 TfuCqiPuschMode12 *param,
8629 Buffer *mBuf
8630 )
8631 #else
8632 PUBLIC S16 cmUnpkTfuCqiPuschMode12(param, mBuf)
8633 TfuCqiPuschMode12 *param;
8634 Buffer *mBuf;
8635 #endif
8636 {
8637
8638    S32 i;
8639    TRC3(cmUnpkTfuCqiPuschMode12)
8640
8641    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8642    for (i=0; i<TFU_MAX_TB; i++) {
8643       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
8644    }
8645    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8646       CMCHKUNPK(cmUnpkTfuSubbandMode12, &param->subbandArr[i], mBuf);
8647    }
8648    RETVALUE(ROK);
8649 }
8650
8651
8652 \f
8653 /***********************************************************
8654 *
8655 *     Func : cmPkTfuCqiPuschMode20
8656 *
8657 *
8658 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8659  * over PUSCH. This mode is for UE selected sub-band feedback.
8660 *
8661 *
8662 *     Ret  : S16
8663 *
8664 *     Notes:
8665 *
8666 *     File  : 
8667 *
8668 **********************************************************/
8669 #ifdef ANSI
8670 PUBLIC S16 cmPkTfuCqiPuschMode20
8671 (
8672 TfuCqiPuschMode20 *param,
8673 Buffer *mBuf
8674 )
8675 #else
8676 PUBLIC S16 cmPkTfuCqiPuschMode20(param, mBuf)
8677 TfuCqiPuschMode20 *param;
8678 Buffer *mBuf;
8679 #endif
8680 {
8681
8682    S32 i;
8683    TRC3(cmPkTfuCqiPuschMode20)
8684
8685    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8686       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8687    }
8688    CMCHKPK(SPkU8, param->numSubband, mBuf);
8689    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8690    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
8691    RETVALUE(ROK);
8692 }
8693
8694
8695 \f
8696 /***********************************************************
8697 *
8698 *     Func : cmUnpkTfuCqiPuschMode20
8699 *
8700 *
8701 *     Desc : This structure conveys information present in CQI reporting mode 2-0 received
8702  * over PUSCH. This mode is for UE selected sub-band feedback.
8703 *
8704 *
8705 *     Ret  : S16
8706 *
8707 *     Notes:
8708 *
8709 *     File  : 
8710 *
8711 **********************************************************/
8712 #ifdef ANSI
8713 PUBLIC S16 cmUnpkTfuCqiPuschMode20
8714 (
8715 TfuCqiPuschMode20 *param,
8716 Buffer *mBuf
8717 )
8718 #else
8719 PUBLIC S16 cmUnpkTfuCqiPuschMode20(param, mBuf)
8720 TfuCqiPuschMode20 *param;
8721 Buffer *mBuf;
8722 #endif
8723 {
8724
8725    S32 i;
8726    TRC3(cmUnpkTfuCqiPuschMode20)
8727
8728    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
8729    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8730    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8731    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8732       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8733    }
8734    RETVALUE(ROK);
8735 }
8736
8737 \f
8738 /***********************************************************
8739 *
8740 *     Func : cmPkTfuCqiPuschMode22
8741 *
8742 *
8743 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8744  * over PUSCH.
8745 *
8746 *
8747 *     Ret  : S16
8748 *
8749 *     Notes:
8750 *
8751 *     File  : 
8752 *
8753 **********************************************************/
8754 #ifdef ANSI
8755 PUBLIC S16 cmPkTfuCqiPuschMode22
8756 (
8757 TfuCqiPuschMode22 *param,
8758 Buffer *mBuf
8759 )
8760 #else
8761 PUBLIC S16 cmPkTfuCqiPuschMode22(param, mBuf)
8762 TfuCqiPuschMode22 *param;
8763 Buffer *mBuf;
8764 #endif
8765 {
8766
8767    S32 i;
8768    TRC3(cmPkTfuCqiPuschMode22)
8769
8770
8771    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8772       CMCHKPK(cmPkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8773    }
8774
8775    CMCHKPK(SPkU8, param->numSubband, mBuf);
8776    CMCHKPK(SPkU8, param->wideBandPmi, mBuf);
8777    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8778       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
8779    }
8780    CMCHKPK(SPkU8, param->pmi, mBuf);
8781    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8782       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8783    }
8784    RETVALUE(ROK);
8785 }
8786
8787
8788 \f
8789 /***********************************************************
8790 *
8791 *     Func : cmUnpkTfuCqiPuschMode22
8792 *
8793 *
8794 *     Desc : This structure conveys information present in CQI reporting mode 2-2 received
8795  * over PUSCH.
8796 *
8797 *
8798 *     Ret  : S16
8799 *
8800 *     Notes:
8801 *
8802 *     File  : 
8803 *
8804 **********************************************************/
8805 #ifdef ANSI
8806 PUBLIC S16 cmUnpkTfuCqiPuschMode22
8807 (
8808 TfuCqiPuschMode22 *param,
8809 Buffer *mBuf
8810 )
8811 #else
8812 PUBLIC S16 cmUnpkTfuCqiPuschMode22(param, mBuf)
8813 TfuCqiPuschMode22 *param;
8814 Buffer *mBuf;
8815 #endif
8816 {
8817
8818    S32 i;
8819    TRC3(cmUnpkTfuCqiPuschMode22)
8820
8821    for (i=0; i<TFU_MAX_TB; i++) {
8822       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
8823    }
8824    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
8825    for (i=0; i<TFU_MAX_TB; i++) {
8826       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
8827    }
8828    CMCHKUNPK(SUnpkU8, &param->wideBandPmi, mBuf);
8829    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8830
8831    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8832       CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subbandArr[i], mBuf);
8833    }
8834
8835    RETVALUE(ROK);
8836 }
8837
8838
8839 #ifdef ANSI
8840 PUBLIC S16 cmPkTfuSubbandMode30
8841 (
8842 TfuSubbandMode30 *param,
8843 Buffer *mBuf
8844 )
8845 #else
8846 PUBLIC S16 cmPkTfuSubbandMode30(param, mBuf)
8847 TfuSubbandMode30 *param;
8848 Buffer *mBuf;
8849 #endif
8850 {
8851
8852    TRC3(cmPkTfuSubbandMode30)
8853
8854    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8855    CMCHKPK(SPkU8, param->cqi, mBuf);
8856    RETVALUE(ROK);
8857 }
8858
8859
8860 #ifdef ANSI
8861 PUBLIC S16 cmUnpkTfuSubbandMode30
8862 (
8863 TfuSubbandMode30 *param,
8864 Buffer *mBuf
8865 )
8866 #else
8867 PUBLIC S16 cmUnpkTfuSubbandMode30(param, mBuf)
8868 TfuSubbandMode30 *param;
8869 Buffer *mBuf;
8870 #endif
8871 {
8872
8873    TRC3(cmUnpkTfuSubbandMode30)
8874
8875    CMCHKUNPK(SUnpkU8, &param->cqi, mBuf);
8876    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
8877    RETVALUE(ROK);
8878 }
8879
8880
8881 \f
8882 /***********************************************************
8883 *
8884 *     Func : cmPkTfuCqiPuschMode30
8885 *
8886 *
8887 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8888  * received over PUSCH.
8889 *
8890 *
8891 *     Ret  : S16
8892 *
8893 *     Notes:
8894 *
8895 *     File  : 
8896 *
8897 **********************************************************/
8898 #ifdef ANSI
8899 PUBLIC S16 cmPkTfuCqiPuschMode30
8900 (
8901 TfuCqiPuschMode30 *param,
8902 Buffer *mBuf
8903 )
8904 #else
8905 PUBLIC S16 cmPkTfuCqiPuschMode30(param, mBuf)
8906 TfuCqiPuschMode30 *param;
8907 Buffer *mBuf;
8908 #endif
8909 {
8910
8911    S32 i;
8912    TRC3(cmPkTfuCqiPuschMode30)
8913
8914    for (i=TFU_MAX_DL_SUBBAND-1; i >= 0; i--) {
8915       CMCHKPK(cmPkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8916    }
8917    CMCHKPK(SPkU8, param->numSubband, mBuf);
8918    CMCHKPK(SPkU8, param->wideBandCqi, mBuf);
8919    RETVALUE(ROK);
8920 }
8921
8922
8923 \f
8924 /***********************************************************
8925 *
8926 *     Func : cmUnpkTfuCqiPuschMode30
8927 *
8928 *
8929 *     Desc : This structure conveys information present in CQI reporting mode 3-0
8930  * received over PUSCH.
8931 *
8932 *
8933 *     Ret  : S16
8934 *
8935 *     Notes:
8936 *
8937 *     File  : 
8938 *
8939 **********************************************************/
8940 #ifdef ANSI
8941 PUBLIC S16 cmUnpkTfuCqiPuschMode30
8942 (
8943 TfuCqiPuschMode30 *param,
8944 Buffer *mBuf
8945 )
8946 #else
8947 PUBLIC S16 cmUnpkTfuCqiPuschMode30(param, mBuf)
8948 TfuCqiPuschMode30 *param;
8949 Buffer *mBuf;
8950 #endif
8951 {
8952
8953    S32 i;
8954    TRC3(cmUnpkTfuCqiPuschMode30)
8955
8956    CMCHKUNPK(SUnpkU8, &param->wideBandCqi, mBuf);
8957    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
8958    for (i=0; i<TFU_MAX_DL_SUBBAND; i++) {
8959       CMCHKUNPK(cmUnpkTfuSubbandMode30, &param->subbandArr[i], mBuf);
8960    }
8961    RETVALUE(ROK);
8962 }
8963
8964
8965 #ifdef ANSI
8966 PUBLIC S16 cmPkTfuSubbandMode31
8967 (
8968 TfuSubbandMode31 *param,
8969 Buffer *mBuf
8970 )
8971 #else
8972 PUBLIC S16 cmPkTfuSubbandMode31(param, mBuf)
8973 TfuSubbandMode31 *param;
8974 Buffer *mBuf;
8975 #endif
8976 {
8977
8978    S32 i;
8979    TRC3(cmPkTfuSubbandMode31)
8980
8981    CMCHKPK(cmPkTfuSubbandInfo, &param->subBand, mBuf);
8982    for (i=TFU_MAX_TB-1; i >= 0; i--) {
8983       CMCHKPK(SPkU8, param->cqi[i], mBuf);
8984    }
8985    RETVALUE(ROK);
8986 }
8987
8988
8989 #ifdef ANSI
8990 PUBLIC S16 cmUnpkTfuSubbandMode31
8991 (
8992 TfuSubbandMode31 *param,
8993 Buffer *mBuf
8994 )
8995 #else
8996 PUBLIC S16 cmUnpkTfuSubbandMode31(param, mBuf)
8997 TfuSubbandMode31 *param;
8998 Buffer *mBuf;
8999 #endif
9000 {
9001
9002    S32 i;
9003    TRC3(cmUnpkTfuSubbandMode31)
9004
9005    for (i=0; i<TFU_MAX_TB; i++) {
9006       CMCHKUNPK(SUnpkU8, &param->cqi[i], mBuf);
9007    }
9008    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subBand, mBuf);
9009    RETVALUE(ROK);
9010 }
9011
9012
9013 \f
9014 /***********************************************************
9015 *
9016 *     Func : cmPkTfuCqiPuschMode31
9017 *
9018 *
9019 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9020  * received over PUSCH.
9021 *
9022 *
9023 *     Ret  : S16
9024 *
9025 *     Notes:
9026 *
9027 *     File  : 
9028 *
9029 **********************************************************/
9030 #ifdef ANSI
9031 PUBLIC S16 cmPkTfuCqiPuschMode31
9032 (
9033 TfuCqiPuschMode31 *param,
9034 Buffer *mBuf
9035 )
9036 #else
9037 PUBLIC S16 cmPkTfuCqiPuschMode31(param, mBuf)
9038 TfuCqiPuschMode31 *param;
9039 Buffer *mBuf;
9040 #endif
9041 {
9042
9043    S32 i;
9044    TRC3(cmPkTfuCqiPuschMode31)
9045
9046
9047 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9048 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9049
9050 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9051 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9052    for (i=param->numSubband-1; i >= 0; i--) {
9053       CMCHKPK(cmPkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9054    }
9055
9056    CMCHKPK(SPkU8, param->numSubband, mBuf);
9057    for (i=TFU_MAX_TB-1; i >= 0; i--) {
9058       CMCHKPK(SPkU8, param->wideBandCqi[i], mBuf);
9059    }
9060    CMCHKPK(SPkU8, param->pmi, mBuf);
9061    RETVALUE(ROK);
9062 }
9063
9064
9065 \f
9066 /***********************************************************
9067 *
9068 *     Func : cmUnpkTfuCqiPuschMode31
9069 *
9070 *
9071 *     Desc : This structure conveys information present in CQI reporting mode 3-1
9072  * received over PUSCH.
9073 *
9074 *
9075 *     Ret  : S16
9076 *
9077 *     Notes:
9078 *
9079 *     File  : 
9080 *
9081 **********************************************************/
9082 #ifdef ANSI
9083 PUBLIC S16 cmUnpkTfuCqiPuschMode31
9084 (
9085 TfuCqiPuschMode31 *param,
9086 Buffer *mBuf
9087 )
9088 #else
9089 PUBLIC S16 cmUnpkTfuCqiPuschMode31(param, mBuf)
9090 TfuCqiPuschMode31 *param;
9091 Buffer *mBuf;
9092 #endif
9093 {
9094
9095    S32 i;
9096    TRC3(cmUnpkTfuCqiPuschMode31)
9097
9098    CMCHKUNPK(SUnpkU8, &param->pmi, mBuf);
9099    for (i=0; i<TFU_MAX_TB; i++) {
9100       CMCHKUNPK(SUnpkU8, &param->wideBandCqi[i], mBuf);
9101    }
9102    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
9103
9104 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9105 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9106    for (i=0; i<param->numSubband; i++) {
9107       CMCHKUNPK(cmUnpkTfuSubbandDlCqiInfo, &param->subbandCqiArr[i], mBuf);
9108    }
9109
9110
9111 /* tfu_c_001.main_4 - Changes for MIMO feature addition */
9112 /* tfu_c_001.main_5 - Removed dependency on MIMO compile-time flag */
9113
9114    RETVALUE(ROK);
9115 }
9116
9117
9118 \f
9119 /***********************************************************
9120 *
9121 *     Func : cmPkTfuDlCqiPusch
9122 *
9123 *
9124 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9125  * CQI) received over PUSCH.
9126 *
9127 *
9128 *     Ret  : S16
9129 *
9130 *     Notes:
9131 *
9132 *     File  : 
9133 *
9134 **********************************************************/
9135 #ifdef ANSI
9136 PUBLIC S16 cmPkTfuDlCqiPusch
9137 (
9138 TfuDlCqiPusch *param,
9139 Buffer *mBuf
9140 )
9141 #else
9142 PUBLIC S16 cmPkTfuDlCqiPusch(param, mBuf)
9143 TfuDlCqiPusch *param;
9144 Buffer *mBuf;
9145 #endif
9146 {
9147
9148    TRC3(cmPkTfuDlCqiPusch)
9149
9150       switch(param->mode) {
9151          case TFU_PUSCH_CQI_MODE_31:
9152             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9153             break;
9154          case TFU_PUSCH_CQI_MODE_30:
9155             CMCHKPK(cmPkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9156             break;
9157          case TFU_PUSCH_CQI_MODE_22:
9158             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9159             break;
9160          case TFU_PUSCH_CQI_MODE_20:
9161             CMCHKPK(cmPkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9162             break;
9163          case TFU_PUSCH_CQI_MODE_12:
9164             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9165             break;
9166          default :
9167             RETVALUE(RFAILED);
9168       }
9169
9170    CMCHKPK(cmPkTknU8, &param->ri, mBuf);
9171    CMCHKPK(SPkU32, param->mode, mBuf);
9172
9173    CMCHKPK(SPkU8, param->cellIdx, mBuf);
9174    RETVALUE(ROK);
9175 }
9176
9177
9178 \f
9179 /***********************************************************
9180 *
9181 *     Func : cmUnpkTfuDlCqiPusch
9182 *
9183 *
9184 *     Desc : This structure conveys Downlink CQI information (mode and corresponding
9185  * CQI) received over PUSCH.
9186 *
9187 *
9188 *     Ret  : S16
9189 *
9190 *     Notes:
9191 *
9192 *     File  : 
9193 *
9194 **********************************************************/
9195 #ifdef ANSI
9196 PUBLIC S16 cmUnpkTfuDlCqiPusch
9197 (
9198 TfuDlCqiPusch *param,
9199 Buffer *mBuf
9200 )
9201 #else
9202 PUBLIC S16 cmUnpkTfuDlCqiPusch(param, mBuf)
9203 TfuDlCqiPusch *param;
9204 Buffer *mBuf;
9205 #endif
9206 {
9207
9208    TRC3(cmUnpkTfuDlCqiPusch)
9209
9210    CMCHKUNPK(SUnpkU8, &param->cellIdx, mBuf);
9211    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
9212    CMCHKUNPK(cmUnpkTknU8, &param->ri, mBuf);
9213    switch(param->mode) {
9214       case TFU_PUSCH_CQI_MODE_12:
9215          CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
9216          break;
9217       case TFU_PUSCH_CQI_MODE_20:
9218          CMCHKUNPK(cmUnpkTfuCqiPuschMode20, &param->u.mode20Info, mBuf);
9219          break;
9220       case TFU_PUSCH_CQI_MODE_22:
9221          CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
9222          break;
9223       case TFU_PUSCH_CQI_MODE_30:
9224          CMCHKUNPK(cmUnpkTfuCqiPuschMode30, &param->u.mode30Info, mBuf);
9225          break;
9226       case TFU_PUSCH_CQI_MODE_31:
9227          CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
9228          break;
9229       default :
9230          RETVALUE(RFAILED);
9231    }
9232    RETVALUE(ROK);
9233 }
9234
9235 \f
9236 /***********************************************************
9237 *
9238 *     Func : cmPkTfuDlCqiInfo
9239 *
9240 *
9241 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9242 *
9243 *
9244 *     Ret  : S16
9245 *
9246 *     Notes:
9247 *
9248 *     File  : 
9249 *
9250 **********************************************************/
9251 #ifdef ANSI
9252 PUBLIC S16 cmPkTfuDlCqiInfo
9253 (
9254 U8 selector,
9255 TfuDlCqiInfo *param,
9256 Buffer *mBuf
9257 )
9258 #else
9259 PUBLIC S16 cmPkTfuDlCqiInfo(selector, param, mBuf)
9260 U8 selector;
9261 TfuDlCqiInfo *param;
9262 Buffer *mBuf;
9263 #endif
9264 {
9265    U32 idx;
9266
9267    TRC3(cmPkTfuDlCqiInfo)
9268
9269    switch(selector) {
9270       case FALSE:
9271          for (idx = 0; idx < param->pusch.numOfCells; idx++)
9272          {
9273             CMCHKPK(cmPkTfuDlCqiPusch, &param->pusch.puschCqi[idx], mBuf);
9274          }
9275          CMCHKPK(SPkU8, param->pusch.numOfCells, mBuf);
9276          break;
9277       case TRUE:
9278          CMCHKPK(cmPkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9279          break;
9280       default :
9281          RETVALUE(RFAILED);
9282    }
9283    RETVALUE(ROK);
9284 }
9285
9286
9287 \f
9288 /***********************************************************
9289 *
9290 *     Func : cmUnpkTfuDlCqiInfo
9291 *
9292 *
9293 *     Desc : This structure contains CQI information received over PUCCH or PUSCH.
9294 *
9295 *
9296 *     Ret  : S16
9297 *
9298 *     Notes:
9299 *
9300 *     File  : 
9301 *
9302 **********************************************************/
9303 #ifdef ANSI
9304 PUBLIC S16 cmUnpkTfuDlCqiInfo
9305 (
9306 U8 selector,
9307 TfuDlCqiInfo *param,
9308 Buffer *mBuf
9309 )
9310 #else
9311 PUBLIC S16 cmUnpkTfuDlCqiInfo(selector, param, mBuf)
9312 U8 selector;
9313 TfuDlCqiInfo *param;
9314 Buffer *mBuf;
9315 #endif
9316 {
9317
9318    U8 idx;
9319    TRC3(cmUnpkTfuDlCqiInfo)
9320
9321    switch(selector) {
9322       case TRUE:
9323          CMCHKUNPK(cmUnpkTfuDlCqiPucch, &param->pucchCqi, mBuf);
9324          break;
9325       case FALSE:
9326          CMCHKUNPK(SUnpkU8, &param->pusch.numOfCells, mBuf);
9327          for (idx = param->pusch.numOfCells; idx > 0; idx--)
9328          {
9329             CMCHKUNPK(cmUnpkTfuDlCqiPusch, &param->pusch.puschCqi[idx-1], mBuf);
9330          }
9331          break;
9332       default :
9333          RETVALUE(RFAILED);
9334    }
9335    RETVALUE(ROK);
9336 }
9337
9338
9339 \f
9340 /***********************************************************
9341 *
9342 *     Func : cmPkTfuRecpReqInfo
9343 *
9344 *
9345 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9346  * needed by PHY to decode the following 
9347  * 1. DATA on PUSCH
9348  * 2. HARQ Feedback on PUCCH
9349  * 3. CQI Report 
9350  * 4. RI Report
9351  * 5. SR Indications.
9352  * This structure carries the reception information for all the scheduled UE.
9353 *
9354 *
9355 *     Ret  : S16
9356 *
9357 *     Notes:
9358 *
9359 *     File  : 
9360 *
9361 **********************************************************/
9362 #ifdef ANSI
9363 PUBLIC S16 cmPkTfuRecpReqInfo
9364 (
9365 TfuRecpReqInfo *param,
9366 Buffer *mBuf
9367 )
9368 #else
9369 PUBLIC S16 cmPkTfuRecpReqInfo(param, mBuf)
9370 TfuRecpReqInfo *param;
9371 Buffer *mBuf;
9372 #endif
9373 {
9374    CmLList *node;
9375    U32 count;
9376    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9377
9378    TRC3(cmPkTfuRecpReqInfo)
9379
9380    /*ccpu00116923 - ADD - SRS present support*/
9381    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9382 #ifdef TFU_UPGRADE
9383    CMCHKPK(SPkU8, param->srsPres, mBuf);
9384 #endif
9385    count = param->ueRecpReqLst.count;
9386    node = param->ueRecpReqLst.last;
9387    while (node) {
9388       tfuUeRecpReqInfo = (TfuUeRecpReqInfo *)node->node;
9389       node=node->prev;
9390       CMCHKPK(cmPkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9391       cmLListDelFrm(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9392       tfuUeRecpReqInfo->lnk.node = (PTR)NULLP;
9393    }
9394    CMCHKPK(SPkU32, count, mBuf);
9395    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
9396    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9397    RETVALUE(ROK);
9398 }
9399
9400
9401 \f
9402 /***********************************************************
9403 *
9404 *     Func : cmUnpkTfuRecpReqInfo
9405 *
9406 *
9407 *     Desc : This structure is sent from Scheduler to PHY. This includes params
9408  * needed by PHY to decode the following 
9409  * 1. DATA on PUSCH
9410  * 2. HARQ Feedback on PUCCH
9411  * 3. CQI Report 
9412  * 4. RI Report
9413  * 5. SR Indications.
9414  * This structure carries the reception information for all the scheduled UE.
9415 *
9416 *
9417 *     Ret  : S16
9418 *
9419 *     Notes:
9420 *
9421 *     File  : 
9422 *
9423 **********************************************************/
9424 #ifdef ANSI
9425 PUBLIC S16 cmUnpkTfuRecpReqInfo
9426 (
9427 TfuRecpReqInfo *param,
9428 Ptr memCp,
9429 Buffer *mBuf
9430 )
9431 #else
9432 PUBLIC S16 cmUnpkTfuRecpReqInfo(param, memCp, mBuf)
9433 TfuRecpReqInfo *param;
9434 Ptr memCp;
9435 Buffer *mBuf;
9436 #endif
9437 {
9438
9439    U32 count, loopCnt;
9440    TfuUeRecpReqInfo *tfuUeRecpReqInfo;
9441
9442    TRC3(cmUnpkTfuRecpReqInfo)
9443
9444    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9445    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
9446    cmLListInit(&param->ueRecpReqLst);
9447    CMCHKUNPK(SUnpkU32, &count, mBuf);
9448    for (loopCnt=0; loopCnt<count; loopCnt++) {
9449       cmGetMem((Ptr)memCp, sizeof(*tfuUeRecpReqInfo), (Ptr *)&tfuUeRecpReqInfo);
9450       CMCHKUNPK(cmUnpkTfuUeRecpReqInfo, tfuUeRecpReqInfo, mBuf);
9451       cmLListAdd2Tail(&param->ueRecpReqLst, &tfuUeRecpReqInfo->lnk);
9452       tfuUeRecpReqInfo->lnk.node = (PTR)tfuUeRecpReqInfo;
9453    }
9454    /*ccpu00116923 - ADD - SRS present support*/
9455    /*tfu_c_001.main_7 - ADD - SRS present field inclusion */
9456 #ifdef TFU_UPGRADE
9457    CMCHKUNPK(SUnpkU8, &param->srsPres, mBuf);
9458 #endif
9459    RETVALUE(ROK);
9460 }
9461
9462
9463 \f
9464 /***********************************************************
9465 *
9466 *     Func : cmPkTfuPdcchInfo
9467 *
9468 *
9469 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9470   * formats. This information is associated with an RNTI.
9471 *
9472 *
9473 *     Ret  : S16
9474 *
9475 *     Notes:
9476 *
9477 *     File  : 
9478 *
9479 **********************************************************/
9480 #ifdef ANSI
9481 PUBLIC S16 cmPkTfuPdcchInfo
9482 (
9483 TfuPdcchInfo *param,
9484 Buffer *mBuf
9485 )
9486 #else
9487 PUBLIC S16 cmPkTfuPdcchInfo(param, mBuf)
9488 TfuPdcchInfo *param;
9489 Buffer *mBuf;
9490 #endif
9491 {
9492
9493    TRC3(cmPkTfuPdcchInfo)
9494 #ifdef TFU_5GTF
9495    CMCHKPK(SPkU8, param->grpId, mBuf);
9496    CMCHKPK(SPkU8, param->sccIdx, mBuf);
9497    CMCHKPK(SPkU8, param->sectorId, mBuf);
9498 #endif /* TFU_5GTF */
9499    CMCHKPK(cmPkTfuDciInfo, &param->dci, mBuf);
9500    CMCHKPK(SPkU8, param->dciNumOfBits, mBuf);
9501    CMCHKPK(cmPkLteAggrLvl, param->aggrLvl, mBuf);
9502    CMCHKPK(SPkU16, param->nCce, mBuf);
9503 #ifdef LTEMAC_SPS
9504    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
9505    CMCHKPK(SPkU8, param->isSpsRnti, mBuf);
9506 #endif
9507    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
9508    RETVALUE(ROK);
9509 }
9510
9511
9512 \f
9513 /***********************************************************
9514 *
9515 *     Func : cmUnpkTfuPdcchInfo
9516 *
9517 *
9518 *     Desc : This structure contains the PDCCH to be sent on PHY i.e. DCI
9519   * formats. This information is associated with an RNTI.
9520 *
9521 *
9522 *     Ret  : S16
9523 *
9524 *     Notes:
9525 *
9526 *     File  : 
9527 *
9528 **********************************************************/
9529 #ifdef ANSI
9530 PUBLIC S16 cmUnpkTfuPdcchInfo
9531 (
9532 TfuPdcchInfo *param,
9533 Buffer *mBuf
9534 )
9535 #else
9536 PUBLIC S16 cmUnpkTfuPdcchInfo(param, mBuf)
9537 TfuPdcchInfo *param;
9538 Buffer *mBuf;
9539 #endif
9540 {
9541
9542    TRC3(cmUnpkTfuPdcchInfo)
9543
9544    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
9545 #ifdef LTEMAC_SPS
9546    CMCHKUNPK(SUnpkU8, &param->isSpsRnti, mBuf);
9547    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
9548 #endif
9549    CMCHKUNPK(SUnpkU16, &param->nCce, mBuf);
9550    CMCHKUNPK(cmUnpkLteAggrLvl, (U32*)&param->aggrLvl, mBuf);
9551    CMCHKUNPK(SUnpkU8, &param->dciNumOfBits, mBuf);
9552    CMCHKUNPK(cmUnpkTfuDciInfo, &param->dci, mBuf);
9553 #ifdef TFU_5GTF 
9554    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
9555    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
9556    CMCHKUNPK(SUnpkU8, &param->grpId, mBuf);
9557 #endif /* TFU_5GTF */
9558    RETVALUE(ROK);
9559 }
9560
9561
9562 \f
9563 /***********************************************************
9564 *
9565 *     Func : cmPkTfuPhichInfo
9566 *
9567 *
9568 *     Desc : This structure contains one PHICH information. In order to locate the
9569  * resources to be used for PHICH the following information is provided along
9570  * with the feedback -
9571  * -# rbStart
9572  * -# nDmrs
9573 *
9574 *
9575 *     Ret  : S16
9576 *
9577 *     Notes:
9578 *
9579 *     File  : 
9580 *
9581 **********************************************************/
9582 #ifdef ANSI
9583 PUBLIC S16 cmPkTfuPhichInfo
9584 (
9585 TfuPhichInfo *param,
9586 Buffer *mBuf
9587 )
9588 #else
9589 PUBLIC S16 cmPkTfuPhichInfo(param, mBuf)
9590 TfuPhichInfo *param;
9591 Buffer *mBuf;
9592 #endif
9593 {
9594
9595    TRC3(cmPkTfuPhichInfo)
9596 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9597 #ifdef TFU_UPGRADE
9598    CMCHKPK(SPkU16, param->txPower, mBuf);
9599 #endif
9600 #ifdef TFU_TDD
9601    CMCHKPK(SPkU8, param->iPhich, mBuf);
9602 #endif
9603    CMCHKPK(SPkU8, param->isAck, mBuf);
9604    CMCHKPK(SPkU8, param->nDmrs, mBuf);
9605    CMCHKPK(SPkU8, param->rbStart, mBuf);
9606    RETVALUE(ROK);
9607 }
9608
9609
9610 \f
9611 /***********************************************************
9612 *
9613 *     Func : cmUnpkTfuPhichInfo
9614 *
9615 *
9616 *     Desc : This structure contains one PHICH information. In order to locate the
9617  * resources to be used for PHICH the following information is provided along
9618  * with the feedback -
9619  * -# rbStart
9620  * -# nDmrs
9621 *
9622 *
9623 *     Ret  : S16
9624 *
9625 *     Notes:
9626 *
9627 *     File  : 
9628 *
9629 **********************************************************/
9630 #ifdef ANSI
9631 PUBLIC S16 cmUnpkTfuPhichInfo
9632 (
9633 TfuPhichInfo *param,
9634 Buffer *mBuf
9635 )
9636 #else
9637 PUBLIC S16 cmUnpkTfuPhichInfo(param, mBuf)
9638 TfuPhichInfo *param;
9639 Buffer *mBuf;
9640 #endif
9641 {
9642
9643    TRC3(cmUnpkTfuPhichInfo)
9644
9645    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
9646    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
9647    CMCHKUNPK(SUnpkU8, &param->isAck, mBuf);
9648 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
9649 #ifdef TFU_TDD
9650    CMCHKUNPK(SUnpkU8, &param->iPhich, mBuf);
9651 #endif
9652 #ifdef TFU_UPGRADE   
9653    CMCHKUNPK(SUnpkU16, &param->txPower, mBuf);
9654 #endif
9655    RETVALUE(ROK);
9656 }
9657
9658
9659 \f
9660 /***********************************************************
9661 *
9662 *     Func : cmPkTfuCntrlReqInfo
9663 *
9664 *
9665 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9666  * control information to be sent to the UE. 
9667  * -# PDCCH  Physical Downlink Control Channel
9668  * -# PHICH  Physical HARQ Indicator Channel
9669  * -# PCFICH Physical Control Format Indicator Channel
9670 *
9671 *
9672 *     Ret  : S16
9673 *
9674 *     Notes:
9675 *
9676 *     File  : 
9677 *
9678 **********************************************************/
9679 #ifdef ANSI
9680 PUBLIC S16 cmPkTfuCntrlReqInfo
9681 (
9682 TfuCntrlReqInfo *param,
9683 Buffer *mBuf
9684 )
9685 #else
9686 PUBLIC S16 cmPkTfuCntrlReqInfo(param, mBuf)
9687 TfuCntrlReqInfo *param;
9688 Buffer *mBuf;
9689 #endif
9690 {
9691
9692    TfuPdcchInfo   *tfuPdcchInfo;
9693    TfuPhichInfo *tfuPhichInfo;
9694    CmLList *node;
9695    U32 count;
9696
9697    TRC3(cmPkTfuCntrlReqInfo)
9698 #ifdef EMTC_ENABLE
9699    count = param->dlMpdcchLst.count;
9700    node = param->dlMpdcchLst.last;
9701    while (node) {
9702       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9703       node=node->prev;
9704       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9705       cmLListDelFrm(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9706       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9707    }
9708    CMCHKPK(SPkU32, count, mBuf);
9709    count = param->ulMpdcchLst.count;
9710    node = param->ulMpdcchLst.last;
9711    while (node) {
9712       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9713       node=node->prev;
9714       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9715       cmLListDelFrm(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9716       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9717    }
9718    CMCHKPK(SPkU32, count, mBuf);
9719 #endif      
9720 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9721    CMCHKPK(cmPkBool, param->isSPSOcc, mBuf);
9722 #endif
9723    count = param->phichLst.count;
9724    node = param->phichLst.last;
9725    while (node) {
9726       tfuPhichInfo = (TfuPhichInfo *)node->node;
9727       node=node->prev;
9728       CMCHKPK(cmPkTfuPhichInfo, tfuPhichInfo, mBuf);
9729       cmLListDelFrm(&param->phichLst, &tfuPhichInfo->lnk);
9730       tfuPhichInfo->lnk.node = (PTR)NULLP;
9731    }
9732    CMCHKPK(SPkU32, count, mBuf);
9733    count = param->dlPdcchLst.count;
9734    node = param->dlPdcchLst.last;
9735    while (node) {
9736       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9737       node=node->prev;
9738       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9739       cmLListDelFrm(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9740       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9741    }
9742    CMCHKPK(SPkU32, count, mBuf);
9743    count = param->ulPdcchLst.count;
9744    node = param->ulPdcchLst.last;
9745    while (node) {
9746       tfuPdcchInfo = (TfuPdcchInfo *)node->node;
9747       node=node->prev;
9748 #ifdef UL_ADPT_DBG      
9749       printf("ulPdcchLst count %d  time[ %d %d] \n",count,param->ulTiming.sfn,param->ulTiming.subframe);
9750 #endif
9751       CMCHKPK(cmPkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9752       cmLListDelFrm(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9753       tfuPdcchInfo->lnk.node = (PTR)NULLP;
9754    }
9755    CMCHKPK(SPkU32, count, mBuf);
9756    CMCHKPK(SPkU8, param->cfi, mBuf);
9757    CMCHKPK(cmPkLteTimingInfo, &param->dlTiming, mBuf);
9758    CMCHKPK(cmPkLteTimingInfo, &param->ulTiming, mBuf);
9759    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
9760    RETVALUE(ROK);
9761 }
9762
9763
9764 \f
9765 /***********************************************************
9766 *
9767 *     Func : cmUnpkTfuCntrlReqInfo
9768 *
9769 *
9770 *     Desc : This structure is sent from Scheduler to PHY. This includes all the
9771  * control information to be sent to the UE. 
9772  * -# PDCCH  Physical Downlink Control Channel
9773  * -# PHICH  Physical HARQ Indicator Channel
9774  * -# PCFICH Physical Control Format Indicator Channel
9775 *
9776 *
9777 *     Ret  : S16
9778 *
9779 *     Notes:
9780 *
9781 *     File  : 
9782 *
9783 **********************************************************/
9784 #ifdef ANSI
9785 PUBLIC S16 cmUnpkTfuCntrlReqInfo
9786 (
9787 TfuCntrlReqInfo *param,
9788 Ptr memCp,
9789 Buffer *mBuf
9790 )
9791 #else
9792 PUBLIC S16 cmUnpkTfuCntrlReqInfo(param, memCp, mBuf)
9793 TfuCntrlReqInfo *param;
9794 Ptr memCp;
9795 Buffer *mBuf;
9796 #endif
9797 {
9798
9799    TfuPdcchInfo *tfuPdcchInfo;
9800    U32 count, loopCnt;
9801    TfuPhichInfo *tfuPhichInfo;
9802
9803    TRC3(cmUnpkTfuCntrlReqInfo)
9804
9805    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
9806    CMCHKUNPK(cmUnpkLteTimingInfo, &param->ulTiming, mBuf);
9807    CMCHKUNPK(cmUnpkLteTimingInfo, &param->dlTiming, mBuf);
9808    CMCHKUNPK(SUnpkU8, &param->cfi, mBuf);
9809    cmLListInit(&param->ulPdcchLst);
9810    CMCHKUNPK(SUnpkU32, &count, mBuf);
9811    for (loopCnt=0; loopCnt<count; loopCnt++) {
9812       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9813       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9814       cmLListAdd2Tail(&param->ulPdcchLst, &tfuPdcchInfo->lnk);
9815       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9816    }
9817    cmLListInit(&param->dlPdcchLst);
9818    CMCHKUNPK(SUnpkU32, &count, mBuf);
9819    for (loopCnt=0; loopCnt<count; loopCnt++) {
9820       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9821       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9822       cmLListAdd2Tail(&param->dlPdcchLst, &tfuPdcchInfo->lnk);
9823       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9824    }
9825    cmLListInit(&param->phichLst);
9826    CMCHKUNPK(SUnpkU32, &count, mBuf);
9827    for (loopCnt=0; loopCnt<count; loopCnt++) {
9828       cmGetMem((Ptr)memCp, sizeof(*tfuPhichInfo), (Ptr *)&tfuPhichInfo);
9829       CMCHKUNPK(cmUnpkTfuPhichInfo, tfuPhichInfo, mBuf);
9830       cmLListAdd2Tail(&param->phichLst, &tfuPhichInfo->lnk);
9831       tfuPhichInfo->lnk.node = (PTR)tfuPhichInfo;
9832    }
9833
9834 #ifdef LTEMAC_SPS /* SPS_NEW_CHGS */
9835    CMCHKUNPK(cmUnpkBool, &param->isSPSOcc, mBuf);
9836 #endif
9837 #ifdef EMTC_ENABLE   
9838    cmLListInit(&param->ulMpdcchLst);
9839    CMCHKUNPK(SUnpkU32, &count, mBuf);
9840    for (loopCnt=0; loopCnt<count; loopCnt++) {
9841       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9842       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9843       cmLListAdd2Tail(&param->ulMpdcchLst, &tfuPdcchInfo->lnk);
9844       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9845    }
9846    cmLListInit(&param->dlMpdcchLst);
9847    CMCHKUNPK(SUnpkU32, &count, mBuf);
9848    printf("4. cmUnpkTfuCntrlReqInfo :: count %ld \n", count); 
9849    for (loopCnt=0; loopCnt<count; loopCnt++) {
9850       cmGetMem((Ptr)memCp, sizeof(*tfuPdcchInfo), (Ptr *)&tfuPdcchInfo);
9851       CMCHKUNPK(cmUnpkTfuPdcchInfo, tfuPdcchInfo, mBuf);
9852       cmLListAdd2Tail(&param->dlMpdcchLst, &tfuPdcchInfo->lnk);
9853       tfuPdcchInfo->lnk.node = (PTR)tfuPdcchInfo;
9854       printf("5. cmUnpkTfuCntrlReqInfo :: Failed \n"); 
9855    }
9856 #endif  
9857    RETVALUE(ROK);
9858 }
9859
9860
9861 \f
9862 /***********************************************************
9863 *
9864 *     Func : cmPkTfuPdschDciInfo
9865 *
9866 *
9867 *     Desc : This structure Carries the control information that would be needed
9868   * by the Physical layer to process the data to be sent on PDSCH.
9869 *
9870 *
9871 *     Ret  : S16
9872 *
9873 *     Notes:
9874 *
9875 *     File  : 
9876 *
9877 **********************************************************/
9878 #ifdef ANSI
9879 PUBLIC S16 cmPkTfuPdschDciInfo
9880 (
9881 TfuPdschDciInfo *param,
9882 Buffer *mBuf
9883 )
9884 #else
9885 PUBLIC S16 cmPkTfuPdschDciInfo(param, mBuf)
9886 TfuPdschDciInfo *param;
9887 Buffer *mBuf;
9888 #endif
9889 {
9890
9891    TRC3(cmPkTfuPdschDciInfo)
9892
9893       switch(param->format) {
9894 #ifdef TFU_5GTF
9895          case TFU_DCI_FORMAT_B1:
9896             /* 
9897             if (param->u.formatB1Info.RBAssign <= 324)
9898             {
9899                printf("DCI Format: [B1] RBAssign: [%d] MCS: [%d]", 
9900                      param->u.formatB1Info.RBAssign, 
9901                      param->u.formatB1Info.u.rbAssignB1Val324.mcs);
9902             } 
9903             */
9904             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
9905             break;
9906          case TFU_DCI_FORMAT_B2:
9907             /* 
9908             if (param->u.formatB2Info.RBAssign <= 324)
9909             {
9910                printf("DCI Format: [B2] RBAssign: [%d] MCS: [%d]", 
9911                      param->u.formatB2Info.RBAssign, 
9912                      param->u.formatB2Info.u.rbAssignB1Val324.mcs);
9913             } 
9914             */
9915             CMCHKPK(cmPkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
9916             break;
9917          case TFU_DCI_FORMAT_A1:
9918             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
9919             break;
9920          case TFU_DCI_FORMAT_A2:
9921             CMCHKPK(cmPkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
9922             break;
9923 #endif
9924 #ifdef EMTC_ENABLE            
9925          case TFU_DCI_FORMAT_6_2:
9926              CMCHKPK(cmPkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
9927          break;
9928          case TFU_DCI_FORMAT_6_1A:
9929             CMCHKPK(cmPkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
9930             break;
9931 #endif            
9932          case TFU_DCI_FORMAT_2A:
9933             CMCHKPK(cmPkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
9934             break;
9935          case TFU_DCI_FORMAT_2:
9936             CMCHKPK(cmPkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
9937             break;
9938          case TFU_DCI_FORMAT_1D:
9939             CMCHKPK(cmPkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
9940             break;
9941          case TFU_DCI_FORMAT_1C:
9942             CMCHKPK(cmPkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
9943             break;
9944          case TFU_DCI_FORMAT_1B:
9945             CMCHKPK(cmPkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
9946             break;
9947          case TFU_DCI_FORMAT_1A:
9948             CMCHKPK(cmPkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
9949             break;
9950          case TFU_DCI_FORMAT_1:
9951             CMCHKPK(cmPkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9952             break;
9953          default :
9954             RETVALUE(RFAILED);
9955       }
9956    CMCHKPK(SPkU32, param->format, mBuf);
9957    RETVALUE(ROK);
9958 }
9959
9960
9961 \f
9962 /***********************************************************
9963 *
9964 *     Func : cmUnpkTfuPdschDciInfo
9965 *
9966 *
9967 *     Desc : This structure Carries the control information that would be needed
9968   * by the Physical layer to process the data to be sent on PDSCH.
9969 *
9970 *
9971 *     Ret  : S16
9972 *
9973 *     Notes:
9974 *
9975 *     File  : 
9976 *
9977 **********************************************************/
9978 #ifdef ANSI
9979 PUBLIC S16 cmUnpkTfuPdschDciInfo
9980 (
9981 TfuPdschDciInfo *param,
9982 Buffer *mBuf
9983 )
9984 #else
9985 PUBLIC S16 cmUnpkTfuPdschDciInfo(param, mBuf)
9986 TfuPdschDciInfo *param;
9987 Buffer *mBuf;
9988 #endif
9989 {
9990
9991    TRC3(cmUnpkTfuPdschDciInfo)
9992
9993    CMCHKUNPK(SUnpkU32, (U32 *)&param->format, mBuf);
9994       switch(param->format) {
9995          case TFU_DCI_FORMAT_1:
9996             CMCHKUNPK(cmUnpkTfuDciFormat1AllocInfo, &param->u.format1AllocInfo, mBuf);
9997             break;
9998          case TFU_DCI_FORMAT_1A:
9999             CMCHKUNPK(cmUnpkTfuDciFormat1aAllocInfo, &param->u.format1aAllocInfo, mBuf);
10000             break;
10001          case TFU_DCI_FORMAT_1B:
10002             CMCHKUNPK(cmUnpkTfuDciFormat1bAllocInfo, &param->u.format1bAllocInfo, mBuf);
10003             break;
10004          case TFU_DCI_FORMAT_1C:
10005             CMCHKUNPK(cmUnpkTfuDciFormat1cInfo, &param->u.format1cAllocInfo, mBuf);
10006             break;
10007          case TFU_DCI_FORMAT_1D:
10008             CMCHKUNPK(cmUnpkTfuDciFormat1dAllocInfo, &param->u.format1dAllocInfo, mBuf);
10009             break;
10010          case TFU_DCI_FORMAT_2:
10011             CMCHKUNPK(cmUnpkTfuDciFormat2AllocInfo, &param->u.format2AllocInfo, mBuf);
10012             break;
10013          case TFU_DCI_FORMAT_2A:
10014             CMCHKUNPK(cmUnpkTfuDciFormat2AAllocInfo, &param->u.format2AAllocInfo, mBuf);
10015             break;
10016 #ifdef EMTC_ENABLE            
10017          case TFU_DCI_FORMAT_6_1A:
10018             CMCHKUNPK(cmUnpkTfuDciFormat6AAllocInfo, &param->u.format61AllocInfo, mBuf);
10019             break;
10020          case TFU_DCI_FORMAT_6_2:
10021             CMCHKUNPK(cmUnpkTfuDciFormat62AllocInfo, &param->u.format62AllocInfo, mBuf);
10022             break;
10023 #endif   
10024 #ifdef TFU_5GTF
10025          case TFU_DCI_FORMAT_A1:
10026             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA1Info, mBuf);
10027             break;
10028                         case TFU_DCI_FORMAT_A2:
10029             CMCHKUNPK(cmUnpkTfuDciFormatA1A2Info, &param->u.formatA2Info, mBuf);
10030             break;
10031          case TFU_DCI_FORMAT_B1:
10032             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB1Info, mBuf);
10033             break;
10034                         case TFU_DCI_FORMAT_B2:
10035             CMCHKUNPK(cmUnpkTfuDciFormatB1B2Info, &param->u.formatB2Info, mBuf);
10036             break;
10037 #endif
10038          default :
10039             RETVALUE(RFAILED);
10040       }
10041    RETVALUE(ROK);
10042 }
10043 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10044 #ifdef TFU_UPGRADE
10045 /***********************************************************
10046 *
10047 *     Func : cmPkTfuBfVectorInfo
10048 *
10049 *
10050 *     Desc : This structure conveys the BeamForming Vector 
10051 *               Information that hold relevance to Tx Mode 7
10052 *
10053 *
10054 *     Ret  : S16
10055 *
10056 *     Notes:
10057 *
10058 *     File  : 
10059 *
10060 **********************************************************/
10061 #ifdef ANSI
10062 PUBLIC S16 cmPkTfuBfVectorInfo
10063 (
10064 TfuBfVectorInfo *param,
10065 Buffer *mBuf
10066 )
10067 #else
10068 PUBLIC S16 cmPkTfuBfVectorInfo(param, mBuf)
10069 TfuBfVectorInfo *param;
10070 Buffer *mBuf;
10071 #endif
10072 {
10073    S32 idx, idx2;
10074    TRC3(cmPkTfuBfVectorInfo)
10075    for(idx=TFU_MAX_DL_SUBBAND-1;idx>=0; idx--)
10076    {
10077       for (idx2=param->numPhyAnt -1; idx2 >= 0; idx2--) {
10078       CMCHKPK(SPkU16, param->bfValue[idx2], mBuf);}
10079       CMCHKPK(SPkU8, param->numPhyAnt, mBuf);
10080       CMCHKPK(SPkU8, param->sbIndex, mBuf);
10081    }
10082    RETVALUE(ROK);
10083 }
10084
10085 /***********************************************************
10086 *
10087 *     Func : cmUnpkTfuBfVectorInfo
10088 *
10089 *
10090 *     Desc : This structure conveys the BeamForming Vector 
10091 *               Information that hold relevance to Tx Mode 7
10092 *
10093 *
10094 *     Ret  : S16
10095 *
10096 *     Notes:
10097 *
10098 *     File  : 
10099 *
10100 **********************************************************/
10101 #ifdef ANSI
10102 PUBLIC S16 cmUnpkTfuBfVectorInfo
10103 (
10104    TfuBfVectorInfo *param,
10105    Buffer *mBuf
10106 )
10107 #else
10108 PUBLIC S16 cmUnpkTfuBfVectorInfo(param, mBuf)
10109  TfuBfVectorInfo *param;
10110  Buffer *mBuf;
10111 #endif
10112 {
10113    S32 idx, idx2;
10114    TRC3(cmUnpkTfuBfVectorInfo)
10115     for(idx=0;idx<TFU_MAX_DL_SUBBAND; idx++)
10116    {
10117       CMCHKUNPK(SUnpkU8, &param->sbIndex, mBuf);
10118       CMCHKUNPK(SUnpkU8, &param->numPhyAnt, mBuf);
10119       for (idx2=0; idx2 <param->numPhyAnt; idx2++) {
10120       CMCHKUNPK(SUnpkU16, &param->bfValue[idx2], mBuf);}
10121    }
10122   
10123    RETVALUE(ROK);
10124 }
10125 #endif 
10126 \f
10127 /***********************************************************
10128 *
10129 *     Func : cmPkTfuDatReqPduInfo
10130 *
10131 *
10132 *     Desc : Pack Function for Tfu Dat Req PDU.
10133 *
10134 *
10135 *     Ret  : S16
10136 *
10137 *     Notes:
10138 *
10139 *     File  : 
10140 *
10141 **********************************************************/
10142 #ifdef ANSI
10143 PUBLIC S16 cmPkTfuDatReqPduInfo
10144 (
10145 TfuDatReqPduInfo *param,
10146 Buffer *mBuf
10147 )
10148 #else
10149 PUBLIC S16 cmPkTfuDatReqPduInfo(param, mBuf)
10150 TfuDatReqPduInfo *param;
10151 Buffer *mBuf;
10152 #endif
10153 {
10154
10155    S32 i;
10156    U8  tbMask = 0;
10157 #ifdef L2_OPTMZ
10158    U32 lchIdx, pduIdx;
10159 #endif
10160
10161    TRC3(cmPkTfuDatReqPduInfo)
10162
10163    /* LTE_ADV_FLAG_REMOVED_START */
10164    CMCHKPK(SPkU8, param->isEnbSFR, mBuf);
10165    /* LTE_ADV_FLAG_REMOVED_END */
10166
10167    /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10168 #ifdef TFU_UPGRADE 
10169    CMCHKPK(SPkU16, param->txPwrOffset, mBuf);
10170    if(param->transMode == TFU_UE_TM_7)
10171    {
10172       CMCHKPK(cmPkTfuBfVectorInfo, param->bfVector, mBuf);
10173       CMCHKPK(SPkU8, param->numBfVectors, mBuf);
10174       CMCHKPK(SPkU8, param->numBfPrbPerSb, mBuf);
10175    }
10176    CMCHKPK(SPkU8, param->deltaPowOffIdx, mBuf);
10177    /* LTE_ADV_FLAG_REMOVED_START */
10178    CMCHKPK(SPkU8, param->pa, mBuf);
10179    /* LTE_ADV_FLAG_REMOVED_END */
10180    CMCHKPK(SPkU8, param->numLayers, mBuf);
10181 #endif
10182    CMCHKPK(cmPkBool, param->isTApres, mBuf);
10183    CMCHKPK(cmPkTknU32, &param->doa, mBuf);
10184    CMCHKPK(SPkU32, param->transMode, mBuf);
10185    CMCHKPK(cmPkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10186    CMCHKPK(SPkU8, param->puschRptUsd, mBuf);
10187    for (i = 0; i < TFU_MAX_TB; i++)
10188    {
10189 #ifndef L2_OPTMZ
10190      if (param->mBuf[i] != NULLP)
10191      {
10192         tbMask = tbMask | (1 << i);
10193      }
10194 #else /* L2_OPTMZ */
10195      for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10196      {
10197         for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10198               pduIdx++)
10199         {
10200            if (param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] != NULLP)
10201            {
10202               tbMask = tbMask | (1 << i);
10203            }
10204         }
10205      }
10206 #endif /* L2_OPTMZ */
10207    }
10208    /* tfu_c_001.main_2: Packing should consider nmbOfTBs.*/
10209    for (i=TFU_MAX_TB - 1; i >= 0; i--) {
10210 #ifndef L2_OPTMZ
10211       if (param->mBuf[i] != NULLP)
10212       {
10213          CMCHKPK(cmPkBuffer, &param->mBuf[i], mBuf);
10214       }
10215 #else
10216      // CMCHKPK(cmPkBuffer, &param->tbInfo[i].macPad, mBuf);
10217       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10218       {
10219          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10220                pduIdx++)
10221          {
10222             CMCHKPK(cmPkBuffer, &param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx],
10223                   mBuf);
10224
10225          }
10226          CMCHKPK(SPkU32, param->tbInfo[i].lchInfo[lchIdx].numPdu, mBuf);
10227       }
10228       CMCHKPK(SPkU32, param->tbInfo[i].numLch, mBuf);
10229       CMCHKPK(SPkU32, param->tbInfo[i].padSize, mBuf);
10230       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macCes, mBuf);
10231       CMCHKPK(cmPkBuffer, &param->tbInfo[i].macHdr, mBuf);
10232       CMCHKPK(cmPkMsgLen, param->tbInfo[i].tbSize, mBuf);
10233       CMCHKPK(cmPkBool, param->tbInfo[i].tbPres, mBuf);
10234 #endif
10235    }
10236    CMCHKPK(SPkU8, tbMask, mBuf);
10237    CMCHKPK(SPkU8, param->nmbOfTBs, mBuf);
10238    CMCHKPK(cmPkTfuPdschDciInfo, &param->dciInfo, mBuf);
10239    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10240    RETVALUE(ROK);
10241 }
10242
10243
10244 \f
10245 /***********************************************************
10246 *
10247 *     Func : cmUnpkTfuDatReqPduInfo
10248 *
10249 *
10250 *     Desc : UnPack function for Tfu Dat req pdu .
10251 *
10252 *
10253 *     Ret  : S16
10254 *
10255 *     Notes:
10256 *
10257 *     File  : 
10258 *
10259 **********************************************************/
10260 #ifdef ANSI
10261 PUBLIC S16 cmUnpkTfuDatReqPduInfo
10262 (
10263 TfuDatReqPduInfo *param,
10264 Buffer *mBuf
10265 )
10266 #else
10267 PUBLIC S16 cmUnpkTfuDatReqPduInfo(param, mBuf)
10268 TfuDatReqPduInfo *param;
10269 Buffer *mBuf;
10270 #endif
10271 {
10272
10273    U8 i;
10274    U8  tbMask = 0;
10275 #ifdef L2_OPTMZ
10276    U32 lchIdx, pduIdx;
10277 #endif
10278    TRC3(cmUnpkTfuDatReqPduInfo)
10279
10280    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10281    CMCHKUNPK(cmUnpkTfuPdschDciInfo, &param->dciInfo, mBuf);
10282    CMCHKUNPK(SUnpkU8, &param->nmbOfTBs, mBuf);
10283
10284    CMCHKUNPK(SUnpkU8, &tbMask, mBuf);
10285    for (i=0; i<TFU_MAX_TB; i++) {
10286 #ifndef L2_OPTMZ
10287       if (tbMask & (1<<i))
10288       {
10289          CMCHKUNPK(cmUnpkBuffer, &param->mBuf[i], mBuf);
10290       }
10291       else
10292       {
10293          param->mBuf[i] = NULLP;
10294       }
10295 #else /* L2_OPTMZ*/
10296       CMCHKUNPK(cmUnpkBool, &param->tbInfo[i].tbPres, mBuf);
10297       CMCHKUNPK(cmUnpkMsgLen, &param->tbInfo[i].tbSize, mBuf);
10298       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macHdr, mBuf);
10299       CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macCes, mBuf);
10300       CMCHKUNPK(SUnpkU32, &param->tbInfo[i].padSize, mBuf);
10301       CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].numLch, mBuf);
10302       for(lchIdx = 0; lchIdx < param->tbInfo[i].numLch; lchIdx++)
10303       {
10304          CMCHKUNPK(SUnpkU32, (U32 *)&param->tbInfo[i].lchInfo[lchIdx].numPdu,
10305                mBuf);
10306          for(pduIdx = 0; pduIdx < param->tbInfo[i].lchInfo[lchIdx].numPdu;
10307                pduIdx++)
10308          {
10309             if (tbMask & (1<<i))
10310             {
10311                CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].lchInfo[lchIdx].\
10312                      mBuf[pduIdx], mBuf);
10313             }
10314             else
10315             {
10316                param->tbInfo[i].lchInfo[lchIdx].mBuf[pduIdx] = NULLP;
10317             }
10318          }
10319       }
10320       //CMCHKUNPK(cmUnpkBuffer, &param->tbInfo[i].macPad, mBuf);
10321 #endif /* L2_OPTMZ*/
10322    }
10323
10324    CMCHKUNPK(SUnpkU8, &param->puschRptUsd, mBuf);
10325    CMCHKUNPK(cmUnpkTfuDlCqiPuschInfo, &param->puschPmiInfo, mBuf);
10326    CMCHKUNPK(SUnpkU32, (U32 *)&param->transMode, mBuf);
10327    CMCHKUNPK(cmUnpkTknU32, &param->doa, mBuf);
10328    CMCHKUNPK(cmUnpkBool, &param->isTApres, mBuf);
10329 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10330 #ifdef TFU_UPGRADE
10331    CMCHKUNPK(SUnpkU8, &param->numLayers, mBuf);
10332    /* LTE_ADV_FLAG_REMOVED_START */
10333    CMCHKUNPK(SUnpkU8, &param->pa, mBuf);
10334    /* LTE_ADV_FLAG_REMOVED_END */
10335    CMCHKUNPK(SUnpkU8, &param->deltaPowOffIdx, mBuf);
10336    if(param->transMode == TFU_UE_TM_7)
10337    {
10338       CMCHKUNPK(SUnpkU8, &param->numBfPrbPerSb, mBuf);
10339       CMCHKUNPK(SUnpkU8, &param->numBfVectors, mBuf);
10340       CMCHKUNPK(cmUnpkTfuBfVectorInfo, param->bfVector, mBuf);
10341    }
10342    CMCHKUNPK(SUnpkU16, &param->txPwrOffset, mBuf);
10343 #endif
10344
10345    /* LTE_ADV_FLAG_REMOVED_START */
10346    CMCHKUNPK(SUnpkU8, &param->isEnbSFR, mBuf);
10347    /* LTE_ADV_FLAG_REMOVED_END */
10348
10349    RETVALUE(ROK);
10350 }
10351
10352
10353 \f
10354 /***********************************************************
10355 *
10356 *     Func : cmPkTfuDatReqInfo
10357 *
10358 *
10359 *     Desc : This structure contains the Data PDUs 
10360  * @details This structure contains Data meant to be sent on both PBCH and
10361  * PDSCH. Control information necessary for processing of the data is sent along
10362  * with the Data.
10363 *
10364 *
10365 *     Ret  : S16
10366 *
10367 *     Notes:
10368 *
10369 *     File  : 
10370 *
10371 **********************************************************/
10372 #ifdef ANSI
10373 PUBLIC S16 cmPkTfuDatReqInfo
10374 (
10375 TfuDatReqInfo *param,
10376 Buffer *mBuf
10377 )
10378 #else
10379 PUBLIC S16 cmPkTfuDatReqInfo(param, mBuf)
10380 TfuDatReqInfo *param;
10381 Buffer *mBuf;
10382 #endif
10383 {
10384
10385    CmLList *node;
10386    U32 count;
10387    TfuDatReqPduInfo *tfuDatReqPduInfo;
10388
10389    TRC3(cmPkTfuDatReqInfo)
10390
10391    count = param->pdus.count;
10392    node = param->pdus.last;
10393    while (node) {
10394       tfuDatReqPduInfo = (TfuDatReqPduInfo *)node->node;
10395       node=node->prev;
10396       CMCHKPK(cmPkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10397       cmLListDelFrm(&param->pdus, &tfuDatReqPduInfo->lnk);
10398       tfuDatReqPduInfo->lnk.node = (PTR)NULLP;
10399    }
10400    CMCHKPK(SPkU32, count, mBuf);
10401    CMCHKPK(cmPkTknBuf, &param->bchDat, mBuf);
10402    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10403    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10404    RETVALUE(ROK);
10405 }
10406
10407
10408 \f
10409 /***********************************************************
10410 *
10411 *     Func : cmUnpkTfuDatReqInfo
10412 *
10413 *
10414 *     Desc : This structure contains the Data PDUs 
10415  * @details This structure contains Data meant to be sent on both PBCH and
10416  * PDSCH. Control information necessary for processing of the data is sent along
10417  * with the Data.
10418 *
10419 *
10420 *     Ret  : S16
10421 *
10422 *     Notes:
10423 *
10424 *     File  : 
10425 *
10426 **********************************************************/
10427 #ifdef ANSI
10428 PUBLIC S16 cmUnpkTfuDatReqInfo
10429 (
10430 TfuDatReqInfo *param,
10431 Ptr memCp,
10432 Buffer *mBuf
10433 )
10434 #else
10435 PUBLIC S16 cmUnpkTfuDatReqInfo(param, memCp, mBuf)
10436 TfuDatReqInfo *param;
10437 Ptr memCp;
10438 Buffer *mBuf;
10439 #endif
10440 {
10441
10442    U32 count, loopCnt;
10443    TfuDatReqPduInfo *tfuDatReqPduInfo;
10444
10445    TRC3(cmUnpkTfuDatReqInfo)
10446
10447    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10448    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10449    CMCHKUNPK(cmUnpkTknBuf, &param->bchDat, &mBuf);
10450    cmLListInit(&param->pdus);
10451    CMCHKUNPK(SUnpkU32, &count, mBuf);
10452    for (loopCnt=0; loopCnt<count; loopCnt++) {
10453       cmGetMem((Ptr)memCp, sizeof(*tfuDatReqPduInfo), (Ptr *)&tfuDatReqPduInfo);
10454       CMCHKUNPK(cmUnpkTfuDatReqPduInfo, tfuDatReqPduInfo, mBuf);
10455       cmLListAdd2Tail(&param->pdus, &tfuDatReqPduInfo->lnk);
10456       tfuDatReqPduInfo->lnk.node = (PTR)tfuDatReqPduInfo;
10457    }
10458    RETVALUE(ROK);
10459 }
10460
10461
10462 \f
10463 /***********************************************************
10464 *
10465 *     Func : cmPkTfuDatInfo
10466 *
10467 *
10468 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10469 *
10470 *
10471 *     Ret  : S16
10472 *
10473 *     Notes:
10474 *
10475 *     File  : 
10476 *
10477 **********************************************************/
10478 #ifdef ANSI
10479 PUBLIC S16 cmPkTfuDatInfo
10480 (
10481 TfuDatInfo *param,
10482 Buffer *mBuf
10483 )
10484 #else
10485 PUBLIC S16 cmPkTfuDatInfo(param, mBuf)
10486 TfuDatInfo *param;
10487 Buffer *mBuf;
10488 #endif
10489 {
10490
10491    TRC3(cmPkTfuDatInfo)
10492
10493    CMCHKPK(cmPkBuffer, &param->mBuf, mBuf);
10494    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10495    RETVALUE(ROK);
10496 }
10497
10498
10499 \f
10500 /***********************************************************
10501 *
10502 *     Func : cmUnpkTfuDatInfo
10503 *
10504 *
10505 *     Desc : This structure contains the Data PDU and the RNTI of the UE.
10506 *
10507 *
10508 *     Ret  : S16
10509 *
10510 *     Notes:
10511 *
10512 *     File  : 
10513 *
10514 **********************************************************/
10515 #ifdef ANSI
10516 PUBLIC S16 cmUnpkTfuDatInfo
10517 (
10518 TfuDatInfo *param,
10519 Buffer *mBuf
10520 )
10521 #else
10522 PUBLIC S16 cmUnpkTfuDatInfo(param, mBuf)
10523 TfuDatInfo *param;
10524 Buffer *mBuf;
10525 #endif
10526 {
10527
10528    TRC3(cmUnpkTfuDatInfo)
10529
10530    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10531    CMCHKUNPK(cmUnpkBuffer, &param->mBuf, mBuf);
10532    RETVALUE(ROK);
10533 }
10534
10535
10536 \f
10537 /***********************************************************
10538 *
10539 *     Func : cmPkTfuDatIndInfo
10540 *
10541 *
10542 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10543  * @details All the PDUs received by Physical layer in one subframe are clubbed
10544  * together into a single data structure and sent to MAC for processing.
10545 *
10546 *
10547 *     Ret  : S16
10548 *
10549 *     Notes:
10550 *
10551 *     File  : 
10552 *
10553 **********************************************************/
10554 #ifdef ANSI
10555 PUBLIC S16 cmPkTfuDatIndInfo
10556 (
10557 TfuDatIndInfo *param,
10558 Buffer *mBuf
10559 )
10560 #else
10561 PUBLIC S16 cmPkTfuDatIndInfo(param, mBuf)
10562 TfuDatIndInfo *param;
10563 Buffer *mBuf;
10564 #endif
10565 {
10566
10567    CmLList *node;
10568    U32 count;
10569    TfuDatInfo *tfuDatInfo;
10570
10571    TRC3(cmPkTfuDatIndInfo)
10572
10573 #ifdef TFU_5GTF
10574    CMCHKPK(SPkU8, param->sccIdx, mBuf);
10575    CMCHKPK(SPkU8, param->sectorId, mBuf);
10576 #endif /* TFU_5GTF */
10577    count = param->datIndLst.count;
10578    node = param->datIndLst.last;
10579    while (node) {
10580       tfuDatInfo = (TfuDatInfo *)node->node;
10581       node=node->prev;
10582       CMCHKPK(cmPkTfuDatInfo, tfuDatInfo, mBuf);
10583       cmLListDelFrm(&param->datIndLst, &tfuDatInfo->lnk);
10584       tfuDatInfo->lnk.node = (PTR)NULLP;
10585    }
10586    CMCHKPK(SPkU32, count, mBuf);
10587    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10588    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10589    RETVALUE(ROK);
10590 }
10591
10592
10593 \f
10594 /***********************************************************
10595 *
10596 *     Func : cmUnpkTfuDatIndInfo
10597 *
10598 *
10599 *     Desc : This structure contains the Data PDUs received at Physical Layer.
10600  * @details All the PDUs received by Physical layer in one subframe are clubbed
10601  * together into a single data structure and sent to MAC for processing.
10602 *
10603 *
10604 *     Ret  : S16
10605 *
10606 *     Notes:
10607 *
10608 *     File  : 
10609 *
10610 **********************************************************/
10611 #ifdef ANSI
10612 PUBLIC S16 cmUnpkTfuDatIndInfo
10613 (
10614 TfuDatIndInfo *param,
10615 Ptr memCp,
10616 Buffer *mBuf
10617 )
10618 #else
10619 PUBLIC S16 cmUnpkTfuDatIndInfo(param, memCp, mBuf)
10620 TfuDatIndInfo *param;
10621 Ptr memCp;
10622 Buffer *mBuf;
10623 #endif
10624 {
10625
10626    U32 count, loopCnt;
10627    TfuDatInfo *tfuDatInfo;
10628
10629    TRC3(cmUnpkTfuDatIndInfo)
10630
10631    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10632    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10633    cmLListInit(&param->datIndLst);
10634    CMCHKUNPK(SUnpkU32, &count, mBuf);
10635    for (loopCnt=0; loopCnt<count; loopCnt++) {
10636       cmGetMem((Ptr)memCp, sizeof(*tfuDatInfo), (Ptr *)&tfuDatInfo);
10637       CMCHKUNPK(cmUnpkTfuDatInfo, tfuDatInfo, mBuf);
10638       cmLListAdd2Tail(&param->datIndLst, &tfuDatInfo->lnk);
10639       tfuDatInfo->lnk.node = (PTR)tfuDatInfo;
10640    }
10641 #ifdef TFU_5GTF
10642    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
10643    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
10644 #endif /* TFU_5GTF */
10645    RETVALUE(ROK);
10646 }
10647
10648
10649 \f
10650 /***********************************************************
10651 *
10652 *     Func : cmPkTfuSrInfo
10653 *
10654 *
10655 *     Desc : This structure contains the SR indication for a UE, identified by
10656   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10657   * calculated by the physical layer, and is used by the scheduler for Power
10658   * control of the UE.
10659 *
10660 *
10661 *     Ret  : S16
10662 *
10663 *     Notes:
10664 *
10665 *     File  : 
10666 *
10667 **********************************************************/
10668 #ifdef ANSI
10669 PUBLIC S16 cmPkTfuSrInfo
10670 (
10671 TfuSrInfo *param,
10672 Buffer *mBuf
10673 )
10674 #else
10675 PUBLIC S16 cmPkTfuSrInfo(param, mBuf)
10676 TfuSrInfo *param;
10677 Buffer *mBuf;
10678 #endif
10679 {
10680
10681    TRC3(cmPkTfuSrInfo)
10682
10683    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10684    RETVALUE(ROK);
10685 }
10686
10687
10688 \f
10689 /***********************************************************
10690 *
10691 *     Func : cmUnpkTfuSrInfo
10692 *
10693 *
10694 *     Desc : This structure contains the SR indication for a UE, identified by
10695   * the given RNTI. The structure also contains a PUCCH Delta power, that is
10696   * calculated by the physical layer, and is used by the scheduler for Power
10697   * control of the UE.
10698 *
10699 *
10700 *     Ret  : S16
10701 *
10702 *     Notes:
10703 *
10704 *     File  : 
10705 *
10706 **********************************************************/
10707 #ifdef ANSI
10708 PUBLIC S16 cmUnpkTfuSrInfo
10709 (
10710 TfuSrInfo *param,
10711 Buffer *mBuf
10712 )
10713 #else
10714 PUBLIC S16 cmUnpkTfuSrInfo(param, mBuf)
10715 TfuSrInfo *param;
10716 Buffer *mBuf;
10717 #endif
10718 {
10719
10720    TRC3(cmUnpkTfuSrInfo)
10721
10722    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10723    RETVALUE(ROK);
10724 }
10725
10726
10727 \f
10728 /***********************************************************
10729 *
10730 *     Func : cmPkTfuSrIndInfo
10731 *
10732 *
10733 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10734   * received in a subframe.
10735 *
10736 *
10737 *     Ret  : S16
10738 *
10739 *     Notes:
10740 *
10741 *     File  : 
10742 *
10743 **********************************************************/
10744 #ifdef ANSI
10745 PUBLIC S16 cmPkTfuSrIndInfo
10746 (
10747 TfuSrIndInfo *param,
10748 Buffer *mBuf
10749 )
10750 #else
10751 PUBLIC S16 cmPkTfuSrIndInfo(param, mBuf)
10752 TfuSrIndInfo *param;
10753 Buffer *mBuf;
10754 #endif
10755 {
10756
10757    CmLList *node;
10758    U32 count;
10759    TfuSrInfo *tfuSrInfo;
10760
10761    TRC3(cmPkTfuSrIndInfo)
10762
10763    count = param->srLst.count;
10764    node = param->srLst.last;
10765    while (node) {
10766       tfuSrInfo = (TfuSrInfo *)node->node;
10767       node=node->prev;
10768       CMCHKPK(cmPkTfuSrInfo, tfuSrInfo, mBuf);
10769       cmLListDelFrm(&param->srLst, &tfuSrInfo->lnk);
10770       tfuSrInfo->lnk.node = (PTR)NULLP;
10771    }
10772    CMCHKPK(SPkU32, count, mBuf);
10773    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10774    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10775    RETVALUE(ROK);
10776 }
10777
10778
10779 \f
10780 /***********************************************************
10781 *
10782 *     Func : cmUnpkTfuSrIndInfo
10783 *
10784 *
10785 *     Desc : This structure contains all the Scheduling Requests (SR) indications
10786   * received in a subframe.
10787 *
10788 *
10789 *     Ret  : S16
10790 *
10791 *     Notes:
10792 *
10793 *     File  : 
10794 *
10795 **********************************************************/
10796 #ifdef ANSI
10797 PUBLIC S16 cmUnpkTfuSrIndInfo
10798 (
10799 TfuSrIndInfo *param,
10800 Ptr memCp,
10801 Buffer *mBuf
10802 )
10803 #else
10804 PUBLIC S16 cmUnpkTfuSrIndInfo(param, memCp, mBuf)
10805 TfuSrIndInfo *param;
10806 Ptr memCp;
10807 Buffer *mBuf;
10808 #endif
10809 {
10810
10811    U32 count, loopCnt;
10812    TfuSrInfo *tfuSrInfo;
10813
10814    TRC3(cmUnpkTfuSrIndInfo)
10815
10816    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
10817    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
10818    cmLListInit(&param->srLst);
10819    CMCHKUNPK(SUnpkU32, &count, mBuf);
10820    for (loopCnt=0; loopCnt<count; loopCnt++) {
10821       cmGetMem((Ptr)memCp, sizeof(*tfuSrInfo), (Ptr *)&tfuSrInfo);
10822       CMCHKUNPK(cmUnpkTfuSrInfo, tfuSrInfo, mBuf);
10823       cmLListAdd2Tail(&param->srLst, &tfuSrInfo->lnk);
10824       tfuSrInfo->lnk.node = (PTR)tfuSrInfo;
10825    }
10826    RETVALUE(ROK);
10827 }
10828
10829 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10830 /***********************************************************
10831 *
10832 *     Func : cmPkTfuHqInfo
10833 *
10834 *
10835 *     Desc : This structure contains the HARQ feedback for a single UE. 
10836   * @details RNTI is present to identify the UE. 
10837   * For FDD a single feedback is present. 
10838   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10839 *
10840 *
10841 *     Ret  : S16
10842 *
10843 *     Notes:
10844 *
10845 *     File  : 
10846 *
10847 **********************************************************/
10848 #ifdef ANSI
10849 PUBLIC S16 cmPkTfuHqInfo
10850 (
10851 TfuHqInfo *param,
10852 Buffer *mBuf
10853 )
10854 #else
10855 PUBLIC S16 cmPkTfuHqInfo(param, mBuf)
10856 TfuHqInfo *param;
10857 Buffer *mBuf;
10858 #endif
10859 {
10860
10861    S32 i;
10862    TRC3(cmPkTfuHqInfo)
10863
10864    CMCHKPK(SPkU8, param->isPusch, mBuf);
10865    for (i=TFU_MAX_HARQ_FDBKS-1; i >= 0; i--) {
10866       CMCHKPK(SPkU32, param->isAck[i], mBuf);
10867    }
10868 #ifdef TFU_TDD        
10869    CMCHKPK(SPkU8, param->M, mBuf);
10870 #endif/*TFU_TDD*/
10871    CMCHKPK(SPkU8, param->noOfTbs, mBuf);
10872 /* ACC-TDD ccpu00130520 */
10873    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
10874    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
10875    RETVALUE(ROK);
10876 }
10877
10878 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
10879 /***********************************************************
10880 *
10881 *     Func : cmUnpkTfuHqInfo
10882 *
10883 *
10884 *     Desc : This structure contains the HARQ feedback for a single UE. 
10885   * @details RNTI is present to identify the UE. 
10886   * For FDD a single feedback is present. 
10887   * For TDD HARQ multiplexing a list of HARQ feedbacks is present.
10888 *
10889 *
10890 *     Ret  : S16
10891 *
10892 *     Notes:
10893 *
10894 *     File  : 
10895 *
10896 **********************************************************/
10897 #ifdef ANSI
10898 PUBLIC S16 cmUnpkTfuHqInfo
10899 (
10900 TfuHqInfo *param,
10901 Buffer *mBuf
10902 )
10903 #else
10904 PUBLIC S16 cmUnpkTfuHqInfo(param, mBuf)
10905 TfuHqInfo *param;
10906 Buffer *mBuf;
10907 #endif
10908 {
10909    S32 i;
10910    TRC3(cmUnpkTfuHqInfo)
10911
10912    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
10913 /* ACC-TDD ccpu00130520 */
10914    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
10915    CMCHKUNPK(SUnpkU8, &param->noOfTbs, mBuf);
10916 #ifdef TFU_TDD
10917    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
10918 #endif
10919    for (i=0; i<TFU_MAX_HARQ_FDBKS; i++) {
10920       CMCHKUNPK(SUnpkU32, (U32 *)&param->isAck[i], mBuf);
10921    }
10922    CMCHKUNPK(SUnpkU8, &param->isPusch, mBuf);
10923    RETVALUE(ROK);
10924 }
10925
10926
10927
10928
10929 \f
10930 /***********************************************************
10931 *
10932 *     Func : cmPkTfuHqIndInfo
10933 *
10934 *
10935 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10936   * @details All the HARQ feedback received in the subframe are clubbed together
10937   * in this data structure and given to the scheduler for processing.
10938 *
10939 *
10940 *     Ret  : S16
10941 *
10942 *     Notes:
10943 *
10944 *     File  : 
10945 *
10946 **********************************************************/
10947 #ifdef ANSI
10948 PUBLIC S16 cmPkTfuHqIndInfo
10949 (
10950 TfuHqIndInfo *param,
10951 Buffer *mBuf
10952 )
10953 #else
10954 PUBLIC S16 cmPkTfuHqIndInfo(param, mBuf)
10955 TfuHqIndInfo *param;
10956 Buffer *mBuf;
10957 #endif
10958 {
10959
10960    CmLList *node;
10961    U32 count;
10962    TfuHqInfo *tfuHqInfo;
10963
10964    TRC3(cmPkTfuHqIndInfo)
10965
10966    count = param->hqIndLst.count;
10967    node = param->hqIndLst.last;
10968    while (node) {
10969       tfuHqInfo = (TfuHqInfo *)node->node;
10970       node=node->prev;
10971       CMCHKPK(cmPkTfuHqInfo, tfuHqInfo, mBuf);
10972       cmLListDelFrm(&param->hqIndLst, &tfuHqInfo->lnk);
10973       tfuHqInfo->lnk.node = (PTR)NULLP;
10974    }
10975    CMCHKPK(SPkU32, count, mBuf);
10976    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
10977    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
10978    RETVALUE(ROK);
10979 }
10980
10981
10982 \f
10983 /***********************************************************
10984 *
10985 *     Func : cmUnpkTfuHqIndInfo
10986 *
10987 *
10988 *     Desc : This structure contains a list of HARQ feedback for a number of UEs.
10989   * @details All the HARQ feedback received in the subframe are clubbed together
10990   * in this data structure and given to the scheduler for processing.
10991 *
10992 *
10993 *     Ret  : S16
10994 *
10995 *     Notes:
10996 *
10997 *     File  : 
10998 *
10999 **********************************************************/
11000 #ifdef ANSI
11001 PUBLIC S16 cmUnpkTfuHqIndInfo
11002 (
11003 TfuHqIndInfo *param,
11004 Ptr memCp,
11005 Buffer *mBuf
11006 )
11007 #else
11008 PUBLIC S16 cmUnpkTfuHqIndInfo(param, memCp, mBuf)
11009 TfuHqIndInfo *param;
11010 Ptr memCp;
11011 Buffer *mBuf;
11012 #endif
11013 {
11014
11015    U32 count, loopCnt;
11016    TfuHqInfo *tfuHqInfo;
11017
11018    TRC3(cmUnpkTfuHqIndInfo)
11019
11020    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11021    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11022    cmLListInit(&param->hqIndLst);
11023    CMCHKUNPK(SUnpkU32, &count, mBuf);
11024    for (loopCnt=0; loopCnt<count; loopCnt++) {
11025       cmGetMem((Ptr)memCp, sizeof(*tfuHqInfo), (Ptr *)&tfuHqInfo);
11026       CMCHKUNPK(cmUnpkTfuHqInfo, tfuHqInfo, mBuf);
11027       cmLListAdd2Tail(&param->hqIndLst, &tfuHqInfo->lnk);
11028       tfuHqInfo->lnk.node = (PTR)tfuHqInfo;
11029    }
11030    RETVALUE(ROK);
11031 }
11032
11033
11034 \f
11035 /***********************************************************
11036 *
11037 *     Func : cmPkTfuUlCqiInfo
11038 *
11039 *
11040 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11041 *
11042 *
11043 *     Ret  : S16
11044 *
11045 *     Notes:
11046 *
11047 *     File  : 
11048 *
11049 **********************************************************/
11050 #ifdef ANSI
11051 PUBLIC S16 cmPkTfuUlCqiInfo
11052 (
11053 TfuUlCqiInfo *param,
11054 Buffer *mBuf
11055 )
11056 #else
11057 PUBLIC S16 cmPkTfuUlCqiInfo(param, mBuf)
11058 TfuUlCqiInfo *param;
11059 Buffer *mBuf;
11060 #endif
11061 {
11062
11063    TRC3(cmPkTfuUlCqiInfo)
11064
11065    CMCHKPK(cmPkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11066    RETVALUE(ROK);
11067 }
11068
11069
11070 \f
11071 /***********************************************************
11072 *
11073 *     Func : cmUnpkTfuUlCqiInfo
11074 *
11075 *
11076 *     Desc : This structure conveys the Uplink CQI information for a single subband.
11077 *
11078 *
11079 *     Ret  : S16
11080 *
11081 *     Notes:
11082 *
11083 *     File  : 
11084 *
11085 **********************************************************/
11086 #ifdef ANSI
11087 PUBLIC S16 cmUnpkTfuUlCqiInfo
11088 (
11089 TfuUlCqiInfo *param,
11090 Buffer *mBuf
11091 )
11092 #else
11093 PUBLIC S16 cmUnpkTfuUlCqiInfo(param, mBuf)
11094 TfuUlCqiInfo *param;
11095 Buffer *mBuf;
11096 #endif
11097 {
11098
11099    TRC3(cmUnpkTfuUlCqiInfo)
11100
11101    CMCHKUNPK(cmUnpkTfuSubbandCqiInfo, &param->subbandCqi, mBuf);
11102    RETVALUE(ROK);
11103 }
11104
11105
11106 \f
11107 /***********************************************************
11108 *
11109 *     Func : cmPkTfuUlCqiRpt
11110 *
11111 *
11112 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11113   * @details The report could be wideband CQI or subBand CQI or both.
11114 *
11115 *
11116 *     Ret  : S16
11117 *
11118 *     Notes:
11119 *
11120 *     File  : 
11121 *
11122 **********************************************************/
11123 #ifdef ANSI
11124 PUBLIC S16 cmPkTfuUlCqiRpt
11125 (
11126 TfuUlCqiRpt *param,
11127 Buffer *mBuf
11128 )
11129 #else
11130 PUBLIC S16 cmPkTfuUlCqiRpt(param, mBuf)
11131 TfuUlCqiRpt *param;
11132 Buffer *mBuf;
11133 #endif
11134 {
11135
11136    S32 i;
11137    TRC3(cmPkTfuUlCqiRpt)
11138
11139    for (i=TFU_MAX_UL_SUBBAND-1; i >= 0; i--) {
11140       CMCHKPK(cmPkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11141    }
11142    CMCHKPK(SPkU8, param->numSubband, mBuf);
11143    CMCHKPK(SPkU8, param->wideCqi, mBuf);
11144    CMCHKPK(SPkU8, param->isTxPort0, mBuf);
11145    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11146    RETVALUE(ROK);
11147 }
11148
11149
11150 \f
11151 /***********************************************************
11152 *
11153 *     Func : cmUnpkTfuUlCqiRpt
11154 *
11155 *
11156 *     Desc : This structure contains the UL CQI estimated by the physical layer. 
11157   * @details The report could be wideband CQI or subBand CQI or both.
11158 *
11159 *
11160 *     Ret  : S16
11161 *
11162 *     Notes:
11163 *
11164 *     File  : 
11165 *
11166 **********************************************************/
11167 #ifdef ANSI
11168 PUBLIC S16 cmUnpkTfuUlCqiRpt
11169 (
11170 TfuUlCqiRpt *param,
11171 Buffer *mBuf
11172 )
11173 #else
11174 PUBLIC S16 cmUnpkTfuUlCqiRpt(param, mBuf)
11175 TfuUlCqiRpt *param;
11176 Buffer *mBuf;
11177 #endif
11178 {
11179
11180    S32 i;
11181    TRC3(cmUnpkTfuUlCqiRpt)
11182
11183    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11184    CMCHKUNPK(SUnpkU8, &param->isTxPort0, mBuf);
11185    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
11186    CMCHKUNPK(SUnpkU8, &param->numSubband, mBuf);
11187    for (i=0; i<TFU_MAX_UL_SUBBAND; i++) {
11188       CMCHKUNPK(cmUnpkTfuUlCqiInfo, &param->ulCqiInfoArr[i], mBuf);
11189    }
11190    RETVALUE(ROK);
11191 }
11192
11193
11194 \f
11195 /***********************************************************
11196 *
11197 *     Func : cmPkTfuUlCqiIndInfo
11198 *
11199 *
11200 *     Desc : This structure conveys the Uplink CQI information.
11201  * @details Uplink CQI is calculated by the physical layer, and is this
11202  * information is provided to the scheduler. 
11203  * This data structure clubs together the UL CQI estimates for all the UEs that
11204  * have been scheduled in the subframe for uplink transmission.
11205 *
11206 *
11207 *     Ret  : S16
11208 *
11209 *     Notes:
11210 *
11211 *     File  : 
11212 *
11213 **********************************************************/
11214 #ifdef ANSI
11215 PUBLIC S16 cmPkTfuUlCqiIndInfo
11216 (
11217 TfuUlCqiIndInfo *param,
11218 Buffer *mBuf
11219 )
11220 #else
11221 PUBLIC S16 cmPkTfuUlCqiIndInfo(param, mBuf)
11222 TfuUlCqiIndInfo *param;
11223 Buffer *mBuf;
11224 #endif
11225 {
11226
11227    CmLList *node;
11228    U32 count;
11229    TfuUlCqiRpt *tfuUlCqiRpt;
11230
11231    TRC3(cmPkTfuUlCqiIndInfo)
11232
11233    count = param->ulCqiRpt.count;
11234    node = param->ulCqiRpt.last;
11235    while (node) {
11236       tfuUlCqiRpt = (TfuUlCqiRpt *)node->node;
11237       node=node->prev;
11238       CMCHKPK(cmPkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11239       cmLListDelFrm(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11240       tfuUlCqiRpt->lnk.node = (PTR)NULLP;
11241    }
11242    CMCHKPK(SPkU32, count, mBuf);
11243    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11244    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11245    RETVALUE(ROK);
11246 }
11247
11248
11249 \f
11250 /***********************************************************
11251 *
11252 *     Func : cmUnpkTfuUlCqiIndInfo
11253 *
11254 *
11255 *     Desc : This structure conveys the Uplink CQI information.
11256  * @details Uplink CQI is calculated by the physical layer, and is this
11257  * information is provided to the scheduler. 
11258  * This data structure clubs together the UL CQI estimates for all the UEs that
11259  * have been scheduled in the subframe for uplink transmission.
11260 *
11261 *
11262 *     Ret  : S16
11263 *
11264 *     Notes:
11265 *
11266 *     File  : 
11267 *
11268 **********************************************************/
11269 #ifdef ANSI
11270 PUBLIC S16 cmUnpkTfuUlCqiIndInfo
11271 (
11272 TfuUlCqiIndInfo *param,
11273 Ptr memCp,
11274 Buffer *mBuf
11275 )
11276 #else
11277 PUBLIC S16 cmUnpkTfuUlCqiIndInfo(param, memCp, mBuf)
11278 TfuUlCqiIndInfo *param;
11279 Ptr memCp;
11280 Buffer *mBuf;
11281 #endif
11282 {
11283
11284    U32 count, loopCnt;
11285    TfuUlCqiRpt *tfuUlCqiRpt;
11286
11287    TRC3(cmUnpkTfuUlCqiIndInfo)
11288
11289    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11290    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11291    cmLListInit(&param->ulCqiRpt);
11292    CMCHKUNPK(SUnpkU32, &count, mBuf);
11293    for (loopCnt=0; loopCnt<count; loopCnt++) {
11294       cmGetMem((Ptr)memCp, sizeof(*tfuUlCqiRpt), (Ptr *)&tfuUlCqiRpt);
11295       CMCHKUNPK(cmUnpkTfuUlCqiRpt, tfuUlCqiRpt, mBuf);
11296       cmLListAdd2Tail(&param->ulCqiRpt, &tfuUlCqiRpt->lnk);
11297       tfuUlCqiRpt->lnk.node = (PTR)tfuUlCqiRpt;
11298    }
11299    RETVALUE(ROK);
11300 }
11301
11302
11303
11304 \f
11305 /***********************************************************
11306 *
11307 *     Func : cmPkTfuDlCqiRpt
11308 *
11309 *
11310 *     Desc : This structure contains the DL CQI report for a single UE. 
11311   * @details The report could either be reported on PUCCH or PUSCH, a flag
11312   * conveys this information.
11313 *
11314 *
11315 *     Ret  : S16
11316 *
11317 *     Notes:
11318 *
11319 *     File  : 
11320 *
11321 **********************************************************/
11322 #ifdef ANSI
11323 PUBLIC S16 cmPkTfuDlCqiRpt
11324 (
11325 TfuDlCqiRpt *param,
11326 Buffer *mBuf
11327 )
11328 #else
11329 PUBLIC S16 cmPkTfuDlCqiRpt(param, mBuf)
11330 TfuDlCqiRpt *param;
11331 Buffer *mBuf;
11332 #endif
11333 {
11334
11335    TRC3(cmPkTfuDlCqiRpt)
11336
11337       if (cmPkTfuDlCqiInfo(param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11338          RETVALUE(RFAILED);
11339    CMCHKPK(SPkU8, param->isPucchInfo, mBuf);
11340    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11341    RETVALUE(ROK);
11342 }
11343
11344
11345 \f
11346 /***********************************************************
11347 *
11348 *     Func : cmUnpkTfuDlCqiRpt
11349 *
11350 *
11351 *     Desc : This structure contains the DL CQI report for a single UE. 
11352   * @details The report could either be reported on PUCCH or PUSCH, a flag
11353   * conveys this information.
11354 *
11355 *
11356 *     Ret  : S16
11357 *
11358 *     Notes:
11359 *
11360 *     File  : 
11361 *
11362 **********************************************************/
11363 #ifdef ANSI
11364 PUBLIC S16 cmUnpkTfuDlCqiRpt
11365 (
11366 TfuDlCqiRpt *param,
11367 Buffer *mBuf
11368 )
11369 #else
11370 PUBLIC S16 cmUnpkTfuDlCqiRpt(param, mBuf)
11371 TfuDlCqiRpt *param;
11372 Buffer *mBuf;
11373 #endif
11374 {
11375
11376    TRC3(cmUnpkTfuDlCqiRpt)
11377
11378    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11379    CMCHKUNPK(SUnpkU8, &param->isPucchInfo, mBuf);
11380    if (cmUnpkTfuDlCqiInfo (param->isPucchInfo, &param->dlCqiInfo, mBuf) != ROK)
11381       RETVALUE(RFAILED);
11382    RETVALUE(ROK);
11383 }
11384
11385
11386 \f
11387 /***********************************************************
11388 *
11389 *     Func : cmPkTfuDlCqiIndInfo
11390 *
11391 *
11392 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11393  * UEs. 
11394  * @details This structure clubs together DL CQI reports for a number of UEs.
11395 *
11396 *
11397 *     Ret  : S16
11398 *
11399 *     Notes:
11400 *
11401 *     File  : 
11402 *
11403 **********************************************************/
11404 #ifdef ANSI
11405 PUBLIC S16 cmPkTfuDlCqiIndInfo
11406 (
11407 TfuDlCqiIndInfo *param,
11408 Buffer *mBuf
11409 )
11410 #else
11411 PUBLIC S16 cmPkTfuDlCqiIndInfo(param, mBuf)
11412 TfuDlCqiIndInfo *param;
11413 Buffer *mBuf;
11414 #endif
11415 {
11416
11417    CmLList *node;
11418    U32 count;
11419    TfuDlCqiRpt *tfuDlCqiRpt;
11420
11421    TRC3(cmPkTfuDlCqiIndInfo)
11422
11423    count = param->dlCqiRptsLst.count;
11424    node = param->dlCqiRptsLst.last;
11425    while (node) {
11426       tfuDlCqiRpt = (TfuDlCqiRpt *)node->node;
11427       node=node->prev;
11428       CMCHKPK(cmPkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11429       cmLListDelFrm(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11430       tfuDlCqiRpt->lnk.node = (PTR)NULLP;
11431    }
11432    CMCHKPK(SPkU32, count, mBuf);
11433    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11434    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11435    RETVALUE(ROK);
11436 }
11437
11438
11439 \f
11440 /***********************************************************
11441 *
11442 *     Func : cmUnpkTfuDlCqiIndInfo
11443 *
11444 *
11445 *     Desc : This structure contains a list of Downlink CQI reports transmitted by
11446  * UEs. 
11447  * @details This structure clubs together DL CQI reports for a number of UEs.
11448 *
11449 *
11450 *     Ret  : S16
11451 *
11452 *     Notes:
11453 *
11454 *     File  : 
11455 *
11456 **********************************************************/
11457 #ifdef ANSI
11458 PUBLIC S16 cmUnpkTfuDlCqiIndInfo
11459 (
11460 TfuDlCqiIndInfo *param,
11461 Ptr memCp,
11462 Buffer *mBuf
11463 )
11464 #else
11465 PUBLIC S16 cmUnpkTfuDlCqiIndInfo(param, memCp, mBuf)
11466 TfuDlCqiIndInfo *param;
11467 Ptr memCp;
11468 Buffer *mBuf;
11469 #endif
11470 {
11471
11472    U32 count, loopCnt;
11473    TfuDlCqiRpt *tfuDlCqiRpt;
11474
11475    TRC3(cmUnpkTfuDlCqiIndInfo)
11476
11477    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11478    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11479    cmLListInit(&param->dlCqiRptsLst);
11480    CMCHKUNPK(SUnpkU32, &count, mBuf);
11481    for (loopCnt=0; loopCnt<count; loopCnt++) {
11482       cmGetMem((Ptr)memCp, sizeof(*tfuDlCqiRpt), (Ptr *)&tfuDlCqiRpt);
11483       CMCHKUNPK(cmUnpkTfuDlCqiRpt, tfuDlCqiRpt, mBuf);
11484       cmLListAdd2Tail(&param->dlCqiRptsLst, &tfuDlCqiRpt->lnk);
11485       tfuDlCqiRpt->lnk.node = (PTR)tfuDlCqiRpt;
11486    }
11487    RETVALUE(ROK);
11488 }
11489
11490
11491 \f
11492 /***********************************************************
11493 *
11494 *     Func : cmPkTfuCrcInfo
11495 *
11496 *
11497 *     Desc : This structure contains the CRC indication for a single
11498   * UE.
11499 *
11500 *
11501 *     Ret  : S16
11502 *
11503 *     Notes:
11504 *
11505 *     File  : 
11506 *
11507 **********************************************************/
11508 #ifdef ANSI
11509 PUBLIC S16 cmPkTfuCrcInfo
11510 (
11511 TfuCrcInfo *param,
11512 Buffer *mBuf
11513 )
11514 #else
11515 PUBLIC S16 cmPkTfuCrcInfo(param, mBuf)
11516 TfuCrcInfo *param;
11517 Buffer *mBuf;
11518 #endif
11519 {
11520
11521    TRC3(cmPkTfuCrcInfo)
11522
11523    CMCHKPK(cmPkTknU8, &param->rv, mBuf);
11524    CMCHKPK(SPkU8, param->isFailure, mBuf);
11525    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11526    RETVALUE(ROK);
11527 }
11528
11529
11530 \f
11531 /***********************************************************
11532 *
11533 *     Func : cmUnpkTfuCrcInfo
11534 *
11535 *
11536 *     Desc : This structure contains the CRC indication for a single
11537   * UE.
11538 *
11539 *
11540 *     Ret  : S16
11541 *
11542 *     Notes:
11543 *
11544 *     File  : 
11545 *
11546 **********************************************************/
11547 #ifdef ANSI
11548 PUBLIC S16 cmUnpkTfuCrcInfo
11549 (
11550 TfuCrcInfo *param,
11551 Buffer *mBuf
11552 )
11553 #else
11554 PUBLIC S16 cmUnpkTfuCrcInfo(param, mBuf)
11555 TfuCrcInfo *param;
11556 Buffer *mBuf;
11557 #endif
11558 {
11559
11560    TRC3(cmUnpkTfuCrcInfo)
11561
11562    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11563    CMCHKUNPK(SUnpkU8, &param->isFailure, mBuf);
11564    CMCHKUNPK(cmUnpkTknU8, &param->rv, mBuf);
11565    RETVALUE(ROK);
11566 }
11567
11568
11569 \f
11570 /***********************************************************
11571 *
11572 *     Func : cmPkTfuCrcIndInfo
11573 *
11574 *
11575 *     Desc : This structure contains information that is passed as a part of the
11576  * CRC Indication from PHY to MAC.
11577  * @details This structure clubs together all the CRC indications for
11578  * a single subframe and conveys this information to the scheduler.
11579 *
11580 *
11581 *     Ret  : S16
11582 *
11583 *     Notes:
11584 *
11585 *     File  : 
11586 *
11587 **********************************************************/
11588 #ifdef ANSI
11589 PUBLIC S16 cmPkTfuCrcIndInfo
11590 (
11591 TfuCrcIndInfo *param,
11592 Buffer *mBuf
11593 )
11594 #else
11595 PUBLIC S16 cmPkTfuCrcIndInfo(param, mBuf)
11596 TfuCrcIndInfo *param;
11597 Buffer *mBuf;
11598 #endif
11599 {
11600
11601    CmLList *node;
11602    U32 count;
11603    TfuCrcInfo *tfuCrcIndInfo;
11604
11605    TRC3(cmPkTfuCrcIndInfo)
11606
11607 #ifdef TFU_5GTF
11608    CMCHKPK(SPkU8, param->sccIdx, mBuf);
11609    CMCHKPK(SPkU8, param->sectorId, mBuf);
11610 #endif /* TFU_5GTF */
11611    count = param->crcLst.count;
11612    node = param->crcLst.last;
11613    while (node) {
11614       tfuCrcIndInfo = (TfuCrcInfo *)node->node;
11615       node=node->prev;
11616       CMCHKPK(cmPkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11617       cmLListDelFrm(&param->crcLst, &tfuCrcIndInfo->lnk);
11618       tfuCrcIndInfo->lnk.node = (PTR)NULLP;
11619    }
11620    CMCHKPK(SPkU32, count, mBuf);
11621    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11622    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11623    RETVALUE(ROK);
11624 }
11625
11626
11627 \f
11628 /***********************************************************
11629 *
11630 *     Func : cmUnpkTfuCrcIndInfo
11631 *
11632 *
11633 *     Desc : This structure contains information that is passed as a part of the
11634  * CRC Indication from PHY to MAC.
11635  * @details This structure clubs together all the CRC indications for
11636  * a single subframe and conveys this information to the scheduler.
11637 *
11638 *
11639 *     Ret  : S16
11640 *
11641 *     Notes:
11642 *
11643 *     File  : 
11644 *
11645 **********************************************************/
11646 #ifdef ANSI
11647 PUBLIC S16 cmUnpkTfuCrcIndInfo
11648 (
11649 TfuCrcIndInfo *param,
11650 Ptr memCp,
11651 Buffer *mBuf
11652 )
11653 #else
11654 PUBLIC S16 cmUnpkTfuCrcIndInfo(param, memCp, mBuf)
11655 TfuCrcIndInfo *param;
11656 Ptr memCp;
11657 Buffer *mBuf;
11658 #endif
11659 {
11660
11661    U32 count, loopCnt;
11662    TfuCrcInfo *tfuCrcIndInfo;
11663
11664    TRC3(cmUnpkTfuCrcIndInfo)
11665
11666    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11667    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11668    cmLListInit(&param->crcLst);
11669    CMCHKUNPK(SUnpkU32, &count, mBuf);
11670    for (loopCnt=0; loopCnt<count; loopCnt++) {
11671       cmGetMem((Ptr)memCp, sizeof(*tfuCrcIndInfo), (Ptr *)&tfuCrcIndInfo);
11672       CMCHKUNPK(cmUnpkTfuCrcInfo, tfuCrcIndInfo, mBuf);
11673       cmLListAdd2Tail(&param->crcLst, &tfuCrcIndInfo->lnk);
11674       tfuCrcIndInfo->lnk.node = (PTR)tfuCrcIndInfo;
11675    }
11676 #ifdef TFU_5GTF
11677    CMCHKUNPK(SUnpkU8, &param->sectorId, mBuf);
11678    CMCHKUNPK(SUnpkU8, &param->sccIdx, mBuf);
11679 #endif /* TFU_5GTF */
11680    RETVALUE(ROK);
11681 }
11682
11683
11684 \f
11685 /***********************************************************
11686 *
11687 *     Func : cmPkTfuTimingAdvInfo
11688 *
11689 *
11690 *     Desc : This structure contains the timing advance information for a single
11691   * UE.
11692 *
11693 *
11694 *     Ret  : S16
11695 *
11696 *     Notes:
11697 *
11698 *     File  : 
11699 *
11700 **********************************************************/
11701 #ifdef ANSI
11702 PUBLIC S16 cmPkTfuTimingAdvInfo
11703 (
11704 TfuTimingAdvInfo *param,
11705 Buffer *mBuf
11706 )
11707 #else
11708 PUBLIC S16 cmPkTfuTimingAdvInfo(param, mBuf)
11709 TfuTimingAdvInfo *param;
11710 Buffer *mBuf;
11711 #endif
11712 {
11713
11714    TRC3(cmPkTfuTimingAdvInfo)
11715
11716    CMCHKPK(SPkU8, param->timingAdv, mBuf);
11717    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
11718    RETVALUE(ROK);
11719 }
11720
11721
11722 \f
11723 /***********************************************************
11724 *
11725 *     Func : cmUnpkTfuTimingAdvInfo
11726 *
11727 *
11728 *     Desc : This structure contains the timing advance information for a single
11729   * UE.
11730 *
11731 *
11732 *     Ret  : S16
11733 *
11734 *     Notes:
11735 *
11736 *     File  : 
11737 *
11738 **********************************************************/
11739 #ifdef ANSI
11740 PUBLIC S16 cmUnpkTfuTimingAdvInfo
11741 (
11742 TfuTimingAdvInfo *param,
11743 Buffer *mBuf
11744 )
11745 #else
11746 PUBLIC S16 cmUnpkTfuTimingAdvInfo(param, mBuf)
11747 TfuTimingAdvInfo *param;
11748 Buffer *mBuf;
11749 #endif
11750 {
11751
11752    TRC3(cmUnpkTfuTimingAdvInfo)
11753
11754    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
11755    CMCHKUNPK(SUnpkU8, &param->timingAdv, mBuf);
11756    RETVALUE(ROK);
11757 }
11758
11759
11760 \f
11761 /***********************************************************
11762 *
11763 *     Func : cmPkTfuTimingAdvIndInfo
11764 *
11765 *
11766 *     Desc : This structure contains information that is passed as part of the Timing
11767  * Advance indication from PHY to MAC.
11768  * @details This structure clubs together timing advances for a number of UEs.
11769 *
11770 *
11771 *     Ret  : S16
11772 *
11773 *     Notes:
11774 *
11775 *     File  : 
11776 *
11777 **********************************************************/
11778 #ifdef ANSI
11779 PUBLIC S16 cmPkTfuTimingAdvIndInfo
11780 (
11781 TfuTimingAdvIndInfo *param,
11782 Buffer *mBuf
11783 )
11784 #else
11785 PUBLIC S16 cmPkTfuTimingAdvIndInfo(param, mBuf)
11786 TfuTimingAdvIndInfo *param;
11787 Buffer *mBuf;
11788 #endif
11789 {
11790
11791    CmLList *node;
11792    U32 count;
11793    TfuTimingAdvInfo *tfuTimingAdvInfo;
11794
11795    TRC3(cmPkTfuTimingAdvIndInfo)
11796
11797    count = param->timingAdvLst.count;
11798    node = param->timingAdvLst.last;
11799    while (node) {
11800       tfuTimingAdvInfo = (TfuTimingAdvInfo *)node->node;
11801       node=node->prev;
11802       CMCHKPK(cmPkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11803       cmLListDelFrm(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11804       tfuTimingAdvInfo->lnk.node = (PTR)NULLP;
11805    }
11806    CMCHKPK(SPkU32, count, mBuf);
11807    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11808    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11809    RETVALUE(ROK);
11810 }
11811
11812
11813 \f
11814 /***********************************************************
11815 *
11816 *     Func : cmUnpkTfuTimingAdvIndInfo
11817 *
11818 *
11819 *     Desc : This structure contains information that is passed as part of the Timing
11820  * Advance indication from PHY to MAC.
11821  * @details This structure clubs together timing advances for a number of UEs.
11822 *
11823 *
11824 *     Ret  : S16
11825 *
11826 *     Notes:
11827 *
11828 *     File  : 
11829 *
11830 **********************************************************/
11831 #ifdef ANSI
11832 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo
11833 (
11834 TfuTimingAdvIndInfo *param,
11835 Ptr memCp,
11836 Buffer *mBuf
11837 )
11838 #else
11839 PUBLIC S16 cmUnpkTfuTimingAdvIndInfo(param, memCp, mBuf)
11840 TfuTimingAdvIndInfo *param;
11841 Ptr memCp;
11842 Buffer *mBuf;
11843 #endif
11844 {
11845
11846    U32 count, loopCnt;
11847    TfuTimingAdvInfo *tfuTimingAdvInfo;
11848
11849    TRC3(cmUnpkTfuTimingAdvIndInfo)
11850
11851    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11852    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11853    cmLListInit(&param->timingAdvLst);
11854    CMCHKUNPK(SUnpkU32, &count, mBuf);
11855    for (loopCnt=0; loopCnt<count; loopCnt++) {
11856       cmGetMem((Ptr)memCp, sizeof(*tfuTimingAdvInfo), (Ptr *)&tfuTimingAdvInfo);
11857       CMCHKUNPK(cmUnpkTfuTimingAdvInfo, tfuTimingAdvInfo, mBuf);
11858       cmLListAdd2Tail(&param->timingAdvLst, &tfuTimingAdvInfo->lnk);
11859       tfuTimingAdvInfo->lnk.node = (PTR)tfuTimingAdvInfo;
11860    }
11861    RETVALUE(ROK);
11862 }
11863
11864 /*CA dev Start*/
11865 /***********************************************************
11866 *
11867 *     Func : cmPkTfuTtiCellInfo
11868 *
11869 *
11870 *     Desc : This structure contains information that is 
11871 *     passed as a part of the TTI indication sent 
11872 *     from CL to MAC and SCH
11873 *
11874 *
11875 *     Ret  : S16
11876 *
11877 *     Notes:
11878 *
11879 *     File  : 
11880 *
11881 **********************************************************/
11882 #ifdef ANSI
11883 PUBLIC S16 cmPkTfuTtiCellInfo
11884 (
11885 TfuTtiCellInfo *param,
11886 Buffer *mBuf
11887 )
11888 #else
11889 PUBLIC S16 cmPkTfuTtiCellInfo(param, mBuf)
11890 TfuTtiCellInfo *param;
11891 Buffer *mBuf;
11892 #endif
11893 {
11894
11895    TRC3(cmPkTfuTtiCellInfo)
11896
11897    CMCHKPK(SPkU8, param->ulBlankSf, mBuf);
11898    CMCHKPK(SPkU8, param->dlBlankSf, mBuf);
11899    CMCHKPK(SPkU8, param->schTickDelta, mBuf);
11900    CMCHKPK(cmPkBool, param->isDummyTti, mBuf);
11901    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
11902    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
11903    RETVALUE(ROK);
11904 }
11905 /*CA dev End*/
11906 \f
11907 /***********************************************************
11908 *
11909 *     Func : cmPkTfuTtiIndInfo
11910 *
11911 *
11912 *     Desc : This structure contains information that is passed as a part of the TTI
11913  * indication sent from PHY to MAC.
11914 *
11915 *
11916 *     Ret  : S16
11917 *
11918 *     Notes:
11919 *
11920 *     File  : 
11921 *
11922 **********************************************************/
11923 #ifdef ANSI
11924 PUBLIC S16 cmPkTfuTtiIndInfo
11925 (
11926 TfuTtiIndInfo *param,
11927 Buffer *mBuf
11928 )
11929 #else
11930 PUBLIC S16 cmPkTfuTtiIndInfo(param, mBuf)
11931 TfuTtiIndInfo *param;
11932 Buffer *mBuf;
11933 #endif
11934 {
11935
11936    S32 i;
11937    TRC3(cmPkTfuTtiIndInfo)
11938
11939    /*CA dev Start*/
11940    for (i=(param->numCells-1); i >= 0; i--) {
11941          CMCHKPK(cmPkTfuTtiCellInfo, &param->cells[i], mBuf);
11942       }
11943    CMCHKPK(SPkU8, param->numCells, mBuf);
11944    /*CA dev End*/
11945    RETVALUE(ROK);
11946 }
11947
11948 /* CA dev Start */
11949 /***********************************************************
11950 *
11951 *     Func : cmUnpkTfuTtiCellInfo
11952 *
11953 *
11954 *     Desc : This structure contains information that is 
11955 *     passed as a part of the TTI indication sent 
11956 *     from CL to MAC and SCH
11957 *
11958 *
11959 *     Ret  : S16
11960 *
11961 *     Notes:
11962 *
11963 *     File  : 
11964 *
11965 **********************************************************/
11966 #ifdef ANSI
11967 PUBLIC S16 cmUnpkTfuTtiCellInfo
11968 (
11969 TfuTtiCellInfo *param,
11970 Buffer *mBuf
11971 )
11972 #else
11973 PUBLIC S16 cmUnpkTfuTtiCellInfo(param, mBuf)
11974 TfuTtiCellInfo *param;
11975 Buffer *mBuf;
11976 #endif
11977 {
11978
11979    TRC3(cmUnpkTfuTtiCellInfo)
11980
11981    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
11982    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
11983    CMCHKUNPK(cmUnpkBool, &param->isDummyTti, mBuf);
11984    CMCHKUNPK(SUnpkU8, &param->schTickDelta, mBuf);
11985    CMCHKUNPK(SUnpkU8, &param->dlBlankSf, mBuf);
11986    CMCHKUNPK(SUnpkU8, &param->ulBlankSf, mBuf);
11987    RETVALUE(ROK);
11988 }
11989 /* CA dev End */
11990
11991 \f
11992 /***********************************************************
11993 *
11994 *     Func : cmUnpackSlotIndInfo
11995 *
11996 *
11997 *     Desc : This structure contains information that is passed as a part of the Slot
11998  * indication sent from PHY to MAC.
11999 *
12000 *
12001 *     Ret  : S16
12002 *
12003 *     Notes:
12004 *
12005 *     File  : 
12006 *
12007 **********************************************************/
12008 PUBLIC S16 cmUnpackSlotIndInfo
12009 (
12010 SlotIndInfo *param,
12011 Buffer *mBuf
12012 )
12013 {
12014    CMCHKUNPK(SUnpkU16, &param->sfn, mBuf);
12015    CMCHKUNPK(SUnpkU16, &param->slot, mBuf);
12016
12017    RETVALUE(ROK);
12018 }
12019
12020
12021 \f
12022 /***********************************************************
12023 *
12024 *     Func : cmPkTfuRaReqInfo
12025 *
12026 *
12027 *     Desc : This structure contains the information for a single Random Access Request.
12028  * @details The information present in this structure is for a single preamble.
12029  * Associated with each preamble are fields that the physical layer calculates
12030  * based on the reception of the Random Access Request. These are the following
12031  * -# Timing Advance
12032  * -# TPC
12033  * -# CQI (optional).
12034 *
12035 *
12036 *     Ret  : S16
12037 *
12038 *     Notes:
12039 *
12040 *     File  : 
12041 *
12042 **********************************************************/
12043 #ifdef ANSI
12044 PUBLIC S16 cmPkTfuRaReqInfo
12045 (
12046 TfuRaReqInfo *param,
12047 Buffer *mBuf
12048 )
12049 #else
12050 PUBLIC S16 cmPkTfuRaReqInfo(param, mBuf)
12051 TfuRaReqInfo *param;
12052 Buffer *mBuf;
12053 #endif
12054 {
12055
12056    TRC3(cmPkTfuRaReqInfo)
12057
12058    CMCHKPK(SPkU8, param->cqiIdx, mBuf);
12059    CMCHKPK(SPkU8, param->cqiPres, mBuf);
12060    CMCHKPK(SPkU8, param->tpc, mBuf);
12061    CMCHKPK(SPkU16, param->ta, mBuf);
12062    CMCHKPK(SPkU8, param->rapId, mBuf);
12063    RETVALUE(ROK);
12064 }
12065
12066
12067 \f
12068 /***********************************************************
12069 *
12070 *     Func : cmUnpkTfuRaReqInfo
12071 *
12072 *
12073 *     Desc : This structure contains the information for a single Random Access Request.
12074  * @details The information present in this structure is for a single preamble.
12075  * Associated with each preamble are fields that the physical layer calculates
12076  * based on the reception of the Random Access Request. These are the following
12077  * -# Timing Advance
12078  * -# TPC
12079  * -# CQI (optional).
12080 *
12081 *
12082 *     Ret  : S16
12083 *
12084 *     Notes:
12085 *
12086 *     File  : 
12087 *
12088 **********************************************************/
12089 #ifdef ANSI
12090 PUBLIC S16 cmUnpkTfuRaReqInfo
12091 (
12092 TfuRaReqInfo *param,
12093 Buffer *mBuf
12094 )
12095 #else
12096 PUBLIC S16 cmUnpkTfuRaReqInfo(param, mBuf)
12097 TfuRaReqInfo *param;
12098 Buffer *mBuf;
12099 #endif
12100 {
12101
12102    TRC3(cmUnpkTfuRaReqInfo)
12103
12104    CMCHKUNPK(SUnpkU8, &param->rapId, mBuf);
12105    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
12106    CMCHKUNPK(SUnpkU8, &param->tpc, mBuf);
12107    CMCHKUNPK(SUnpkU8, &param->cqiPres, mBuf);
12108    CMCHKUNPK(SUnpkU8, &param->cqiIdx, mBuf);
12109    RETVALUE(ROK);
12110 }
12111
12112
12113 \f
12114 /***********************************************************
12115 *
12116 *     Func : cmPkTfuRachInfo
12117 *
12118 *
12119 *     Desc : This structure contains RACH request information for a single
12120   * RA-RNTI.
12121 *
12122 *
12123 *     Ret  : S16
12124 *
12125 *     Notes:
12126 *
12127 *     File  : 
12128 *
12129 **********************************************************/
12130 #ifdef ANSI
12131 PUBLIC S16 cmPkTfuRachInfo
12132 (
12133  CmMemListCp   memCp,
12134 TfuRachInfo *param,
12135 Buffer *mBuf
12136 )
12137 #else
12138 PUBLIC S16 cmPkTfuRachInfo(memCp, param, mBuf)
12139  CmMemListCp   memCp;
12140 TfuRachInfo *param;
12141 Buffer *mBuf;
12142 #endif
12143 {
12144
12145    S32 i;
12146    TRC3(cmPkTfuRachInfo)
12147
12148    for (i= (param->numRaReqInfo - 1); i >= 0; i--) {
12149       CMCHKPK(cmPkTfuRaReqInfo, &(param->raReqInfoArr[i]), mBuf);
12150    }
12151 #ifdef PRACH_5GTF 
12152    CMCHKPK(SPkU16, param->nPwrFactor, mBuf);
12153    CMCHKPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12154    CMCHKPK(SPkU8, param->nf1Value, mBuf);
12155    CMCHKPK(SPkU8, param->nCyclicShift, mBuf);
12156    CMCHKPK(SPkU8, param->nRootSeq, mBuf);
12157    CMCHKPK(SPkU8, param->nPRACHConfiguration, mBuf);
12158    CMCHKPK(SPkU8, param->nPreambleFormat, mBuf);
12159 #endif
12160    CMCHKPK(SPkU8, param->numRaReqInfo, mBuf);
12161    CMCHKPK(cmPkLteRnti, param->raRnti, mBuf);
12162    RETVALUE(ROK);
12163 }
12164
12165
12166 \f
12167 /***********************************************************
12168 *
12169 *     Func : cmUnpkTfuRachInfo
12170 *
12171 *
12172 *     Desc : This structure contains RACH request information for a single
12173   * RA-RNTI.
12174 *
12175 *
12176 *     Ret  : S16
12177 *
12178 *     Notes:
12179 *
12180 *     File  : 
12181 *
12182 **********************************************************/
12183 #ifdef ANSI
12184 PUBLIC S16 cmUnpkTfuRachInfo
12185 (
12186 CmMemListCp   memCp,
12187 TfuRachInfo *param,
12188 Buffer *mBuf
12189 )
12190 #else
12191 PUBLIC S16 cmUnpkTfuRachInfo(memCp, param, mBuf)
12192 CmMemListCp   memCp;
12193 TfuRachInfo *param;
12194 Buffer *mBuf;
12195 #endif
12196 {
12197
12198    S32 i;
12199    TRC3(cmUnpkTfuRachInfo)
12200
12201    CMCHKUNPK(cmUnpkLteRnti, &param->raRnti, mBuf);
12202    CMCHKUNPK(SUnpkU8, &param->numRaReqInfo, mBuf);
12203 #ifdef PRACH_5GTF 
12204    CMCHKUNPK(SPkU8, param->nPreambleFormat, mBuf);
12205    CMCHKUNPK(SPkU8, param->nPRACHConfiguration, mBuf);
12206    CMCHKUNPK(SPkU8, param->nRootSeq, mBuf);
12207    CMCHKUNPK(SPkU8, param->nCyclicShift, mBuf);
12208    CMCHKUNPK(SPkU8, param->nf1Value, mBuf);
12209    CMCHKUNPK(SPkU8, param->nPRACHSymbIndex, mBuf);
12210    CMCHKUNPK(SPkU16, param->nPwrFactor, mBuf);
12211 #endif
12212    if (cmGetMem (&(memCp), (sizeof(TfuRaReqInfo) * param->numRaReqInfo), 
12213             (Ptr *)&param->raReqInfoArr) != ROK)
12214    {
12215       RETVALUE(RFAILED);
12216    }
12217    for (i=0; i<param->numRaReqInfo; i++) {
12218       CMCHKUNPK(cmUnpkTfuRaReqInfo, &param->raReqInfoArr[i], mBuf);
12219    }
12220    RETVALUE(ROK);
12221 }
12222
12223
12224 \f
12225 /***********************************************************
12226 *
12227 *     Func : cmPkTfuRaReqIndInfo
12228 *
12229 *
12230 *     Desc : This structure contains the list of Random Access Requests received in a
12231  * single TTI.
12232  * @details Random Access Request is associated with a RA-RNTI, which remains
12233  * common for all the Random access requests within a subframe. This structure
12234  * thus carries the RA-RNTI and a list of Random Access Request information.
12235  * This information consists of the following 
12236  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12237  * UE.
12238  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12239  * needs to be uplink synchronized. This value is calculated by physical layer. 
12240  * -# tpc - this is the power control command that the physical layer calculates
12241  * from the received RA request. This value is transmitted in the RA Response
12242  * sent out by MAC.
12243  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12244  * physical layer. This aids MAC in the scheduling of this UE.
12245 *
12246 *
12247 *     Ret  : S16
12248 *
12249 *     Notes:
12250 *
12251 *     File  : 
12252 *
12253 **********************************************************/
12254 #ifdef ANSI
12255 PUBLIC S16 cmPkTfuRaReqIndInfo
12256 (
12257 TfuRaReqIndInfo *param,
12258 Buffer *mBuf
12259 )
12260 #else
12261 PUBLIC S16 cmPkTfuRaReqIndInfo(param, mBuf)
12262 TfuRaReqIndInfo *param;
12263 Buffer *mBuf;
12264 #endif
12265 {
12266
12267    S32 i;
12268    TRC3(cmPkTfuRaReqIndInfo)
12269
12270    for (i= (param->nmbOfRaRnti-1); i >= 0; i--) 
12271    {
12272       if (ROK != cmPkTfuRachInfo(param->memCp, 
12273                &(param->rachInfoArr[i]), mBuf))
12274       {
12275          RETVALUE(RFAILED);
12276       }
12277    }
12278    CMCHKPK(SPkU8, param->nmbOfRaRnti, mBuf);
12279    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12280    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12281    RETVALUE(ROK);
12282 }
12283
12284
12285 \f
12286 /***********************************************************
12287 *
12288 *     Func : cmUnpkTfuRaReqIndInfo
12289 *
12290 *
12291 *     Desc : This structure contains the list of Random Access Requests received in a
12292  * single TTI.
12293  * @details Random Access Request is associated with a RA-RNTI, which remains
12294  * common for all the Random access requests within a subframe. This structure
12295  * thus carries the RA-RNTI and a list of Random Access Request information.
12296  * This information consists of the following 
12297  * -# preamble-id - this corresponds to the Index of the Preamble choosen by the
12298  * UE.
12299  * -# Timing Advance - this corresponds to the timing adjustment that the UE
12300  * needs to be uplink synchronized. This value is calculated by physical layer. 
12301  * -# tpc - this is the power control command that the physical layer calculates
12302  * from the received RA request. This value is transmitted in the RA Response
12303  * sent out by MAC.
12304  * -# CQI - this is the Channel quality index of the UL channel estimated by the
12305  * physical layer. This aids MAC in the scheduling of this UE.
12306 *
12307 *
12308 *     Ret  : S16
12309 *
12310 *     Notes:
12311 *
12312 *     File  : 
12313 *
12314 **********************************************************/
12315 #ifdef ANSI
12316 PUBLIC S16 cmUnpkTfuRaReqIndInfo
12317 (
12318 TfuRaReqIndInfo *param,
12319 Buffer *mBuf
12320 )
12321 #else
12322 PUBLIC S16 cmUnpkTfuRaReqIndInfo(param, mBuf)
12323 TfuRaReqIndInfo *param;
12324 Buffer *mBuf;
12325 #endif
12326 {
12327
12328    S32 i;
12329    TRC3(cmUnpkTfuRaReqIndInfo)
12330
12331    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12332    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12333    CMCHKUNPK(SUnpkU8, &param->nmbOfRaRnti, mBuf);
12334    if (cmGetMem (&(param->memCp), (sizeof(TfuRachInfo) * param->nmbOfRaRnti), 
12335             (Ptr *)&param->rachInfoArr) != ROK)
12336    {
12337       RETVALUE(RFAILED);
12338    }
12339    for (i=0; i<param->nmbOfRaRnti; i++) 
12340    {
12341       if (ROK != cmUnpkTfuRachInfo(param->memCp, &param->rachInfoArr[i], mBuf))
12342       {
12343          RETVALUE(RFAILED);
12344       }
12345    }
12346    RETVALUE(ROK);
12347 }
12348
12349
12350 \f
12351 /***********************************************************
12352 *
12353 *     Func : cmPkTfuPucchDeltaPwr
12354 *
12355 *
12356 *     Desc : This structure contains PUCCH Delta power for a single UE.
12357 *
12358 *
12359 *     Ret  : S16
12360 *
12361 *     Notes:
12362 *
12363 *     File  : 
12364 *
12365 **********************************************************/
12366 #ifdef ANSI
12367 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo
12368 (
12369 TfuPucchDeltaPwr *param,
12370 Buffer *mBuf
12371 )
12372 #else
12373 PUBLIC S16 cmPkTfuPucchDeltaPwrInfo(param, mBuf)
12374 TfuPucchDeltaPwr *param;
12375 Buffer *mBuf;
12376 #endif
12377 {
12378
12379    TRC3(cmPkTfuPucchDeltaPwrInfo)
12380
12381    CMCHKPK(SPkS8, param->pucchDeltaPwr, mBuf);
12382    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12383    RETVALUE(ROK);
12384 }
12385
12386
12387 \f
12388 /***********************************************************
12389 *
12390 *     Func : cmUnpkTfuPucchDeltaPwr
12391 *
12392 *
12393 *     Desc : This structure contains PUCCH Delta power for a single UE.
12394 *
12395 *
12396 *     Ret  : S16
12397 *
12398 *     Notes:
12399 *
12400 *     File  : 
12401 *
12402 **********************************************************/
12403 #ifdef ANSI
12404 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo
12405 (
12406 TfuPucchDeltaPwr *param,
12407 Buffer *mBuf
12408 )
12409 #else
12410 PUBLIC S16 cmUnpkTfuPucchDeltaPwrInfo(param, mBuf)
12411 TfuPucchDeltaPwr *param;
12412 Buffer *mBuf;
12413 #endif
12414 {
12415
12416    TRC3(cmUnpkTfuPucchDeltaPwrInfo)
12417
12418    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
12419    CMCHKUNPK(SUnpkS8, &param->pucchDeltaPwr, mBuf);
12420    RETVALUE(ROK);
12421 }
12422
12423
12424 \f
12425 /***********************************************************
12426 *
12427 *     Func : cmPkTfuPucchDeltaPwrIndInfo
12428 *
12429 *
12430 *     Desc : This structure contains information that is passed as a part of the
12431  * PUCCH Delta power indication from PHY to SCH.
12432  * @details This structure clubs together PUCCH Delta power values for a number
12433  * of UEs.
12434 *
12435 *
12436 *     Ret  : S16
12437 *
12438 *     Notes:
12439 *
12440 *     File  : 
12441 *
12442 **********************************************************/
12443 #ifdef ANSI
12444 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo
12445 (
12446 TfuPucchDeltaPwrIndInfo *param,
12447 Buffer *mBuf
12448 )
12449 #else
12450 PUBLIC S16 cmPkTfuPucchDeltaPwrIndInfo(param, mBuf)
12451 TfuPucchDeltaPwrIndInfo *param;
12452 Buffer *mBuf;
12453 #endif
12454 {
12455
12456    CmLList *node;
12457    U32 count;
12458    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12459
12460    TRC3(cmPkTfuPucchDeltaPwrIndInfo)
12461
12462    count = param->pucchDeltaPwrLst.count;
12463    node = param->pucchDeltaPwrLst.last;
12464    while (node) {
12465       tfuPucchDeltaPwr = (TfuPucchDeltaPwr *)node->node;
12466       node=node->prev;
12467       CMCHKPK(cmPkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12468       cmLListDelFrm(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12469       tfuPucchDeltaPwr->lnk.node = (PTR)NULLP;
12470    }
12471    CMCHKPK(SPkU32, count, mBuf);
12472    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
12473    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
12474    RETVALUE(ROK);
12475 }
12476
12477
12478 \f
12479 /***********************************************************
12480 *
12481 *     Func : cmUnpkTfuPucchDeltaPwrIndInfo
12482 *
12483 *
12484 *     Desc : This structure contains information that is passed as a part of the
12485  * PUCCH Delta power indication from PHY to SCH.
12486  * @details This structure clubs together PUCCH Delta power values for a number
12487  * of UEs.
12488 *
12489 *
12490 *     Ret  : S16
12491 *
12492 *     Notes:
12493 *
12494 *     File  : 
12495 *
12496 **********************************************************/
12497 #ifdef ANSI
12498 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo
12499 (
12500 TfuPucchDeltaPwrIndInfo *param,
12501 Ptr memCp,
12502 Buffer *mBuf
12503 )
12504 #else
12505 PUBLIC S16 cmUnpkTfuPucchDeltaPwrIndInfo(param, memCp, mBuf)
12506 TfuPucchDeltaPwrIndInfo *param;
12507 Ptr memCp;
12508 Buffer *mBuf;
12509 #endif
12510 {
12511
12512    U32 count, loopCnt;
12513    TfuPucchDeltaPwr *tfuPucchDeltaPwr;
12514
12515    TRC3(cmUnpkTfuPucchDeltaPwrIndInfo)
12516
12517    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
12518    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
12519    cmLListInit(&param->pucchDeltaPwrLst);
12520    CMCHKUNPK(SUnpkU32, &count, mBuf);
12521    for (loopCnt=0; loopCnt<count; loopCnt++) {
12522       cmGetMem((Ptr)memCp, sizeof(*tfuPucchDeltaPwr), (Ptr *)&tfuPucchDeltaPwr);
12523       CMCHKUNPK(cmUnpkTfuPucchDeltaPwrInfo, tfuPucchDeltaPwr, mBuf);
12524       cmLListAdd2Tail(&param->pucchDeltaPwrLst, &tfuPucchDeltaPwr->lnk);
12525       tfuPucchDeltaPwr->lnk.node = (PTR)tfuPucchDeltaPwr;
12526    }
12527    RETVALUE(ROK);
12528 }
12529
12530 #ifdef ANSI
12531 PUBLIC S16 cmPkBuffer
12532 (
12533 Buffer **param,
12534 Buffer *mBuf
12535 )
12536 #else
12537 PUBLIC S16 cmPkBuffer(param, mBuf)
12538 Buffer **param;
12539 Buffer *mBuf;
12540 #endif
12541 {
12542    MsgLen msgLen=0;
12543    TRC3(cmPkBuffer)
12544    if (SFndLenMsg(*param, &msgLen) != ROK)
12545       RETVALUE(RFAILED);
12546    if (SCatMsg(mBuf, *param, M1M2) != ROK)
12547       RETVALUE(RFAILED);
12548    TFU_FREE_MSG(*param);
12549    *param = NULLP;
12550    CMCHKPK(cmPkMsgLen, msgLen, mBuf);
12551    RETVALUE(ROK);
12552 }
12553 #ifdef ANSI
12554 PUBLIC S16 cmUnpkBuffer
12555 (
12556 Buffer **param,
12557 Buffer *mBuf
12558 )
12559 #else
12560 PUBLIC S16 cmUnpkBuffer(param, mBuf)
12561 Buffer **param;
12562 Buffer *mBuf;
12563 #endif
12564 {
12565    MsgLen msgLen=0, totalMsgLen=0;
12566    TRC3(cmUnpkBuffer)
12567    CMCHKUNPK(cmUnpkMsgLen, &msgLen, mBuf);
12568    if (SFndLenMsg(mBuf, &totalMsgLen) != ROK)
12569       RETVALUE(RFAILED);
12570    if (SSegMsg(mBuf, totalMsgLen-msgLen, param) != ROK)
12571       RETVALUE(RFAILED);
12572    RETVALUE(ROK);
12573 }
12574
12575
12576 /***********************************************************
12577 *
12578 *     Func : cmPkTfuDoaInd
12579 *
12580 *
12581 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12582  * identifier for one or more UEs.
12583  * It carries a DOA for each UE. 
12584  * @param pst Pointer to the post structure.
12585  * @param suId SAP ID of the service user.
12586  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12587  * @return ROK/RFAILED
12588 *
12589 *
12590 *     Ret  : S16
12591 *
12592 *     Notes:
12593 *
12594 *     File  : 
12595 *
12596 **********************************************************/
12597 #ifdef ANSI
12598 PUBLIC S16 cmPkTfuDoaInd
12599 (
12600 Pst * pst,
12601 SuId suId,
12602 TfuDoaIndInfo * doaInd
12603 )
12604 #else
12605 PUBLIC S16 cmPkTfuDoaInd(pst, suId, doaInd)
12606 Pst * pst;
12607 SuId suId;
12608 TfuDoaIndInfo * doaInd;
12609 #endif
12610 {
12611    Buffer *mBuf = NULLP;
12612    TRC3(cmPkTfuDoaInd)
12613
12614    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
12615 #if (ERRCLASS & ERRCLS_ADD_RES)
12616       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12617          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12618          (ErrVal)ETFU125, (ErrVal)0, "Packing failed");
12619 #endif
12620       SPutSBuf(pst->region, pst->pool, (Data *)doaInd, sizeof(TfuDoaIndInfo));
12621       RETVALUE(RFAILED);
12622    }
12623       cmPkTfuDoaIndInfo(doaInd, mBuf);
12624    if (SPkS16(suId, mBuf) != ROK) {
12625 #if (ERRCLASS & ERRCLS_ADD_RES)
12626       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12627          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12628          (ErrVal)ETFU126, (ErrVal)0, "Packing failed");
12629 #endif
12630       TFU_FREE_MEM(doaInd);
12631       TFU_FREE_MSG(mBuf);
12632       RETVALUE(RFAILED);
12633    }
12634    TFU_FREE_MEM(doaInd);
12635    pst->event = (Event) EVTTFUDOAIND;
12636    RETVALUE(SPstTsk(pst,mBuf));
12637 }
12638
12639 \f
12640 /***********************************************************
12641 *
12642 *     Func : cmUnpkTfuDoaInd
12643 *
12644 *
12645 *     Desc : This API is used to indicate DOA(Direction Of Arrival)
12646  * identifier for one or more UEs.
12647  * It carries a DOA for each UE. 
12648  * @param pst Pointer to the post structure.
12649  * @param suId SAP ID of the service user.
12650  * @param doaInd Pointer to the TfuDoaIndInfo structure.
12651  * @return ROK/RFAILED
12652 *
12653 *
12654 *     Ret  : S16
12655 *
12656 *     Notes:
12657 *
12658 *     File  : 
12659 *
12660 **********************************************************/
12661 #ifdef ANSI
12662 PUBLIC S16 cmUnpkTfuDoaInd
12663 (
12664 TfuDoaInd func,
12665 Pst *pst,
12666 Buffer *mBuf
12667 )
12668 #else
12669 PUBLIC S16 cmUnpkTfuDoaInd(func, pst, mBuf)
12670 TfuDoaInd func;
12671 Pst *pst;
12672 Buffer *mBuf;
12673 #endif
12674 {
12675    SuId suId;
12676    TfuDoaIndInfo *doaInd;
12677    
12678    TRC3(cmUnpkTfuDoaInd)
12679
12680    if (SUnpkS16(&suId, mBuf) != ROK) {
12681       TFU_FREE_MSG(mBuf);
12682 #if (ERRCLASS & ERRCLS_ADD_RES)
12683       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12684          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12685          (ErrVal)ETFU127, (ErrVal)0, "Packing failed");
12686 #endif
12687       RETVALUE(RFAILED);
12688    }
12689    {
12690       Mem   sMem;
12691       sMem.region = pst->region;
12692       sMem.pool = pst->pool;
12693       if ((cmAllocEvnt(sizeof(TfuDoaIndInfo), TFU_BLKSZ, &sMem, (Ptr *)&doaInd)) != ROK)            {
12694 #if (ERRCLASS & ERRCLS_ADD_RES)
12695          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
12696             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
12697             (ErrVal)ETFU128, (ErrVal)0, "Packing failed");
12698 #endif
12699          TFU_FREE_MSG(mBuf);
12700          RETVALUE(RFAILED);
12701       }
12702    }
12703    
12704       cmUnpkTfuDoaIndInfo(doaInd, (Ptr)&doaInd->memCp, mBuf);
12705    TFU_FREE_MSG(mBuf);
12706    RETVALUE((*func)(pst, suId, doaInd));
12707 }
12708
12709
12710 \f
12711 /***********************************************************
12712 *
12713 *     Func : cmPkTfuDciFormatTbInfo
12714 *
12715 *
12716 *     Desc : This structure contains the TB level DCI signalling
12717   * parameters in case of DCI formats 2 and 2A
12718 *
12719 *
12720 *     Ret  : S16
12721 *
12722 *     Notes:
12723 *
12724 *     File  : 
12725 *
12726 **********************************************************/
12727 #ifdef ANSI
12728 PUBLIC S16 cmPkTfuDciFormatTbInfo
12729 (
12730 TfuDciFormatTbInfo *param,
12731 Buffer *mBuf
12732 )
12733 #else
12734 PUBLIC S16 cmPkTfuDciFormatTbInfo(param, mBuf)
12735 TfuDciFormatTbInfo *param;
12736 Buffer *mBuf;
12737 #endif
12738 {
12739
12740    TRC3(cmPkTfuDciFormatTbInfo)
12741
12742    CMCHKPK(SPkU8, param->mcs, mBuf);
12743    CMCHKPK(SPkU8, param->rv, mBuf);
12744    CMCHKPK(SPkU8, param->ndi, mBuf);
12745    RETVALUE(ROK);
12746 }
12747
12748
12749 \f
12750 /***********************************************************
12751 *
12752 *     Func : cmUnpkTfuDciFormatTbInfo
12753 *
12754 *
12755 *     Desc : This structure contains the TB level DCI signalling
12756   * parameters in case of DCI formats 2 and 2A
12757 *
12758 *
12759 *     Ret  : S16
12760 *
12761 *     Notes:
12762 *
12763 *     File  : 
12764 *
12765 **********************************************************/
12766 #ifdef ANSI
12767 PUBLIC S16 cmUnpkTfuDciFormatTbInfo
12768 (
12769 TfuDciFormatTbInfo *param,
12770 Buffer *mBuf
12771 )
12772 #else
12773 PUBLIC S16 cmUnpkTfuDciFormatTbInfo(param, mBuf)
12774 TfuDciFormatTbInfo *param;
12775 Buffer *mBuf;
12776 #endif
12777 {
12778
12779    TRC3(cmUnpkTfuDciFormatTbInfo)
12780
12781    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
12782    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
12783    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
12784    RETVALUE(ROK);
12785 }
12786
12787
12788 \f
12789 /***********************************************************
12790 *
12791 *     Func : cmPkTfuSubbandDlCqiInfo
12792 *
12793 *
12794 *     Desc : This structure is used to convey the subbannd CQI reported.
12795 *
12796 *
12797 *     Ret  : S16
12798 *
12799 *     Notes:
12800 *
12801 *     File  : 
12802 *
12803 **********************************************************/
12804 #ifdef ANSI
12805 PUBLIC S16 cmPkTfuSubbandDlCqiInfo
12806 (
12807 TfuSubbandDlCqiInfo *param,
12808 Buffer *mBuf
12809 )
12810 #else
12811 PUBLIC S16 cmPkTfuSubbandDlCqiInfo(param, mBuf)
12812 TfuSubbandDlCqiInfo *param;
12813 Buffer *mBuf;
12814 #endif
12815 {
12816
12817    S32 i;
12818    TRC3(cmPkTfuSubbandDlCqiInfo)
12819
12820    for (i=TFU_MAX_TB-1; i >= 0; i--) {
12821       CMCHKPK(SPkU8, param->cqiIdx[i], mBuf);
12822    }
12823    CMCHKPK(cmPkTfuSubbandInfo, &param->subband, mBuf);
12824    RETVALUE(ROK);
12825 }
12826
12827
12828 \f
12829 /***********************************************************
12830 *
12831 *     Func : cmUnpkTfuSubbandDlCqiInfo
12832 *
12833 *
12834 *     Desc : This structure is used to convey the subbannd CQI reported.
12835 *
12836 *
12837 *     Ret  : S16
12838 *
12839 *     Notes:
12840 *
12841 *     File  : 
12842 *
12843 **********************************************************/
12844 #ifdef ANSI
12845 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo
12846 (
12847 TfuSubbandDlCqiInfo *param,
12848 Buffer *mBuf
12849 )
12850 #else
12851 PUBLIC S16 cmUnpkTfuSubbandDlCqiInfo(param, mBuf)
12852 TfuSubbandDlCqiInfo *param;
12853 Buffer *mBuf;
12854 #endif
12855 {
12856
12857    S32 i;
12858    TRC3(cmUnpkTfuSubbandDlCqiInfo)
12859
12860    CMCHKUNPK(cmUnpkTfuSubbandInfo, &param->subband, mBuf);
12861    for (i=0; i<TFU_MAX_TB; i++) {
12862       CMCHKUNPK(SUnpkU8, &param->cqiIdx[i], mBuf);
12863    }
12864    RETVALUE(ROK);
12865 }
12866
12867 /***********************************************************
12868 *
12869 *     Func : cmPkTfuDlCqiPuschInfo
12870 *
12871 *
12872 *     Desc : This structure conveys explicitly the PMI information in case
12873  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12874 *
12875 *
12876 *     Ret  : S16
12877 *
12878 *     Notes:
12879 *
12880 *     File  : 
12881 *
12882 **********************************************************/
12883 #ifdef ANSI
12884 PUBLIC S16 cmPkTfuDlCqiPuschInfo
12885 (
12886 TfuDlCqiPuschInfo *param,
12887 Buffer *mBuf
12888 )
12889 #else
12890 PUBLIC S16 cmPkTfuDlCqiPuschInfo(param, mBuf)
12891 TfuDlCqiPuschInfo *param;
12892 Buffer *mBuf;
12893 #endif
12894 {
12895
12896    TRC3(cmPkTfuDlCqiPuschInfo)
12897
12898       switch(param->mode) {
12899          case TFU_PUSCH_CQI_MODE_31:
12900             CMCHKPK(cmPkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12901             break;
12902          case TFU_PUSCH_CQI_MODE_22:
12903             CMCHKPK(cmPkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12904             break;
12905          case TFU_PUSCH_CQI_MODE_12:
12906             CMCHKPK(cmPkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12907             break;
12908          default :
12909             RETVALUE(RFAILED);
12910       }
12911    CMCHKPK(SPkU32, param->mode, mBuf);
12912    RETVALUE(ROK);
12913 }
12914
12915
12916 \f
12917 /***********************************************************
12918 *
12919 *     Func : cmUnpkTfuDlCqiPuschInfo
12920 *
12921 *
12922 *     Desc : This structure conveys explicitly the PMI information in case
12923  *  of PUSCH feedback usage in scheduling. Applicable for TM 4,5,6.
12924 *
12925 *
12926 *     Ret  : S16
12927 *
12928 *     Notes:
12929 *
12930 *     File  : 
12931 *
12932 **********************************************************/
12933 #ifdef ANSI
12934 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo
12935 (
12936 TfuDlCqiPuschInfo *param,
12937 Buffer *mBuf
12938 )
12939 #else
12940 PUBLIC S16 cmUnpkTfuDlCqiPuschInfo(param, mBuf)
12941 TfuDlCqiPuschInfo *param;
12942 Buffer *mBuf;
12943 #endif
12944 {
12945
12946    TRC3(cmUnpkTfuDlCqiPuschInfo)
12947
12948    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
12949       switch(param->mode) {
12950          case TFU_PUSCH_CQI_MODE_12:
12951             CMCHKUNPK(cmUnpkTfuCqiPuschMode12, &param->u.mode12Info, mBuf);
12952             break;
12953          case TFU_PUSCH_CQI_MODE_22:
12954             CMCHKUNPK(cmUnpkTfuCqiPuschMode22, &param->u.mode22Info, mBuf);
12955             break;
12956          case TFU_PUSCH_CQI_MODE_31:
12957             CMCHKUNPK(cmUnpkTfuCqiPuschMode31, &param->u.mode31Info, mBuf);
12958             break;
12959          default :
12960             RETVALUE(RFAILED);
12961       }
12962    RETVALUE(ROK);
12963 }
12964 \f
12965 /***********************************************************
12966 *
12967 *     Func : cmPkTfuDoaRpt
12968 *
12969 *
12970 *     Desc : This structure contains the DOA estimated by the physical layer. 
12971   * @details DOA for a given UE.
12972 *
12973 *
12974 *     Ret  : S16
12975 *
12976 *     Notes:
12977 *
12978 *     File  : 
12979 *
12980 **********************************************************/
12981 #ifdef ANSI
12982 PUBLIC S16 cmPkTfuDoaRpt
12983 (
12984 TfuDoaRpt *param,
12985 Buffer *mBuf
12986 )
12987 #else
12988 PUBLIC S16 cmPkTfuDoaRpt(param, mBuf)
12989 TfuDoaRpt *param;
12990 Buffer *mBuf;
12991 #endif
12992 {
12993
12994    TRC3(cmPkTfuDoaRpt)
12995
12996    CMCHKPK(SPkU32, param->doa, mBuf);
12997    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
12998    RETVALUE(ROK);
12999 }
13000
13001
13002 \f
13003 /***********************************************************
13004 *
13005 *     Func : cmUnpkTfuDoaRpt
13006 *
13007 *
13008 *     Desc : This structure contains the DOA estimated by the physical layer. 
13009   * @details DOA for a given UE.
13010 *
13011 *
13012 *     Ret  : S16
13013 *
13014 *     Notes:
13015 *
13016 *     File  : 
13017 *
13018 **********************************************************/
13019 #ifdef ANSI
13020 PUBLIC S16 cmUnpkTfuDoaRpt
13021 (
13022 TfuDoaRpt *param,
13023 Buffer *mBuf
13024 )
13025 #else
13026 PUBLIC S16 cmUnpkTfuDoaRpt(param, mBuf)
13027 TfuDoaRpt *param;
13028 Buffer *mBuf;
13029 #endif
13030 {
13031
13032    TRC3(cmUnpkTfuDoaRpt)
13033
13034    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
13035    CMCHKUNPK(SUnpkU32, &param->doa, mBuf);
13036    RETVALUE(ROK);
13037 }
13038
13039
13040 \f
13041 /***********************************************************
13042 *
13043 *     Func : cmPkTfuDoaIndInfo
13044 *
13045 *
13046 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13047  * @details DOA is calculated by the physical layer, and this
13048  * information is provided to the scheduler. 
13049  * This data structure clubs together the DOAs for all the UEs
13050  * calculated by PHY in this subframe.
13051 *
13052 *
13053 *     Ret  : S16
13054 *
13055 *     Notes:
13056 *
13057 *     File  : 
13058 *
13059 **********************************************************/
13060 #ifdef ANSI
13061 PUBLIC S16 cmPkTfuDoaIndInfo
13062 (
13063 TfuDoaIndInfo *param,
13064 Buffer *mBuf
13065 )
13066 #else
13067 PUBLIC S16 cmPkTfuDoaIndInfo(param, mBuf)
13068 TfuDoaIndInfo *param;
13069 Buffer *mBuf;
13070 #endif
13071 {
13072
13073    CmLList *node;
13074    U32 count;
13075    TfuDoaRpt *tfuDoaRpt;
13076    TRC3(cmPkTfuDoaIndInfo)
13077
13078    count = param->doaRpt.count;
13079    node = param->doaRpt.last;
13080    while (node) {
13081       tfuDoaRpt = (TfuDoaRpt *)node->node;
13082       node=node->prev;
13083       CMCHKPK(cmPkTfuDoaRpt, tfuDoaRpt, mBuf);
13084       cmLListDelFrm(&param->doaRpt, &tfuDoaRpt->lnk);
13085       tfuDoaRpt->lnk.node = (PTR)NULLP;
13086    }
13087    CMCHKPK(SPkU32, count, mBuf);
13088    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13089    RETVALUE(ROK);
13090 }
13091
13092
13093 \f
13094 /***********************************************************
13095 *
13096 *     Func : cmUnpkTfuDoaIndInfo
13097 *
13098 *
13099 *     Desc : This structure conveys the DOA(Direction Of Arrival) indicator.
13100  * @details DOA is calculated by the physical layer, and this
13101  * information is provided to the scheduler. 
13102  * This data structure clubs together the DOAs for all the UEs
13103  * calculated by PHY in this subframe.
13104 *
13105 *
13106 *     Ret  : S16
13107 *
13108 *     Notes:
13109 *
13110 *     File  : 
13111 *
13112 **********************************************************/
13113 #ifdef ANSI
13114 PUBLIC S16 cmUnpkTfuDoaIndInfo
13115 (
13116 TfuDoaIndInfo *param,
13117 Ptr memCp,
13118 Buffer *mBuf
13119 )
13120 #else
13121 PUBLIC S16 cmUnpkTfuDoaIndInfo(param, memCp, mBuf)
13122 TfuDoaIndInfo *param;
13123 Ptr memCp;
13124 Buffer *mBuf;
13125 #endif
13126 {
13127
13128    U32 count, loopCnt;
13129    TfuDoaRpt *tfuDoaRpt;
13130    TRC3(cmUnpkTfuDoaIndInfo)
13131
13132    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13133    cmLListInit(&param->doaRpt);
13134    CMCHKUNPK(SUnpkU32, &count, mBuf);
13135    for (loopCnt=0; loopCnt<count; loopCnt++) {
13136       cmGetMem((Ptr)memCp, sizeof(*tfuDoaRpt), (Ptr *)&tfuDoaRpt);
13137       CMCHKUNPK(cmUnpkTfuDoaRpt, tfuDoaRpt, mBuf);
13138       cmLListAdd2Tail(&param->doaRpt, &tfuDoaRpt->lnk);
13139       tfuDoaRpt->lnk.node = (PTR)tfuDoaRpt;
13140    }
13141    RETVALUE(ROK);
13142 }
13143
13144
13145 /* tfu_c_001.main_7. Added changes of TFU_UPGRADE */
13146 #ifdef TFU_UPGRADE
13147
13148 \f
13149 /***********************************************************
13150 *
13151 *     Func : cmPkTfuSrsRpt
13152 *
13153 *
13154 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13155  * @details Uplink SRS from each UE is received by the physical layer, and this
13156  * information is provided to the scheduler.
13157 *
13158 *
13159 *     Ret  : S16
13160 *
13161 *     Notes:
13162 *
13163 *     File  : 
13164 *
13165 **********************************************************/
13166 #ifdef ANSI
13167 PUBLIC S16 cmPkTfuSrsRpt
13168 (
13169 TfuSrsRpt *param,
13170 Buffer *mBuf
13171 )
13172 #else
13173 PUBLIC S16 cmPkTfuSrsRpt(param, mBuf)
13174 TfuSrsRpt *param;
13175 Buffer *mBuf;
13176 #endif
13177 {
13178
13179    S32 i;
13180    TRC3(cmPkTfuSrsRpt)
13181
13182    CMCHKPK(SPkU8, param->wideCqi, mBuf);
13183    CMCHKPK(SPkU8, param->wideCqiPres, mBuf);
13184    for (i=TFU_MAX_UL_RB-1; i >= 0; i--) {
13185       CMCHKPK(SPkU8, param->snr[i], mBuf);
13186    }
13187    CMCHKPK(SPkU8, param->rbStart, mBuf);
13188    CMCHKPK(SPkU8, param->numRbs, mBuf);
13189    CMCHKPK(SPkU16, param->ta, mBuf);
13190    CMCHKPK(SPkU16, param->dopEst, mBuf);
13191    CMCHKPK(cmPkLteRnti, param->ueId, mBuf);
13192    RETVALUE(ROK);
13193 }
13194
13195
13196 \f
13197 /***********************************************************
13198 *
13199 *     Func : cmUnpkTfuSrsRpt
13200 *
13201 *
13202 *     Desc : This structure conveys the Uplink SRS indication of a UE.
13203  * @details Uplink SRS from each UE is received by the physical layer, and this
13204  * information is provided to the scheduler.
13205 *
13206 *
13207 *     Ret  : S16
13208 *
13209 *     Notes:
13210 *
13211 *     File  : 
13212 *
13213 **********************************************************/
13214 #ifdef ANSI
13215 PUBLIC S16 cmUnpkTfuSrsRpt
13216 (
13217 TfuSrsRpt *param,
13218 Buffer *mBuf
13219 )
13220 #else
13221 PUBLIC S16 cmUnpkTfuSrsRpt(param, mBuf)
13222 TfuSrsRpt *param;
13223 Buffer *mBuf;
13224 #endif
13225 {
13226
13227    S32 i;
13228    TRC3(cmUnpkTfuSrsRpt)
13229
13230    CMCHKUNPK(cmUnpkLteRnti, &param->ueId, mBuf);
13231    CMCHKUNPK(SUnpkU16, &param->dopEst, mBuf);
13232    CMCHKUNPK(SUnpkU16, &param->ta, mBuf);
13233    CMCHKUNPK(SUnpkU8, &param->numRbs, mBuf);
13234    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
13235    for (i=0; i<TFU_MAX_UL_RB; i++) {
13236       CMCHKUNPK(SUnpkU8, &param->snr[i], mBuf);
13237    }
13238    CMCHKUNPK(SUnpkU8, &param->wideCqiPres, mBuf);
13239    CMCHKUNPK(SUnpkU8, &param->wideCqi, mBuf);
13240    RETVALUE(ROK);
13241 }
13242
13243
13244 \f
13245 /***********************************************************
13246 *
13247 *     Func : cmPkTfuSrsIndInfo
13248 *
13249 *
13250 *     Desc : This structure conveys the Uplink SRS indication.
13251  * @details Uplink SRS is received by the physical layer, and this
13252  * information is provided to the scheduler. 
13253  * This data structure clubs together the UL SRS indications of all the UEs 
13254  * in the subframe.
13255 *
13256 *
13257 *     Ret  : S16
13258 *
13259 *     Notes:
13260 *
13261 *     File  : 
13262 *
13263 **********************************************************/
13264 #ifdef ANSI
13265 PUBLIC S16 cmPkTfuSrsIndInfo
13266 (
13267 TfuSrsIndInfo *param,
13268 Buffer *mBuf
13269 )
13270 #else
13271 PUBLIC S16 cmPkTfuSrsIndInfo(param, mBuf)
13272 TfuSrsIndInfo *param;
13273 Buffer *mBuf;
13274 #endif
13275 {
13276
13277    CmLList *node;
13278    U32 count;
13279    TfuSrsRpt *tfuSrsRpt;
13280
13281    TRC3(cmPkTfuSrsIndInfo)
13282
13283    count = param->srsRpt.count;
13284    node = param->srsRpt.last;
13285    while (node) {
13286       tfuSrsRpt = (TfuSrsRpt *)node->node;
13287       node=node->prev;
13288       CMCHKPK(cmPkTfuSrsRpt, tfuSrsRpt, mBuf);
13289       cmLListDelFrm(&param->srsRpt, &tfuSrsRpt->lnk);
13290       tfuSrsRpt->lnk.node = (PTR)NULLP;
13291    }
13292    CMCHKPK(SPkU32, count, mBuf);
13293    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13294    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13295    RETVALUE(ROK);
13296 }
13297
13298
13299 \f
13300 /***********************************************************
13301 *
13302 *     Func : cmUnpkTfuSrsIndInfo
13303 *
13304 *
13305 *     Desc : This structure conveys the Uplink SRS indication.
13306  * @details Uplink SRS is received by the physical layer, and this
13307  * information is provided to the scheduler. 
13308  * This data structure clubs together the UL SRS indications of all the UEs 
13309  * in the subframe.
13310 *
13311 *
13312 *     Ret  : S16
13313 *
13314 *     Notes:
13315 *
13316 *     File  : 
13317 *
13318 **********************************************************/
13319 #ifdef ANSI
13320 PUBLIC S16 cmUnpkTfuSrsIndInfo
13321 (
13322 TfuSrsIndInfo *param,
13323 Ptr memCp,
13324 Buffer *mBuf
13325 )
13326 #else
13327 PUBLIC S16 cmUnpkTfuSrsIndInfo(param, memCp, mBuf)
13328 TfuSrsIndInfo *param;
13329 Ptr memCp;
13330 Buffer *mBuf;
13331 #endif
13332 {
13333
13334    U32 count, loopCnt;
13335    TfuSrsRpt *tfuSrsRpt;
13336
13337    TRC3(cmUnpkTfuSrsIndInfo)
13338
13339    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13340    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13341    cmLListInit(&param->srsRpt);
13342    CMCHKUNPK(SUnpkU32, &count, mBuf);
13343    for (loopCnt=0; loopCnt<count; loopCnt++) {
13344       cmGetMem((Ptr)memCp, sizeof(*tfuSrsRpt), (Ptr *)&tfuSrsRpt);
13345       CMCHKUNPK(cmUnpkTfuSrsRpt, tfuSrsRpt, mBuf);
13346       cmLListAdd2Tail(&param->srsRpt, &tfuSrsRpt->lnk);
13347       tfuSrsRpt->lnk.node = (PTR)tfuSrsRpt;
13348    }
13349    RETVALUE(ROK);
13350 }
13351
13352
13353 \f
13354 /***********************************************************
13355 *
13356 *     Func : cmPkTfuRawCqiRpt
13357 *
13358 *
13359 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13360  * as transmitted by the UE. 
13361  * @details These bits shall be interpretted by MAC to derive the following 
13362  * -# Wideband CQI
13363  * -# Subband CQI
13364  * -# PMI
13365  * -# RI
13366 *
13367 *
13368 *     Ret  : S16
13369 *
13370 *     Notes:
13371 *
13372 *     File  : 
13373 *
13374 **********************************************************/
13375 #ifdef ANSI
13376 PUBLIC S16 cmPkTfuRawCqiRpt
13377 (
13378 TfuRawCqiRpt *param,
13379 Buffer *mBuf
13380 )
13381 #else
13382 PUBLIC S16 cmPkTfuRawCqiRpt(param, mBuf)
13383 TfuRawCqiRpt *param;
13384 Buffer *mBuf;
13385 #endif
13386 {
13387
13388    TRC3(cmPkTfuRawCqiRpt)
13389 #ifdef TFU_5GTF
13390    CMCHKPK(SPkU32, param->uciPayload, mBuf);
13391 #else
13392    S32 i;
13393    for (i=CM_LTE_MAX_CELLS-1; i >= 0; i--) {
13394       CMCHKPK(SPkU8, param->ri[i], mBuf);
13395    }
13396    for (i=TFU_MAX_CQI_BYTES-1; i >= 0; i--) {
13397       CMCHKPK(SPkU8, param->cqiBits[i], mBuf);
13398    }
13399 #endif
13400    CMCHKPK(SPkU8, param->numBits, mBuf);
13401    CMCHKPK(cmPkLteRnti, param->crnti, mBuf);
13402    RETVALUE(ROK);
13403 }
13404
13405
13406 \f
13407 /***********************************************************
13408 *
13409 *     Func : cmUnpkTfuRawCqiRpt
13410 *
13411 *
13412 *     Desc : This structure contains the Raw CQI information i.e. the CQI report
13413  * as transmitted by the UE. 
13414  * @details These bits shall be interpretted by MAC to derive the following 
13415  * -# Wideband CQI
13416  * -# Subband CQI
13417  * -# PMI
13418  * -# RI
13419 *
13420 *
13421 *     Ret  : S16
13422 *
13423 *     Notes:
13424 *
13425 *     File  : 
13426 *
13427 **********************************************************/
13428 #ifdef ANSI
13429 PUBLIC S16 cmUnpkTfuRawCqiRpt
13430 (
13431 TfuRawCqiRpt *param,
13432 Buffer *mBuf
13433 )
13434 #else
13435 PUBLIC S16 cmUnpkTfuRawCqiRpt(param, mBuf)
13436 TfuRawCqiRpt *param;
13437 Buffer *mBuf;
13438 #endif
13439 {
13440
13441    TRC3(cmUnpkTfuRawCqiRpt)
13442
13443    CMCHKUNPK(cmUnpkLteRnti, &param->crnti, mBuf);
13444    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
13445 #ifndef TFU_5GTF
13446    S32 i;
13447    for (i=0; i<TFU_MAX_CQI_BYTES; i++) {
13448       CMCHKUNPK(SUnpkU8, &param->cqiBits[i], mBuf);
13449    }
13450    for (i=0; i<CM_LTE_MAX_CELLS; i++) {
13451       CMCHKUNPK(SUnpkU8, &param->ri[i], mBuf);
13452    }
13453 #else
13454       CMCHKUNPK(SUnpkU32, &param->uciPayload, mBuf);
13455 #endif
13456    RETVALUE(ROK);
13457 }
13458
13459
13460 \f
13461 /***********************************************************
13462 *
13463 *     Func : cmPkTfuRawCqiIndInfo
13464 *
13465 *
13466 *     Desc : This structure contains the Raw CQI reports received for the
13467  * transmitting UEs in a single subframe. 
13468  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13469  * interpretation is upto the MAC layer.
13470 *
13471 *
13472 *     Ret  : S16
13473 *
13474 *     Notes:
13475 *
13476 *     File  : 
13477 *
13478 **********************************************************/
13479 #ifdef ANSI
13480 PUBLIC S16 cmPkTfuRawCqiIndInfo
13481 (
13482 TfuRawCqiIndInfo *param,
13483 Buffer *mBuf
13484 )
13485 #else
13486 PUBLIC S16 cmPkTfuRawCqiIndInfo(param, mBuf)
13487 TfuRawCqiIndInfo *param;
13488 Buffer *mBuf;
13489 #endif
13490 {
13491
13492    U32 count;
13493    TfuRawCqiRpt *tfuRawCqiRpt;
13494    CmLList *node;
13495
13496    TRC3(cmPkTfuRawCqiIndInfo)
13497
13498    count = param->rawCqiRpt.count;
13499    node = param->rawCqiRpt.last;
13500    while (node) {
13501       tfuRawCqiRpt = (TfuRawCqiRpt *)node->node;
13502       node=node->prev;
13503       CMCHKPK(cmPkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13504       cmLListDelFrm(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13505       tfuRawCqiRpt->lnk.node = (PTR)NULLP;
13506    }
13507    CMCHKPK(SPkU32, count, mBuf);
13508    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
13509    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
13510    RETVALUE(ROK);
13511 }
13512
13513
13514 \f
13515 /***********************************************************
13516 *
13517 *     Func : cmUnpkTfuRawCqiIndInfo
13518 *
13519 *
13520 *     Desc : This structure contains the Raw CQI reports received for the
13521  * transmitting UEs in a single subframe. 
13522  * @details Raw CQI corresponds to the actual bits transmitted by the UE, whose
13523  * interpretation is upto the MAC layer.
13524 *
13525 *
13526 *     Ret  : S16
13527 *
13528 *     Notes:
13529 *
13530 *     File  : 
13531 *
13532 **********************************************************/
13533 #ifdef ANSI
13534 PUBLIC S16 cmUnpkTfuRawCqiIndInfo
13535 (
13536 TfuRawCqiIndInfo *param,
13537 Ptr memCp,
13538 Buffer *mBuf
13539 )
13540 #else
13541 PUBLIC S16 cmUnpkTfuRawCqiIndInfo(param, memCp, mBuf)
13542 TfuRawCqiIndInfo *param;
13543 Ptr memCp;
13544 Buffer *mBuf;
13545 #endif
13546 {
13547
13548    U32 count, loopCnt;
13549    TfuRawCqiRpt *tfuRawCqiRpt;
13550
13551    TRC3(cmUnpkTfuRawCqiIndInfo)
13552
13553    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
13554    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
13555    cmLListInit(&param->rawCqiRpt);
13556    CMCHKUNPK(SUnpkU32, &count, mBuf);
13557    for (loopCnt=0; loopCnt<count; loopCnt++) {
13558       cmGetMem((Ptr)memCp, sizeof(*tfuRawCqiRpt), (Ptr *)&tfuRawCqiRpt);
13559       CMCHKUNPK(cmUnpkTfuRawCqiRpt, tfuRawCqiRpt, mBuf);
13560       cmLListAdd2Tail(&param->rawCqiRpt, &tfuRawCqiRpt->lnk);
13561       tfuRawCqiRpt->lnk.node = (PTR)tfuRawCqiRpt;
13562    }
13563    RETVALUE(ROK);
13564 }
13565
13566
13567 #ifdef TFU_TDD
13568
13569 #ifdef TFU_TDD
13570
13571 \f
13572 /***********************************************************
13573 *
13574 *     Func : cmPkTfuUePucchHqRecpInfo
13575 *
13576 *
13577 *     Desc : This structure is sent from scheduler to PHY in order to request the
13578  * reception of harq information on PUCCH.
13579 *
13580 *
13581 *     Ret  : S16
13582 *
13583 *     Notes:
13584 *
13585 *     File  : 
13586 *
13587 **********************************************************/
13588 #ifdef ANSI
13589 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13590 (
13591 TfuUePucchHqRecpInfo *param,
13592 Buffer *mBuf
13593 )
13594 #else
13595 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13596 TfuUePucchHqRecpInfo *param;
13597 Buffer *mBuf;
13598 #endif
13599 {
13600
13601    S32 i;
13602    TRC3(cmPkTfuUePucchHqRecpInfo)
13603
13604    CMCHKPK(SPkU8, param->a, mBuf);
13605    for (i=TFU_MAX_HQ_RES-1; i >= 0; i--) {
13606       CMCHKPK(SPkU16, param->hqRes[i], mBuf);
13607    }
13608    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13609    CMCHKPK(SPkU8, param->hqSz, mBuf);
13610    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13611    RETVALUE(ROK);
13612 }
13613
13614
13615 \f
13616 /***********************************************************
13617 *
13618 *     Func : cmUnpkTfuUePucchHqRecpInfo
13619 *
13620 *
13621 *     Desc : This structure is sent from scheduler to PHY in order to request the
13622  * reception of harq information on PUCCH.
13623 *
13624 *
13625 *     Ret  : S16
13626 *
13627 *     Notes:
13628 *
13629 *     File  : 
13630 *
13631 **********************************************************/
13632 #ifdef ANSI
13633 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13634 (
13635 TfuUePucchHqRecpInfo *param,
13636 Buffer *mBuf
13637 )
13638 #else
13639 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13640 TfuUePucchHqRecpInfo *param;
13641 Buffer *mBuf;
13642 #endif
13643 {
13644
13645    S32 i;
13646    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13647
13648    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13649    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13650    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13651    for (i=0; i<TFU_MAX_HQ_RES; i++) {
13652       CMCHKUNPK(SUnpkU16, &param->hqRes[i], mBuf);
13653    }
13654    CMCHKUNPK(SUnpkU8, &param->a, mBuf);
13655    RETVALUE(ROK);
13656 }
13657
13658
13659 #endif
13660
13661 #endif
13662
13663 #ifndef TFU_TDD  /* else of TFU_TDD */
13664
13665 #ifndef TFU_TDD  /* else of TFU_TDD */
13666
13667 \f
13668 /***********************************************************
13669 *
13670 *     Func : cmPkTfuUePucchHqRecpInfo
13671 *
13672 *
13673 *     Desc : This structure is sent from scheduler to PHY in order to request the
13674  * reception of harq information on PUCCH.
13675 *
13676 *
13677 *     Ret  : S16
13678 *
13679 *     Notes:
13680 *
13681 *     File  : 
13682 *
13683 **********************************************************/
13684 #ifdef ANSI
13685 PUBLIC S16 cmPkTfuUePucchHqRecpInfo
13686 (
13687 TfuUePucchHqRecpInfo *param,
13688 Buffer *mBuf
13689 )
13690 #else
13691 PUBLIC S16 cmPkTfuUePucchHqRecpInfo(param, mBuf)
13692 TfuUePucchHqRecpInfo *param;
13693 Buffer *mBuf;
13694 #endif
13695 {
13696
13697    TRC3(cmPkTfuUePucchHqRecpInfo)
13698 #ifdef LTE_ADV
13699    S32 idx;
13700    for (idx=(TFU_MAX_HQ_RES-1); idx >= 0; idx--) {
13701       CMCHKPK(SPkU16, param->hqRes[idx], mBuf);
13702    }
13703 #else
13704    CMCHKPK(SPkU16, param->hqRes[0], mBuf);
13705 #endif
13706    CMCHKPK(SPkU8, param->pucchResCnt, mBuf);
13707    CMCHKPK(SPkU8, param->hqSz, mBuf);
13708    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
13709
13710    RETVALUE(ROK);
13711 }
13712
13713
13714 \f
13715 /***********************************************************
13716 *
13717 *     Func : cmUnpkTfuUePucchHqRecpInfo
13718 *
13719 *
13720 *     Desc : This structure is sent from scheduler to PHY in order to request the
13721  * reception of harq information on PUCCH.
13722 *
13723 *
13724 *     Ret  : S16
13725 *
13726 *     Notes:
13727 *
13728 *     File  : 
13729 *
13730 **********************************************************/
13731 #ifdef ANSI
13732 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo
13733 (
13734 TfuUePucchHqRecpInfo *param,
13735 Buffer *mBuf
13736 )
13737 #else
13738 PUBLIC S16 cmUnpkTfuUePucchHqRecpInfo(param, mBuf)
13739 TfuUePucchHqRecpInfo *param;
13740 Buffer *mBuf;
13741 #endif
13742 {
13743    TRC3(cmUnpkTfuUePucchHqRecpInfo)
13744
13745    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
13746    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
13747    CMCHKUNPK(SUnpkU8, &param->pucchResCnt, mBuf);
13748 #ifdef LTE_ADV
13749    S32 idx;
13750    for (idx=0; idx<TFU_MAX_HQ_RES; idx++) {
13751       CMCHKUNPK(SUnpkU16, &param->hqRes[idx], mBuf);
13752    }
13753 #else
13754    CMCHKUNPK(SUnpkU16, &param->hqRes[0], mBuf);
13755 #endif
13756
13757    RETVALUE(ROK);
13758 }
13759
13760
13761 #endif
13762
13763 #endif
13764
13765 \f
13766 /***********************************************************
13767 *
13768 *     Func : cmPkTfuUePucchSrRecpInfo
13769 *
13770 *
13771 *     Desc : This structure is sent from scheduler to PHY in order to request the
13772  * reception of SR information on PUCCH.
13773 *
13774 *
13775 *     Ret  : S16
13776 *
13777 *     Notes:
13778 *
13779 *     File  : 
13780 *
13781 **********************************************************/
13782 #ifdef ANSI
13783 PUBLIC S16 cmPkTfuUePucchSrRecpInfo
13784 (
13785 TfuUePucchSrRecpInfo *param,
13786 Buffer *mBuf
13787 )
13788 #else
13789 PUBLIC S16 cmPkTfuUePucchSrRecpInfo(param, mBuf)
13790 TfuUePucchSrRecpInfo *param;
13791 Buffer *mBuf;
13792 #endif
13793 {
13794
13795    TRC3(cmPkTfuUePucchSrRecpInfo)
13796
13797    CMCHKPK(SPkU16, param->n1PucchIdx, mBuf);
13798    RETVALUE(ROK);
13799 }
13800
13801
13802 \f
13803 /***********************************************************
13804 *
13805 *     Func : cmUnpkTfuUePucchSrRecpInfo
13806 *
13807 *
13808 *     Desc : This structure is sent from scheduler to PHY in order to request the
13809  * reception of SR information on PUCCH.
13810 *
13811 *
13812 *     Ret  : S16
13813 *
13814 *     Notes:
13815 *
13816 *     File  : 
13817 *
13818 **********************************************************/
13819 #ifdef ANSI
13820 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo
13821 (
13822 TfuUePucchSrRecpInfo *param,
13823 Buffer *mBuf
13824 )
13825 #else
13826 PUBLIC S16 cmUnpkTfuUePucchSrRecpInfo(param, mBuf)
13827 TfuUePucchSrRecpInfo *param;
13828 Buffer *mBuf;
13829 #endif
13830 {
13831
13832    TRC3(cmUnpkTfuUePucchSrRecpInfo)
13833
13834    CMCHKUNPK(SUnpkU16, &param->n1PucchIdx, mBuf);
13835    RETVALUE(ROK);
13836 }
13837
13838
13839 \f
13840 /***********************************************************
13841 *
13842 *     Func : cmPkTfuUePucchCqiRecpInfo
13843 *
13844 *
13845 *     Desc : This structure is sent from scheduler to PHY in order to request the
13846  * reception of CQI information on PUCCH.
13847 *
13848 *
13849 *     Ret  : S16
13850 *
13851 *     Notes:
13852 *
13853 *     File  : 
13854 *
13855 **********************************************************/
13856 #ifdef ANSI
13857 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo
13858 (
13859 TfuUePucchCqiRecpInfo *param,
13860 Buffer *mBuf
13861 )
13862 #else
13863 PUBLIC S16 cmPkTfuUePucchCqiRecpInfo(param, mBuf)
13864 TfuUePucchCqiRecpInfo *param;
13865 Buffer *mBuf;
13866 #endif
13867 {
13868
13869    TRC3(cmPkTfuUePucchCqiRecpInfo)
13870
13871    CMCHKPK(SPkU8, param->cqiPmiSz, mBuf);
13872    CMCHKPK(SPkU16, param->n2PucchIdx, mBuf);
13873    RETVALUE(ROK);
13874 }
13875
13876
13877 \f
13878 /***********************************************************
13879 *
13880 *     Func : cmUnpkTfuUePucchCqiRecpInfo
13881 *
13882 *
13883 *     Desc : This structure is sent from scheduler to PHY in order to request the
13884  * reception of CQI information on PUCCH.
13885 *
13886 *
13887 *     Ret  : S16
13888 *
13889 *     Notes:
13890 *
13891 *     File  : 
13892 *
13893 **********************************************************/
13894 #ifdef ANSI
13895 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo
13896 (
13897 TfuUePucchCqiRecpInfo *param,
13898 Buffer *mBuf
13899 )
13900 #else
13901 PUBLIC S16 cmUnpkTfuUePucchCqiRecpInfo(param, mBuf)
13902 TfuUePucchCqiRecpInfo *param;
13903 Buffer *mBuf;
13904 #endif
13905 {
13906
13907    TRC3(cmUnpkTfuUePucchCqiRecpInfo)
13908
13909    CMCHKUNPK(SUnpkU16, &param->n2PucchIdx, mBuf);
13910    CMCHKUNPK(SUnpkU8, &param->cqiPmiSz, mBuf);
13911    RETVALUE(ROK);
13912 }
13913
13914
13915 \f
13916 /***********************************************************
13917 *
13918 *     Func : cmPkTfuUePucchSrsRecpInfo
13919 *
13920 *
13921 *     Desc : This structure is sent from scheduler to PHY in order to request the
13922  * reception of SRS information on PUCCH.
13923 *
13924 *
13925 *     Ret  : S16
13926 *
13927 *     Notes:
13928 *
13929 *     File  : 
13930 *
13931 **********************************************************/
13932 #ifdef ANSI
13933 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo
13934 (
13935 TfuUePucchSrsRecpInfo *param,
13936 Buffer *mBuf
13937 )
13938 #else
13939 PUBLIC S16 cmPkTfuUePucchSrsRecpInfo(param, mBuf)
13940 TfuUePucchSrsRecpInfo *param;
13941 Buffer *mBuf;
13942 #endif
13943 {
13944
13945    TRC3(cmPkTfuUePucchSrsRecpInfo)
13946
13947    CMCHKPK(SPkU32, param->srsCyclicShft, mBuf);
13948    CMCHKPK(SPkU16, param->srsCfgIdx, mBuf);
13949    CMCHKPK(SPkU8, param->transComb, mBuf);
13950    CMCHKPK(SPkU32, param->srsHopBw, mBuf);
13951    CMCHKPK(SPkU8, param->nRrc, mBuf);
13952    CMCHKPK(SPkU32, param->srsBw, mBuf);
13953    RETVALUE(ROK);
13954 }
13955
13956 #ifdef TFU_5GTF
13957 #ifdef ANSI
13958 PUBLIC S16 cmPkTfuUePucchUciRecpInfo
13959 (
13960 TfuUePucchUciRecpInfo *param,
13961 Buffer *mBuf
13962 )
13963 #else
13964 PUBLIC S16 cmPkTfuUePucchUciRecpInfo(param, mBuf)
13965 TfuUePucchUciRecpInfo *param;
13966 Buffer *mBuf;
13967 #endif
13968 {
13969
13970    TRC3(cmPkTfuUePucchUciRecpInfo)
13971
13972    CMCHKPK(SPkU8, param->SCID, mBuf);
13973    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
13974    CMCHKPK(SPkU8, param->numBits, mBuf);
13975    RETVALUE(ROK);
13976 }
13977 #endif
13978
13979 \f
13980 /***********************************************************
13981 *
13982 *     Func : cmUnpkTfuUePucchSrsRecpInfo
13983 *
13984 *
13985 *     Desc : This structure is sent from scheduler to PHY in order to request the
13986  * reception of SRS information on PUCCH.
13987 *
13988 *
13989 *     Ret  : S16
13990 *
13991 *     Notes:
13992 *
13993 *     File  : 
13994 *
13995 **********************************************************/
13996 #ifdef ANSI
13997 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo
13998 (
13999 TfuUePucchSrsRecpInfo *param,
14000 Buffer *mBuf
14001 )
14002 #else
14003 PUBLIC S16 cmUnpkTfuUePucchSrsRecpInfo(param, mBuf)
14004 TfuUePucchSrsRecpInfo *param;
14005 Buffer *mBuf;
14006 #endif
14007 {
14008
14009    TRC3(cmUnpkTfuUePucchSrsRecpInfo)
14010
14011    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsBw, mBuf);
14012    CMCHKUNPK(SUnpkU8, &param->nRrc, mBuf);
14013    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsHopBw, mBuf);
14014    CMCHKUNPK(SUnpkU8, &param->transComb, mBuf);
14015    CMCHKUNPK(SUnpkU16, &param->srsCfgIdx, mBuf);
14016    CMCHKUNPK(SUnpkU32, (U32 *)&param->srsCyclicShft, mBuf);
14017    RETVALUE(ROK);
14018 }
14019
14020 #ifdef TFU_5GTF 
14021 /***********************************************************
14022 *
14023 *     Func : cmPkTfuUePucchBsiBriRecpInfo
14024 *
14025 *
14026 *     Desc : This structure is sent from scheduler to PHY in order to request the
14027  * reception of BSI_BRI information on PUCCH.
14028 *
14029 *
14030 *     Ret  : S16
14031 *
14032 *     Notes:
14033 *
14034 *     File  : 
14035 *
14036 **********************************************************/
14037 #ifdef ANSI
14038 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo
14039 (
14040 TfuUePucchBsiBriRecpInfo *param,
14041 Buffer *mBuf
14042 )
14043 #else
14044 PUBLIC S16 cmPkTfuUePucchBsiBriRecpInfo(param, mBuf)
14045 TfuUePucchBsiBriRecpInfo *param;
14046 Buffer *mBuf;
14047 #endif
14048 {
14049
14050    TRC3(cmPkTfuUePucchBsiBriRecpInfo)
14051
14052    CMCHKPK(SPkU8, param->briRpt, mBuf);
14053    CMCHKPK(SPkU8, param->bsiRpt, mBuf);
14054    CMCHKPK(SPkU8, param->SCID, mBuf);
14055    CMCHKPK(SPkU8, param->pucchIndex, mBuf);
14056    CMCHKPK(SPkU8, param->puschFlag, mBuf);
14057    RETVALUE(ROK);
14058 }
14059
14060 /***********************************************************
14061 *
14062 *     Func : cmUnpkTfuUePucchBsiBriRecpInfo
14063 *
14064 *
14065 *     Desc : This structure is sent from scheduler to PHY in order to request the
14066  * reception of BSI_BRI information on PUCCH.
14067 *
14068 *
14069 *     Ret  : S16
14070 *
14071 *     Notes:
14072 *
14073 *     File  : 
14074 *
14075 **********************************************************/
14076 #ifdef ANSI
14077 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo
14078 (
14079 TfuUePucchBsiBriRecpInfo *param,
14080 Buffer *mBuf
14081 )
14082 #else
14083 PUBLIC S16 cmUnpkTfuUePucchBsiBriRecpInfo(param, mBuf)
14084 TfuUePucchBsiBriRecpInfo *param;
14085 Buffer *mBuf;
14086 #endif
14087 {
14088
14089    TRC3(cmUnpkTfuUePucchBsiBriRecpInfo)
14090
14091    CMCHKUNPK(SUnpkU8, &param->puschFlag, mBuf);
14092    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14093    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14094    CMCHKUNPK(SUnpkU8, &param->bsiRpt, mBuf);
14095    CMCHKUNPK(SUnpkU8, &param->briRpt, mBuf);
14096    RETVALUE(ROK);
14097 }
14098 #endif
14099
14100 #ifdef TFU_5GTF
14101 #ifdef ANSI
14102 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo
14103 (
14104 TfuUePucchUciRecpInfo *param,
14105 Buffer *mBuf
14106 )
14107 #else
14108 PUBLIC S16 cmUnpkTfuUePucchUciRecpInfo(param, mBuf)
14109 TfuUePucchUciRecpInfo *param;
14110 Buffer *mBuf;
14111 #endif
14112 {
14113
14114    TRC3(cmUnpkTfuUePucchUciRecpInfo)
14115
14116    CMCHKUNPK(SUnpkU8, &param->numBits, mBuf);
14117    CMCHKUNPK(SUnpkU8, &param->pucchIndex, mBuf);
14118    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14119
14120    RETVALUE(ROK);
14121 }
14122 #endif
14123
14124 \f
14125 /***********************************************************
14126 *
14127 *     Func : cmPkTfuUePucchRecpReq
14128 *
14129 *
14130 *     Desc : This structure is sent from scheduler to PHY in order to request the
14131   * reception of UCI on PUCCH. This may contain the following:
14132   * -# HARQ
14133   * -# SR
14134   * -# SRS
14135   * -# CQI
14136   * -# HARQ+SR
14137   * -# HARQ+SRS
14138   * -# HARQ+CQI
14139   * -# HARQ+SR+SRS
14140   * -# HARQ+SR+CQI
14141   * -# SR+SRS
14142   * -# SR+CQI
14143 *
14144 *
14145 *     Ret  : S16
14146 *
14147 *     Notes:
14148 *
14149 *     File  : 
14150 *
14151 **********************************************************/
14152 #ifdef ANSI
14153 PUBLIC S16 cmPkTfuUePucchRecpReq
14154 (
14155 TfuUePucchRecpReq *param,
14156 Buffer *mBuf
14157 )
14158 #else
14159 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14160 TfuUePucchRecpReq *param;
14161 Buffer *mBuf;
14162 #endif
14163 {
14164
14165    TRC3(cmPkTfuUePucchRecpReq)
14166
14167 #ifdef TFU_5GTF
14168    CMCHKPK(cmPkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14169    CMCHKPK(cmPkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14170 #endif /* TFU_5GTF */
14171    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14172    CMCHKPK(cmPkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14173    CMCHKPK(cmPkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14174    CMCHKPK(cmPkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14175    CMCHKPK(SPkU32, param->uciInfo, mBuf);
14176    RETVALUE(ROK);
14177 }
14178
14179
14180 \f
14181 /***********************************************************
14182 *
14183 *     Func : cmUnpkTfuUePucchRecpReq
14184 *
14185 *
14186 *     Desc : This structure is sent from scheduler to PHY in order to request the
14187   * reception of UCI on PUCCH. This may contain the following:
14188   * -# HARQ
14189   * -# SR
14190   * -# SRS
14191   * -# CQI
14192   * -# HARQ+SR
14193   * -# HARQ+SRS
14194   * -# HARQ+CQI
14195   * -# HARQ+SR+SRS
14196   * -# HARQ+SR+CQI
14197   * -# SR+SRS
14198   * -# SR+CQI
14199 *
14200 *
14201 *     Ret  : S16
14202 *
14203 *     Notes:
14204 *
14205 *     File  : 
14206 *
14207 **********************************************************/
14208 #ifdef ANSI
14209 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14210 (
14211 TfuUePucchRecpReq *param,
14212 Buffer *mBuf
14213 )
14214 #else
14215 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14216 TfuUePucchRecpReq *param;
14217 Buffer *mBuf;
14218 #endif
14219 {
14220
14221    TRC3(cmUnpkTfuUePucchRecpReq)
14222
14223    CMCHKUNPK(SUnpkU32, (U32 *)&param->uciInfo, mBuf);
14224    CMCHKUNPK(cmUnpkTfuUePucchCqiRecpInfo, &param->cqiInfo, mBuf);
14225    CMCHKUNPK(cmUnpkTfuUePucchSrRecpInfo, &param->srInfo, mBuf);
14226    CMCHKUNPK(cmUnpkTfuUePucchHqRecpInfo, &param->hqInfo, mBuf);
14227    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14228 #ifdef TFU_5GTF
14229    CMCHKUNPK(cmUnpkTfuUePucchUciRecpInfo, &param->uciPduInfo, mBuf);
14230    CMCHKUNPK(cmUnpkTfuUePucchBsiBriRecpInfo, &param->bsiBriInfo, mBuf);
14231 #endif /* TFU_5GTF */
14232    RETVALUE(ROK);
14233 }
14234
14235
14236 \f
14237 /***********************************************************
14238 *
14239 *     Func : cmPkTfuUeUlSchRecpInfo
14240 *
14241 *
14242 *     Desc : This structure is sent from scheduler to PHY in order to request the
14243   * reception of UEs data on ULSCH.
14244 *
14245 *
14246 *     Ret  : S16
14247 *
14248 *     Notes:
14249 *
14250 *     File  : 
14251 *
14252 **********************************************************/
14253 #ifdef ANSI
14254 PUBLIC S16 cmPkTfuUeUlSchRecpInfo
14255 (
14256 TfuUeUlSchRecpInfo *param,
14257 Buffer *mBuf
14258 )
14259 #else
14260 PUBLIC S16 cmPkTfuUeUlSchRecpInfo(param, mBuf)
14261 TfuUeUlSchRecpInfo *param;
14262 Buffer *mBuf;
14263 #endif
14264 {
14265
14266    TRC3(cmPkTfuUeUlSchRecpInfo)
14267 #ifdef TFU_5GTF
14268    CMCHKPK(SPkU8, param->beamIndex, mBuf);
14269    CMCHKPK(SPkU8, param->uciWoTBFlag, mBuf);
14270    CMCHKPK(SPkU8, param->PMI, mBuf);
14271    CMCHKPK(SPkU8, param->SCID, mBuf);
14272    CMCHKPK(SPkU8, param->nAntPortLayer, mBuf);
14273    CMCHKPK(SPkU8, param->xPUSCHRange, mBuf);
14274    CMCHKPK(SPkU8, param->numRbg, mBuf);
14275    CMCHKPK(SPkU8, param->rbgStart, mBuf);
14276 #endif
14277    CMCHKPK(SPkU8, param->mcs, mBuf);
14278    CMCHKPK(SPkU8, param->nSrs, mBuf);
14279    CMCHKPK(SPkU8, param->crntTxNb, mBuf);
14280    CMCHKPK(SPkU8, param->txMode, mBuf);
14281    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14282    CMCHKPK(SPkU8, param->rv, mBuf);
14283    CMCHKPK(SPkU8, param->ndi, mBuf);
14284    CMCHKPK(SPkU8, param->isRtx, mBuf);
14285    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
14286    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14287    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14288    CMCHKPK(SPkU32, param->modType, mBuf);
14289    CMCHKPK(SPkU8, param->numRb, mBuf);
14290    CMCHKPK(SPkU8, param->rbStart, mBuf);
14291    CMCHKPK(SPkU16, param->size, mBuf);
14292
14293    RETVALUE(ROK);
14294 }
14295
14296
14297 \f
14298 /***********************************************************
14299 *
14300 *     Func : cmUnpkTfuUeUlSchRecpInfo
14301 *
14302 *
14303 *     Desc : This structure is sent from scheduler to PHY in order to request the
14304   * reception of UEs data on ULSCH.
14305 *
14306 *
14307 *     Ret  : S16
14308 *
14309 *     Notes:
14310 *
14311 *     File  : 
14312 *
14313 **********************************************************/
14314 #ifdef ANSI
14315 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo
14316 (
14317 TfuUeUlSchRecpInfo *param,
14318 Buffer *mBuf
14319 )
14320 #else
14321 PUBLIC S16 cmUnpkTfuUeUlSchRecpInfo(param, mBuf)
14322 TfuUeUlSchRecpInfo *param;
14323 Buffer *mBuf;
14324 #endif
14325 {
14326
14327    TRC3(cmUnpkTfuUeUlSchRecpInfo)
14328
14329    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
14330    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14331    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14332    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
14333    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
14334    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14335    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
14336    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14337    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14338    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
14339    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14340    CMCHKUNPK(SUnpkU8, &param->txMode, mBuf);
14341    CMCHKUNPK(SUnpkU8, &param->crntTxNb, mBuf);
14342    CMCHKUNPK(SUnpkU8, &param->nSrs, mBuf);
14343    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14344 #ifdef TFU_5GTF 
14345    CMCHKUNPK(SUnpkU8, &param->rbgStart, mBuf);
14346    CMCHKUNPK(SUnpkU8, &param->numRbg, mBuf);
14347    CMCHKUNPK(SUnpkU8, &param->xPUSCHRange, mBuf);
14348    CMCHKUNPK(SUnpkU8, &param->nAntPortLayer, mBuf);
14349    CMCHKUNPK(SUnpkU8, &param->SCID, mBuf);
14350    CMCHKUNPK(SUnpkU8, &param->PMI, mBuf);
14351    CMCHKUNPK(SUnpkU8, &param->uciWoTBFlag, mBuf);
14352    CMCHKUNPK(SUnpkU8, &param->beamIndex, mBuf);
14353 #endif
14354    RETVALUE(ROK);
14355 }
14356
14357
14358 \f
14359 /***********************************************************
14360 *
14361 *     Func : cmPkTfuUePuschCqiRecpInfo
14362 *
14363 *
14364 *     Desc : This structure is sent from scheduler to PHY in order to request the
14365   * reception of CQI_RI info on PUSCH.
14366 *
14367 *
14368 *     Ret  : S16
14369 *
14370 *     Notes:
14371 *
14372 *     File  : 
14373 *
14374 **********************************************************/
14375 #ifdef ANSI
14376 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo
14377 (
14378 TfuUePuschCqiRecpInfo *param,
14379 Buffer *mBuf
14380 )
14381 #else
14382 PUBLIC S16 cmPkTfuUePuschCqiRecpInfo(param, mBuf)
14383 TfuUePuschCqiRecpInfo *param;
14384 Buffer *mBuf;
14385 #endif
14386 {
14387
14388    U32 idx = 0;
14389    TRC3(cmPkTfuUePuschCqiRecpInfo)
14390
14391    CMCHKPK(SPkU8, param->riBetaOff, mBuf);
14392    CMCHKPK(SPkU8, param->cqiBetaOff, mBuf);
14393    for (idx = 0; idx < param->cCNum; idx++)
14394    {
14395       CMCHKPK(cmPkTknU8, &param->riSz[idx], mBuf);
14396       CMCHKPK(SPkU8, param->cqiPmiSzRn1[idx], mBuf);
14397       CMCHKPK(SPkU8, param->cqiPmiSzR1[idx], mBuf);
14398    }
14399    CMCHKPK(SPkU8, param->cCNum, mBuf);
14400    CMCHKPK(SPkU8, param->reportType, mBuf);
14401    RETVALUE(ROK);
14402 }
14403
14404
14405 \f
14406 /***********************************************************
14407 *
14408 *     Func : cmUnpkTfuUePuschCqiRecpInfo
14409 *
14410 *
14411 *     Desc : This structure is sent from scheduler to PHY in order to request the
14412   * reception of CQI_RI info on PUSCH.
14413 *
14414 *
14415 *     Ret  : S16
14416 *
14417 *     Notes:
14418 *
14419 *     File  : 
14420 *
14421 **********************************************************/
14422 #ifdef ANSI
14423 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo
14424 (
14425 TfuUePuschCqiRecpInfo *param,
14426 Buffer *mBuf
14427 )
14428 #else
14429 PUBLIC S16 cmUnpkTfuUePuschCqiRecpInfo(param, mBuf)
14430 TfuUePuschCqiRecpInfo *param;
14431 Buffer *mBuf;
14432 #endif
14433 {
14434
14435    U32 idx;
14436    TRC3(cmUnpkTfuUePuschCqiRecpInfo)
14437
14438    CMCHKUNPK(SUnpkU8, &param->reportType, mBuf);
14439    CMCHKUNPK(SUnpkU8, &param->cCNum, mBuf);
14440    for (idx = param->cCNum; idx > 0; idx--)
14441    {
14442       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzR1[idx-1], mBuf);
14443       CMCHKUNPK(SUnpkU8, &param->cqiPmiSzRn1[idx-1], mBuf);
14444       CMCHKUNPK(cmUnpkTknU8, &param->riSz[idx-1], mBuf);
14445    }
14446    CMCHKUNPK(SUnpkU8, &param->cqiBetaOff, mBuf);
14447    CMCHKUNPK(SUnpkU8, &param->riBetaOff, mBuf);
14448    RETVALUE(ROK);
14449 }
14450
14451
14452 \f
14453 /***********************************************************
14454 *
14455 *     Func : cmPkTfuUePuschHqRecpInfo
14456 *
14457 *
14458 *     Desc : This structure is sent from scheduler to PHY in order to request the
14459   * reception of Harq info on PUSCH.
14460 *
14461 *
14462 *     Ret  : S16
14463 *
14464 *     Notes:
14465 *
14466 *     File  : 
14467 *
14468 **********************************************************/
14469 #ifdef ANSI
14470 PUBLIC S16 cmPkTfuUePuschHqRecpInfo
14471 (
14472 TfuUePuschHqRecpInfo *param,
14473 Buffer *mBuf
14474 )
14475 #else
14476 PUBLIC S16 cmPkTfuUePuschHqRecpInfo(param, mBuf)
14477 TfuUePuschHqRecpInfo *param;
14478 Buffer *mBuf;
14479 #endif
14480 {
14481
14482    TRC3(cmPkTfuUePuschHqRecpInfo)
14483
14484
14485 #ifdef TFU_TDD
14486    CMCHKPK(SPkU8, param->ulDai, mBuf);
14487    CMCHKPK(SPkU8, param->nBundled, mBuf);
14488    CMCHKPK(SPkU32, param->hqFdbkMode, mBuf);
14489 #endif
14490    CMCHKPK(SPkU8, param->hqBetaOff, mBuf);
14491    CMCHKPK(SPkU8, param->hqSz, mBuf);
14492    RETVALUE(ROK);
14493 }
14494
14495
14496 \f
14497 /***********************************************************
14498 *
14499 *     Func : cmUnpkTfuUePuschHqRecpInfo
14500 *
14501 *
14502 *     Desc : This structure is sent from scheduler to PHY in order to request the
14503   * reception of Harq info on PUSCH.
14504 *
14505 *
14506 *     Ret  : S16
14507 *
14508 *     Notes:
14509 *
14510 *     File  : 
14511 *
14512 **********************************************************/
14513 #ifdef ANSI
14514 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo
14515 (
14516 TfuUePuschHqRecpInfo *param,
14517 Buffer *mBuf
14518 )
14519 #else
14520 PUBLIC S16 cmUnpkTfuUePuschHqRecpInfo(param, mBuf)
14521 TfuUePuschHqRecpInfo *param;
14522 Buffer *mBuf;
14523 #endif
14524 {
14525
14526    TRC3(cmUnpkTfuUePuschHqRecpInfo)
14527
14528    CMCHKUNPK(SUnpkU8, &param->hqSz, mBuf);
14529    CMCHKUNPK(SUnpkU8, &param->hqBetaOff, mBuf);
14530
14531 #ifdef TFU_TDD
14532    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqFdbkMode, mBuf);
14533    CMCHKUNPK(SUnpkU8, &param->nBundled, mBuf);
14534    CMCHKUNPK(SUnpkU8, &param->ulDai, mBuf);
14535 #endif
14536    RETVALUE(ROK);
14537 }
14538
14539
14540 \f
14541 /***********************************************************
14542 *
14543 *     Func : cmPkTfuUePuschRecpReq
14544 *
14545 *
14546 *     Desc : This structure is sent from scheduler to PHY in order to request the
14547   * reception of UEs data on PUSCH. This may contain the following: 
14548   * -# Data
14549   * -# Data + SRS
14550   * -# Data + HARQ
14551   * -# Data + HARQ + SRS
14552   * -# Data + CQI/RI
14553   * -# Data + CQI/RI + SRS
14554   * -# Data + CQI/RI + HARQ
14555   * -# Data + CQI/RI + HARQ + SRS
14556 *
14557 *
14558 *     Ret  : S16
14559 *
14560 *     Notes:
14561 *
14562 *     File  : 
14563 *
14564 **********************************************************/
14565 #ifdef ANSI
14566 PUBLIC S16 cmPkTfuUePuschRecpReq
14567 (
14568 TfuUePuschRecpReq *param,
14569 Buffer *mBuf
14570 )
14571 #else
14572 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
14573 TfuUePuschRecpReq *param;
14574 Buffer *mBuf;
14575 #endif
14576 {
14577
14578    TRC3(cmPkTfuUePuschRecpReq)
14579
14580    CMCHKPK(cmPkTknU8, &param->initialNumRbs, mBuf);
14581    CMCHKPK(cmPkTknU8, &param->initialNSrs, mBuf);
14582    CMCHKPK(cmPkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14583    CMCHKPK(cmPkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14584    CMCHKPK(cmPkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14585    CMCHKPK(cmPkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14586    CMCHKPK(SPkU32, param->rcpInfo, mBuf);
14587    RETVALUE(ROK);
14588 }
14589
14590
14591 \f
14592 /***********************************************************
14593 *
14594 *     Func : cmUnpkTfuUePuschRecpReq
14595 *
14596 *
14597 *     Desc : This structure is sent from scheduler to PHY in order to request the
14598   * reception of UEs data on PUSCH. This may contain the following: 
14599   * -# Data
14600   * -# Data + SRS
14601   * -# Data + HARQ
14602   * -# Data + HARQ + SRS
14603   * -# Data + CQI/RI
14604   * -# Data + CQI/RI + SRS
14605   * -# Data + CQI/RI + HARQ
14606   * -# Data + CQI/RI + HARQ + SRS
14607 *
14608 *
14609 *     Ret  : S16
14610 *
14611 *     Notes:
14612 *
14613 *     File  : 
14614 *
14615 **********************************************************/
14616 #ifdef ANSI
14617 PUBLIC S16 cmUnpkTfuUePuschRecpReq
14618 (
14619 TfuUePuschRecpReq *param,
14620 Buffer *mBuf
14621 )
14622 #else
14623 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
14624 TfuUePuschRecpReq *param;
14625 Buffer *mBuf;
14626 #endif
14627 {
14628
14629    TRC3(cmUnpkTfuUePuschRecpReq)
14630
14631    CMCHKUNPK(SUnpkU32, (U32 *)&param->rcpInfo, mBuf);
14632    CMCHKUNPK(cmUnpkTfuUeUlSchRecpInfo, &param->ulSchInfo, mBuf);
14633    CMCHKUNPK(cmUnpkTfuUePuschCqiRecpInfo, &param->cqiRiInfo, mBuf);
14634    CMCHKUNPK(cmUnpkTfuUePuschHqRecpInfo, &param->hqInfo, mBuf);
14635    CMCHKUNPK(cmUnpkTfuUePucchSrsRecpInfo, &param->srsInfo, mBuf);
14636    CMCHKUNPK(cmUnpkTknU8, &param->initialNSrs, mBuf);
14637    CMCHKUNPK(cmUnpkTknU8, &param->initialNumRbs, mBuf);
14638    RETVALUE(ROK);
14639 }
14640
14641
14642 \f
14643 /***********************************************************
14644 *
14645 *     Func : cmPkTfuUeRecpReqInfo
14646 *
14647 *
14648 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14649  * data. This contains information needed by PHY to decode the data sent by the
14650  * UE.
14651 *
14652 *
14653 *     Ret  : S16
14654 *
14655 *     Notes:
14656 *
14657 *     File  : 
14658 *
14659 **********************************************************/
14660 #ifdef ANSI
14661 PUBLIC S16 cmPkTfuUeRecpReqInfo
14662 (
14663 TfuUeRecpReqInfo *param,
14664 Buffer *mBuf
14665 )
14666 #else
14667 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
14668 TfuUeRecpReqInfo *param;
14669 Buffer *mBuf;
14670 #endif
14671 {
14672
14673    TRC3(cmPkTfuUeRecpReqInfo)
14674
14675       switch(param->type) {
14676          case TFU_RECP_REQ_PUSCH:
14677             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14678             break;
14679          case TFU_RECP_REQ_PUCCH:
14680             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14681             break;
14682          default :
14683             RETVALUE(RFAILED);
14684       }
14685    CMCHKPK(SPkU32, param->type, mBuf);
14686 #ifdef TFU_5GTF
14687    CMCHKPK(SPkU8, param->groupId, mBuf);
14688 #endif /* TFU_5GTF */
14689    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
14690    RETVALUE(ROK);
14691 }
14692
14693
14694 \f
14695 /***********************************************************
14696 *
14697 *     Func : cmUnpkTfuUeRecpReqInfo
14698 *
14699 *
14700 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
14701  * data. This contains information needed by PHY to decode the data sent by the
14702  * UE.
14703 *
14704 *
14705 *     Ret  : S16
14706 *
14707 *     Notes:
14708 *
14709 *     File  : 
14710 *
14711 **********************************************************/
14712 #ifdef ANSI
14713 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
14714 (
14715 TfuUeRecpReqInfo *param,
14716 Buffer *mBuf
14717 )
14718 #else
14719 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
14720 TfuUeRecpReqInfo *param;
14721 Buffer *mBuf;
14722 #endif
14723 {
14724
14725    TRC3(cmUnpkTfuUeRecpReqInfo)
14726
14727    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
14728 #ifdef TFU_5GTF
14729    CMCHKUNPK(SUnpkU8, &param->groupId, mBuf);
14730 #endif /* TFU_5GTF */
14731    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14732       switch(param->type) {
14733          case TFU_RECP_REQ_PUCCH:
14734             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
14735             break;
14736          case TFU_RECP_REQ_PUSCH:
14737             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
14738             break;
14739          default :
14740             RETVALUE(RFAILED);
14741       }
14742    RETVALUE(ROK);
14743 }
14744 #endif /* TFU_UPGRADE */
14745 #ifndef TFU_UPGRADE  /* TFU_UPGRADE */
14746 /***********************************************************
14747 *
14748 *     Func : cmPkTfuUePucchRecpReq
14749 *
14750 *
14751 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14752   * reception of an UEs data on PUCCH. This may contain the following: 
14753   * -# HARQ-ACK 
14754   * -# Scheduling Request (SR)
14755   * -# HARQ-ACK and SR
14756   * -# CQI
14757   * -# CQI and HARQ-ACK
14758 *
14759 *
14760 *     Ret  : S16
14761 *
14762 *     Notes:
14763 *
14764 *     File  : 
14765 *
14766 **********************************************************/
14767 #ifdef ANSI
14768 PUBLIC S16 cmPkTfuUePucchRecpReq
14769 (
14770 TfuUePucchRecpReq *param,
14771 Buffer *mBuf
14772 )
14773 #else
14774 PUBLIC S16 cmPkTfuUePucchRecpReq(param, mBuf)
14775 TfuUePucchRecpReq *param;
14776 Buffer *mBuf;
14777 #endif
14778 {
14779
14780 #ifdef TFU_TDD
14781    S32 i;
14782 #endif
14783    TRC3(cmPkTfuUePucchRecpReq)
14784
14785
14786 #ifdef TFU_TDD
14787    for (i=TFU_MAX_M-1; i >= 0; i--) {
14788       CMCHKPK(SPkU8, param->p[i], mBuf);
14789    }
14790    for (i=TFU_MAX_M-1; i >= 0; i--) {
14791       CMCHKPK(SPkU8, param->m[i], mBuf);
14792    }
14793    CMCHKPK(SPkU8, param->M, mBuf);
14794    CMCHKPK(SPkU8, param->multCnt, mBuf);
14795
14796 #endif
14797    CMCHKPK(SPkU32, param->type, mBuf);
14798       switch(param->hqType) {
14799          case TFU_HQ_RECP_REQ_N1PUCCH:
14800             CMCHKPK(SPkU16, param->t.n1Pucch, mBuf);
14801             break;
14802    
14803 #ifdef TFU_TDD
14804          case TFU_HQ_RECP_REQ_NORMAL:
14805             for (i=TFU_MAX_M-1; i >= 0; i--) {
14806                CMCHKPK(SPkU16, param->t.nCce[i], mBuf);
14807             }
14808             break;
14809    
14810 #endif
14811    
14812 #ifndef TFU_TDD
14813          case TFU_HQ_RECP_REQ_NORMAL:
14814             CMCHKPK(SPkU16, param->t.nCce, mBuf);
14815             break;
14816    
14817 #endif
14818          default :
14819             RETVALUE(RFAILED);
14820       }
14821    CMCHKPK(SPkU32, param->hqType, mBuf);
14822    RETVALUE(ROK);
14823 }
14824
14825
14826 \f
14827 /***********************************************************
14828 *
14829 *     Func : cmUnpkTfuUePucchRecpReq
14830 *
14831 *
14832 *     Desc : This structure is sent from Scheduler to PHY in order to request the
14833   * reception of an UEs data on PUCCH. This may contain the following: 
14834   * -# HARQ-ACK 
14835   * -# Scheduling Request (SR)
14836   * -# HARQ-ACK and SR
14837   * -# CQI
14838   * -# CQI and HARQ-ACK
14839 *
14840 *
14841 *     Ret  : S16
14842 *
14843 *     Notes:
14844 *
14845 *     File  : 
14846 *
14847 **********************************************************/
14848 #ifdef ANSI
14849 PUBLIC S16 cmUnpkTfuUePucchRecpReq
14850 (
14851 TfuUePucchRecpReq *param,
14852 Buffer *mBuf
14853 )
14854 #else
14855 PUBLIC S16 cmUnpkTfuUePucchRecpReq(param, mBuf)
14856 TfuUePucchRecpReq *param;
14857 Buffer *mBuf;
14858 #endif
14859 {
14860
14861 #ifdef TFU_TDD
14862    S32 i;
14863 #endif
14864    TRC3(cmUnpkTfuUePucchRecpReq)
14865
14866    CMCHKUNPK(SUnpkU32, (U32 *)&param->hqType, mBuf);
14867       switch(param->hqType) {
14868    
14869 #ifndef TFU_TDD
14870          case TFU_HQ_RECP_REQ_NORMAL:
14871             CMCHKUNPK(SUnpkU16, &param->t.nCce, mBuf);
14872             break;
14873    
14874 #endif
14875    
14876 #ifdef TFU_TDD
14877          case TFU_HQ_RECP_REQ_NORMAL:
14878             for (i=0; i<TFU_MAX_M; i++) {
14879                CMCHKUNPK(SUnpkU16, &param->t.nCce[i], mBuf);
14880             }
14881             break;
14882    
14883 #endif
14884          case TFU_HQ_RECP_REQ_N1PUCCH:
14885             CMCHKUNPK(SUnpkU16, &param->t.n1Pucch, mBuf);
14886             break;
14887          default :
14888             RETVALUE(RFAILED);
14889       }
14890    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
14891
14892 #ifdef TFU_TDD
14893    CMCHKUNPK(SUnpkU8, &param->multCnt, mBuf);
14894    CMCHKUNPK(SUnpkU8, &param->M, mBuf);
14895    for (i=0; i<TFU_MAX_M; i++) {
14896       CMCHKUNPK(SUnpkU8, &param->m[i], mBuf);
14897    }
14898    for (i=0; i<TFU_MAX_M; i++) {
14899       CMCHKUNPK(SUnpkU8, &param->p[i], mBuf);
14900    }
14901
14902 #endif
14903    RETVALUE(ROK);
14904 }
14905
14906
14907 \f
14908 /***********************************************************
14909 *
14910 *     Func : cmPkTfuUeMsg3RecpReq
14911 *
14912 *
14913 *     Desc : This structure is sent from scheduler to PHY in order to request the
14914   * reception of UEs data sent as MSG3 for Random access.
14915 *
14916 *
14917 *     Ret  : S16
14918 *
14919 *     Notes:
14920 *
14921 *     File  : 
14922 *
14923 **********************************************************/
14924 #ifdef ANSI
14925 PUBLIC S16 cmPkTfuUeMsg3RecpReq
14926 (
14927 TfuUeMsg3RecpReq *param,
14928 Buffer *mBuf
14929 )
14930 #else
14931 PUBLIC S16 cmPkTfuUeMsg3RecpReq(param, mBuf)
14932 TfuUeMsg3RecpReq *param;
14933 Buffer *mBuf;
14934 #endif
14935 {
14936
14937    TRC3(cmPkTfuUeMsg3RecpReq)
14938
14939    CMCHKPK(SPkU32, param->modType, mBuf);
14940    CMCHKPK(SPkU16, param->size, mBuf);
14941    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14942    CMCHKPK(SPkU8, param->nDmrs, mBuf);
14943    CMCHKPK(SPkU8, param->rv, mBuf);
14944    CMCHKPK(SPkU8, param->ndi, mBuf);
14945    CMCHKPK(SPkU8, param->harqProcId, mBuf);
14946    CMCHKPK(SPkU8, param->isRtx, mBuf);
14947    CMCHKPK(SPkU8, param->ulDelay, mBuf);
14948    CMCHKPK(SPkU8, param->expCqi, mBuf);
14949    CMCHKPK(SPkU8, param->mcs, mBuf);
14950    CMCHKPK(SPkU8, param->numRb, mBuf);
14951    CMCHKPK(SPkU8, param->rbStart, mBuf);
14952    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
14953    RETVALUE(ROK);
14954 }
14955
14956
14957 \f
14958 /***********************************************************
14959 *
14960 *     Func : cmUnpkTfuUeMsg3RecpReq
14961 *
14962 *
14963 *     Desc : This structure is sent from scheduler to PHY in order to request the
14964   * reception of UEs data sent as MSG3 for Random access.
14965 *
14966 *
14967 *     Ret  : S16
14968 *
14969 *     Notes:
14970 *
14971 *     File  : 
14972 *
14973 **********************************************************/
14974 #ifdef ANSI
14975 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq
14976 (
14977 TfuUeMsg3RecpReq *param,
14978 Buffer *mBuf
14979 )
14980 #else
14981 PUBLIC S16 cmUnpkTfuUeMsg3RecpReq(param, mBuf)
14982 TfuUeMsg3RecpReq *param;
14983 Buffer *mBuf;
14984 #endif
14985 {
14986
14987    TRC3(cmUnpkTfuUeMsg3RecpReq)
14988
14989    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
14990    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
14991    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
14992    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
14993    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
14994    CMCHKUNPK(SUnpkU8, &param->ulDelay, mBuf);
14995    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
14996    /*ccpu00128993 - ADD - fix for msg3 softcombining bug*/
14997    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
14998    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
14999    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
15000    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
15001    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
15002    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
15003    RETVALUE(ROK);
15004 }
15005
15006
15007 \f
15008 /***********************************************************
15009 *
15010 *     Func : cmPkTfuUePuschRecpReq
15011 *
15012 *
15013 *     Desc : This structure is sent from scheduler to PHY in order to request the
15014   * reception of UEs data on PUSCH. This may contain the following: 
15015   * -# Data
15016   * -# Data + CQI and RI
15017   * -# Data + CQI and HARQ
15018 *
15019 *
15020 *     Ret  : S16
15021 *
15022 *     Notes:
15023 *
15024 *     File  : 
15025 *
15026 **********************************************************/
15027 #ifdef ANSI
15028 PUBLIC S16 cmPkTfuUePuschRecpReq
15029 (
15030 TfuUePuschRecpReq *param,
15031 Buffer *mBuf
15032 )
15033 #else
15034 PUBLIC S16 cmPkTfuUePuschRecpReq(param, mBuf)
15035 TfuUePuschRecpReq *param;
15036 Buffer *mBuf;
15037 #endif
15038 {
15039
15040    TRC3(cmPkTfuUePuschRecpReq)
15041
15042    CMCHKPK(SPkU32, param->modType, mBuf);
15043    CMCHKPK(SPkU16, param->size, mBuf);
15044    CMCHKPK(SPkU32, param->mode, mBuf);
15045    CMCHKPK(SPkU8, param->expHarq, mBuf);
15046    CMCHKPK(SPkU8, param->expCqi, mBuf);
15047    CMCHKPK(SPkU8, param->nDmrs, mBuf);
15048    CMCHKPK(SPkU8, param->rv, mBuf);
15049    CMCHKPK(SPkU8, param->isRtx, mBuf);
15050    CMCHKPK(SPkU8, param->ndi, mBuf);
15051    CMCHKPK(SPkU8, param->harqProcId, mBuf);
15052    CMCHKPK(SPkU8, param->mcs, mBuf);
15053    CMCHKPK(SPkU8, param->numRb, mBuf);
15054    CMCHKPK(SPkU8, param->rbStart, mBuf);
15055    CMCHKPK(SPkU8, param->hoppingBits, mBuf);
15056    CMCHKPK(SPkU8, param->hoppingEnbld, mBuf);
15057    RETVALUE(ROK);
15058 }
15059
15060
15061 \f
15062 /***********************************************************
15063 *
15064 *     Func : cmUnpkTfuUePuschRecpReq
15065 *
15066 *
15067 *     Desc : This structure is sent from scheduler to PHY in order to request the
15068   * reception of UEs data on PUSCH. This may contain the following: 
15069   * -# Data
15070   * -# Data + CQI and RI
15071   * -# Data + CQI and HARQ
15072 *
15073 *
15074 *     Ret  : S16
15075 *
15076 *     Notes:
15077 *
15078 *     File  : 
15079 *
15080 **********************************************************/
15081 #ifdef ANSI
15082 PUBLIC S16 cmUnpkTfuUePuschRecpReq
15083 (
15084 TfuUePuschRecpReq *param,
15085 Buffer *mBuf
15086 )
15087 #else
15088 PUBLIC S16 cmUnpkTfuUePuschRecpReq(param, mBuf)
15089 TfuUePuschRecpReq *param;
15090 Buffer *mBuf;
15091 #endif
15092 {
15093
15094    TRC3(cmUnpkTfuUePuschRecpReq)
15095
15096    CMCHKUNPK(SUnpkU8, &param->hoppingEnbld, mBuf);
15097    CMCHKUNPK(SUnpkU8, &param->hoppingBits, mBuf);
15098    CMCHKUNPK(SUnpkU8, &param->rbStart, mBuf);
15099    CMCHKUNPK(SUnpkU8, &param->numRb, mBuf);
15100    CMCHKUNPK(SUnpkU8, &param->mcs, mBuf);
15101    CMCHKUNPK(SUnpkU8, &param->harqProcId, mBuf);
15102    CMCHKUNPK(SUnpkU8, &param->ndi, mBuf);
15103    CMCHKUNPK(SUnpkU8, &param->isRtx, mBuf);
15104    CMCHKUNPK(SUnpkU8, &param->rv, mBuf);
15105    CMCHKUNPK(SUnpkU8, &param->nDmrs, mBuf);
15106    CMCHKUNPK(SUnpkU8, &param->expCqi, mBuf);
15107    CMCHKUNPK(SUnpkU8, &param->expHarq, mBuf);
15108    CMCHKUNPK(SUnpkU32, (U32 *)&param->mode, mBuf);
15109    CMCHKUNPK(SUnpkU16, &param->size, mBuf);
15110    CMCHKUNPK(SUnpkU32, (U32 *)&param->modType, mBuf);
15111    RETVALUE(ROK);
15112 }
15113
15114
15115 \f
15116 /***********************************************************
15117 *
15118 *     Func : cmPkTfuUeRecpReqInfo
15119 *
15120 *
15121 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15122  * data. This contains information needed by PHY to decode the data sent by the
15123  * UE.
15124 *
15125 *
15126 *     Ret  : S16
15127 *
15128 *     Notes:
15129 *
15130 *     File  : 
15131 *
15132 **********************************************************/
15133 #ifdef ANSI
15134 PUBLIC S16 cmPkTfuUeRecpReqInfo
15135 (
15136 TfuUeRecpReqInfo *param,
15137 Buffer *mBuf
15138 )
15139 #else
15140 PUBLIC S16 cmPkTfuUeRecpReqInfo(param, mBuf)
15141 TfuUeRecpReqInfo *param;
15142 Buffer *mBuf;
15143 #endif
15144 {
15145
15146    TRC3(cmPkTfuUeRecpReqInfo)
15147
15148       switch(param->type) {
15149          case TFU_RECP_REQ_PUSCH:
15150             CMCHKPK(cmPkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15151             break;
15152          case TFU_RECP_REQ_MSG3:
15153             CMCHKPK(cmPkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15154             break;
15155          case TFU_RECP_REQ_PUCCH:
15156             CMCHKPK(cmPkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15157             break;
15158          default :
15159             RETVALUE(RFAILED);
15160       }
15161    CMCHKPK(SPkU32, param->type, mBuf);
15162    CMCHKPK(cmPkLteRnti, param->rnti, mBuf);
15163    RETVALUE(ROK);
15164 }
15165
15166
15167 \f
15168 /***********************************************************
15169 *
15170 *     Func : cmUnpkTfuUeRecpReqInfo
15171 *
15172 *
15173 *     Desc : This structure is a Per UE reception request for either PUCCH or PUSCH
15174  * data. This contains information needed by PHY to decode the data sent by the
15175  * UE.
15176 *
15177 *
15178 *     Ret  : S16
15179 *
15180 *     Notes:
15181 *
15182 *     File  : 
15183 *
15184 **********************************************************/
15185 #ifdef ANSI
15186 PUBLIC S16 cmUnpkTfuUeRecpReqInfo
15187 (
15188 TfuUeRecpReqInfo *param,
15189 Buffer *mBuf
15190 )
15191 #else
15192 PUBLIC S16 cmUnpkTfuUeRecpReqInfo(param, mBuf)
15193 TfuUeRecpReqInfo *param;
15194 Buffer *mBuf;
15195 #endif
15196 {
15197
15198    TRC3(cmUnpkTfuUeRecpReqInfo)
15199
15200    CMCHKUNPK(cmUnpkLteRnti, &param->rnti, mBuf);
15201    CMCHKUNPK(SUnpkU32, (U32 *)&param->type, mBuf);
15202       switch(param->type) {
15203          case TFU_RECP_REQ_PUCCH:
15204             CMCHKUNPK(cmUnpkTfuUePucchRecpReq, &param->t.pucchRecpReq, mBuf);
15205             break;
15206          case TFU_RECP_REQ_MSG3:
15207             CMCHKUNPK(cmUnpkTfuUeMsg3RecpReq, &param->t.msg3RecpReq, mBuf);
15208             break;
15209          case TFU_RECP_REQ_PUSCH:
15210             CMCHKUNPK(cmUnpkTfuUePuschRecpReq, &param->t.puschRecpReq, mBuf);
15211             break;
15212          default :
15213             RETVALUE(RFAILED);
15214       }
15215    RETVALUE(ROK);
15216 }
15217
15218
15219 #endif /* ifndef TFU_UPGRADE */
15220 /*LAA: Packing and Unpacking*/
15221
15222 /***********************************************************
15223 *
15224 *     Func : cmPkTfuErrIndInfo
15225 *
15226 *
15227 *     Desc : This structure contains information that is passed as a part of
15228 *     the ERR indication sent from PHY to MAC.
15229 *
15230 *
15231 *     Ret  : S16
15232 *
15233 *     Notes:
15234 *
15235 *     File  : 
15236 *
15237 **********************************************************/
15238 #ifdef ANSI
15239 PRIVATE S16 cmPkTfuErrIndInfo
15240 (
15241 TfuErrIndInfo *param,
15242 Buffer *mBuf
15243 )
15244 #else
15245 PRIVATE S16 cmPkTfuErrIndInfo(param, mBuf)
15246 TfuErrIndInfo *param;
15247 Buffer *mBuf;
15248 #endif
15249 {
15250
15251    TRC3(cmPkTfuErrIndInfo)
15252
15253    CMCHKPK(cmPkLteTimingInfo, &param->timingInfo, mBuf);
15254    CMCHKPK(cmPkLteCellId, param->cellId, mBuf);
15255    RETVALUE(ROK);
15256 }
15257 /***********************************************************
15258 *
15259 *     Func : cmUnpkTfuErrIndInfo
15260 *
15261 *
15262 *     Desc : This structure contains information that is passed as a part of the ERR
15263  * indication sent from PHY to MAC.
15264 *
15265 *
15266 *     Ret  : S16
15267 *
15268 *     Notes:
15269 *
15270 *     File  : 
15271 *
15272 **********************************************************/
15273 #ifdef ANSI
15274 PRIVATE S16 cmUnpkTfuErrIndInfo
15275 (
15276 TfuErrIndInfo *param,
15277 Buffer *mBuf
15278 )
15279 #else
15280 PRIVATE S16 cmUnpkTfuErrIndInfo(param, mBuf)
15281 TfuErrIndInfo *param;
15282 Buffer *mBuf;
15283 #endif
15284 {
15285
15286    TRC3(cmUnpkTfuErrIndInfo)
15287
15288    CMCHKUNPK(cmUnpkLteCellId, &param->cellId, mBuf);
15289    CMCHKUNPK(cmUnpkLteTimingInfo, &param->timingInfo, mBuf);
15290    RETVALUE(ROK);
15291 }
15292
15293 /***********************************************************
15294 *
15295 *     Func : cmPkTfuErrInd
15296 *
15297 *
15298  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15299  *      Currently invoked in the cases when the Unlicensed SCell transmission
15300  *      fails.
15301  *      This API contains the Cell and subframe information for which the
15302  *      transmission failed. 
15303  *           
15304  *  @param[in]  Pst                *pst
15305  *  @param[in]  SuId               suId 
15306  *  @param[in]  TfuErrIndInfo      *errIndInfo 
15307  *  @return  S16
15308  *      -# ROK 
15309  *      -# RFAILED 
15310 *
15311 *
15312 *     Ret  : S16
15313 *
15314 *     Notes:
15315 *
15316 *     File  : 
15317 *
15318 **********************************************************/
15319 #ifdef ANSI
15320 PUBLIC S16 cmPkTfuErrInd
15321 (
15322 Pst * pst,
15323 SuId suId,
15324 TfuErrIndInfo * errInd
15325 )
15326 #else
15327 PUBLIC S16 cmPkTfuErrInd(pst, suId, errInd)
15328 Pst * pst;
15329 SuId suId;
15330 TfuErrIndInfo * errInd;
15331 #endif
15332 {
15333    Buffer *mBuf = NULLP;
15334    TRC3(cmPkTfuErrInd)
15335
15336    if (SGetMsg(pst->region, pst->pool, &mBuf) != ROK) {
15337 #if (ERRCLASS & ERRCLS_ADD_RES)
15338       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15339          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15340          (ErrVal)ETFU105, (ErrVal)0, "Packing failed");
15341 #endif
15342       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15343       RETVALUE(RFAILED);
15344    }
15345    if (pst->selector == TFU_SEL_LC) {
15346       if (cmPkTfuErrIndInfo(errInd, mBuf) != ROK) {
15347 #if (ERRCLASS & ERRCLS_ADD_RES)
15348          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15349             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15350             (ErrVal)ETFU106, (ErrVal)0, "Packing failed");
15351 #endif
15352          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15353          TFU_FREE_MSG(mBuf);
15354          RETVALUE(RFAILED);
15355       }
15356    }
15357    else if(pst->selector == TFU_SEL_LWLC)
15358    {
15359       if (cmPkPtr((PTR)errInd, mBuf) != ROK)
15360       {
15361 #if (ERRCLASS & ERRCLS_ADD_RES)
15362          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15363             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15364             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC Packing failed");
15365 #endif
15366          
15367          /*MS_FIX:71858:Changed to SPutSBuf as being allocated with SGetSBuf*/
15368          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15369          TFU_FREE_MSG(mBuf);
15370          RETVALUE(RFAILED);
15371       }
15372    }
15373
15374    if (SPkS16(suId, mBuf) != ROK) {
15375 #if (ERRCLASS & ERRCLS_ADD_RES)
15376       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15377          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15378          (ErrVal)ETFU107, (ErrVal)0, "Packing failed");
15379 #endif
15380       SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15381       TFU_FREE_MSG(mBuf);
15382       RETVALUE(RFAILED);
15383    }
15384    if (pst->selector != TFU_SEL_LWLC) {
15385       if (SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo)) != ROK) {
15386 #if (ERRCLASS & ERRCLS_ADD_RES)
15387       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15388          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15389          (ErrVal)ETFU108, (ErrVal)0, "Packing failed");
15390 #endif
15391          TFU_FREE_MSG(mBuf);
15392          RETVALUE(RFAILED);
15393       }
15394    }
15395
15396    pst->event = (Event) EVTTFUERRIND;
15397    RETVALUE(SPstTsk(pst,mBuf));
15398 }
15399
15400 \f
15401 /***********************************************************
15402 *
15403 *     Func : cmUnpkTfuErrInd
15404 *
15405 *
15406  *      This API is invoked by PHY to send ERROR INDICATION to scheduler 
15407  *      Currently invoked in the cases when the Unlicensed SCell transmission
15408  *      fails.
15409  *      This API contains the Cell and subframe information for which the
15410  *      transmission failed. 
15411  * @param pst Pointer to the post structure.
15412  * @param suId SAP ID of the service user.
15413  * @param errInd Pointer to the TfuErrIndInfo.
15414  * @return ROK/RFAILED
15415 *
15416 *
15417 *     Ret  : S16
15418 *
15419 *     Notes:
15420 *
15421 *     File  : 
15422 *
15423 **********************************************************/
15424 #ifdef ANSI
15425 PUBLIC S16 cmUnpkTfuErrInd
15426 (
15427 TfuErrInd func,
15428 Pst *pst,
15429 Buffer *mBuf
15430 )
15431 #else
15432 PUBLIC S16 cmUnpkTfuErrInd(func, pst, mBuf)
15433 TfuErrInd func;
15434 Pst *pst;
15435 Buffer *mBuf;
15436 #endif
15437 {
15438    SuId suId;
15439    TfuErrIndInfo *errInd;
15440    
15441    TRC3(cmUnpkTfuErrInd)
15442
15443    if (SUnpkS16(&suId, mBuf) != ROK) {
15444       TFU_FREE_MSG(mBuf);
15445 #if (ERRCLASS & ERRCLS_ADD_RES)
15446       SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15447          __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15448          (ErrVal)ETFU109, (ErrVal)0, "Packing failed");
15449 #endif
15450       RETVALUE(RFAILED);
15451    }
15452    if (pst->selector != TFU_SEL_LWLC) {
15453       if ((SGetSBuf(pst->region, pst->pool, (Data **)&errInd, sizeof(TfuErrIndInfo))) != ROK) {
15454 #if (ERRCLASS & ERRCLS_ADD_RES)
15455          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15456             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15457             (ErrVal)ETFU110, (ErrVal)0, "Packing failed");
15458 #endif
15459          TFU_FREE_MSG(mBuf);
15460          RETVALUE(RFAILED);
15461       }
15462    }
15463
15464    if (pst->selector == TFU_SEL_LC) 
15465    {
15466       if (cmUnpkTfuErrIndInfo(errInd, mBuf) != ROK) {
15467          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15468          TFU_FREE_MSG(mBuf);
15469 #if (ERRCLASS & ERRCLS_ADD_RES)
15470          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15471                __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15472                (ErrVal)ETFU111, (ErrVal)0, "Packing failed");
15473 #endif
15474          RETVALUE(RFAILED);
15475       }
15476    }
15477    else if(pst->selector == TFU_SEL_LWLC)
15478    {
15479       if (cmUnpkPtr((PTR *)&errInd, mBuf) != ROK)
15480       {
15481 #if (ERRCLASS & ERRCLS_ADD_RES)
15482          SLogError(pst->srcEnt, pst->srcInst, pst->srcProcId,
15483             __FILE__, __LINE__, (ErrCls)ERRCLS_ADD_RES,
15484             (ErrVal)ETFUXXX, (ErrVal)0, "LWLC un-Packing failed");
15485 #endif
15486          SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15487          TFU_FREE_MSG(mBuf);
15488          RETVALUE(RFAILED);
15489       }
15490    }
15491    TFU_FREE_MSG(mBuf);
15492    /* [ccpu00141698]-MOD- MAC/SCH does not free the TTI ind anymore */
15493    (*func)(pst, suId, errInd);
15494    SPutSBuf(pst->region, pst->pool, (Data *)errInd, sizeof(TfuErrIndInfo));
15495    RETVALUE(ROK);
15496
15497 }
15498 #endif /* if defined(LCTFU) */
15499
15500 /**********************************************************************
15501          End of file
15502  **********************************************************************/