This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

how the mdBindDev received the third parameter from the application layer

how the mdBindDev received the third parameter from the application layer

Hello, I'm studying the video port ddk driver, and my environment is
CCS5.5
DSP/BIOS5.42
ddk1.11
 and I'm confused aboud how the mdBindDev received the third parameter from the application layer,
in the "video_rgb" example, I found there defined 3 variables in "evmdm642_vcapparamsNTSC.c", these are:
VPORTCAP_Params EVMDM642_vCapParamsChan = {
    VPORT_MODE_BT656_8BIT, /* cmode:3  */
    VPORT_FLDOP_FRAME,     /* fldOp:3  */   

    VPORT_SCALING_DISABLE,     /* scale:1  */   
    VPORT_RESMPL_DISABLE,      /* resmpl:1 */
    VPORTCAP_BPK_10BIT_ZERO_EXTENDED, /*bpk10Bit:2   */

    VPORTCAP_HRST_END_HBLK,  /*hCtRst:1  */
    VPORTCAP_VRST_START_VBLK,  /*vCtRst:1  */
    VPORTCAP_FLDD_DISABLE,   /*fldDect:1 */
    VPORTCAP_EXC_ENABLE,     /*extCtl:1  */  
    VPORTCAP_FINV_ENABLE,   /* fldInv:1 */
   
    0,                 /*fldXStrt1 */
    18,                /*fldYStrt1 */ 
    0,                 /*fldXStrt2 */ 
    18,                /*fldYStrt2 */
   
    LINE_SZ-1,         /*fldXStop1 */
    NUM_LINES + 18,       /*fldYStop1 */
   
    LINE_SZ-1,         /*fldXStop2 */
    NUM_LINES + 18,       /*fldYStop2 */
   
    (LINE_SZ>>3),      /*thrld     */   
    3,                 /*numFrmBufs*/   
    8,                 /*alignment */   
    VPORT_FLDS_MERGED, /*mergeFlds */   
    NULL,              /*segId     */               
    EDMA_OPT_PRI_HIGH, /*edmaPri   */  
    8
};

VPORT_PortParams EVMDM642_vCapParamsPort = {
    FALSE,                      /*  enableDualChan;                */
    VPORT_POLARITY_ACTIVE_LOW,  /* vport control pin 1 polarity    */
    VPORT_POLARITY_ACTIVE_HIGH, /* vport control pin 2 polarity    */
    VPORT_POLARITY_ACTIVE_HIGH, /* vport control pin 3 polarity    */
    &SAA7115_Fxns,
    INV,
};   

SAA7115_ConfParams EVMDM642_vCapParamsSAA7115 = {
  SAA7115_MODE_NTSC720,
  SAA7115_MODE_NTSC720,
  SAA7115_AFMT_COMPOSITE,
  FALSE,
  FALSE,
  INV
};   
 and I know that the first and third variable is passed to the mini driver by the follow code in the application layer:
    capChan = FVID_create("/VP0CAPTURE/A/0",
            IOM_INPUT, &status, (Ptr)&EVMDM642_vCapParamsChan, NULL);


    FVID_control(capChan2, VPORT_CMD_EDC_BASE+EDC_CONFIG,
        (Ptr)&EVMDM642_vCapParamsSAA7115);
but I can't find how the second variable passed to the mini-driver,but I find that it seemed the mdBindDev received
 this variable,as is because the mdBinddev call flow is bellow:
static Int mdBindDev(Ptr *devp, Int devid, Ptr devParams)--->
 mdControlChan(&portObjs[portNum], VPORT_CMD_CONFIG_PORT, devParams); --->
_configPort(chanp, args);
and we can find in the _configPort function bellow:
/*
 *  ======== _configPort ========
 *  configure port level registers
 */
static Int _configPort(Ptr chanp, Ptr args)
{
    PortObj* port = (PortObj *)chanp;
    volatile Int *base = (volatile Int *)port->base;
    /* configure video port control register */
    VPORT_PortParams* portParams = (VPORT_PortParams*)args;
   
   
    /* enable video port */
    base[_VP_PCR_OFFSET] |= VP_PCR_PEREN_ENABLE << _VP_PCR_PEREN_SHIFT;
               
    /* reset video port */
    base[_VP_VPCTL_OFFSET] |=
        VP_VPCTL_VPRST_RESET << _VP_VPCTL_VPRST_SHIFT;

    base[_VP_VPCTL_OFFSET] = VP_VPCTL_RMK(0,0,0,portParams->vc3Polarity,
        portParams->vc2Polarity,portParams->vc1Polarity,0,0,
        portParams->dualChanEnable);
   
    /* enable video port */
    base[_VP_VPCTL_OFFSET] |= (VP_VPCTL_VPHLT_CLEAR << _VP_VPCTL_VPHLT_SHIFT);
    port->chanObj[0].edcFxns = portParams->edcTbl[0];
    port->chanObj[1].edcFxns = portParams->edcTbl[1];
   
    IRQ_clear(IRQ_EVT_EDMAINT);
    return IOM_COMPLETED;

}
 it received an arg and it's type is VPORT_PortParams, and it is same with the second variable "VPORT_PortParams EVMDM642_vCapParamsPort"defined in the file,
so I guess mdBindDev received this variable, but I' can't find how this variable passed to it, can anyone help me,thank you!