Problems registering drivers capabilities to io-net.
The registration function doesn’t seem to be working,
when I have the registration function commented out it loads into io-net, but not when it’s part of the code.
Here’s the code related to our register function.
// functions that we supply
io_net_registrant_funcs_t ipf_funcs =
{
9, // nfuncs
ipf_recvd_arp, // rx_up()
ipf_recvd_ip, // rx_down()
ipf_recv_complete, // tx_done()
ipf_shutdown1, // shutdown1()
ipf_shutdown2, // shutdown2()
ipf_advertise, // dl_advert()
NULL, // devctl()
ipf_flush, // flush()
NULL // raw_open()
};
void *func_hdl; //pointer to our function handle
//a description of our filter
io_net_registrant_t ipf_entry =
{
_REG_FILTER_BELOW, //sit below down producer and above the top end of a converter
“nfm-ipf.so”, //our name
“ip”, //our top type
“en”, //our bottom type
&func_hdl, //pointer to function table
&ipf_funcs, //pointer to our functions
0 //number of dependencies
};
int ipf_reg_hdl;
uint16_t ipf_cell;
uint16_t ipf_endpoint;
void *ipf_dll_hdl; //pointer to ipf handle used by io-net
io_net_self_t *ipf_ion; //pointer to structure of io-net functions
//---------------FUNCTIONS
//ipf’s registration function, registers device with io-net
static int ipf_register_filter(void)
{
if((*ipf_ion->reg)(ipf_dll_hdl,
&ipf_entry,
&ipf_reg_hdl,
&ipf_cell,
&ipf_endpoint) < 0)
{
return(0); //failed
}
return(1); //success
}
the above is the function that is called in our initialization function. I would guess that it has something to do with the ipf_entry structure, since ipf_reg_hdl, ipf_cell, and ipf_endpoint are filled in
by io-net when the ipf->reg() function is called. Also to mention, the ipf_dll_hdl is assigned the dll_hdl in the init function before the above function is called.
ex.
int our_init(void *dll_hdl,…)
{
ipf_dll_hdl = dll_hdl;
if(!ipf_register_filter(void);
{
return(-1); //failed
}
return(0); //success
}
Using QNX RTOS v6a.
Help would be greatly appreciated…
Thanks,
QNX SLC Project Group