Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
eaf83e39
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
eaf83e39
编写于
1月 29, 2009
作者:
D
David Woodhouse
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
solos: Tidy up DMA handling a little. Still untested
Signed-off-by:
N
David Woodhouse
<
David.Woodhouse@intel.com
>
上级
90937231
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
42 deletion
+53
-42
drivers/atm/solos-pci.c
drivers/atm/solos-pci.c
+53
-42
未找到文件。
drivers/atm/solos-pci.c
浏览文件 @
eaf83e39
...
...
@@ -68,6 +68,8 @@
#define RX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2)
#define TX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2 + BUF_SIZE)
#define RX_DMA_SIZE 2048
static
int
debug
=
0
;
static
int
atmdebug
=
0
;
static
int
firmware_upgrade
=
0
;
...
...
@@ -608,17 +610,11 @@ void solos_bh(unsigned long card_arg)
if
(
card
->
using_dma
)
{
skb
=
card
->
rx_skb
[
port
];
pci_unmap_single
(
card
->
dev
,
SKB_CB
(
skb
)
->
dma_addr
,
skb
->
len
,
PCI_DMA_FROMDEVICE
);
card
->
rx_skb
[
port
]
=
alloc_skb
(
2048
,
GFP_ATOMIC
);
if
(
card
->
rx_skb
[
port
])
{
SKB_CB
(
card
->
rx_skb
[
port
])
->
dma_addr
=
pci_map_single
(
card
->
dev
,
skb
->
data
,
skb
->
len
,
PCI_DMA_FROMDEVICE
);
iowrite32
(
SKB_CB
(
card
->
rx_skb
[
port
])
->
dma_addr
,
card
->
config_regs
+
RX_DMA_ADDR
(
port
));
}
card
->
rx_skb
[
port
]
=
NULL
;
pci_unmap_single
(
card
->
dev
,
SKB_CB
(
skb
)
->
dma_addr
,
RX_DMA_SIZE
,
PCI_DMA_FROMDEVICE
);
header
=
(
void
*
)
skb
->
data
;
size
=
le16_to_cpu
(
header
->
size
);
skb_put
(
skb
,
size
+
sizeof
(
*
header
));
...
...
@@ -669,7 +665,7 @@ void solos_bh(unsigned long card_arg)
case
PKT_STATUS
:
process_status
(
card
,
port
,
skb
);
dev_kfree_skb
(
skb
);
dev_kfree_skb
_any
(
skb
);
break
;
case
PKT_COMMAND
:
...
...
@@ -681,12 +677,32 @@ void solos_bh(unsigned long card_arg)
if
(
net_ratelimit
())
dev_warn
(
&
card
->
dev
->
dev
,
"Dropping console response on port %d
\n
"
,
port
);
dev_kfree_skb_any
(
skb
);
}
else
skb_queue_tail
(
&
card
->
cli_queue
[
port
],
skb
);
spin_unlock
(
&
card
->
cli_queue_lock
);
break
;
}
}
/* Allocate RX skbs for any ports which need them */
if
(
card
->
using_dma
&&
card
->
atmdev
[
port
]
&&
!
card
->
rx_skb
[
port
])
{
struct
sk_buff
*
skb
=
alloc_skb
(
RX_DMA_SIZE
,
GFP_ATOMIC
);
if
(
skb
)
{
SKB_CB
(
skb
)
->
dma_addr
=
pci_map_single
(
card
->
dev
,
skb
->
data
,
RX_DMA_SIZE
,
PCI_DMA_FROMDEVICE
);
iowrite32
(
SKB_CB
(
skb
)
->
dma_addr
,
card
->
config_regs
+
RX_DMA_ADDR
(
port
));
card
->
rx_skb
[
port
]
=
skb
;
}
else
{
if
(
net_ratelimit
())
dev_warn
(
&
card
->
dev
->
dev
,
"Failed to allocate RX skb"
);
/* We'll have to try again later */
tasklet_schedule
(
&
card
->
tlet
);
}
}
}
if
(
rx_done
)
iowrite32
(
rx_done
,
card
->
config_regs
+
FLAGS_ADDR
);
...
...
@@ -901,50 +917,45 @@ static int fpga_tx(struct solos_card *card)
for
(
port
=
0
;
port
<
card
->
nr_ports
;
port
++
)
{
if
(
card
->
atmdev
[
port
]
&&
!
(
tx_pending
&
(
1
<<
port
)))
{
struct
sk_buff
*
oldskb
=
card
->
tx_skb
[
port
];
if
(
oldskb
)
pci_unmap_single
(
card
->
dev
,
SKB_CB
(
oldskb
)
->
dma_addr
,
oldskb
->
len
,
PCI_DMA_TODEVICE
);
spin_lock
(
&
card
->
tx_queue_lock
);
skb
=
skb_dequeue
(
&
card
->
tx_queue
[
port
]);
spin_unlock
(
&
card
->
tx_queue_lock
);
if
(
!
skb
)
if
(
skb
&&
!
card
->
using_dma
)
{
memcpy_toio
(
TX_BUF
(
card
,
port
),
skb
->
data
,
skb
->
len
);
tx_started
|=
1
<<
port
;
//Set TX full flag
oldskb
=
skb
;
/* We're done with this skb already */
}
else
if
(
skb
&&
card
->
using_dma
)
{
SKB_CB
(
skb
)
->
dma_addr
=
pci_map_single
(
card
->
dev
,
skb
->
data
,
skb
->
len
,
PCI_DMA_TODEVICE
);
iowrite32
(
SKB_CB
(
skb
)
->
dma_addr
,
card
->
config_regs
+
TX_DMA_ADDR
(
port
));
}
if
(
!
oldskb
)
continue
;
/* Clean up and free oldskb now it's gone */
if
(
atmdebug
)
{
dev_info
(
&
card
->
dev
->
dev
,
"Transmitted: port %d
\n
"
,
port
);
print_buffer
(
skb
);
print_buffer
(
old
skb
);
}
if
(
card
->
using_dma
)
{
if
(
card
->
tx_skb
[
port
])
{
struct
sk_buff
*
oldskb
=
card
->
tx_skb
[
port
];
pci_unmap_single
(
card
->
dev
,
SKB_CB
(
oldskb
)
->
dma_addr
,
oldskb
->
len
,
PCI_DMA_TODEVICE
);
vcc
=
SKB_CB
(
oldskb
)
->
vcc
;
if
(
vcc
)
{
atomic_inc
(
&
vcc
->
stats
->
tx
);
solos_pop
(
vcc
,
oldskb
);
}
else
dev_kfree_skb_irq
(
oldskb
);
}
SKB_CB
(
skb
)
->
dma_addr
=
pci_map_single
(
card
->
dev
,
skb
->
data
,
skb
->
len
,
PCI_DMA_TODEVICE
);
iowrite32
(
SKB_CB
(
skb
)
->
dma_addr
,
card
->
config_regs
+
TX_DMA_ADDR
(
port
));
}
else
{
memcpy_toio
(
TX_BUF
(
card
,
port
),
skb
->
data
,
skb
->
len
);
tx_started
|=
1
<<
port
;
//Set TX full flag
vcc
=
SKB_CB
(
oldskb
)
->
vcc
;
vcc
=
SKB_CB
(
skb
)
->
vcc
;
if
(
vcc
)
{
atomic_inc
(
&
vcc
->
stats
->
tx
);
solos_pop
(
vcc
,
oldskb
);
}
else
dev_kfree_skb_irq
(
oldskb
);
if
(
vcc
)
{
atomic_inc
(
&
vcc
->
stats
->
tx
);
solos_pop
(
vcc
,
skb
);
}
else
dev_kfree_skb_irq
(
skb
);
}
}
}
if
(
tx_started
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录