Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
extctrl2014
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
extctrl2014
Commits
8ad47a57
Commit
8ad47a57
authored
8 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Added non-functional code for driver unload.
parent
722a5f16
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mc/hijacknet_fei.mc.c
+49
-30
49 additions, 30 deletions
mc/hijacknet_fei.mc.c
with
49 additions
and
30 deletions
mc/hijacknet_fei.mc.c
+
49
−
30
View file @
8ad47a57
...
...
@@ -392,7 +392,6 @@ static void hijackedInt(DRV_CTRL *pDrvCtrl)
tag
=
&
pDrvCtrl
->
rbdTags
[
hijack
[
unit
].
irqRbdIndex
])
{
unsigned
char
*
data
;
int
length
,
newlength
,
ether_type
;
// struct hijacknet_hook *hook;
data
=
(
unsigned
char
*
)
tag
->
pMblk
->
mBlkHdr
.
mData
;
length
=
status
&
0x3fff
;
...
...
@@ -577,54 +576,67 @@ static int fei_hijacknet_send(HIJACKNET_DRIVER *driver,
}
static
int
fei_hijacknet_close
(
HIJACKNET_DRIVER
*
driver
)
{
printf
(
"IMPLEMENT %s
\n
"
,
__FUNCTION__
);
#if 0
int hijacknet_uninstall(int unit)
{
int
result
=
0
;
END_OBJ *interface;
int
old_level
;
struct
hijack
*
hijack
;
DRV_CTRL
*
drv
;
VOIDFUNCPTR
*
vector
;
int old_level;
if (unit < 0 || unit >= NUM_INTERFACES) {
printf("Index out of bounds %d\n", unit);
printf
(
"NOT USING new %s (driver still stuck in memory)
\n
"
,
__FUNCTION__
);
goto
out
;
hijack
=
driver_to_hijack
(
driver
);
if
(
hijack
==
NULL
)
{
result
=
1
;
goto
out
;
}
interface = endFindByName("fei", unit);
if (interface == NULL) {
printf("Failed to find fei%d\n", unit);
drv
=
hijack
->
drv
;
vector
=
INUM_TO_IVEC
(
drv
->
board
.
vector
);
old_level
=
intLock
();
hijack
->
active
--
;
if
(
hijack
->
active
>
0
)
{
/* Somebody else has driver open */
result
=
2
;
goto out;
goto
out
_unlock
;
}
drv = (DRV_CTRL*)interface;
vector = INUM_TO_IVEC (drv->board.vector);
if (pciIntDisconnect2(vector, hijack_irq_handler, (int)drv) != 0) {
printf("Failed to disconnect hijack_irq_handler from fei%d\n", unit);
if
(
pciIntDisconnect2
(
vector
,
hijackedInt
,
(
int
)
drv
)
!=
0
)
{
result
=
3
;
goto out;
goto
out
_unlock
;
}
old_level = intLock();
hijack[unit].active = 0;
hijack[unit].receive_hook = NULL;
hijack[unit].send_hook = NULL;
intUnlock(old_level);
drv
->
endObj
.
pFuncTable
=
hijack
->
origNetFuncs
;
pciIntConnect
(
vector
,
fei82557Int
,
(
int
)
drv
);
printf("fei%d connected to fei82557Int\n", unit)
;
result
=
4
;
out_unlock:
intUnlock
(
old_level
);
out:
return result;
switch
(
result
)
{
case
1
:
{
printf
(
"No corresponding hijack for driver %p
\n
"
,
driver
);
}
break
;
case
2
:
{
printf
(
"More processes using hijack driver
\n
"
);
}
break
;
case
3
:
{
printf
(
"Failed to disconnect hijack_irq_handler from fei
\n
"
);
}
break
;
case
4
:
{
printf
(
"fei reconnected to fei82557Int
\n
"
);
}
break
;
default:
{
printf
(
"Unknown result %d
\n
"
,
result
);
}
break
;
}
#endif
return
0
;
return
result
;
}
HIJACKNET_DRIVER
*
fei_hijacknet_open
(
int
unit
)
{
HIJACKNET_DRIVER
*
result
=
NULL
;
int
error
=
0
;
int
error
=
0
,
info
=
0
;
END_OBJ
*
interface
;
DRV_CTRL
*
drv
;
VOIDFUNCPTR
*
vector
;
...
...
@@ -639,6 +651,11 @@ HIJACKNET_DRIVER *fei_hijacknet_open(int unit)
goto
out
;
}
result
=
&
hijack
[
unit
].
driver
;
if
(
hijack
[
unit
].
active
>=
1
)
{
snprintf
(
msg
,
sizeof
(
msg
),
"Locking hijack driver fei%d in memory
\n
"
,
unit
);
info
=
1
;
goto
out
;
}
hijack
[
unit
].
active
++
;
if
(
hijack
[
unit
].
active
>
1
)
{
/* device has already been successfully opened */
...
...
@@ -691,7 +708,9 @@ error_out:
hijack
[
unit
].
active
--
;
out:
intUnlock
(
old_level
);
if
(
error
)
{
if
(
info
)
{
printf
(
"%s"
,
msg
);
}
else
if
(
error
)
{
printf
(
"%s"
,
msg
);
result
=
NULL
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment