Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
4ef594eb
K
Kernel
项目概览
openeuler
/
Kernel
接近 2 年 前同步成功
通知
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看板
提交
4ef594eb
编写于
2月 07, 2012
作者:
B
Ben Hutchings
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
sfc: Generalise driver event generation
Signed-off-by:
N
Ben Hutchings
<
bhutchings@solarflare.com
>
上级
055e0ad0
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
27 addition
and
24 deletion
+27
-24
drivers/net/ethernet/sfc/nic.c
drivers/net/ethernet/sfc/nic.c
+27
-24
未找到文件。
drivers/net/ethernet/sfc/nic.c
浏览文件 @
4ef594eb
...
...
@@ -57,13 +57,17 @@
/* Depth of RX flush request fifo */
#define EFX_RX_FLUSH_COUNT 4
/*
Generated event code for efx_generate_test_event()
*/
#define
EFX_CHANNEL_MAGIC_TEST(_channel) \
(0x00010100 + (_channel)->channel)
/*
Driver generated events
*/
#define
_EFX_CHANNEL_MAGIC_TEST 0x000101
#define _EFX_CHANNEL_MAGIC_FILL 0x000102
/* Generated event code for efx_generate_fill_event() */
#define EFX_CHANNEL_MAGIC_FILL(_channel) \
(0x00010200 + (_channel)->channel)
#define _EFX_CHANNEL_MAGIC(_code, _data) ((_code) << 8 | (_data))
#define _EFX_CHANNEL_MAGIC_CODE(_magic) ((_magic) >> 8)
#define EFX_CHANNEL_MAGIC_TEST(_channel) \
_EFX_CHANNEL_MAGIC(_EFX_CHANNEL_MAGIC_TEST, (_channel)->channel)
#define EFX_CHANNEL_MAGIC_FILL(_channel) \
_EFX_CHANNEL_MAGIC(_EFX_CHANNEL_MAGIC_FILL, (_channel)->channel)
/**************************************************************************
*
...
...
@@ -693,6 +697,16 @@ static void efx_generate_event(struct efx_channel *channel, efx_qword_t *event)
efx_writeo
(
channel
->
efx
,
&
drv_ev_reg
,
FR_AZ_DRV_EV
);
}
static
void
efx_magic_event
(
struct
efx_channel
*
channel
,
u32
magic
)
{
efx_qword_t
event
;
EFX_POPULATE_QWORD_2
(
event
,
FSF_AZ_EV_CODE
,
FSE_AZ_EV_CODE_DRV_GEN_EV
,
FSF_AZ_DRV_GEN_EV_MAGIC
,
magic
);
efx_generate_event
(
channel
,
&
event
);
}
/* Handle a transmit completion event
*
* The NIC batches TX completion events; the message we receive is of
...
...
@@ -898,12 +912,13 @@ static void
efx_handle_generated_event
(
struct
efx_channel
*
channel
,
efx_qword_t
*
event
)
{
struct
efx_nic
*
efx
=
channel
->
efx
;
unsigned
code
;
unsigned
magic
;
code
=
EFX_QWORD_FIELD
(
*
event
,
FSF_AZ_DRV_GEN_EV_MAGIC
);
if
(
code
==
EFX_CHANNEL_MAGIC_TEST
(
channel
))
magic
=
EFX_QWORD_FIELD
(
*
event
,
FSF_AZ_DRV_GEN_EV_MAGIC
);
if
(
magic
==
EFX_CHANNEL_MAGIC_TEST
(
channel
))
;
/* ignore */
else
if
(
code
==
EFX_CHANNEL_MAGIC_FILL
(
channel
))
else
if
(
magic
==
EFX_CHANNEL_MAGIC_FILL
(
channel
))
/* The queue must be empty, so we won't receive any rx
* events, so efx_process_channel() won't refill the
* queue. Refill it here */
...
...
@@ -1132,24 +1147,12 @@ void efx_nic_remove_eventq(struct efx_channel *channel)
void
efx_nic_generate_test_event
(
struct
efx_channel
*
channel
)
{
unsigned
int
magic
=
EFX_CHANNEL_MAGIC_TEST
(
channel
);
efx_qword_t
test_event
;
EFX_POPULATE_QWORD_2
(
test_event
,
FSF_AZ_EV_CODE
,
FSE_AZ_EV_CODE_DRV_GEN_EV
,
FSF_AZ_DRV_GEN_EV_MAGIC
,
magic
);
efx_generate_event
(
channel
,
&
test_event
);
efx_magic_event
(
channel
,
EFX_CHANNEL_MAGIC_TEST
(
channel
));
}
void
efx_nic_generate_fill_event
(
struct
efx_channel
*
channel
)
{
unsigned
int
magic
=
EFX_CHANNEL_MAGIC_FILL
(
channel
);
efx_qword_t
test_event
;
EFX_POPULATE_QWORD_2
(
test_event
,
FSF_AZ_EV_CODE
,
FSE_AZ_EV_CODE_DRV_GEN_EV
,
FSF_AZ_DRV_GEN_EV_MAGIC
,
magic
);
efx_generate_event
(
channel
,
&
test_event
);
efx_magic_event
(
channel
,
EFX_CHANNEL_MAGIC_FILL
(
channel
));
}
/**************************************************************************
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录