Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78935
b: refs/heads/master
c: db0ce50
h: refs/heads/master
i:
  78933: 76cd645
  78931: 86b8e5c
  78927: 687f767
v: v3
  • Loading branch information
Patrick McHardy authored and David S. Miller committed Jan 28, 2008
1 parent dd5cd7f commit 6df6c30
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2a88719197bde746006c18ebe8f3576c87991419
refs/heads/master: db0ce50d3792e993a1b24f16fb70153eccf38f33
47 changes: 31 additions & 16 deletions trunk/drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static void e1000_clean_tx_ring(struct e1000_adapter *adapter,
struct e1000_tx_ring *tx_ring);
static void e1000_clean_rx_ring(struct e1000_adapter *adapter,
struct e1000_rx_ring *rx_ring);
static void e1000_set_multi(struct net_device *netdev);
static void e1000_set_rx_mode(struct net_device *netdev);
static void e1000_update_phy_info(unsigned long data);
static void e1000_watchdog(unsigned long data);
static void e1000_82547_tx_fifo_stall(unsigned long data);
Expand Down Expand Up @@ -487,7 +487,7 @@ static void e1000_configure(struct e1000_adapter *adapter)
struct net_device *netdev = adapter->netdev;
int i;

e1000_set_multi(netdev);
e1000_set_rx_mode(netdev);

e1000_restore_vlan(adapter);
e1000_init_manageability(adapter);
Expand Down Expand Up @@ -900,7 +900,7 @@ e1000_probe(struct pci_dev *pdev,
netdev->stop = &e1000_close;
netdev->hard_start_xmit = &e1000_xmit_frame;
netdev->get_stats = &e1000_get_stats;
netdev->set_multicast_list = &e1000_set_multi;
netdev->set_rx_mode = &e1000_set_rx_mode;
netdev->set_mac_address = &e1000_set_mac;
netdev->change_mtu = &e1000_change_mtu;
netdev->do_ioctl = &e1000_ioctl;
Expand Down Expand Up @@ -2383,21 +2383,22 @@ e1000_set_mac(struct net_device *netdev, void *p)
}

/**
* e1000_set_multi - Multicast and Promiscuous mode set
* e1000_set_rx_mode - Secondary Unicast, Multicast and Promiscuous mode set
* @netdev: network interface device structure
*
* The set_multi entry point is called whenever the multicast address
* list or the network interface flags are updated. This routine is
* responsible for configuring the hardware for proper multicast,
* The set_rx_mode entry point is called whenever the unicast or multicast
* address lists or the network interface flags are updated. This routine is
* responsible for configuring the hardware for proper unicast, multicast,
* promiscuous mode, and all-multi behavior.
**/

static void
e1000_set_multi(struct net_device *netdev)
e1000_set_rx_mode(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
struct dev_mc_list *mc_ptr;
struct dev_addr_list *uc_ptr;
struct dev_addr_list *mc_ptr;
uint32_t rctl;
uint32_t hash_value;
int i, rar_entries = E1000_RAR_ENTRIES;
Expand All @@ -2420,9 +2421,16 @@ e1000_set_multi(struct net_device *netdev)
rctl |= (E1000_RCTL_UPE | E1000_RCTL_MPE);
} else if (netdev->flags & IFF_ALLMULTI) {
rctl |= E1000_RCTL_MPE;
rctl &= ~E1000_RCTL_UPE;
} else {
rctl &= ~(E1000_RCTL_UPE | E1000_RCTL_MPE);
rctl &= ~E1000_RCTL_MPE;
}

uc_ptr = NULL;
if (netdev->uc_count > rar_entries - 1) {
rctl |= E1000_RCTL_UPE;
} else if (!(netdev->flags & IFF_PROMISC)) {
rctl &= ~E1000_RCTL_UPE;
uc_ptr = netdev->uc_list;
}

E1000_WRITE_REG(hw, RCTL, rctl);
Expand All @@ -2432,16 +2440,22 @@ e1000_set_multi(struct net_device *netdev)
if (hw->mac_type == e1000_82542_rev2_0)
e1000_enter_82542_rst(adapter);

/* load the first 14 multicast address into the exact filters 1-14
/* load the first 14 addresses into the exact filters 1-14. Unicast
* addresses take precedence to avoid disabling unicast filtering
* when possible.
*
* RAR 0 is used for the station MAC adddress
* if there are not 14 addresses, go ahead and clear the filters
* -- with 82571 controllers only 0-13 entries are filled here
*/
mc_ptr = netdev->mc_list;

for (i = 1; i < rar_entries; i++) {
if (mc_ptr) {
e1000_rar_set(hw, mc_ptr->dmi_addr, i);
if (uc_ptr) {
e1000_rar_set(hw, uc_ptr->da_addr, i);
uc_ptr = uc_ptr->next;
} else if (mc_ptr) {
e1000_rar_set(hw, mc_ptr->da_addr, i);
mc_ptr = mc_ptr->next;
} else {
E1000_WRITE_REG_ARRAY(hw, RA, i << 1, 0);
Expand All @@ -2450,6 +2464,7 @@ e1000_set_multi(struct net_device *netdev)
E1000_WRITE_FLUSH(hw);
}
}
WARN_ON(uc_ptr != NULL);

/* clear the old settings from the multicast hash table */

Expand All @@ -2461,7 +2476,7 @@ e1000_set_multi(struct net_device *netdev)
/* load any remaining addresses into the hash table */

for (; mc_ptr; mc_ptr = mc_ptr->next) {
hash_value = e1000_hash_mc_addr(hw, mc_ptr->dmi_addr);
hash_value = e1000_hash_mc_addr(hw, mc_ptr->da_addr);
e1000_mta_set(hw, hash_value);
}

Expand Down Expand Up @@ -5070,7 +5085,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)

if (wufc) {
e1000_setup_rctl(adapter);
e1000_set_multi(netdev);
e1000_set_rx_mode(netdev);

/* turn on all-multi mode if wake on multicast is enabled */
if (wufc & E1000_WUFC_MC) {
Expand Down

0 comments on commit 6df6c30

Please sign in to comment.