mirror of
https://github.com/torvalds/linux.git
synced 2024-11-28 15:11:31 +00:00
net: use netdev_mc_count and netdev_mc_empty when appropriate
This patch replaces dev->mc_count in all drivers (hopefully I didn't miss anything). Used spatch and did small tweaks and conding style changes when it was suitable. Jirka Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
8e5574211d
commit
4cd24eaf0c
@ -560,7 +560,7 @@ static void iss_net_set_multicast_list(struct net_device *dev)
|
||||
#if 0
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
return;
|
||||
else if (dev->mc_count)
|
||||
else if (!netdev_mc_empty(dev))
|
||||
dev->flags |= IFF_ALLMULTI;
|
||||
else
|
||||
dev->flags &= ~IFF_ALLMULTI;
|
||||
|
@ -862,7 +862,7 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
|
||||
}
|
||||
|
||||
nes_debug(NES_DBG_NIC_RX, "Number of MC entries = %d, Promiscous = %d, All Multicast = %d.\n",
|
||||
netdev->mc_count, !!(netdev->flags & IFF_PROMISC),
|
||||
netdev_mc_count(netdev), !!(netdev->flags & IFF_PROMISC),
|
||||
!!(netdev->flags & IFF_ALLMULTI));
|
||||
if (!mc_all_on) {
|
||||
multicast_addr = netdev->mc_list;
|
||||
|
@ -1138,18 +1138,18 @@ static void wq_set_multicast_list (struct work_struct *work)
|
||||
} else if ((dev->flags & IFF_ALLMULTI)) {
|
||||
dprintk("%s: allmulti mode\n", dev->name);
|
||||
priv->rx_mode = RX_MODE_ALL_MULTI;
|
||||
} else if (dev->mc_count) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
int mci;
|
||||
struct dev_mc_list *mc;
|
||||
|
||||
dprintk("%s: set_mc_list, %d entries\n",
|
||||
dev->name, dev->mc_count);
|
||||
dev->name, netdev_mc_count(dev));
|
||||
|
||||
priv->rx_mode = RX_MODE_MULTI;
|
||||
priv->multi_num = 0;
|
||||
|
||||
for (mci = 0, mc=dev->mc_list;
|
||||
mci < dev->mc_count;
|
||||
mci < netdev_mc_count(dev);
|
||||
mc = mc->next, mci++) {
|
||||
dvb_set_mc_filter(dev, mc);
|
||||
}
|
||||
@ -1236,7 +1236,6 @@ static void dvb_net_setup(struct net_device *dev)
|
||||
dev->header_ops = &dvb_header_ops;
|
||||
dev->netdev_ops = &dvb_netdev_ops;
|
||||
dev->mtu = 4096;
|
||||
dev->mc_count = 0;
|
||||
|
||||
dev->flags |= IFF_NOARP;
|
||||
}
|
||||
|
@ -1229,8 +1229,8 @@ static void elp_set_mc_list(struct net_device *dev)
|
||||
/* send a "load multicast list" command to the board, max 10 addrs/cmd */
|
||||
/* if num_addrs==0 the list will be cleared */
|
||||
adapter->tx_pcb.command = CMD_LOAD_MULTICAST_LIST;
|
||||
adapter->tx_pcb.length = 6 * dev->mc_count;
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
adapter->tx_pcb.length = 6 * netdev_mc_count(dev);
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
memcpy(adapter->tx_pcb.data.multicast[i], dmi->dmi_addr, 6);
|
||||
dmi = dmi->next;
|
||||
}
|
||||
@ -1244,7 +1244,7 @@ static void elp_set_mc_list(struct net_device *dev)
|
||||
TIMEOUT_MSG(__LINE__);
|
||||
}
|
||||
}
|
||||
if (dev->mc_count)
|
||||
if (!netdev_mc_empty(dev))
|
||||
adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD | RECV_MULTI;
|
||||
else /* num_addrs == 0 */
|
||||
adapter->tx_pcb.data.configure = NO_LOOPBACK | RECV_BROAD;
|
||||
|
@ -1111,12 +1111,14 @@ set_multicast_list(struct net_device *dev)
|
||||
unsigned long flags;
|
||||
struct el3_private *lp = netdev_priv(dev);
|
||||
int ioaddr = dev->base_addr;
|
||||
int mc_count = netdev_mc_count(dev);
|
||||
|
||||
if (el3_debug > 1) {
|
||||
static int old;
|
||||
if (old != dev->mc_count) {
|
||||
old = dev->mc_count;
|
||||
pr_debug("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count);
|
||||
if (old != mc_count) {
|
||||
old = mc_count;
|
||||
pr_debug("%s: Setting Rx mode to %d addresses.\n",
|
||||
dev->name, mc_count);
|
||||
}
|
||||
}
|
||||
spin_lock_irqsave(&lp->lock, flags);
|
||||
@ -1124,7 +1126,7 @@ set_multicast_list(struct net_device *dev)
|
||||
outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
|
||||
ioaddr + EL3_CMD);
|
||||
}
|
||||
else if (dev->mc_count || (dev->flags&IFF_ALLMULTI)) {
|
||||
else if (mc_count || (dev->flags&IFF_ALLMULTI)) {
|
||||
outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast, ioaddr + EL3_CMD);
|
||||
}
|
||||
else
|
||||
|
@ -626,7 +626,7 @@ static int init586(struct net_device *dev)
|
||||
volatile struct tdr_cmd_struct *tdr_cmd;
|
||||
volatile struct mcsetup_cmd_struct *mc_cmd;
|
||||
struct dev_mc_list *dmi = dev->mc_list;
|
||||
int num_addrs = dev->mc_count;
|
||||
int num_addrs = netdev_mc_count(dev);
|
||||
|
||||
ptr = (void *) ((char *) p->scb + sizeof(struct scb_struct));
|
||||
|
||||
@ -771,7 +771,7 @@ static int init586(struct net_device *dev)
|
||||
* Multicast setup
|
||||
*/
|
||||
|
||||
if (dev->mc_count) {
|
||||
if (num_addrs) {
|
||||
/* I don't understand this: do we really need memory after the init? */
|
||||
int len = ((char *) p->iscp - (char *) ptr - 8) / 6;
|
||||
if (len <= 0) {
|
||||
|
@ -1526,10 +1526,10 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
|
||||
|
||||
if ((dev->flags&IFF_PROMISC) ||
|
||||
(dev->flags&IFF_ALLMULTI) ||
|
||||
dev->mc_count > 10)
|
||||
netdev_mc_count(dev) > 10)
|
||||
/* Enable promiscuous mode */
|
||||
filt |= 1;
|
||||
else if(dev->mc_count)
|
||||
else if (!netdev_mc_empty(dev))
|
||||
{
|
||||
unsigned char block[62];
|
||||
unsigned char *bp;
|
||||
@ -1542,16 +1542,17 @@ static void do_mc32_set_multicast_list(struct net_device *dev, int retry)
|
||||
if(!lp->mc_list_valid)
|
||||
{
|
||||
block[1]=0;
|
||||
block[0]=dev->mc_count;
|
||||
block[0]=netdev_mc_count(dev);
|
||||
bp=block+2;
|
||||
|
||||
for(i=0;i<dev->mc_count;i++)
|
||||
for(i=0;i<netdev_mc_count(dev);i++)
|
||||
{
|
||||
memcpy(bp, dmc->dmi_addr, 6);
|
||||
bp+=6;
|
||||
dmc=dmc->next;
|
||||
}
|
||||
if(mc32_command_nowait(dev, 2, block, 2+6*dev->mc_count)==-1)
|
||||
if(mc32_command_nowait(dev, 2, block,
|
||||
2+6*netdev_mc_count(dev))==-1)
|
||||
{
|
||||
lp->mc_reload_wait = 1;
|
||||
return;
|
||||
|
@ -611,7 +611,7 @@ static void lance_load_multicast (struct net_device *dev)
|
||||
ib->filter [1] = 0;
|
||||
|
||||
/* Add addresses */
|
||||
for (i = 0; i < dev->mc_count; i++){
|
||||
for (i = 0; i < netdev_mc_count(dev); i++){
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -1505,7 +1505,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
int config = 0, cnt;
|
||||
|
||||
DEB(DEB_MULTI,printk(KERN_DEBUG "%s: set multicast list, %d entries, promisc %s, allmulti %s\n",
|
||||
dev->name, dev->mc_count,
|
||||
dev->name, netdev_mc_count(dev),
|
||||
dev->flags & IFF_PROMISC ? "ON" : "OFF",
|
||||
dev->flags & IFF_ALLMULTI ? "ON" : "OFF"));
|
||||
|
||||
@ -1533,7 +1533,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
i596_add_cmd(dev, &lp->cf_cmd.cmd);
|
||||
}
|
||||
|
||||
cnt = dev->mc_count;
|
||||
cnt = netdev_mc_count(dev);
|
||||
if (cnt > MAX_MC_CNT)
|
||||
{
|
||||
cnt = MAX_MC_CNT;
|
||||
@ -1541,7 +1541,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
dev->name, cnt);
|
||||
}
|
||||
|
||||
if (dev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
struct dev_mc_list *dmi;
|
||||
unsigned char *cp;
|
||||
struct mc_cmd *cmd;
|
||||
@ -1550,7 +1550,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
return;
|
||||
cmd = &lp->mc_cmd;
|
||||
cmd->cmd.command = CmdMulticastList;
|
||||
cmd->mc_cnt = dev->mc_count * 6;
|
||||
cmd->mc_cnt = netdev_mc_count(dev) * 6;
|
||||
cp = cmd->mc_addrs;
|
||||
for (dmi = dev->mc_list; cnt && dmi != NULL; dmi = dmi->next, cnt--, cp += 6) {
|
||||
memcpy(cp, dmi->dmi_addr, 6);
|
||||
|
@ -619,7 +619,7 @@ static void lance_load_multicast (struct net_device *dev)
|
||||
ib->filter [1] = 0;
|
||||
|
||||
/* Add addresses */
|
||||
for (i = 0; i < dev->mc_count; i++){
|
||||
for (i = 0; i < netdev_mc_count(dev); i++){
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -2845,7 +2845,7 @@ static void ace_set_multicast_list(struct net_device *dev)
|
||||
* set the entire multicast list at a time and keeping track of
|
||||
* it here is going to be messy.
|
||||
*/
|
||||
if ((dev->mc_count) && !(ap->mcast_all)) {
|
||||
if (!netdev_mc_empty(dev) && !ap->mcast_all) {
|
||||
cmd.evt = C_SET_MULTICAST_MODE;
|
||||
cmd.code = C_C_MCAST_ENABLE;
|
||||
cmd.idx = 0;
|
||||
|
@ -1387,7 +1387,8 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
|
||||
}
|
||||
else
|
||||
writel( PROM, lp->mmio + CMD2);
|
||||
if(dev->flags & IFF_ALLMULTI || dev->mc_count > MAX_FILTER_SIZE){
|
||||
if (dev->flags & IFF_ALLMULTI ||
|
||||
netdev_mc_count(dev) > MAX_FILTER_SIZE) {
|
||||
/* get all multicast packet */
|
||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
||||
lp->mc_list = dev->mc_list;
|
||||
@ -1395,7 +1396,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
|
||||
amd8111e_writeq(*(u64*)mc_filter,lp->mmio + LADRF);
|
||||
return;
|
||||
}
|
||||
if( dev->mc_count == 0 ){
|
||||
if (netdev_mc_empty(dev)) {
|
||||
/* get only own packets */
|
||||
mc_filter[1] = mc_filter[0] = 0;
|
||||
lp->mc_list = NULL;
|
||||
@ -1409,7 +1410,7 @@ static void amd8111e_set_multicast_list(struct net_device *dev)
|
||||
lp->options |= OPTION_MULTICAST_ENABLE;
|
||||
lp->mc_list = dev->mc_list;
|
||||
mc_filter[1] = mc_filter[0] = 0;
|
||||
for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < dev->mc_count;
|
||||
for (i = 0, mc_ptr = dev->mc_list; mc_ptr && i < netdev_mc_count(dev);
|
||||
i++, mc_ptr = mc_ptr->next) {
|
||||
bit_num = (ether_crc_le(ETH_ALEN, mc_ptr->dmi_addr) >> 26) & 0x3f;
|
||||
mc_filter[bit_num >> 5] |= 1 << (bit_num & 31);
|
||||
|
@ -819,7 +819,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
lance->RDP = PROM; /* Set promiscuous mode */
|
||||
} else {
|
||||
short multicast_table[4];
|
||||
int num_addrs = dev->mc_count;
|
||||
int num_addrs = netdev_mc_count(dev);
|
||||
int i;
|
||||
/* We don't use the multicast table, but rely on upper-layer filtering. */
|
||||
memset(multicast_table, (num_addrs == 0) ? 0 : -1,
|
||||
|
@ -563,7 +563,7 @@ static void at91ether_sethashtable(struct net_device *dev)
|
||||
mc_filter[0] = mc_filter[1] = 0;
|
||||
|
||||
curr = dev->mc_list;
|
||||
for (i = 0; i < dev->mc_count; i++, curr = curr->next) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++, curr = curr->next) {
|
||||
if (!curr) break; /* unexpected end of list */
|
||||
|
||||
bitnr = hash_get_index(curr->dmi_addr);
|
||||
@ -592,7 +592,7 @@ static void at91ether_set_multicast_list(struct net_device *dev)
|
||||
at91_emac_write(AT91_EMAC_HSH, -1);
|
||||
at91_emac_write(AT91_EMAC_HSL, -1);
|
||||
cfg |= AT91_EMAC_MTI;
|
||||
} else if (dev->mc_count > 0) { /* Enable specific multicasts */
|
||||
} else if (!netdev_mc_empty(dev)) { /* Enable specific multicasts */
|
||||
at91ether_sethashtable(dev);
|
||||
cfg |= AT91_EMAC_MTI;
|
||||
} else if (dev->flags & (~IFF_ALLMULTI)) { /* Disable all multicast mode */
|
||||
|
@ -463,7 +463,7 @@ static void ether3_setmulticastlist(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* promiscuous mode */
|
||||
priv(dev)->regs.config1 |= CFG1_RECVPROMISC;
|
||||
} else if (dev->flags & IFF_ALLMULTI || dev->mc_count) {
|
||||
} else if (dev->flags & IFF_ALLMULTI || !netdev_mc_empty(dev)) {
|
||||
priv(dev)->regs.config1 |= CFG1_RECVSPECBRMULTI;
|
||||
} else
|
||||
priv(dev)->regs.config1 |= CFG1_RECVSPECBROAD;
|
||||
|
@ -737,7 +737,7 @@ static void eth_set_mcast_list(struct net_device *dev)
|
||||
struct port *port = netdev_priv(dev);
|
||||
struct dev_mc_list *mclist = dev->mc_list;
|
||||
u8 diffs[ETH_ALEN], *addr;
|
||||
int cnt = dev->mc_count, i;
|
||||
int cnt = netdev_mc_count(dev), i;
|
||||
|
||||
if ((dev->flags & IFF_PROMISC) || !mclist || !cnt) {
|
||||
__raw_writel(DEFAULT_RX_CNTRL0 & ~RX_CNTRL0_ADDR_FLTR_EN,
|
||||
|
@ -1207,7 +1207,7 @@ ks8695_set_multicast(struct net_device *ndev)
|
||||
if (ndev->flags & IFF_ALLMULTI) {
|
||||
/* enable all multicast mode */
|
||||
ctrl |= DRXC_RM;
|
||||
} else if (ndev->mc_count > KS8695_NR_ADDRESSES) {
|
||||
} else if (netdev_mc_count(ndev) > KS8695_NR_ADDRESSES) {
|
||||
/* more specific multicast addresses than can be
|
||||
* handled in hardware
|
||||
*/
|
||||
@ -1216,7 +1216,7 @@ ks8695_set_multicast(struct net_device *ndev)
|
||||
/* enable specific multicasts */
|
||||
ctrl &= ~DRXC_RM;
|
||||
ks8695_init_partial_multicast(ksp, ndev->mc_list,
|
||||
ndev->mc_count);
|
||||
netdev_mc_count(ndev));
|
||||
}
|
||||
|
||||
ks8695_writereg(ksp, KS8695_DRXC, ctrl);
|
||||
|
@ -839,12 +839,12 @@ set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
|
||||
} else if (dev->mc_count > MC_FILTERBREAK ||
|
||||
} else if (netdev_mc_count(dev) > MC_FILTERBREAK ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outb(2, ioaddr + RX_MODE); /* Use normal mode. */
|
||||
} else if (dev->mc_count == 0) {
|
||||
} else if (netdev_mc_empty(dev)) {
|
||||
memset(mc_filter, 0x00, sizeof(mc_filter));
|
||||
outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */
|
||||
} else {
|
||||
@ -852,7 +852,7 @@ set_rx_mode(struct net_device *dev)
|
||||
int i;
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
unsigned int bit =
|
||||
ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
|
||||
|
@ -1097,7 +1097,7 @@ static void set_multicast_list( struct net_device *dev )
|
||||
REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */
|
||||
} else {
|
||||
short multicast_table[4];
|
||||
int num_addrs = dev->mc_count;
|
||||
int num_addrs = netdev_mc_count(dev);
|
||||
int i;
|
||||
/* We don't use the multicast table, but rely on upper-layer
|
||||
* filtering. */
|
||||
|
@ -861,7 +861,7 @@ static void set_rx_mode_8002(struct net_device *dev)
|
||||
struct net_local *lp = netdev_priv(dev);
|
||||
long ioaddr = dev->base_addr;
|
||||
|
||||
if (dev->mc_count > 0 || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC)))
|
||||
if (!netdev_mc_empty(dev) || (dev->flags & (IFF_ALLMULTI|IFF_PROMISC)))
|
||||
lp->addr_mode = CMR2h_PROMISC;
|
||||
else
|
||||
lp->addr_mode = CMR2h_Normal;
|
||||
@ -877,7 +877,8 @@ static void set_rx_mode_8012(struct net_device *dev)
|
||||
|
||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||
new_mode = CMR2h_PROMISC;
|
||||
} else if ((dev->mc_count > 1000) || (dev->flags & IFF_ALLMULTI)) {
|
||||
} else if ((netdev_mc_count(dev) > 1000) ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
new_mode = CMR2h_Normal;
|
||||
@ -885,7 +886,7 @@ static void set_rx_mode_8012(struct net_device *dev)
|
||||
struct dev_mc_list *mclist;
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next)
|
||||
{
|
||||
int filterbit = ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
|
||||
|
@ -1013,7 +1013,7 @@ static void au1000_multicast_list(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||
aup->mac->control |= MAC_PROMISCUOUS;
|
||||
} else if ((dev->flags & IFF_ALLMULTI) ||
|
||||
dev->mc_count > MULTICAST_FILTER_LIMIT) {
|
||||
netdev_mc_count(dev) > MULTICAST_FILTER_LIMIT) {
|
||||
aup->mac->control |= MAC_PASS_ALL_MULTI;
|
||||
aup->mac->control &= ~MAC_PROMISCUOUS;
|
||||
printk(KERN_INFO "%s: Pass all multicast\n", dev->name);
|
||||
@ -1023,7 +1023,7 @@ static void au1000_multicast_list(struct net_device *dev)
|
||||
u32 mc_filter[2]; /* Multicast hash filter */
|
||||
|
||||
mc_filter[1] = mc_filter[0] = 0;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
|
||||
(long *)mc_filter);
|
||||
|
@ -1691,7 +1691,7 @@ static int __b44_load_mcast(struct b44 *bp, struct net_device *dev)
|
||||
struct dev_mc_list *mclist;
|
||||
int i, num_ents;
|
||||
|
||||
num_ents = min_t(int, dev->mc_count, B44_MCAST_TABLE_SIZE);
|
||||
num_ents = min_t(int, netdev_mc_count(dev), B44_MCAST_TABLE_SIZE);
|
||||
mclist = dev->mc_list;
|
||||
for (i = 0; mclist && i < num_ents; i++, mclist = mclist->next) {
|
||||
__b44_cam_write(bp, mclist->dmi_addr, i + 1);
|
||||
@ -1716,7 +1716,7 @@ static void __b44_set_rx_mode(struct net_device *dev)
|
||||
__b44_set_mac_addr(bp);
|
||||
|
||||
if ((dev->flags & IFF_ALLMULTI) ||
|
||||
(dev->mc_count > B44_MCAST_TABLE_SIZE))
|
||||
(netdev_mc_count(dev) > B44_MCAST_TABLE_SIZE))
|
||||
val |= RXCONFIG_ALLMULTI;
|
||||
else
|
||||
i = __b44_load_mcast(bp, dev);
|
||||
|
@ -619,7 +619,7 @@ static void bcm_enet_set_multicast_list(struct net_device *dev)
|
||||
|
||||
/* only 3 perfect match registers left, first one is used for
|
||||
* own mac address */
|
||||
if ((dev->flags & IFF_ALLMULTI) || dev->mc_count > 3)
|
||||
if ((dev->flags & IFF_ALLMULTI) || netdev_mc_count(dev) > 3)
|
||||
val |= ENET_RXCFG_ALLMCAST_MASK;
|
||||
else
|
||||
val &= ~ENET_RXCFG_ALLMCAST_MASK;
|
||||
@ -632,7 +632,7 @@ static void bcm_enet_set_multicast_list(struct net_device *dev)
|
||||
}
|
||||
|
||||
for (i = 0, mc_list = dev->mc_list;
|
||||
(mc_list != NULL) && (i < dev->mc_count) && (i < 3);
|
||||
(mc_list != NULL) && (i < netdev_mc_count(dev)) && (i < 3);
|
||||
i++, mc_list = mc_list->next) {
|
||||
u8 *dmi_addr;
|
||||
u32 tmp;
|
||||
|
@ -565,14 +565,15 @@ static void be_set_multicast_list(struct net_device *netdev)
|
||||
}
|
||||
|
||||
/* Enable multicast promisc if num configured exceeds what we support */
|
||||
if (netdev->flags & IFF_ALLMULTI || netdev->mc_count > BE_MAX_MC) {
|
||||
if (netdev->flags & IFF_ALLMULTI ||
|
||||
netdev_mc_count(netdev) > BE_MAX_MC) {
|
||||
be_cmd_multicast_set(adapter, adapter->if_handle, NULL, 0,
|
||||
&adapter->mc_cmd_mem);
|
||||
goto done;
|
||||
}
|
||||
|
||||
be_cmd_multicast_set(adapter, adapter->if_handle, netdev->mc_list,
|
||||
netdev->mc_count, &adapter->mc_cmd_mem);
|
||||
netdev_mc_count(netdev), &adapter->mc_cmd_mem);
|
||||
done:
|
||||
return;
|
||||
}
|
||||
|
@ -819,7 +819,7 @@ static void bfin_mac_multicast_hash(struct net_device *dev)
|
||||
|
||||
emac_hashhi = emac_hashlo = 0;
|
||||
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
@ -862,7 +862,7 @@ static void bfin_mac_set_multicast_list(struct net_device *dev)
|
||||
sysctl = bfin_read_EMAC_OPMODE();
|
||||
sysctl |= PAM;
|
||||
bfin_write_EMAC_OPMODE(sysctl);
|
||||
} else if (dev->mc_count) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
/* set up multicast hash table */
|
||||
sysctl = bfin_read_EMAC_OPMODE();
|
||||
sysctl |= HM;
|
||||
|
@ -973,7 +973,7 @@ static void bmac_set_multicast(struct net_device *dev)
|
||||
{
|
||||
struct dev_mc_list *dmi;
|
||||
struct bmac_data *bp = netdev_priv(dev);
|
||||
int num_addrs = dev->mc_count;
|
||||
int num_addrs = netdev_mc_count(dev);
|
||||
unsigned short rx_cfg;
|
||||
int i;
|
||||
|
||||
@ -982,7 +982,7 @@ static void bmac_set_multicast(struct net_device *dev)
|
||||
|
||||
XXDEBUG(("bmac: enter bmac_set_multicast, n_addrs=%d\n", num_addrs));
|
||||
|
||||
if((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) {
|
||||
if((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
|
||||
for (i=0; i<4; i++) bp->hash_table_mask[i] = 0xffff;
|
||||
bmac_update_hash_table_mask(dev, bp);
|
||||
rx_cfg = bmac_rx_on(dev, 1, 0);
|
||||
@ -1021,7 +1021,7 @@ static void bmac_set_multicast(struct net_device *dev)
|
||||
unsigned short rx_cfg;
|
||||
u32 crc;
|
||||
|
||||
if((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) {
|
||||
if((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 64)) {
|
||||
bmwrite(dev, BHASH0, 0xffff);
|
||||
bmwrite(dev, BHASH1, 0xffff);
|
||||
bmwrite(dev, BHASH2, 0xffff);
|
||||
@ -1039,7 +1039,7 @@ static void bmac_set_multicast(struct net_device *dev)
|
||||
|
||||
for(i = 0; i < 4; i++) hash_table[i] = 0;
|
||||
|
||||
for(i = 0; i < dev->mc_count; i++) {
|
||||
for(i = 0; i < netdev_mc_count(dev); i++) {
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -3560,7 +3560,7 @@ bnx2_set_rx_mode(struct net_device *dev)
|
||||
|
||||
memset(mc_filter, 0, 4 * NUM_MC_HASH_REGISTERS);
|
||||
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
|
||||
crc = ether_crc_le(ETH_ALEN, mclist->dmi_addr);
|
||||
|
@ -11471,7 +11471,8 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
|
||||
rx_mode = BNX2X_RX_MODE_PROMISC;
|
||||
|
||||
else if ((dev->flags & IFF_ALLMULTI) ||
|
||||
((dev->mc_count > BNX2X_MAX_MULTICAST) && CHIP_IS_E1(bp)))
|
||||
((netdev_mc_count(dev) > BNX2X_MAX_MULTICAST) &&
|
||||
CHIP_IS_E1(bp)))
|
||||
rx_mode = BNX2X_RX_MODE_ALLMULTI;
|
||||
|
||||
else { /* some multicasts */
|
||||
@ -11482,7 +11483,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
|
||||
bnx2x_sp(bp, mcast_config);
|
||||
|
||||
for (i = 0, mclist = dev->mc_list;
|
||||
mclist && (i < dev->mc_count);
|
||||
mclist && (i < netdev_mc_count(dev));
|
||||
i++, mclist = mclist->next) {
|
||||
|
||||
config->config_table[i].
|
||||
@ -11554,7 +11555,7 @@ static void bnx2x_set_rx_mode(struct net_device *dev)
|
||||
memset(mc_filter, 0, 4 * MC_HASH_SIZE);
|
||||
|
||||
for (i = 0, mclist = dev->mc_list;
|
||||
mclist && (i < dev->mc_count);
|
||||
mclist && (i < netdev_mc_count(dev));
|
||||
i++, mclist = mclist->next) {
|
||||
|
||||
DP(NETIF_MSG_IFUP, "Adding mcast MAC: %pM\n",
|
||||
|
@ -97,13 +97,13 @@ struct t1_rx_mode {
|
||||
|
||||
#define t1_rx_mode_promisc(rm) (rm->dev->flags & IFF_PROMISC)
|
||||
#define t1_rx_mode_allmulti(rm) (rm->dev->flags & IFF_ALLMULTI)
|
||||
#define t1_rx_mode_mc_cnt(rm) (rm->dev->mc_count)
|
||||
#define t1_rx_mode_mc_cnt(rm) (netdev_mc_count(rm->dev))
|
||||
|
||||
static inline u8 *t1_get_next_mcaddr(struct t1_rx_mode *rm)
|
||||
{
|
||||
u8 *addr = NULL;
|
||||
|
||||
if (rm->idx++ < rm->dev->mc_count) {
|
||||
if (rm->idx++ < t1_rx_mode_mc_cnt(rm)) {
|
||||
addr = rm->list->dmi_addr;
|
||||
rm->list = rm->list->next;
|
||||
}
|
||||
|
@ -340,7 +340,7 @@ static void cpmac_set_multicast_list(struct net_device *dev)
|
||||
* cpmac uses some strange mac address hashing
|
||||
* (not crc32)
|
||||
*/
|
||||
for (i = 0, iter = dev->mc_list; i < dev->mc_count;
|
||||
for (i = 0, iter = dev->mc_list; i < netdev_mc_count(dev);
|
||||
i++, iter = iter->next) {
|
||||
bit = 0;
|
||||
tmp = iter->dmi_addr[0];
|
||||
|
@ -1564,7 +1564,7 @@ static void
|
||||
set_multicast_list(struct net_device *dev)
|
||||
{
|
||||
struct net_local *lp = netdev_priv(dev);
|
||||
int num_addr = dev->mc_count;
|
||||
int num_addr = netdev_mc_count(dev);
|
||||
unsigned long int lo_bits;
|
||||
unsigned long int hi_bits;
|
||||
|
||||
|
@ -956,11 +956,11 @@ static void emac_dev_mcast_set(struct net_device *ndev)
|
||||
} else {
|
||||
mbp_enable = (mbp_enable & ~EMAC_MBP_RXPROMISC);
|
||||
if ((ndev->flags & IFF_ALLMULTI) ||
|
||||
(ndev->mc_count > EMAC_DEF_MAX_MULTICAST_ADDRESSES)) {
|
||||
netdev_mc_count(ndev) > EMAC_DEF_MAX_MULTICAST_ADDRESSES) {
|
||||
mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
|
||||
emac_add_mcast(priv, EMAC_ALL_MULTI_SET, NULL);
|
||||
}
|
||||
if (ndev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(ndev)) {
|
||||
struct dev_mc_list *mc_ptr;
|
||||
mbp_enable = (mbp_enable | EMAC_MBP_RXMCAST);
|
||||
emac_add_mcast(priv, EMAC_ALL_MULTI_CLR, NULL);
|
||||
|
@ -464,7 +464,7 @@ static int de620_close(struct net_device *dev)
|
||||
|
||||
static void de620_set_multicast_list(struct net_device *dev)
|
||||
{
|
||||
if (dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
|
||||
if (!netdev_mc_empty(dev) || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
|
||||
{ /* Enable promiscuous mode */
|
||||
de620_set_register(dev, W_TCR, (TCR_DEF & ~RXPBM) | RXALL);
|
||||
}
|
||||
|
@ -960,7 +960,7 @@ static void lance_load_multicast(struct net_device *dev)
|
||||
*lib_ptr(ib, filter[3], lp->type) = 0;
|
||||
|
||||
/* Add addresses */
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -2227,7 +2227,7 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
|
||||
* perfect filtering will be used.
|
||||
*/
|
||||
|
||||
if (dev->mc_count > (PI_CMD_ADDR_FILTER_K_SIZE - bp->uc_count))
|
||||
if (netdev_mc_count(dev) > (PI_CMD_ADDR_FILTER_K_SIZE - bp->uc_count))
|
||||
{
|
||||
bp->group_prom = PI_FSTATE_K_PASS; /* Enable LLC group prom mode */
|
||||
bp->mc_count = 0; /* Don't add mc addrs to CAM */
|
||||
@ -2235,7 +2235,7 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
|
||||
else
|
||||
{
|
||||
bp->group_prom = PI_FSTATE_K_BLOCK; /* Disable LLC group prom mode */
|
||||
bp->mc_count = dev->mc_count; /* Add mc addrs to CAM */
|
||||
bp->mc_count = netdev_mc_count(dev); /* Add mc addrs to CAM */
|
||||
}
|
||||
|
||||
/* Copy addresses to multicast address table, then update adapter CAM */
|
||||
|
@ -1287,7 +1287,7 @@ static void SetMulticastFilter(struct net_device *dev)
|
||||
lp->init_block.mcast_table[i] = 0;
|
||||
}
|
||||
/* Add multicast addresses */
|
||||
for (i = 0; i < dev->mc_count; i++) { /* for each address in the list */
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) { /* for each address in the list */
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
if ((*addrs & 0x01) == 1) { /* multicast address? */
|
||||
|
@ -1128,17 +1128,17 @@ set_multicast (struct net_device *dev)
|
||||
/* Receive all frames promiscuously. */
|
||||
rx_mode = ReceiveAllFrames;
|
||||
} else if ((dev->flags & IFF_ALLMULTI) ||
|
||||
(dev->mc_count > multicast_filter_limit)) {
|
||||
(netdev_mc_count(dev) > multicast_filter_limit)) {
|
||||
/* Receive broadcast and multicast frames */
|
||||
rx_mode = ReceiveBroadcast | ReceiveMulticast | ReceiveUnicast;
|
||||
} else if (dev->mc_count > 0) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
int i;
|
||||
struct dev_mc_list *mclist;
|
||||
/* Receive broadcast frames and multicast frames filtering
|
||||
by Hashtable */
|
||||
rx_mode =
|
||||
ReceiveBroadcast | ReceiveMulticastHash | ReceiveUnicast;
|
||||
for (i=0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i=0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist=mclist->next)
|
||||
{
|
||||
int bit, index = 0;
|
||||
|
@ -725,7 +725,7 @@ dm9000_hash_table(struct net_device *dev)
|
||||
{
|
||||
board_info_t *db = netdev_priv(dev);
|
||||
struct dev_mc_list *mcptr = dev->mc_list;
|
||||
int mc_cnt = dev->mc_count;
|
||||
int mc_cnt = netdev_mc_count(dev);
|
||||
int i, oft;
|
||||
u32 hash_val;
|
||||
u16 hash_table[4];
|
||||
|
@ -1538,7 +1538,7 @@ static void e100_multi(struct nic *nic, struct cb *cb, struct sk_buff *skb)
|
||||
{
|
||||
struct net_device *netdev = nic->netdev;
|
||||
struct dev_mc_list *list = netdev->mc_list;
|
||||
u16 i, count = min(netdev->mc_count, E100_MAX_MULTICAST_ADDRS);
|
||||
u16 i, count = min(netdev_mc_count(netdev), E100_MAX_MULTICAST_ADDRS);
|
||||
|
||||
cb->command = cpu_to_le16(cb_multi);
|
||||
cb->u.multi.count = cpu_to_le16(count * ETH_ALEN);
|
||||
@ -1552,7 +1552,7 @@ static void e100_set_multicast_list(struct net_device *netdev)
|
||||
struct nic *nic = netdev_priv(netdev);
|
||||
|
||||
DPRINTK(HW, DEBUG, "mc_count=%d, flags=0x%04X\n",
|
||||
netdev->mc_count, netdev->flags);
|
||||
netdev_mc_count(netdev), netdev->flags);
|
||||
|
||||
if (netdev->flags & IFF_PROMISC)
|
||||
nic->flags |= promiscuous;
|
||||
@ -1560,7 +1560,7 @@ static void e100_set_multicast_list(struct net_device *netdev)
|
||||
nic->flags &= ~promiscuous;
|
||||
|
||||
if (netdev->flags & IFF_ALLMULTI ||
|
||||
netdev->mc_count > E100_MAX_MULTICAST_ADDRS)
|
||||
netdev_mc_count(netdev) > E100_MAX_MULTICAST_ADDRS)
|
||||
nic->flags |= multicast_all;
|
||||
else
|
||||
nic->flags &= ~multicast_all;
|
||||
|
@ -1288,8 +1288,9 @@ set_multicast_list(struct net_device *dev)
|
||||
short ioaddr = dev->base_addr;
|
||||
unsigned short mode;
|
||||
struct dev_mc_list *dmi=dev->mc_list;
|
||||
int mc_count = mc_count;
|
||||
|
||||
if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || dev->mc_count > 63)
|
||||
if (dev->flags&(IFF_ALLMULTI|IFF_PROMISC) || mc_count > 63)
|
||||
{
|
||||
eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
|
||||
mode = inb(ioaddr + REG2);
|
||||
@ -1299,7 +1300,7 @@ set_multicast_list(struct net_device *dev)
|
||||
eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */
|
||||
}
|
||||
|
||||
else if (dev->mc_count==0 )
|
||||
else if (mc_count == 0)
|
||||
{
|
||||
eepro_sw2bank2(ioaddr); /* be CAREFUL, BANK 2 now */
|
||||
mode = inb(ioaddr + REG2);
|
||||
@ -1329,9 +1330,9 @@ set_multicast_list(struct net_device *dev)
|
||||
outw(MC_SETUP, ioaddr + IO_PORT);
|
||||
outw(0, ioaddr + IO_PORT);
|
||||
outw(0, ioaddr + IO_PORT);
|
||||
outw(6*(dev->mc_count + 1), ioaddr + IO_PORT);
|
||||
outw(6 * (mc_count + 1), ioaddr + IO_PORT);
|
||||
|
||||
for (i = 0; i < dev->mc_count; i++)
|
||||
for (i = 0; i < mc_count; i++)
|
||||
{
|
||||
eaddrs=(unsigned short *)dmi->dmi_addr;
|
||||
dmi=dmi->next;
|
||||
@ -1348,7 +1349,7 @@ set_multicast_list(struct net_device *dev)
|
||||
outb(MC_SETUP, ioaddr);
|
||||
|
||||
/* Update the transmit queue */
|
||||
i = lp->tx_end + XMT_HEADER + 6*(dev->mc_count + 1);
|
||||
i = lp->tx_end + XMT_HEADER + 6 * (mc_count + 1);
|
||||
|
||||
if (lp->tx_start != lp->tx_end)
|
||||
{
|
||||
@ -1380,8 +1381,8 @@ set_multicast_list(struct net_device *dev)
|
||||
break;
|
||||
} else if ((i & 0x0f) == 0x03) { /* MC-Done */
|
||||
printk(KERN_DEBUG "%s: set Rx mode to %d address%s.\n",
|
||||
dev->name, dev->mc_count,
|
||||
dev->mc_count > 1 ? "es":"");
|
||||
dev->name, mc_count,
|
||||
mc_count > 1 ? "es":"");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1578,7 +1578,7 @@ static void eexp_setup_filter(struct net_device *dev)
|
||||
{
|
||||
struct dev_mc_list *dmi;
|
||||
unsigned short ioaddr = dev->base_addr;
|
||||
int count = dev->mc_count;
|
||||
int count = netdev_mc_count(dev);
|
||||
int i;
|
||||
if (count > 8) {
|
||||
printk(KERN_INFO "%s: too many multicast addresses (%d)\n",
|
||||
@ -1627,9 +1627,9 @@ eexp_set_multicast(struct net_device *dev)
|
||||
}
|
||||
if (!(dev->flags & IFF_PROMISC)) {
|
||||
eexp_setup_filter(dev);
|
||||
if (lp->old_mc_count != dev->mc_count) {
|
||||
if (lp->old_mc_count != netdev_mc_count(dev)) {
|
||||
kick = 1;
|
||||
lp->old_mc_count = dev->mc_count;
|
||||
lp->old_mc_count = netdev_mc_count(dev);
|
||||
}
|
||||
}
|
||||
if (kick) {
|
||||
|
@ -1981,7 +1981,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
|
||||
}
|
||||
ehea_allmulti(dev, 0);
|
||||
|
||||
if (dev->mc_count) {
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
ret = ehea_drop_multicast_list(dev);
|
||||
if (ret) {
|
||||
/* Dropping the current multicast list failed.
|
||||
@ -1990,14 +1990,14 @@ static void ehea_set_multicast_list(struct net_device *dev)
|
||||
ehea_allmulti(dev, 1);
|
||||
}
|
||||
|
||||
if (dev->mc_count > port->adapter->max_mc_mac) {
|
||||
if (netdev_mc_count(dev) > port->adapter->max_mc_mac) {
|
||||
ehea_info("Mcast registration limit reached (0x%llx). "
|
||||
"Use ALLMULTI!",
|
||||
port->adapter->max_mc_mac);
|
||||
goto out;
|
||||
}
|
||||
|
||||
for (i = 0, k_mcl_entry = dev->mc_list; i < dev->mc_count; i++,
|
||||
for (i = 0, k_mcl_entry = dev->mc_list; i < netdev_mc_count(dev); i++,
|
||||
k_mcl_entry = k_mcl_entry->next)
|
||||
ehea_add_multicast_entry(port, k_mcl_entry->dmi_addr);
|
||||
|
||||
|
@ -1413,7 +1413,7 @@ static void enc28j60_set_multicast_list(struct net_device *dev)
|
||||
if (netif_msg_link(priv))
|
||||
dev_info(&dev->dev, "promiscuous mode\n");
|
||||
priv->rxfilter = RXFILTER_PROMISC;
|
||||
} else if ((dev->flags & IFF_ALLMULTI) || dev->mc_count) {
|
||||
} else if ((dev->flags & IFF_ALLMULTI) || !netdev_mc_empty(dev)) {
|
||||
if (netif_msg_link(priv))
|
||||
dev_info(&dev->dev, "%smulticast mode\n",
|
||||
(dev->flags & IFF_ALLMULTI) ? "all-" : "");
|
||||
|
@ -827,11 +827,11 @@ static void enic_set_multicast_list(struct net_device *netdev)
|
||||
int multicast = (netdev->flags & IFF_MULTICAST) ? 1 : 0;
|
||||
int broadcast = (netdev->flags & IFF_BROADCAST) ? 1 : 0;
|
||||
int promisc = (netdev->flags & IFF_PROMISC) ? 1 : 0;
|
||||
unsigned int mc_count = netdev_mc_count(netdev);
|
||||
int allmulti = (netdev->flags & IFF_ALLMULTI) ||
|
||||
(netdev->mc_count > ENIC_MULTICAST_PERFECT_FILTERS);
|
||||
mc_count > ENIC_MULTICAST_PERFECT_FILTERS;
|
||||
unsigned int flags = netdev->flags | (allmulti ? IFF_ALLMULTI : 0);
|
||||
u8 mc_addr[ENIC_MULTICAST_PERFECT_FILTERS][ETH_ALEN];
|
||||
unsigned int mc_count = netdev->mc_count;
|
||||
unsigned int i, j;
|
||||
|
||||
if (mc_count > ENIC_MULTICAST_PERFECT_FILTERS)
|
||||
|
@ -1390,20 +1390,20 @@ static void set_rx_mode(struct net_device *dev)
|
||||
outl(0x002C, ioaddr + RxCtrl);
|
||||
/* Unconditionally log net taps. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
} else if ((dev->mc_count > 0) || (dev->flags & IFF_ALLMULTI)) {
|
||||
} else if ((!netdev_mc_empty(dev)) || (dev->flags & IFF_ALLMULTI)) {
|
||||
/* There is apparently a chip bug, so the multicast filter
|
||||
is never enabled. */
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outl(0x000C, ioaddr + RxCtrl);
|
||||
} else if (dev->mc_count == 0) {
|
||||
} else if (netdev_mc_empty(dev)) {
|
||||
outl(0x0004, ioaddr + RxCtrl);
|
||||
return;
|
||||
} else { /* Never executed, for now. */
|
||||
struct dev_mc_list *mclist;
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
unsigned int bit_nr =
|
||||
ether_crc_le(ETH_ALEN, mclist->dmi_addr) & 0x3f;
|
||||
|
@ -1359,7 +1359,7 @@ static void eth16i_multicast(struct net_device *dev)
|
||||
{
|
||||
int ioaddr = dev->base_addr;
|
||||
|
||||
if(dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
|
||||
if (!netdev_mc_empty(dev) || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
|
||||
{
|
||||
outb(3, ioaddr + RECEIVE_MODE_REG);
|
||||
} else {
|
||||
|
@ -1213,7 +1213,7 @@ static void SetMulticastFilter(struct net_device *dev)
|
||||
}
|
||||
|
||||
/* Update table */
|
||||
for (i = 0; i < dev->mc_count; i++) { /* for each address in the list */
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) { /* for each address in the list */
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
if ((*addrs & 0x01) == 1) { /* multicast address? */
|
||||
|
@ -1786,7 +1786,7 @@ static void __set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
rx_mode = CR_W_PROM | CR_W_AB | CR_W_AM;
|
||||
} else if ((dev->mc_count > multicast_filter_limit) ||
|
||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to match, or accept all multicasts. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
@ -1796,7 +1796,7 @@ static void __set_rx_mode(struct net_device *dev)
|
||||
int i;
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
unsigned int bit;
|
||||
bit = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26) ^ 0x3F;
|
||||
|
@ -1606,7 +1606,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
|
||||
dmi = dev->mc_list;
|
||||
|
||||
for (j = 0; j < dev->mc_count; j++, dmi = dmi->next) {
|
||||
for (j = 0; j < netdev_mc_count(dev); j++, dmi = dmi->next) {
|
||||
/* Only support group multicast for now */
|
||||
if (!(dmi->dmi_addr[0] & 1))
|
||||
continue;
|
||||
|
@ -581,7 +581,7 @@ static void mpc52xx_fec_set_multicast_list(struct net_device *dev)
|
||||
u32 gaddr2 = 0x00000000;
|
||||
|
||||
dmi = dev->mc_list;
|
||||
for (i=0; i<dev->mc_count; i++) {
|
||||
for (i=0; i<netdev_mc_count(dev); i++) {
|
||||
crc = ether_crc_le(6, dmi->dmi_addr) >> 26;
|
||||
if (crc >= 32)
|
||||
gaddr1 |= 1 << (crc-32);
|
||||
|
@ -218,7 +218,7 @@ static void set_multicast_finish(struct net_device *dev)
|
||||
|
||||
/* if all multi or too many multicasts; just enable all */
|
||||
if ((dev->flags & IFF_ALLMULTI) != 0 ||
|
||||
dev->mc_count > FCC_MAX_MULTICAST_ADDRS) {
|
||||
netdev_mc_count(dev) > FCC_MAX_MULTICAST_ADDRS) {
|
||||
|
||||
W32(ep, fen_gaddrh, 0xffffffff);
|
||||
W32(ep, fen_gaddrl, 0xffffffff);
|
||||
|
@ -220,7 +220,7 @@ static void set_multicast_finish(struct net_device *dev)
|
||||
|
||||
/* if all multi or too many multicasts; just enable all */
|
||||
if ((dev->flags & IFF_ALLMULTI) != 0 ||
|
||||
dev->mc_count > FEC_MAX_MULTICAST_ADDRS) {
|
||||
netdev_mc_count(dev) > FEC_MAX_MULTICAST_ADDRS) {
|
||||
fep->fec.hthi = 0xffffffffU;
|
||||
fep->fec.htlo = 0xffffffffU;
|
||||
}
|
||||
|
@ -213,7 +213,7 @@ static void set_multicast_finish(struct net_device *dev)
|
||||
|
||||
/* if all multi or too many multicasts; just enable all */
|
||||
if ((dev->flags & IFF_ALLMULTI) != 0 ||
|
||||
dev->mc_count > SCC_MAX_MULTICAST_ADDRS) {
|
||||
netdev_mc_count(dev) > SCC_MAX_MULTICAST_ADDRS) {
|
||||
|
||||
W16(ep, sen_gaddr1, 0xffff);
|
||||
W16(ep, sen_gaddr2, 0xffff);
|
||||
|
@ -2863,7 +2863,7 @@ static void gfar_set_multi(struct net_device *dev)
|
||||
em_num = 0;
|
||||
}
|
||||
|
||||
if (dev->mc_count == 0)
|
||||
if (netdev_mc_empty(dev))
|
||||
return;
|
||||
|
||||
/* Parse the list, and set the appropriate bits */
|
||||
|
@ -1854,13 +1854,13 @@ static void set_rx_mode(struct net_device *dev)
|
||||
|
||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||
writew(0x000F, ioaddr + AddrMode);
|
||||
} else if ((dev->mc_count > 63) || (dev->flags & IFF_ALLMULTI)) {
|
||||
} else if ((netdev_mc_count(dev) > 63) || (dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to match, or accept all multicasts. */
|
||||
writew(0x000B, ioaddr + AddrMode);
|
||||
} else if (dev->mc_count > 0) { /* Must use the CAM filter. */
|
||||
} else if (!netdev_mc_empty(dev)) { /* Must use the CAM filter. */
|
||||
struct dev_mc_list *mclist;
|
||||
int i;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
writel(*(u32*)(mclist->dmi_addr), ioaddr + 0x100 + i*8);
|
||||
writel(0x20000 | (*(u16*)&mclist->dmi_addr[4]),
|
||||
|
@ -2090,7 +2090,7 @@ static void hp100_set_multicast_list(struct net_device *dev)
|
||||
lp->mac2_mode = HP100_MAC2MODE6; /* promiscuous mode = get all good */
|
||||
lp->mac1_mode = HP100_MAC1MODE6; /* packets on the net */
|
||||
memset(&lp->hash_bytes, 0xff, 8);
|
||||
} else if (dev->mc_count || (dev->flags & IFF_ALLMULTI)) {
|
||||
} else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI)) {
|
||||
lp->mac2_mode = HP100_MAC2MODE5; /* multicast mode = get packets for */
|
||||
lp->mac1_mode = HP100_MAC1MODE5; /* me, broadcasts and all multicasts */
|
||||
#ifdef HP100_MULTICAST_FILTER /* doesn't work!!! */
|
||||
@ -2104,9 +2104,10 @@ static void hp100_set_multicast_list(struct net_device *dev)
|
||||
|
||||
memset(&lp->hash_bytes, 0x00, 8);
|
||||
#ifdef HP100_DEBUG
|
||||
printk("hp100: %s: computing hash filter - mc_count = %i\n", dev->name, dev->mc_count);
|
||||
printk("hp100: %s: computing hash filter - mc_count = %i\n",
|
||||
dev->name, netdev_mc_count(dev));
|
||||
#endif
|
||||
for (i = 0, dmi = dev->mc_list; i < dev->mc_count; i++, dmi = dmi->next) {
|
||||
for (i = 0, dmi = dev->mc_list; i < netdev_mc_count(dev); i++, dmi = dmi->next) {
|
||||
addrs = dmi->dmi_addr;
|
||||
if ((*addrs & 0x01) == 0x01) { /* multicast address? */
|
||||
#ifdef HP100_DEBUG
|
||||
|
@ -391,7 +391,7 @@ static void emac_hash_mc(struct emac_instance *dev)
|
||||
struct dev_mc_list *dmi;
|
||||
int i;
|
||||
|
||||
DBG(dev, "hash_mc %d" NL, dev->ndev->mc_count);
|
||||
DBG(dev, "hash_mc %d" NL, netdev_mc_count(dev->ndev));
|
||||
|
||||
memset(gaht_temp, 0, sizeof (gaht_temp));
|
||||
|
||||
@ -425,9 +425,9 @@ static inline u32 emac_iff2rmr(struct net_device *ndev)
|
||||
if (ndev->flags & IFF_PROMISC)
|
||||
r |= EMAC_RMR_PME;
|
||||
else if (ndev->flags & IFF_ALLMULTI ||
|
||||
(ndev->mc_count > EMAC_XAHT_SLOTS(dev)))
|
||||
(netdev_mc_count(ndev) > EMAC_XAHT_SLOTS(dev)))
|
||||
r |= EMAC_RMR_PMME;
|
||||
else if (ndev->mc_count > 0)
|
||||
else if (!netdev_mc_empty(ndev))
|
||||
r |= EMAC_RMR_MAE;
|
||||
|
||||
return r;
|
||||
|
@ -1062,7 +1062,8 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
|
||||
struct ibmveth_adapter *adapter = netdev_priv(netdev);
|
||||
unsigned long lpar_rc;
|
||||
|
||||
if((netdev->flags & IFF_PROMISC) || (netdev->mc_count > adapter->mcastFilterSize)) {
|
||||
if ((netdev->flags & IFF_PROMISC) ||
|
||||
(netdev_mc_count(netdev) > adapter->mcastFilterSize)) {
|
||||
lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
|
||||
IbmVethMcastEnableRecv |
|
||||
IbmVethMcastDisableFiltering,
|
||||
@ -1083,7 +1084,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
|
||||
ibmveth_error_printk("h_multicast_ctrl rc=%ld when attempting to clear filter table\n", lpar_rc);
|
||||
}
|
||||
/* add the addresses to the filter table */
|
||||
for(i = 0; i < netdev->mc_count; ++i, mclist = mclist->next) {
|
||||
for(i = 0; i < netdev_mc_count(netdev); ++i, mclist = mclist->next) {
|
||||
// add the multicast address to the filter table
|
||||
unsigned long mcast_addr = 0;
|
||||
memcpy(((char *)&mcast_addr)+2, mclist->dmi_addr, 6);
|
||||
|
@ -2848,14 +2848,14 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
|
||||
u32 vmolr = 0;
|
||||
int i;
|
||||
|
||||
if (!netdev->mc_count) {
|
||||
if (netdev_mc_empty(netdev)) {
|
||||
/* nothing to program, so clear mc list */
|
||||
igb_update_mc_addr_list(hw, NULL, 0);
|
||||
igb_restore_vf_multicasts(adapter);
|
||||
return 0;
|
||||
}
|
||||
|
||||
mta_list = kzalloc(netdev->mc_count * 6, GFP_ATOMIC);
|
||||
mta_list = kzalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
|
||||
if (!mta_list)
|
||||
return -ENOMEM;
|
||||
|
||||
@ -2865,7 +2865,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
|
||||
/* The shared function expects a packed array of only addresses. */
|
||||
mc_ptr = netdev->mc_list;
|
||||
|
||||
for (i = 0; i < netdev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(netdev); i++) {
|
||||
if (!mc_ptr)
|
||||
break;
|
||||
memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr, ETH_ALEN);
|
||||
@ -2874,7 +2874,7 @@ static int igb_write_mc_addr_list(struct net_device *netdev)
|
||||
igb_update_mc_addr_list(hw, mta_list, i);
|
||||
kfree(mta_list);
|
||||
|
||||
return netdev->mc_count;
|
||||
return netdev_mc_count(netdev);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1403,8 +1403,8 @@ static void igbvf_set_multi(struct net_device *netdev)
|
||||
u8 *mta_list = NULL;
|
||||
int i;
|
||||
|
||||
if (netdev->mc_count) {
|
||||
mta_list = kmalloc(netdev->mc_count * 6, GFP_ATOMIC);
|
||||
if (!netdev_mc_empty(netdev)) {
|
||||
mta_list = kmalloc(netdev_mc_count(netdev) * 6, GFP_ATOMIC);
|
||||
if (!mta_list) {
|
||||
dev_err(&adapter->pdev->dev,
|
||||
"failed to allocate multicast filter list\n");
|
||||
@ -1415,7 +1415,7 @@ static void igbvf_set_multi(struct net_device *netdev)
|
||||
/* prepare a packed array of only addresses. */
|
||||
mc_ptr = netdev->mc_list;
|
||||
|
||||
for (i = 0; i < netdev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(netdev); i++) {
|
||||
if (!mc_ptr)
|
||||
break;
|
||||
memcpy(mta_list + (i*ETH_ALEN), mc_ptr->dmi_addr,
|
||||
|
@ -1681,14 +1681,15 @@ static void ioc3_set_multicast_list(struct net_device *dev)
|
||||
ioc3_w_emcr(ip->emcr); /* Clear promiscuous. */
|
||||
(void) ioc3_r_emcr();
|
||||
|
||||
if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 64)) {
|
||||
if ((dev->flags & IFF_ALLMULTI) ||
|
||||
(netdev_mc_count(dev) > 64)) {
|
||||
/* Too many for hashing to make sense or we want all
|
||||
multicast packets anyway, so skip computing all the
|
||||
hashes and just accept all packets. */
|
||||
ip->ehar_h = 0xffffffff;
|
||||
ip->ehar_l = 0xffffffff;
|
||||
} else {
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
char *addr = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -585,11 +585,11 @@ static void ipg_nic_set_multicast_list(struct net_device *dev)
|
||||
receivemode = IPG_RM_RECEIVEALLFRAMES;
|
||||
} else if ((dev->flags & IFF_ALLMULTI) ||
|
||||
((dev->flags & IFF_MULTICAST) &&
|
||||
(dev->mc_count > IPG_MULTICAST_HASHTABLE_SIZE))) {
|
||||
(netdev_mc_count(dev) > IPG_MULTICAST_HASHTABLE_SIZE))) {
|
||||
/* NIC to be configured to receive all multicast
|
||||
* frames. */
|
||||
receivemode |= IPG_RM_RECEIVEMULTICAST;
|
||||
} else if ((dev->flags & IFF_MULTICAST) && (dev->mc_count > 0)) {
|
||||
} else if ((dev->flags & IFF_MULTICAST) && !netdev_mc_empty(dev)) {
|
||||
/* NIC to be configured to receive selected
|
||||
* multicast addresses. */
|
||||
receivemode |= IPG_RM_RECEIVEMULTICASTHASH;
|
||||
|
@ -655,14 +655,15 @@ set_multicast_list(struct net_device *dev)
|
||||
/* Enable promiscuous mode */
|
||||
outw(MULTICAST|PROMISC, ioaddr);
|
||||
}
|
||||
else if((dev->flags&IFF_ALLMULTI) || dev->mc_count > HW_MAX_ADDRS)
|
||||
else if ((dev->flags&IFF_ALLMULTI) ||
|
||||
netdev_mc_count(dev) > HW_MAX_ADDRS)
|
||||
{
|
||||
/* Disable promiscuous mode, use normal mode. */
|
||||
hardware_set_filter(NULL);
|
||||
|
||||
outw(MULTICAST, ioaddr);
|
||||
}
|
||||
else if(dev->mc_count)
|
||||
else if (!netdev_mc_empty(dev))
|
||||
{
|
||||
/* Walk the address list, and load the filter */
|
||||
hardware_set_filter(dev->mc_list);
|
||||
|
@ -958,7 +958,7 @@ static void veth_set_multicast_list(struct net_device *dev)
|
||||
write_lock_irqsave(&port->mcast_gate, flags);
|
||||
|
||||
if ((dev->flags & IFF_PROMISC) || (dev->flags & IFF_ALLMULTI) ||
|
||||
(dev->mc_count > VETH_MAX_MCAST)) {
|
||||
(netdev_mc_count(dev) > VETH_MAX_MCAST)) {
|
||||
port->promiscuous = 1;
|
||||
} else {
|
||||
struct dev_mc_list *dmi = dev->mc_list;
|
||||
@ -969,7 +969,7 @@ static void veth_set_multicast_list(struct net_device *dev)
|
||||
/* Update table */
|
||||
port->num_mcast = 0;
|
||||
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
u8 *addr = dmi->dmi_addr;
|
||||
u64 xaddr = 0;
|
||||
|
||||
|
@ -1077,7 +1077,7 @@ ixgb_set_multi(struct net_device *netdev)
|
||||
rctl |= IXGB_RCTL_VFE;
|
||||
}
|
||||
|
||||
if (netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES) {
|
||||
if (netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES) {
|
||||
rctl |= IXGB_RCTL_MPE;
|
||||
IXGB_WRITE_REG(hw, RCTL, rctl);
|
||||
} else {
|
||||
@ -1092,7 +1092,7 @@ ixgb_set_multi(struct net_device *netdev)
|
||||
memcpy(&mta[i * IXGB_ETH_LENGTH_OF_ADDRESS],
|
||||
mc_ptr->dmi_addr, IXGB_ETH_LENGTH_OF_ADDRESS);
|
||||
|
||||
ixgb_mc_addr_list_update(hw, mta, netdev->mc_count, 0);
|
||||
ixgb_mc_addr_list_update(hw, mta, netdev_mc_count(netdev), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1616,7 +1616,7 @@ ixgb_update_stats(struct ixgb_adapter *adapter)
|
||||
return;
|
||||
|
||||
if ((netdev->flags & IFF_PROMISC) || (netdev->flags & IFF_ALLMULTI) ||
|
||||
(netdev->mc_count > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) {
|
||||
(netdev_mc_count(netdev) > IXGB_MAX_NUM_MULTICAST_ADDRESSES)) {
|
||||
u64 multi = IXGB_READ_REG(&adapter->hw, MPRCL);
|
||||
u32 bcast_l = IXGB_READ_REG(&adapter->hw, BPRCL);
|
||||
u32 bcast_h = IXGB_READ_REG(&adapter->hw, BPRCH);
|
||||
|
@ -2571,7 +2571,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
||||
hw->mac.ops.update_uc_addr_list(hw, netdev);
|
||||
|
||||
/* reprogram multicast list */
|
||||
addr_count = netdev->mc_count;
|
||||
addr_count = netdev_mc_count(netdev);
|
||||
if (addr_count)
|
||||
addr_list = netdev->mc_list->dmi_addr;
|
||||
hw->mac.ops.update_mc_addr_list(hw, addr_list, addr_count,
|
||||
|
@ -1527,7 +1527,7 @@ static void ixgbevf_set_rx_mode(struct net_device *netdev)
|
||||
int addr_count = 0;
|
||||
|
||||
/* reprogram multicast list */
|
||||
addr_count = netdev->mc_count;
|
||||
addr_count = netdev_mc_count(netdev);
|
||||
if (addr_count)
|
||||
addr_list = netdev->mc_list->dmi_addr;
|
||||
if (hw->mac.ops.update_mc_addr_list)
|
||||
|
@ -2013,7 +2013,7 @@ jme_set_multi(struct net_device *netdev)
|
||||
|
||||
jme->reg_rxmcs |= RXMCS_MULFRAME | RXMCS_MULFILTERED;
|
||||
for (i = 0, mclist = netdev->mc_list;
|
||||
mclist && i < netdev->mc_count;
|
||||
mclist && i < netdev_mc_count(netdev);
|
||||
++i, mclist = mclist->next) {
|
||||
|
||||
bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) & 0x3F;
|
||||
|
@ -490,19 +490,19 @@ static void korina_multicast_list(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
recognise |= ETH_ARC_PRO;
|
||||
|
||||
else if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 4))
|
||||
else if ((dev->flags & IFF_ALLMULTI) || (netdev_mc_count(dev) > 4))
|
||||
/* All multicast and broadcast */
|
||||
recognise |= ETH_ARC_AM;
|
||||
|
||||
/* Build the hash table */
|
||||
if (dev->mc_count > 4) {
|
||||
if (netdev_mc_count(dev) > 4) {
|
||||
u16 hash_table[4];
|
||||
u32 crc;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
hash_table[i] = 0;
|
||||
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
char *addrs = dmi->dmi_addr;
|
||||
|
||||
dmi = dmi->next;
|
||||
|
@ -965,14 +965,14 @@ static void ks8851_set_rx_mode(struct net_device *dev)
|
||||
|
||||
rxctrl.rxcr1 = (RXCR1_RXME | RXCR1_RXAE |
|
||||
RXCR1_RXPAFMA | RXCR1_RXMAFMA);
|
||||
} else if (dev->flags & IFF_MULTICAST && dev->mc_count > 0) {
|
||||
} else if (dev->flags & IFF_MULTICAST && !netdev_mc_empty(dev)) {
|
||||
struct dev_mc_list *mcptr = dev->mc_list;
|
||||
u32 crc;
|
||||
int i;
|
||||
|
||||
/* accept some multicast */
|
||||
|
||||
for (i = dev->mc_count; i > 0; i--) {
|
||||
for (i = netdev_mc_count(dev); i > 0; i--) {
|
||||
crc = ether_crc(ETH_ALEN, mcptr->dmi_addr);
|
||||
crc >>= (32 - 6); /* get top six bits */
|
||||
|
||||
|
@ -1193,8 +1193,8 @@ static void ks_set_rx_mode(struct net_device *netdev)
|
||||
else
|
||||
ks_set_promis(ks, false);
|
||||
|
||||
if ((netdev->flags & IFF_MULTICAST) && netdev->mc_count) {
|
||||
if (netdev->mc_count <= MAX_MCAST_LST) {
|
||||
if ((netdev->flags & IFF_MULTICAST) && netdev_mc_count(netdev)) {
|
||||
if (netdev_mc_count(netdev) <= MAX_MCAST_LST) {
|
||||
int i = 0;
|
||||
for (ptr = netdev->mc_list; ptr; ptr = ptr->next) {
|
||||
if (!(*ptr->dmi_addr & 1))
|
||||
|
@ -1288,7 +1288,7 @@ static void set_multicast_list(struct net_device *dev)
|
||||
} else {
|
||||
short multicast_table[4];
|
||||
int i;
|
||||
int num_addrs=dev->mc_count;
|
||||
int num_addrs=netdev_mc_count(dev);
|
||||
if(dev->flags&IFF_ALLMULTI)
|
||||
num_addrs=1;
|
||||
/* FIXIT: We don't use the multicast table, but rely on upper-layer filtering. */
|
||||
|
@ -1380,21 +1380,21 @@ static void set_multicast_list(struct net_device *dev)
|
||||
}
|
||||
}
|
||||
|
||||
cnt = dev->mc_count;
|
||||
cnt = netdev_mc_count(dev);
|
||||
if (cnt > MAX_MC_CNT) {
|
||||
cnt = MAX_MC_CNT;
|
||||
printk(KERN_NOTICE "%s: Only %d multicast addresses supported",
|
||||
dev->name, cnt);
|
||||
}
|
||||
|
||||
if (dev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
struct dev_mc_list *dmi;
|
||||
unsigned char *cp;
|
||||
struct mc_cmd *cmd;
|
||||
|
||||
cmd = &dma->mc_cmd;
|
||||
cmd->cmd.command = SWAP16(CmdMulticastList);
|
||||
cmd->mc_cnt = SWAP16(dev->mc_count * 6);
|
||||
cmd->mc_cnt = SWAP16(netdev_mc_count(dev) * 6);
|
||||
cp = cmd->mc_addrs;
|
||||
for (dmi = dev->mc_list;
|
||||
cnt && dmi != NULL;
|
||||
|
@ -232,7 +232,7 @@ static void temac_set_multicast_list(struct net_device *ndev)
|
||||
|
||||
mutex_lock(&lp->indirect_mutex);
|
||||
if (ndev->flags & (IFF_ALLMULTI | IFF_PROMISC) ||
|
||||
ndev->mc_count > MULTICAST_CAM_TABLE_NUM) {
|
||||
netdev_mc_count(ndev) > MULTICAST_CAM_TABLE_NUM) {
|
||||
/*
|
||||
* We must make the kernel realise we had to move
|
||||
* into promisc mode or we start all out war on
|
||||
@ -242,9 +242,9 @@ static void temac_set_multicast_list(struct net_device *ndev)
|
||||
ndev->flags |= IFF_PROMISC;
|
||||
temac_indirect_out32(lp, XTE_AFM_OFFSET, XTE_AFM_EPPRM_MASK);
|
||||
dev_info(&ndev->dev, "Promiscuous mode enabled.\n");
|
||||
} else if (ndev->mc_count) {
|
||||
} else if (!netdev_mc_empty(ndev)) {
|
||||
struct dev_mc_list *mclist = ndev->mc_list;
|
||||
for (i = 0; mclist && i < ndev->mc_count; i++) {
|
||||
for (i = 0; mclist && i < netdev_mc_count(ndev); i++) {
|
||||
|
||||
if (i >= MULTICAST_CAM_TABLE_NUM)
|
||||
break;
|
||||
|
@ -1253,18 +1253,19 @@ static void set_multicast_list(struct net_device *dev) {
|
||||
|
||||
if (i596_debug > 1)
|
||||
printk ("%s: set multicast list %d\n",
|
||||
dev->name, dev->mc_count);
|
||||
dev->name, netdev_mc_count(dev));
|
||||
|
||||
if (dev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
struct dev_mc_list *dmi;
|
||||
char *cp;
|
||||
cmd = kmalloc(sizeof(struct i596_cmd)+2+dev->mc_count*6, GFP_ATOMIC);
|
||||
cmd = kmalloc(sizeof(struct i596_cmd) + 2 +
|
||||
netdev_mc_count(dev) * 6, GFP_ATOMIC);
|
||||
if (cmd == NULL) {
|
||||
printk (KERN_ERR "%s: set_multicast Memory squeeze.\n", dev->name);
|
||||
return;
|
||||
}
|
||||
cmd->command = CmdMulticastList;
|
||||
*((unsigned short *) (cmd + 1)) = dev->mc_count * 6;
|
||||
*((unsigned short *) (cmd + 1)) = netdev_mc_count(dev) * 6;
|
||||
cp = ((char *)(cmd + 1))+2;
|
||||
for (dmi = dev->mc_list; dmi != NULL; dmi = dmi->next) {
|
||||
memcpy(cp, dmi,6);
|
||||
@ -1277,7 +1278,8 @@ static void set_multicast_list(struct net_device *dev) {
|
||||
if (lp->set_conf.pa_next != I596_NULL) {
|
||||
return;
|
||||
}
|
||||
if (dev->mc_count == 0 && !(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
|
||||
if (netdev_mc_empty(dev) &&
|
||||
!(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
|
||||
lp->i596_config[8] &= ~0x01;
|
||||
} else {
|
||||
lp->i596_config[8] |= 0x01;
|
||||
|
@ -901,7 +901,7 @@ static void macb_sethashtable(struct net_device *dev)
|
||||
mc_filter[0] = mc_filter[1] = 0;
|
||||
|
||||
curr = dev->mc_list;
|
||||
for (i = 0; i < dev->mc_count; i++, curr = curr->next) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++, curr = curr->next) {
|
||||
if (!curr) break; /* unexpected end of list */
|
||||
|
||||
bitnr = hash_get_index(curr->dmi_addr);
|
||||
@ -934,7 +934,7 @@ static void macb_set_rx_mode(struct net_device *dev)
|
||||
macb_writel(bp, HRB, -1);
|
||||
macb_writel(bp, HRT, -1);
|
||||
cfg |= MACB_BIT(NCFGR_MTI);
|
||||
} else if (dev->mc_count > 0) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
/* Enable specific multicasts */
|
||||
macb_sethashtable(dev);
|
||||
cfg |= MACB_BIT(NCFGR_MTI);
|
||||
|
@ -606,7 +606,7 @@ static void mace_set_multicast(struct net_device *dev)
|
||||
} else {
|
||||
for (i = 0; i < 8; i++)
|
||||
multicast_filter[i] = 0;
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
crc = ether_crc_le(6, dmi->dmi_addr);
|
||||
j = crc >> 26; /* bit number in multicast_filter */
|
||||
multicast_filter[j >> 3] |= 1 << (j & 7);
|
||||
|
@ -518,7 +518,7 @@ static void mace_set_multicast(struct net_device *dev)
|
||||
} else {
|
||||
for (i = 0; i < 8; i++)
|
||||
multicast_filter[i] = 0;
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
crc = ether_crc_le(6, dmi->dmi_addr);
|
||||
j = crc >> 26; /* bit number in multicast_filter */
|
||||
multicast_filter[j >> 3] |= 1 << (j & 7);
|
||||
|
@ -2488,7 +2488,7 @@ static void __set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
|
||||
rx_mode = RxFilterEnable | AcceptBroadcast
|
||||
| AcceptAllMulticast | AcceptAllPhys | AcceptMyPhys;
|
||||
} else if ((dev->mc_count > multicast_filter_limit) ||
|
||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
rx_mode = RxFilterEnable | AcceptBroadcast
|
||||
| AcceptAllMulticast | AcceptMyPhys;
|
||||
@ -2496,7 +2496,7 @@ static void __set_rx_mode(struct net_device *dev)
|
||||
struct dev_mc_list *mclist;
|
||||
int i;
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
int b = (ether_crc(ETH_ALEN, mclist->dmi_addr) >> 23) & 0x1ff;
|
||||
mc_filter[b/8] |= (1 << (b & 0x07));
|
||||
|
@ -554,7 +554,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
|
||||
return;
|
||||
}
|
||||
|
||||
if (netdev->mc_count == 0) {
|
||||
if (netdev_mc_empty(netdev)) {
|
||||
adapter->set_promisc(adapter,
|
||||
NETXEN_NIU_NON_PROMISC_MODE);
|
||||
netxen_nic_disable_mcast_filter(adapter);
|
||||
@ -563,7 +563,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
|
||||
|
||||
adapter->set_promisc(adapter, NETXEN_NIU_ALLMULTI_MODE);
|
||||
if (netdev->flags & IFF_ALLMULTI ||
|
||||
netdev->mc_count > adapter->max_mc_count) {
|
||||
netdev_mc_count(netdev) > adapter->max_mc_count) {
|
||||
netxen_nic_disable_mcast_filter(adapter);
|
||||
return;
|
||||
}
|
||||
@ -573,7 +573,7 @@ void netxen_p2_nic_set_multi(struct net_device *netdev)
|
||||
for (mc_ptr = netdev->mc_list; mc_ptr; mc_ptr = mc_ptr->next, index++)
|
||||
netxen_nic_set_mcast_addr(adapter, index, mc_ptr->dmi_addr);
|
||||
|
||||
if (index != netdev->mc_count)
|
||||
if (index != netdev_mc_count(netdev))
|
||||
printk(KERN_WARNING "%s: %s multicast address count mismatch\n",
|
||||
netxen_nic_driver_name, netdev->name);
|
||||
|
||||
@ -704,12 +704,12 @@ void netxen_p3_nic_set_multi(struct net_device *netdev)
|
||||
}
|
||||
|
||||
if ((netdev->flags & IFF_ALLMULTI) ||
|
||||
(netdev->mc_count > adapter->max_mc_count)) {
|
||||
(netdev_mc_count(netdev) > adapter->max_mc_count)) {
|
||||
mode = VPORT_MISS_MODE_ACCEPT_MULTI;
|
||||
goto send_fw_cmd;
|
||||
}
|
||||
|
||||
if (netdev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(netdev)) {
|
||||
for (mc_ptr = netdev->mc_list; mc_ptr;
|
||||
mc_ptr = mc_ptr->next) {
|
||||
nx_p3_nic_add_mac(adapter, mc_ptr->dmi_addr, &del_list);
|
||||
|
@ -597,7 +597,7 @@ static int init586(struct net_device *dev)
|
||||
struct tdr_cmd_struct __iomem *tdr_cmd;
|
||||
struct mcsetup_cmd_struct __iomem *mc_cmd;
|
||||
struct dev_mc_list *dmi = dev->mc_list;
|
||||
int num_addrs = dev->mc_count;
|
||||
int num_addrs = netdev_mc_count(dev);
|
||||
|
||||
ptr = p->scb + 1;
|
||||
|
||||
|
@ -849,7 +849,7 @@ static int ni65_lance_reinit(struct net_device *dev)
|
||||
|
||||
if(dev->flags & IFF_PROMISC)
|
||||
ni65_init_lance(p,dev->dev_addr,0x00,M_PROM);
|
||||
else if(dev->mc_count || dev->flags & IFF_ALLMULTI)
|
||||
else if (netdev_mc_count(dev) || dev->flags & IFF_ALLMULTI)
|
||||
ni65_init_lance(p,dev->dev_addr,0xff,0x0);
|
||||
else
|
||||
ni65_init_lance(p,dev->dev_addr,0x00,0x00);
|
||||
|
@ -6369,7 +6369,7 @@ static void niu_set_rx_mode(struct net_device *dev)
|
||||
np->flags &= ~(NIU_FLAGS_MCAST | NIU_FLAGS_PROMISC);
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
np->flags |= NIU_FLAGS_PROMISC;
|
||||
if ((dev->flags & IFF_ALLMULTI) || (dev->mc_count > 0))
|
||||
if ((dev->flags & IFF_ALLMULTI) || (!netdev_mc_empty(dev)))
|
||||
np->flags |= NIU_FLAGS_MCAST;
|
||||
|
||||
alt_cnt = netdev_uc_count(dev);
|
||||
@ -6412,7 +6412,7 @@ static void niu_set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_ALLMULTI) {
|
||||
for (i = 0; i < 16; i++)
|
||||
hash[i] = 0xffff;
|
||||
} else if (dev->mc_count > 0) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
for (addr = dev->mc_list; addr; addr = addr->next) {
|
||||
u32 crc = ether_crc_le(ETH_ALEN, addr->da_addr);
|
||||
|
||||
|
@ -1719,7 +1719,7 @@ static void ns83820_set_multicast(struct net_device *ndev)
|
||||
else
|
||||
and_mask &= ~(RFCR_AAU | RFCR_AAM);
|
||||
|
||||
if (ndev->flags & IFF_ALLMULTI || ndev->mc_count)
|
||||
if (ndev->flags & IFF_ALLMULTI || netdev_mc_count(ndev))
|
||||
or_mask |= RFCR_AAM;
|
||||
else
|
||||
and_mask &= ~RFCR_AAM;
|
||||
|
@ -493,8 +493,8 @@ static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)
|
||||
}
|
||||
|
||||
if (netdev->flags & IFF_MULTICAST) {
|
||||
if (cam_mode == 0 || (netdev->flags & IFF_ALLMULTI)
|
||||
|| netdev->mc_count > available_cam_entries)
|
||||
if (cam_mode == 0 || (netdev->flags & IFF_ALLMULTI) ||
|
||||
netdev_mc_count(netdev) > available_cam_entries)
|
||||
multicast_mode = 2; /* 1 - Accept all multicast. */
|
||||
else
|
||||
multicast_mode = 0; /* 0 - Use CAM. */
|
||||
@ -511,7 +511,7 @@ static void octeon_mgmt_set_rx_filtering(struct net_device *netdev)
|
||||
}
|
||||
}
|
||||
if (multicast_mode == 0) {
|
||||
i = netdev->mc_count;
|
||||
i = netdev_mc_count(netdev);
|
||||
list = netdev->mc_list;
|
||||
while (i--) {
|
||||
octeon_mgmt_cam_state_add(&cam_state, list->da_addr);
|
||||
|
@ -1820,7 +1820,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
|
||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
||||
AcceptAllPhys;
|
||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
||||
} else if ((dev->mc_count > multicast_filter_limit) ||
|
||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
||||
@ -1829,7 +1829,7 @@ static void netdrv_set_rx_mode (struct net_device *dev)
|
||||
struct dev_mc_list *mclist;
|
||||
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
||||
mc_filter[1] = mc_filter[0] = 0;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
|
||||
|
||||
|
@ -1148,7 +1148,7 @@ static void set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
|
||||
ioaddr + EL3_CMD);
|
||||
else if (dev->mc_count || (dev->flags & IFF_ALLMULTI))
|
||||
else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI))
|
||||
outw(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
|
||||
else
|
||||
outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
|
||||
|
@ -886,7 +886,7 @@ static void set_rx_mode(struct net_device *dev)
|
||||
|
||||
if (dev->flags & IFF_PROMISC)
|
||||
opts |= RxMulticast | RxProm;
|
||||
else if (dev->mc_count || (dev->flags & IFF_ALLMULTI))
|
||||
else if (!netdev_mc_empty(dev) || (dev->flags & IFF_ALLMULTI))
|
||||
opts |= RxMulticast;
|
||||
outw(opts, ioaddr + EL3_CMD);
|
||||
}
|
||||
|
@ -1187,19 +1187,19 @@ static void set_rx_mode(struct net_device *dev)
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
|
||||
} else if (dev->mc_count > MC_FILTERBREAK ||
|
||||
} else if (netdev_mc_count(dev) > MC_FILTERBREAK ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outb(2, ioaddr + RX_MODE); /* Use normal mode. */
|
||||
} else if (dev->mc_count == 0) {
|
||||
} else if (netdev_mc_empty(dev)) {
|
||||
memset(mc_filter, 0x00, sizeof(mc_filter));
|
||||
outb(1, ioaddr + RX_MODE); /* Ignore almost all multicasts. */
|
||||
} else {
|
||||
struct dev_mc_list *mclist;
|
||||
|
||||
memset(mc_filter, 0, sizeof(mc_filter));
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
unsigned int bit =
|
||||
ether_crc_le(ETH_ALEN, mclist->dmi_addr) >> 26;
|
||||
|
@ -1481,8 +1481,8 @@ static void set_multicast_list(struct net_device *dev)
|
||||
#ifdef PCMCIA_DEBUG
|
||||
{
|
||||
static int old;
|
||||
if (dev->mc_count != old) {
|
||||
old = dev->mc_count;
|
||||
if (netdev_mc_count(dev) != old) {
|
||||
old = netdev_mc_count(dev);
|
||||
pr_debug("%s: setting Rx mode to %d addresses.\n",
|
||||
dev->name, old);
|
||||
}
|
||||
@ -1490,13 +1490,13 @@ static void set_multicast_list(struct net_device *dev)
|
||||
#endif
|
||||
|
||||
/* Set multicast_num_addrs. */
|
||||
lp->multicast_num_addrs = dev->mc_count;
|
||||
lp->multicast_num_addrs = netdev_mc_count(dev);
|
||||
|
||||
/* Set multicast_ladrf. */
|
||||
if (num_addrs > 0) {
|
||||
/* Calculate multicast logical address filter */
|
||||
memset(lp->multicast_ladrf, 0, MACE_LADRF_LEN);
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
memcpy(adr, dmi->dmi_addr, ETHER_ADDR_LEN);
|
||||
dmi = dmi->next;
|
||||
BuildLAF(lp->multicast_ladrf, adr);
|
||||
@ -1537,15 +1537,15 @@ static void set_multicast_list(struct net_device *dev)
|
||||
#ifdef PCMCIA_DEBUG
|
||||
{
|
||||
static int old;
|
||||
if (dev->mc_count != old) {
|
||||
old = dev->mc_count;
|
||||
if (netdev_mc_count(dev) != old) {
|
||||
old = netdev_mc_count(dev);
|
||||
pr_debug("%s: setting Rx mode to %d addresses.\n",
|
||||
dev->name, old);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
lp->multicast_num_addrs = dev->mc_count;
|
||||
lp->multicast_num_addrs = netdev_mc_count(dev);
|
||||
restore_multicast_list(dev);
|
||||
|
||||
} /* set_multicast_list */
|
||||
|
@ -1638,8 +1638,8 @@ static void set_rx_mode(struct net_device *dev)
|
||||
} else if (dev->flags & IFF_ALLMULTI)
|
||||
rx_cfg_setting = RxStripCRC | RxEnable | RxAllMulti;
|
||||
else {
|
||||
if (dev->mc_count) {
|
||||
fill_multicast_tbl(dev->mc_count, dev->mc_list,
|
||||
if (!netdev_mc_empty(dev)) {
|
||||
fill_multicast_tbl(netdev_mc_count(dev), dev->mc_list,
|
||||
(u_char *)multicast_table);
|
||||
}
|
||||
rx_cfg_setting = RxStripCRC | RxEnable;
|
||||
|
@ -1384,7 +1384,7 @@ set_addresses(struct net_device *dev)
|
||||
if (++n > 9)
|
||||
break;
|
||||
i = 0;
|
||||
if (n > 1 && n <= dev->mc_count && dmi) {
|
||||
if (n > 1 && n <= netdev_mc_count(dev) && dmi) {
|
||||
dmi = dmi->next;
|
||||
}
|
||||
}
|
||||
@ -1394,7 +1394,7 @@ set_addresses(struct net_device *dev)
|
||||
SelectPage(k);
|
||||
}
|
||||
|
||||
if (n && n <= dev->mc_count && dmi)
|
||||
if (n && n <= netdev_mc_count(dev) && dmi)
|
||||
addr = dmi->dmi_addr;
|
||||
else
|
||||
addr = dev->dev_addr;
|
||||
@ -1424,9 +1424,9 @@ set_multicast_list(struct net_device *dev)
|
||||
|
||||
if (dev->flags & IFF_PROMISC) { /* snoop */
|
||||
PutByte(XIRCREG42_SWC1, value | 0x06); /* set MPE and PME */
|
||||
} else if (dev->mc_count > 9 || (dev->flags & IFF_ALLMULTI)) {
|
||||
} else if (netdev_mc_count(dev) > 9 || (dev->flags & IFF_ALLMULTI)) {
|
||||
PutByte(XIRCREG42_SWC1, value | 0x02); /* set MPE */
|
||||
} else if (dev->mc_count) {
|
||||
} else if (!netdev_mc_empty(dev)) {
|
||||
/* the chip can filter 9 addresses perfectly */
|
||||
PutByte(XIRCREG42_SWC1, value | 0x01);
|
||||
SelectPage(0x40);
|
||||
|
@ -2698,7 +2698,7 @@ static void pcnet32_load_multicast(struct net_device *dev)
|
||||
ib->filter[1] = 0;
|
||||
|
||||
/* Add addresses */
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
addrs = dmi->dmi_addr;
|
||||
dmi = dmi->next;
|
||||
|
||||
|
@ -568,7 +568,7 @@ void gelic_net_set_multi(struct net_device *netdev)
|
||||
status);
|
||||
|
||||
if ((netdev->flags & IFF_ALLMULTI) ||
|
||||
(netdev->mc_count > GELIC_NET_MC_COUNT_MAX)) {
|
||||
(netdev_mc_count(netdev) > GELIC_NET_MC_COUNT_MAX)) {
|
||||
status = lv1_net_add_multicast_address(bus_id(card),
|
||||
dev_id(card),
|
||||
0, 1);
|
||||
|
@ -447,12 +447,12 @@ void qlcnic_set_multi(struct net_device *netdev)
|
||||
}
|
||||
|
||||
if ((netdev->flags & IFF_ALLMULTI) ||
|
||||
(netdev->mc_count > adapter->max_mc_count)) {
|
||||
(netdev_mc_count(netdev) > adapter->max_mc_count)) {
|
||||
mode = VPORT_MISS_MODE_ACCEPT_MULTI;
|
||||
goto send_fw_cmd;
|
||||
}
|
||||
|
||||
if (netdev->mc_count > 0) {
|
||||
if (!netdev_mc_empty(netdev)) {
|
||||
for (mc_ptr = netdev->mc_list; mc_ptr;
|
||||
mc_ptr = mc_ptr->next) {
|
||||
qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr,
|
||||
|
@ -4221,7 +4221,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
|
||||
* transition is taking place.
|
||||
*/
|
||||
if ((ndev->flags & IFF_ALLMULTI) ||
|
||||
(ndev->mc_count > MAX_MULTICAST_ENTRIES)) {
|
||||
(netdev_mc_count(ndev) > MAX_MULTICAST_ENTRIES)) {
|
||||
if (!test_bit(QL_ALLMULTI, &qdev->flags)) {
|
||||
if (ql_set_routing_reg
|
||||
(qdev, RT_IDX_ALLMULTI_SLOT, RT_IDX_MCAST, 1)) {
|
||||
@ -4243,7 +4243,7 @@ static void qlge_set_multicast_list(struct net_device *ndev)
|
||||
}
|
||||
}
|
||||
|
||||
if (ndev->mc_count) {
|
||||
if (!netdev_mc_empty(ndev)) {
|
||||
status = ql_sem_spinlock(qdev, SEM_MAC_ADDR_MASK);
|
||||
if (status)
|
||||
goto exit;
|
||||
|
@ -958,21 +958,22 @@ static void r6040_multicast_list(struct net_device *dev)
|
||||
}
|
||||
/* Too many multicast addresses
|
||||
* accept all traffic */
|
||||
else if ((dev->mc_count > MCAST_MAX) || (dev->flags & IFF_ALLMULTI))
|
||||
else if ((netdev_mc_count(dev) > MCAST_MAX) ||
|
||||
(dev->flags & IFF_ALLMULTI))
|
||||
reg |= 0x0020;
|
||||
|
||||
iowrite16(reg, ioaddr);
|
||||
spin_unlock_irqrestore(&lp->lock, flags);
|
||||
|
||||
/* Build the hash table */
|
||||
if (dev->mc_count > MCAST_MAX) {
|
||||
if (netdev_mc_count(dev) > MCAST_MAX) {
|
||||
u16 hash_table[4];
|
||||
u32 crc;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
hash_table[i] = 0;
|
||||
|
||||
for (i = 0; i < dev->mc_count; i++) {
|
||||
for (i = 0; i < netdev_mc_count(dev); i++) {
|
||||
char *addrs = dmi->dmi_addr;
|
||||
|
||||
dmi = dmi->next;
|
||||
@ -994,14 +995,14 @@ static void r6040_multicast_list(struct net_device *dev)
|
||||
iowrite16(hash_table[3], ioaddr + MAR3);
|
||||
}
|
||||
/* Multicast Address 1~4 case */
|
||||
for (i = 0, dmi; (i < dev->mc_count) && (i < MCAST_MAX); i++) {
|
||||
for (i = 0, dmi; (i < netdev_mc_count(dev)) && (i < MCAST_MAX); i++) {
|
||||
adrp = (u16 *)dmi->dmi_addr;
|
||||
iowrite16(adrp[0], ioaddr + MID_1L + 8*i);
|
||||
iowrite16(adrp[1], ioaddr + MID_1M + 8*i);
|
||||
iowrite16(adrp[2], ioaddr + MID_1H + 8*i);
|
||||
dmi = dmi->next;
|
||||
}
|
||||
for (i = dev->mc_count; i < MCAST_MAX; i++) {
|
||||
for (i = netdev_mc_count(dev); i < MCAST_MAX; i++) {
|
||||
iowrite16(0xffff, ioaddr + MID_0L + 8*i);
|
||||
iowrite16(0xffff, ioaddr + MID_0M + 8*i);
|
||||
iowrite16(0xffff, ioaddr + MID_0H + 8*i);
|
||||
|
@ -4758,7 +4758,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
|
||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
||||
AcceptAllPhys;
|
||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
||||
} else if ((dev->mc_count > multicast_filter_limit) ||
|
||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
|
||||
(dev->flags & IFF_ALLMULTI)) {
|
||||
/* Too many to filter perfectly -- accept all multicasts. */
|
||||
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
||||
@ -4769,7 +4769,7 @@ static void rtl_set_rx_mode(struct net_device *dev)
|
||||
|
||||
rx_mode = AcceptBroadcast | AcceptMyPhys;
|
||||
mc_filter[1] = mc_filter[0] = 0;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; mclist && i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
int bit_nr = ether_crc(ETH_ALEN, mclist->dmi_addr) >> 26;
|
||||
mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
|
||||
|
@ -5055,8 +5055,8 @@ static void s2io_set_multicast(struct net_device *dev)
|
||||
}
|
||||
|
||||
/* Update individual M_CAST address list */
|
||||
if ((!sp->m_cast_flg) && dev->mc_count) {
|
||||
if (dev->mc_count >
|
||||
if ((!sp->m_cast_flg) && netdev_mc_count(dev)) {
|
||||
if (netdev_mc_count(dev) >
|
||||
(config->max_mc_addr - config->max_mac_addr)) {
|
||||
DBG_PRINT(ERR_DBG,
|
||||
"%s: No more Rx filters can be added - "
|
||||
@ -5066,7 +5066,7 @@ static void s2io_set_multicast(struct net_device *dev)
|
||||
}
|
||||
|
||||
prev_cnt = sp->mc_addr_count;
|
||||
sp->mc_addr_count = dev->mc_count;
|
||||
sp->mc_addr_count = netdev_mc_count(dev);
|
||||
|
||||
/* Clear out the previous list of Mc in the H/W. */
|
||||
for (i = 0; i < prev_cnt; i++) {
|
||||
@ -5092,7 +5092,7 @@ static void s2io_set_multicast(struct net_device *dev)
|
||||
}
|
||||
|
||||
/* Create the new Rx filter list and update the same in H/W. */
|
||||
for (i = 0, mclist = dev->mc_list; i < dev->mc_count;
|
||||
for (i = 0, mclist = dev->mc_list; i < netdev_mc_count(dev);
|
||||
i++, mclist = mclist->next) {
|
||||
memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr,
|
||||
ETH_ALEN);
|
||||
|
@ -429,7 +429,7 @@ static void _sc92031_set_mar(struct net_device *dev)
|
||||
u32 mar0 = 0, mar1 = 0;
|
||||
|
||||
if ((dev->flags & IFF_PROMISC) ||
|
||||
dev->mc_count > multicast_filter_limit ||
|
||||
netdev_mc_count(dev) > multicast_filter_limit ||
|
||||
(dev->flags & IFF_ALLMULTI))
|
||||
mar0 = mar1 = 0xffffffff;
|
||||
else if (dev->flags & IFF_MULTICAST) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user