Commit b92fa332 authored by Arne Øslebø's avatar Arne Øslebø
Browse files

fixed create_offline_flow

git-svn-id: file:///home/svn/mapi/trunk@884 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 733751ac
......@@ -361,8 +361,6 @@ mapidrv_create_offline_flow (int devid, int format,int fd,char **devtype)
i->hwinfo.offline=4;
if(format==MFF_DAG_ERF) {
//This should be read from the file
i->hwinfo.link_type=DLT_EN10MB;
i->hwinfo.cap_length=1500;
i->hwinfo.devtype=MAPI_DEVICE_DAG;
i->hwinfo.devid=i->id;
......@@ -395,8 +393,6 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
*devtype=MAPI_DEVICE_DAG;
inst->hwinfo.offline=1;
//This should be read from the file
inst->hwinfo.link_type=DLT_EN10MB;
inst->hwinfo.cap_length=1500;
inst->hwinfo.devtype=MAPI_DEVICE_DAG;
inst->hwinfo.devid=inst->id;
......@@ -519,10 +515,27 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
int
mapidrv_connect (int devid,int fd)
{
int ret;
dag_instance_t *i=flist_get(devlist,devid);
if(i==NULL)
return -1;
return mapid_connect(&i->mapidlib,fd);
ret=mapid_connect(&i->mapidlib,fd);
if(i->hwinfo.offline==4) {
if (pthread_attr_init (&i->th_attr) != 0)
{
ERROR_CMD(fprintf (stderr, "pthread_attr_init failed [%s:%d]\n",__FILE__,__LINE__));
return NICDRV_PTHR_ERR;
}
if (pthread_create
(&i->th_proc, &i->th_attr, (void *) mapidrv_offline_proc_loop, (void *)i->id) != 0)
{
ERROR_CMD(fprintf (stderr, "pthread_create failed [%s:%d]\n",__FILE__,__LINE__));
return NICDRV_PTHR_ERR;
}
}
return ret;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment