Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
b8ab2dc3
cloud-kernel
项目概览
openanolis
/
cloud-kernel
1 年多 前同步成功
通知
160
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b8ab2dc3
编写于
3月 26, 2006
作者:
K
Komuro
提交者:
Jeff Garzik
3月 29, 2006
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[PATCH] axnet_cs.c : add hardware multicast support
Signed-off-by:
N
Jeff Garzik
<
jeff@garzik.org
>
上级
5c513129
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
53 addition
and
8 deletion
+53
-8
drivers/net/pcmcia/axnet_cs.c
drivers/net/pcmcia/axnet_cs.c
+53
-8
未找到文件。
drivers/net/pcmcia/axnet_cs.c
浏览文件 @
b8ab2dc3
...
...
@@ -35,6 +35,7 @@
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/netdevice.h>
#include <linux/crc32.h>
#include "../8390.h"
#include <pcmcia/cs_types.h>
...
...
@@ -1682,17 +1683,67 @@ static struct net_device_stats *get_stats(struct net_device *dev)
return
&
ei_local
->
stat
;
}
/*
* Form the 64 bit 8390 multicast table from the linked list of addresses
* associated with this dev structure.
*/
static
inline
void
make_mc_bits
(
u8
*
bits
,
struct
net_device
*
dev
)
{
struct
dev_mc_list
*
dmi
;
u32
crc
;
for
(
dmi
=
dev
->
mc_list
;
dmi
;
dmi
=
dmi
->
next
)
{
crc
=
ether_crc
(
ETH_ALEN
,
dmi
->
dmi_addr
);
/*
* The 8390 uses the 6 most significant bits of the
* CRC to index the multicast table.
*/
bits
[
crc
>>
29
]
|=
(
1
<<
((
crc
>>
26
)
&
7
));
}
}
/**
* do_set_multicast_list - set/clear multicast filter
* @dev: net device for which multicast filter is adjusted
*
* Set or clear the multicast filter for this adaptor.
May be called
*
from a BH in 2.1.x.
Must be called with lock held.
* Set or clear the multicast filter for this adaptor.
* Must be called with lock held.
*/
static
void
do_set_multicast_list
(
struct
net_device
*
dev
)
{
long
e8390_base
=
dev
->
base_addr
;
int
i
;
struct
ei_device
*
ei_local
=
(
struct
ei_device
*
)
netdev_priv
(
dev
);
if
(
!
(
dev
->
flags
&
(
IFF_PROMISC
|
IFF_ALLMULTI
)))
{
memset
(
ei_local
->
mcfilter
,
0
,
8
);
if
(
dev
->
mc_list
)
make_mc_bits
(
ei_local
->
mcfilter
,
dev
);
}
else
{
/* set to accept-all */
memset
(
ei_local
->
mcfilter
,
0xFF
,
8
);
}
/*
* DP8390 manuals don't specify any magic sequence for altering
* the multicast regs on an already running card. To be safe, we
* ensure multicast mode is off prior to loading up the new hash
* table. If this proves to be not enough, we can always resort
* to stopping the NIC, loading the table and then restarting.
*/
if
(
netif_running
(
dev
))
outb_p
(
E8390_RXCONFIG
,
e8390_base
+
EN0_RXCR
);
outb_p
(
E8390_NODMA
+
E8390_PAGE1
,
e8390_base
+
E8390_CMD
);
for
(
i
=
0
;
i
<
8
;
i
++
)
{
outb_p
(
ei_local
->
mcfilter
[
i
],
e8390_base
+
EN1_MULT_SHIFT
(
i
));
}
outb_p
(
E8390_NODMA
+
E8390_PAGE0
,
e8390_base
+
E8390_CMD
);
if
(
dev
->
flags
&
IFF_PROMISC
)
outb_p
(
E8390_RXCONFIG
|
0x58
,
e8390_base
+
EN0_RXCR
);
...
...
@@ -1794,12 +1845,6 @@ static void AX88190_init(struct net_device *dev, int startp)
if
(
inb_p
(
e8390_base
+
EN1_PHYS_SHIFT
(
i
))
!=
dev
->
dev_addr
[
i
])
printk
(
KERN_ERR
"Hw. address read/write mismap %d
\n
"
,
i
);
}
/*
* Initialize the multicast list to accept-all. If we enable multicast
* the higher levels can do the filtering.
*/
for
(
i
=
0
;
i
<
8
;
i
++
)
outb_p
(
0xff
,
e8390_base
+
EN1_MULT
+
i
);
outb_p
(
ei_local
->
rx_start_page
,
e8390_base
+
EN1_CURPAG
);
outb_p
(
E8390_NODMA
+
E8390_PAGE0
+
E8390_STOP
,
e8390_base
+
E8390_CMD
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录