aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2008-03-18 18:17:16 -0400
committerJeff Garzik <jeff@garzik.org>2008-03-25 23:41:28 -0400
commit23d245b66ec8bec21f41ea484e05f470bea764e8 (patch)
tree4a5e9310d965bc93439469cef03181416bb806ec /drivers/net
parent33eddedb9cae602e093348421205b1619cccdbb4 (diff)
dm9000: Support promisc and all-multi modes
Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/dm9000.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 1fe305ca2cf0..b09a53de1c53 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -798,8 +798,6 @@ dm9000_init_dm9000(struct net_device *dev)
798 /* Set address filter table */ 798 /* Set address filter table */
799 dm9000_hash_table(dev); 799 dm9000_hash_table(dev);
800 800
801 /* Activate DM9000 */
802 iow(db, DM9000_RCR, RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN);
803 /* Enable TX/RX interrupt mask */ 801 /* Enable TX/RX interrupt mask */
804 iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM); 802 iow(db, DM9000_IMR, IMR_PAR | IMR_PTM | IMR_PRM);
805 803
@@ -1197,6 +1195,7 @@ dm9000_hash_table(struct net_device *dev)
1197 int i, oft; 1195 int i, oft;
1198 u32 hash_val; 1196 u32 hash_val;
1199 u16 hash_table[4]; 1197 u16 hash_table[4];
1198 u8 rcr = RCR_DIS_LONG | RCR_DIS_CRC | RCR_RXEN;
1200 unsigned long flags; 1199 unsigned long flags;
1201 1200
1202 dm9000_dbg(db, 1, "entering %s\n", __func__); 1201 dm9000_dbg(db, 1, "entering %s\n", __func__);
@@ -1213,6 +1212,12 @@ dm9000_hash_table(struct net_device *dev)
1213 /* broadcast address */ 1212 /* broadcast address */
1214 hash_table[3] = 0x8000; 1213 hash_table[3] = 0x8000;
1215 1214
1215 if (dev->flags & IFF_PROMISC)
1216 rcr |= RCR_PRMSC;
1217
1218 if (dev->flags & IFF_ALLMULTI)
1219 rcr |= RCR_ALL;
1220
1216 /* the multicast address in Hash Table : 64 bits */ 1221 /* the multicast address in Hash Table : 64 bits */
1217 for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) { 1222 for (i = 0; i < mc_cnt; i++, mcptr = mcptr->next) {
1218 hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f; 1223 hash_val = ether_crc_le(6, mcptr->dmi_addr) & 0x3f;
@@ -1225,6 +1230,7 @@ dm9000_hash_table(struct net_device *dev)
1225 iow(db, oft++, hash_table[i] >> 8); 1230 iow(db, oft++, hash_table[i] >> 8);
1226 } 1231 }
1227 1232
1233 iow(db, DM9000_RCR, rcr);
1228 spin_unlock_irqrestore(&db->lock, flags); 1234 spin_unlock_irqrestore(&db->lock, flags);
1229} 1235}
1230 1236