Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
a4cd1845
Commit
a4cd1845
authored
Jul 18, 2007
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SPARC64]: Handle reset events in vio_link_state_change().
Signed-off-by:
David S. Miller
<
davem@davemloft.net
>
parent
8a2950cc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
29 additions
and
0 deletions
+29
-0
arch/sparc64/kernel/viohs.c
arch/sparc64/kernel/viohs.c
+29
-0
No files found.
arch/sparc64/kernel/viohs.c
View file @
a4cd1845
...
...
@@ -78,6 +78,23 @@ static int start_handshake(struct vio_driver_state *vio)
return
0
;
}
static
void
flush_rx_dring
(
struct
vio_driver_state
*
vio
)
{
struct
vio_dring_state
*
dr
;
u64
ident
;
BUG_ON
(
!
(
vio
->
dr_state
&
VIO_DR_STATE_RXREG
));
dr
=
&
vio
->
drings
[
VIO_DRIVER_RX_RING
];
ident
=
dr
->
ident
;
BUG_ON
(
!
vio
->
desc_buf
);
kfree
(
vio
->
desc_buf
);
memset
(
dr
,
0
,
sizeof
(
*
dr
));
dr
->
ident
=
ident
;
}
void
vio_link_state_change
(
struct
vio_driver_state
*
vio
,
int
event
)
{
if
(
event
==
LDC_EVENT_UP
)
{
...
...
@@ -98,6 +115,16 @@ void vio_link_state_change(struct vio_driver_state *vio, int event)
break
;
}
start_handshake
(
vio
);
}
else
if
(
event
==
LDC_EVENT_RESET
)
{
vio
->
hs_state
=
VIO_HS_INVALID
;
if
(
vio
->
dr_state
&
VIO_DR_STATE_RXREG
)
flush_rx_dring
(
vio
);
vio
->
dr_state
=
0x00
;
memset
(
&
vio
->
ver
,
0
,
sizeof
(
vio
->
ver
));
ldc_disconnect
(
vio
->
lp
);
}
}
EXPORT_SYMBOL
(
vio_link_state_change
);
...
...
@@ -396,6 +423,8 @@ static int process_dreg_info(struct vio_driver_state *vio,
if
(
vio
->
dr_state
&
VIO_DR_STATE_RXREG
)
goto
send_nack
;
BUG_ON
(
vio
->
desc_buf
);
vio
->
desc_buf
=
kzalloc
(
pkt
->
descr_size
,
GFP_ATOMIC
);
if
(
!
vio
->
desc_buf
)
goto
send_nack
;
...
...
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