Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arne Øslebø
mapi
Commits
d5d83b52
Commit
d5d83b52
authored
Mar 02, 2009
by
Browse files
Corrected order of function calls
git-svn-id:
file:///home/svn/mapi/trunk@1480
8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent
7c0f7d51
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/drivers/mapinapatechdrv.c
View file @
d5d83b52
...
...
@@ -422,7 +422,9 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
}
channelsBitmask
=
cardCapabilities
.
totalChannelsBitmask
;
if
(
NTCI_CardIdentification
(
i
->
napatechhandle
)
==
NT_CARD_TYPE
)
{
/* Check if we need to use NTPL to set up feeds. */
if
((
result
=
NTCI_GetCapabilities
(
i
->
napatechhandle
,
CAPID_VERSION
,
...
...
@@ -460,6 +462,8 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
return
;
}
}
/* if (NTCI_CardIdentification(i->napatechhandle)==NT_CARD_TYPE) */
i
->
hwinfo
.
devtype
=
MAPI_DEVICE_NAPATECH
;
i
->
hwinfo
.
devid
=
i
->
id
;
i
->
hwinfo
.
pkts
=
0
;
...
...
@@ -480,29 +484,6 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
return
-
1
;
}
if
(
channelsBitmask
==
0
)
{
PassFilter_t
command
;
command
.
WriteHW
=
TRUE
;
sprintf
(
command
.
achFilterString
,
"Capture[Priority=0;Feed=0]=ALL"
);
/* TODO - preclasification ^^^ */
if
((
result
=
NTCI_PacketClassification
(
i
->
napatechhandle
,
STID_PASS_FILTER
,
&
command
))
!=
NTCI_ERRCODE_SUCCESS
)
{
FilterError_t
error
;
result
=
NTCI_PacketClassification
(
i
->
napatechhandle
,
STID_GET_FILTER_ERROR
,
&
error
);
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError1
));
// stderr
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError2
));
// stderr
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError3
));
// stderr
NTCI_CloseCard
(
i
->
napatechhandle
);
return
-
1
;
}
}
/* Create the packet feed.
*
...
...
@@ -540,8 +521,36 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
return
-
1
;
}
if
(
channelsBitmask
==
0
)
{
PassFilter_t
command
;
command
.
WriteHW
=
TRUE
;
sprintf
(
command
.
achFilterString
,
"Capture[Priority=0;Feed=0]=ALL"
);
/* TODO - preclasification ^^^ */
if
((
result
=
NTCI_PacketClassification
(
i
->
napatechhandle
,
STID_PASS_FILTER
,
&
command
))
!=
NTCI_ERRCODE_SUCCESS
)
{
FilterError_t
error
;
result
=
NTCI_PacketClassification
(
i
->
napatechhandle
,
STID_GET_FILTER_ERROR
,
&
error
);
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError1
));
// stderr
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError2
));
// stderr
DEBUG_CMD
(
Debug_Message
(
"%s
\n
"
,
error
.
achFilterError3
));
// stderr
NTCI_CloseCard
(
i
->
napatechhandle
);
return
-
1
;
}
}
// i->packetfeedhandle = packetFeedHandle;
if
((
result
=
NTCI_StartPacketFeed
(
i
->
napatechhandle
,
i
->
packetfeedhandle
))
!=
NTCI_ERRCODE_SUCCESS
)
{
DEBUG_CMD
(
Debug_Message
(
"Error while starting packet feed (%i)
\n
"
,
result
));
// stderr
NTCI_CloseCard
(
i
->
napatechhandle
);
return
-
1
;
}
/* find the location of the feed buffer where new
* data will be stored */
if
((
result
=
NTCI_GetPacketFeedBuffers
(
i
->
napatechhandle
,
...
...
@@ -552,12 +561,7 @@ mapidrv_create_flow (int devid, int fd, char **devtype)
NTCI_CloseCard
(
i
->
napatechhandle
);
return
-
1
;
}
if
((
result
=
NTCI_StartPacketFeed
(
i
->
napatechhandle
,
i
->
packetfeedhandle
))
!=
NTCI_ERRCODE_SUCCESS
)
{
DEBUG_CMD
(
Debug_Message
(
"Error while starting packet feed (%i)
\n
"
,
result
));
// stderr
NTCI_CloseCard
(
i
->
napatechhandle
);
return
-
1
;
}
//Start processing thread
if
(
pthread_attr_init
(
&
i
->
th_attr
)
!=
0
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment