Jump to ID:
BSPs and Drivers

Project Home

Documents

Discussions

Wiki

Project Info
Forum Topic - Problem with devctl(): Page 1 of 8 (8 Items)
   
 
 
Problem with devctl()  
I'm trying to use devctl() is a resource manager to return information about one or more PCI boards to a client.  The 
fundamental problem is the data doesn't get back to the client.

Here's my devctl() server function.

int io_devctl (resmgr_context_t *ctp, io_devctl_t *msg, RESMGR_OCB_T *ocb)
{
    int status;
    CIOLIB_DEVICE *param;
    
    if ((status = iofunc_devctl_default (ctp, msg, ocb)) != _RESMGR_DEFAULT)
        return (status);
    
    param = _DEVCTL_DATA(msg->i);
    switch (msg->i.dcmd)
    {
        case CIOLIB_GET_DEVICE:
            memcpy (¶m->dev_info, board[param->index], sizeof (struct pci_dev_info));
            msg->o.ret_val = 0; 
            break;
            
         default:
            return EINVAL;
    }
    return 0;
}

CIOLIB_DEVICE is declared as:
typedef struct {
    int               index;
    pci_dev_info dev_info;
}

CIOLIB_GET_DEVICE is declared as a __DIOTF control code so I can pass data in as well as out.

In the client I set the dev_info structure to a fixed value.  When it gets to io_devctl() it has that value.  Right 
after the memcpy(), dev_info has the correct data.  But when it gets back to the client it hasn't changed.  It's still 
the original preset value.

I"m baffled.  What am I missing?

Thanks,

Doug