Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
9be6f0d4
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
6
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
9be6f0d4
编写于
5月 06, 2009
作者:
J
John W. Linville
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rtl8187: use DMA-aware buffers with usb_control_msg
Signed-off-by:
N
John W. Linville
<
linville@tuxdriver.com
>
上级
621ad7c9
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
62 addition
and
16 deletion
+62
-16
drivers/net/wireless/rtl818x/rtl8187.h
drivers/net/wireless/rtl818x/rtl8187.h
+43
-14
drivers/net/wireless/rtl818x/rtl8187_dev.c
drivers/net/wireless/rtl818x/rtl8187_dev.c
+12
-1
drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
+7
-1
未找到文件。
drivers/net/wireless/rtl818x/rtl8187.h
浏览文件 @
9be6f0d4
...
...
@@ -120,6 +120,12 @@ struct rtl8187_priv {
__le64
buf
;
struct
sk_buff_head
queue
;
}
b_tx_status
;
/* This queue is used by both -b and non-b devices */
struct
mutex
io_mutex
;
union
{
u8
bits8
;
__le16
bits16
;
__le32
bits32
;
}
*
io_dmabuf
;
};
void
rtl8187_write_phy
(
struct
ieee80211_hw
*
dev
,
u8
addr
,
u32
data
);
...
...
@@ -129,10 +135,14 @@ static inline u8 rtl818x_ioread8_idx(struct rtl8187_priv *priv,
{
u8
val
;
mutex_lock
(
&
priv
->
io_mutex
);
usb_control_msg
(
priv
->
udev
,
usb_rcvctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_GET_REG
,
RTL8187_REQT_READ
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
val
,
sizeof
(
val
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits8
,
sizeof
(
val
),
HZ
/
2
);
val
=
priv
->
io_dmabuf
->
bits8
;
mutex_unlock
(
&
priv
->
io_mutex
);
return
val
;
}
...
...
@@ -147,10 +157,14 @@ static inline u16 rtl818x_ioread16_idx(struct rtl8187_priv *priv,
{
__le16
val
;
mutex_lock
(
&
priv
->
io_mutex
);
usb_control_msg
(
priv
->
udev
,
usb_rcvctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_GET_REG
,
RTL8187_REQT_READ
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
val
,
sizeof
(
val
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits16
,
sizeof
(
val
),
HZ
/
2
);
val
=
priv
->
io_dmabuf
->
bits16
;
mutex_unlock
(
&
priv
->
io_mutex
);
return
le16_to_cpu
(
val
);
}
...
...
@@ -165,10 +179,14 @@ static inline u32 rtl818x_ioread32_idx(struct rtl8187_priv *priv,
{
__le32
val
;
mutex_lock
(
&
priv
->
io_mutex
);
usb_control_msg
(
priv
->
udev
,
usb_rcvctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_GET_REG
,
RTL8187_REQT_READ
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
val
,
sizeof
(
val
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits32
,
sizeof
(
val
),
HZ
/
2
);
val
=
priv
->
io_dmabuf
->
bits32
;
mutex_unlock
(
&
priv
->
io_mutex
);
return
le32_to_cpu
(
val
);
}
...
...
@@ -181,10 +199,15 @@ static inline u32 rtl818x_ioread32(struct rtl8187_priv *priv, __le32 *addr)
static
inline
void
rtl818x_iowrite8_idx
(
struct
rtl8187_priv
*
priv
,
u8
*
addr
,
u8
val
,
u8
idx
)
{
mutex_lock
(
&
priv
->
io_mutex
);
priv
->
io_dmabuf
->
bits8
=
val
;
usb_control_msg
(
priv
->
udev
,
usb_sndctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_SET_REG
,
RTL8187_REQT_WRITE
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
val
,
sizeof
(
val
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits8
,
sizeof
(
val
),
HZ
/
2
);
mutex_unlock
(
&
priv
->
io_mutex
);
}
static
inline
void
rtl818x_iowrite8
(
struct
rtl8187_priv
*
priv
,
u8
*
addr
,
u8
val
)
...
...
@@ -195,12 +218,15 @@ static inline void rtl818x_iowrite8(struct rtl8187_priv *priv, u8 *addr, u8 val)
static
inline
void
rtl818x_iowrite16_idx
(
struct
rtl8187_priv
*
priv
,
__le16
*
addr
,
u16
val
,
u8
idx
)
{
__le16
buf
=
cpu_to_le16
(
val
);
mutex_lock
(
&
priv
->
io_mutex
);
priv
->
io_dmabuf
->
bits16
=
cpu_to_le16
(
val
);
usb_control_msg
(
priv
->
udev
,
usb_sndctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_SET_REG
,
RTL8187_REQT_WRITE
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
buf
,
sizeof
(
buf
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits16
,
sizeof
(
val
),
HZ
/
2
);
mutex_unlock
(
&
priv
->
io_mutex
);
}
static
inline
void
rtl818x_iowrite16
(
struct
rtl8187_priv
*
priv
,
__le16
*
addr
,
...
...
@@ -212,12 +238,15 @@ static inline void rtl818x_iowrite16(struct rtl8187_priv *priv, __le16 *addr,
static
inline
void
rtl818x_iowrite32_idx
(
struct
rtl8187_priv
*
priv
,
__le32
*
addr
,
u32
val
,
u8
idx
)
{
__le32
buf
=
cpu_to_le32
(
val
);
mutex_lock
(
&
priv
->
io_mutex
);
priv
->
io_dmabuf
->
bits32
=
cpu_to_le32
(
val
);
usb_control_msg
(
priv
->
udev
,
usb_sndctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_SET_REG
,
RTL8187_REQT_WRITE
,
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
buf
,
sizeof
(
buf
),
HZ
/
2
);
(
unsigned
long
)
addr
,
idx
&
0x03
,
&
priv
->
io_dmabuf
->
bits32
,
sizeof
(
val
),
HZ
/
2
);
mutex_unlock
(
&
priv
->
io_mutex
);
}
static
inline
void
rtl818x_iowrite32
(
struct
rtl8187_priv
*
priv
,
__le32
*
addr
,
...
...
drivers/net/wireless/rtl818x/rtl8187_dev.c
浏览文件 @
9be6f0d4
...
...
@@ -1329,6 +1329,14 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
priv
=
dev
->
priv
;
priv
->
is_rtl8187b
=
(
id
->
driver_info
==
DEVICE_RTL8187B
);
/* allocate "DMA aware" buffer for register accesses */
priv
->
io_dmabuf
=
kmalloc
(
sizeof
(
*
priv
->
io_dmabuf
),
GFP_KERNEL
);
if
(
!
priv
->
io_dmabuf
)
{
err
=
-
ENOMEM
;
goto
err_free_dev
;
}
mutex_init
(
&
priv
->
io_mutex
);
SET_IEEE80211_DEV
(
dev
,
&
intf
->
dev
);
usb_set_intfdata
(
intf
,
dev
);
priv
->
udev
=
udev
;
...
...
@@ -1495,7 +1503,7 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
err
=
ieee80211_register_hw
(
dev
);
if
(
err
)
{
printk
(
KERN_ERR
"rtl8187: Cannot register device
\n
"
);
goto
err_free_d
ev
;
goto
err_free_d
mabuf
;
}
mutex_init
(
&
priv
->
conf_mutex
);
skb_queue_head_init
(
&
priv
->
b_tx_status
.
queue
);
...
...
@@ -1506,6 +1514,8 @@ static int __devinit rtl8187_probe(struct usb_interface *intf,
return
0
;
err_free_dmabuf:
kfree
(
priv
->
io_dmabuf
);
err_free_dev:
ieee80211_free_hw
(
dev
);
usb_set_intfdata
(
intf
,
NULL
);
...
...
@@ -1526,6 +1536,7 @@ static void __devexit rtl8187_disconnect(struct usb_interface *intf)
priv
=
dev
->
priv
;
usb_reset_device
(
priv
->
udev
);
usb_put_dev
(
interface_to_usbdev
(
intf
));
kfree
(
priv
->
io_dmabuf
);
ieee80211_free_hw
(
dev
);
}
...
...
drivers/net/wireless/rtl818x/rtl8187_rtl8225.c
浏览文件 @
9be6f0d4
...
...
@@ -88,9 +88,15 @@ static void rtl8225_write_8051(struct ieee80211_hw *dev, u8 addr, __le16 data)
rtl818x_iowrite16
(
priv
,
&
priv
->
map
->
RFPinsOutput
,
reg80
);
udelay
(
10
);
mutex_lock
(
&
priv
->
io_mutex
);
priv
->
io_dmabuf
->
bits16
=
data
;
usb_control_msg
(
priv
->
udev
,
usb_sndctrlpipe
(
priv
->
udev
,
0
),
RTL8187_REQ_SET_REG
,
RTL8187_REQT_WRITE
,
addr
,
0x8225
,
&
data
,
sizeof
(
data
),
HZ
/
2
);
addr
,
0x8225
,
&
priv
->
io_dmabuf
->
bits16
,
sizeof
(
data
),
HZ
/
2
);
mutex_unlock
(
&
priv
->
io_mutex
);
rtl818x_iowrite16
(
priv
,
&
priv
->
map
->
RFPinsOutput
,
reg80
|
(
1
<<
2
));
udelay
(
10
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录