Commit 8b7a7fc6 authored by Jon Kåre Hellan's avatar Jon Kåre Hellan
Browse files

Port to ENDACE DAG API ver 2.5.5r1


git-svn-id: file:///home/svn/mapi/branches/mapi_1.0@203 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent 480e85e4
......@@ -319,9 +319,13 @@ mapidrv_create_offline_flow (int devid, int format,int fd,char **devtype)
int
mapidrv_create_flow (int devid, int fd, char **devtype)
{
daggpp_t *gpp;
volatile uint8_t *dagiom;
volatile daggpp_t *gpp;
dag_instance_t *i;
unsigned slen=0;
dag_reg_t *regs;
uint32_t regn, gpp_base;
dag_reg_t result[DAG_REG_MAX_ENTRIES];
if(devid<0)
{
......@@ -364,9 +368,20 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
i->hwinfo.cap_length=0;
/* memory mapped area */
gpp=(daggpp_t *) (dag_iom(i->dagfd)+dag_info(i->dagfd)->gpp_base);
slen=gpp->snaplen;
regs = dag_regs (i->dagfd);
regn = 0;
if ((dag_reg_table_find(regs, 0, DAG_REG_GPP, result, &regn)) || (!regn))
gpp_base = 0;
else
gpp_base = DAG_REG_ADDR(*result);
if (gpp_base) {
/* memory mapped area */
dagiom = dag_iom(i->dagfd);
if (((*(volatile uint32_t *)dagiom >> 16) & 0xff) != 0x03) {
gpp = (daggpp_t *) (dagiom + gpp_base); /* WARNING: race */
slen = gpp->snaplen;
}
}
i->hwinfo.cap_length=slen;
if (i->hwinfo.cap_length==0) {
......
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