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
Kirill Smelkov
linux
Commits
14b80ba2
Commit
14b80ba2
authored
Sep 30, 2020
by
Felix Fietkau
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mt76: mt7603: switch to .mcu_skb_send_msg
Reduces code duplication Signed-off-by:
Felix Fietkau
<
nbd@nbd.name
>
parent
64537a02
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
37 deletions
+6
-37
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
+6
-37
No files found.
drivers/net/wireless/mediatek/mt76/mt7603/mcu.c
View file @
14b80ba2
...
...
@@ -36,14 +36,16 @@ mt7603_mcu_parse_response(struct mt76_dev *mdev, int cmd,
}
static
int
__mt7603_mcu_msg_send
(
struct
mt7603_dev
*
dev
,
struct
sk_buff
*
skb
,
int
cmd
,
int
*
wait_seq
)
mt7603_mcu_skb_send_msg
(
struct
mt76_dev
*
m
dev
,
struct
sk_buff
*
skb
,
int
cmd
,
int
*
wait_seq
)
{
struct
mt7603_dev
*
dev
=
container_of
(
mdev
,
struct
mt7603_dev
,
mt76
);
int
hdrlen
=
dev
->
mcu_running
?
sizeof
(
struct
mt7603_mcu_txd
)
:
12
;
struct
mt76_dev
*
mdev
=
&
dev
->
mt76
;
struct
mt7603_mcu_txd
*
txd
;
u8
seq
;
mdev
->
mcu
.
timeout
=
3
*
HZ
;
seq
=
++
mdev
->
mcu
.
msg_seq
&
0xf
;
if
(
!
seq
)
seq
=
++
mdev
->
mcu
.
msg_seq
&
0xf
;
...
...
@@ -74,39 +76,6 @@ __mt7603_mcu_msg_send(struct mt7603_dev *dev, struct sk_buff *skb,
return
mt76_tx_queue_skb_raw
(
dev
,
MT_TXQ_MCU
,
skb
,
0
);
}
static
int
mt7603_mcu_msg_send
(
struct
mt76_dev
*
mdev
,
int
cmd
,
const
void
*
data
,
int
len
,
bool
wait_resp
)
{
struct
mt7603_dev
*
dev
=
container_of
(
mdev
,
struct
mt7603_dev
,
mt76
);
unsigned
long
expires
=
jiffies
+
3
*
HZ
;
struct
sk_buff
*
skb
;
int
ret
,
seq
;
skb
=
mt76_mcu_msg_alloc
(
mdev
,
data
,
len
);
if
(
!
skb
)
return
-
ENOMEM
;
mutex_lock
(
&
mdev
->
mcu
.
mutex
);
ret
=
__mt7603_mcu_msg_send
(
dev
,
skb
,
cmd
,
&
seq
);
if
(
ret
)
goto
out
;
while
(
wait_resp
)
{
skb
=
mt76_mcu_get_response
(
&
dev
->
mt76
,
expires
);
ret
=
mt7603_mcu_parse_response
(
mdev
,
cmd
,
skb
,
seq
);
dev_kfree_skb
(
skb
);
if
(
ret
!=
-
EAGAIN
)
break
;
}
out:
mutex_unlock
(
&
mdev
->
mcu
.
mutex
);
return
ret
;
}
static
int
mt7603_mcu_init_download
(
struct
mt7603_dev
*
dev
,
u32
addr
,
u32
len
)
{
...
...
@@ -271,7 +240,7 @@ int mt7603_mcu_init(struct mt7603_dev *dev)
{
static
const
struct
mt76_mcu_ops
mt7603_mcu_ops
=
{
.
headroom
=
sizeof
(
struct
mt7603_mcu_txd
),
.
mcu_s
end_msg
=
mt7603_mcu_msg_send
,
.
mcu_s
kb_send_msg
=
mt7603_mcu_skb_send_msg
,
.
mcu_parse_response
=
mt7603_mcu_parse_response
,
.
mcu_restart
=
mt7603_mcu_restart
,
};
...
...
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