Commit 560400cb authored by 's avatar

added device file descriptor in struct hwinfo


git-svn-id: file:///home/svn/mapi/trunk@1260 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 2c91bfe3
......@@ -129,6 +129,7 @@ int mapidrv_add_device(const char *devname, int file,int devid, global_function_
i->file=file;
i->th_proc=0;
i->hwinfo.offline=0;
i->hwinfo.devfd=i->dagfd;
i->hwinfo.gflist=gflist;
i->hwinfo.pkt_drop=0;
i->offline_status = olstatus;
......@@ -519,8 +520,10 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
ERROR_CMD(fprintf (stderr, "dag_open %s: %s [%s:%d]\n", i->name, strerror (errno),__FILE__,__LINE__));
return DAGDRV_OPEN_ERR;
}
i->hwinfo.devfd=i->dagfd;
if(dag_attach_stream(i->dagfd,i->dagstream, 0, 0) < 0)
if(dag_attach_stream(i->dagfd,i->dagstream, 0, 0) < 0)
dagutil_panic("dag_attach_stream %s:%u: %s\n", i->dagname, i->dagstream, strerror(errno));
if(dag_start_stream(i->dagfd, i->dagstream) < 0)
......
......@@ -89,6 +89,7 @@ typedef struct mapid_hw_info {
//3 finished offline flow
//4 if old-fashioned offline
int devid; //Device ID set by mapid
int devfd; //file descriptor for hardware device
global_function_list_t *gflist; //Global function list
void *adapterinfo; //Pointer to adapter specific information
} mapid_hw_info_t;
......
......@@ -88,6 +88,7 @@ int mapidrv_add_device(const char *devname, int file,int devid, global_function_
i->file=file;
i->th_proc=0;
i->hwinfo.offline=0;
i->hwinfo.devfd=-1;
i->hwinfo.gflist=gflist;
i->hwinfo.pkt_drop=0;
i->offline_status = olstatus;
......@@ -418,7 +419,8 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
ERROR_CMD(fprintf(stderr,"pcap_open_live: %s [%s:%d]\n",errbuf,__FILE__,__LINE__));
return PCAP_OPEN_ERR;
}
i->hwinfo.devfd=pcap_fileno(i->pcap);
i->hwinfo.link_type = pcap_datalink(i->pcap);
i->hwinfo.cap_length = pcap_snapshot(i->pcap);
i->hwinfo.devid=i->id;
......
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