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
5731d7b3
Commit
5731d7b3
authored
Oct 09, 2013
by
Robert Stonehouse
Committed by
Ben Hutchings
Dec 06, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sfc: Refactor efx_mcdi_poll() by introducing efx_mcdi_poll_once()
Signed-off-by:
Ben Hutchings
<
bhutchings@solarflare.com
>
parent
2ec03014
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
6 deletions
+17
-6
drivers/net/ethernet/sfc/mcdi.c
drivers/net/ethernet/sfc/mcdi.c
+17
-6
No files found.
drivers/net/ethernet/sfc/mcdi.c
View file @
5731d7b3
...
@@ -50,6 +50,7 @@ struct efx_mcdi_async_param {
...
@@ -50,6 +50,7 @@ struct efx_mcdi_async_param {
static
void
efx_mcdi_timeout_async
(
unsigned
long
context
);
static
void
efx_mcdi_timeout_async
(
unsigned
long
context
);
static
int
efx_mcdi_drv_attach
(
struct
efx_nic
*
efx
,
bool
driver_operating
,
static
int
efx_mcdi_drv_attach
(
struct
efx_nic
*
efx
,
bool
driver_operating
,
bool
*
was_attached_out
);
bool
*
was_attached_out
);
static
bool
efx_mcdi_poll_once
(
struct
efx_nic
*
efx
);
static
inline
struct
efx_mcdi_iface
*
efx_mcdi
(
struct
efx_nic
*
efx
)
static
inline
struct
efx_mcdi_iface
*
efx_mcdi
(
struct
efx_nic
*
efx
)
{
{
...
@@ -237,6 +238,21 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx)
...
@@ -237,6 +238,21 @@ static void efx_mcdi_read_response_header(struct efx_nic *efx)
}
}
}
}
static
bool
efx_mcdi_poll_once
(
struct
efx_nic
*
efx
)
{
struct
efx_mcdi_iface
*
mcdi
=
efx_mcdi
(
efx
);
rmb
();
if
(
!
efx
->
type
->
mcdi_poll_response
(
efx
))
return
false
;
spin_lock_bh
(
&
mcdi
->
iface_lock
);
efx_mcdi_read_response_header
(
efx
);
spin_unlock_bh
(
&
mcdi
->
iface_lock
);
return
true
;
}
static
int
efx_mcdi_poll
(
struct
efx_nic
*
efx
)
static
int
efx_mcdi_poll
(
struct
efx_nic
*
efx
)
{
{
struct
efx_mcdi_iface
*
mcdi
=
efx_mcdi
(
efx
);
struct
efx_mcdi_iface
*
mcdi
=
efx_mcdi
(
efx
);
...
@@ -272,18 +288,13 @@ static int efx_mcdi_poll(struct efx_nic *efx)
...
@@ -272,18 +288,13 @@ static int efx_mcdi_poll(struct efx_nic *efx)
time
=
jiffies
;
time
=
jiffies
;
rmb
();
if
(
efx_mcdi_poll_once
(
efx
))
if
(
efx
->
type
->
mcdi_poll_response
(
efx
))
break
;
break
;
if
(
time_after
(
time
,
finish
))
if
(
time_after
(
time
,
finish
))
return
-
ETIMEDOUT
;
return
-
ETIMEDOUT
;
}
}
spin_lock_bh
(
&
mcdi
->
iface_lock
);
efx_mcdi_read_response_header
(
efx
);
spin_unlock_bh
(
&
mcdi
->
iface_lock
);
/* Return rc=0 like wait_event_timeout() */
/* Return rc=0 like wait_event_timeout() */
return
0
;
return
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