Commit d6f5ede4 authored by Prasanna Meda's avatar Prasanna Meda Committed by Linus Torvalds

[netdrvr tulip] fix hashed setup frame code

It is using local variable `i' in both the inner and outer loop.

Need to bring the for loop outside the loop.  Otherwise we need to reset the
setup_frame to tp->setup_frame after every loop.  You do not need to set the
setup_frm for every mc address, we can set once after the complete has_table
is ready.
parent 5ada03a9
...@@ -998,12 +998,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev) ...@@ -998,12 +998,12 @@ static void build_setup_frame_hash(u16 *setup_frm, struct net_device *dev)
set_bit_le(index, hash_table); set_bit_le(index, hash_table);
}
for (i = 0; i < 32; i++) { for (i = 0; i < 32; i++) {
*setup_frm++ = hash_table[i]; *setup_frm++ = hash_table[i];
*setup_frm++ = hash_table[i]; *setup_frm++ = hash_table[i];
} }
setup_frm = &tp->setup_frame[13*6]; setup_frm = &tp->setup_frame[13*6];
}
/* Fill the final entry with our physical address. */ /* Fill the final entry with our physical address. */
eaddrs = (u16 *)dev->dev_addr; eaddrs = (u16 *)dev->dev_addr;
...@@ -1103,11 +1103,13 @@ static void set_rx_mode(struct net_device *dev) ...@@ -1103,11 +1103,13 @@ static void set_rx_mode(struct net_device *dev)
} }
} else { } else {
unsigned long flags; unsigned long flags;
u32 tx_flags = 0x08000000 | 192;
/* Note that only the low-address shortword of setup_frame is valid! /* Note that only the low-address shortword of setup_frame is valid!
The values are doubled for big-endian architectures. */ The values are doubled for big-endian architectures. */
if (dev->mc_count > 14) { /* Must use a multicast hash table. */ if (dev->mc_count > 14) { /* Must use a multicast hash table. */
build_setup_frame_hash(tp->setup_frame, dev); build_setup_frame_hash(tp->setup_frame, dev);
tx_flags = 0x08400000 | 192;
} else { } else {
build_setup_frame_perfect(tp->setup_frame, dev); build_setup_frame_perfect(tp->setup_frame, dev);
} }
...@@ -1117,7 +1119,6 @@ static void set_rx_mode(struct net_device *dev) ...@@ -1117,7 +1119,6 @@ static void set_rx_mode(struct net_device *dev)
if (tp->cur_tx - tp->dirty_tx > TX_RING_SIZE - 2) { if (tp->cur_tx - tp->dirty_tx > TX_RING_SIZE - 2) {
/* Same setup recently queued, we need not add it. */ /* Same setup recently queued, we need not add it. */
} else { } else {
u32 tx_flags = 0x08000000 | 192;
unsigned int entry; unsigned int entry;
int dummy = -1; int dummy = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment