On Fri, Jan 29, 2010 at 09:45:42AM -0800, Jack Vogel wrote:
> No need, I set it up and tried it, and I was right, it does not fail if that
> routine is not used. The interesting thing is that the igb driver, which
> has the same code, works fine.
>
> In any case, I'm hot on the track of this and hope I can figure it out
> today.
Ah nice, I found a hole in time to try it as well. I just rebuild a kernel
and rebooted. During the reboot I found what you write above. :)
Anyways, the attached patch makes it work indeed as you found yourself as
well in the mean time. :-)
I tried just deleting the call itself at first, but the module is compiled
with warnings treated as errors and barfs about a defined but unused
function. So in the patch you'll find the entire function removed.
Let me know about anything else I can do. I don't have the necessary test
equipment at home, so normally I'll need to find a time window to test
things. But I'm more then willing to.
The version I patch is the following by the way, from 8.0-RELEASE-p2:
/*$FreeBSD: src/sys/dev/e1000/if_em.c,v 1.21.2.3.2.1 2009/10/25 01:10:29
kensmith Exp $*/
Thanks so far!
Marco
--
"Van Duitsers heb je pas gewonnen als ze met de bus de stad uit zijn."
- Youp van 't Hek
--- sys/dev/e1000/if_em.c.orig 2010-01-29 18:20:46.000000000 +0100
+++ sys/dev/e1000/if_em.c 2010-01-29 18:26:59.000000000 +0100
@@ -289,7 +289,6 @@
#if __FreeBSD_version >= 700029
static void em_register_vlan(void *, struct ifnet *, u16);
static void em_unregister_vlan(void *, struct ifnet *, u16);
-static void em_setup_vlan_hw_support(struct adapter *);
#endif
static int em_xmit(struct adapter *, struct mbuf **);
static void em_smartspeed(struct adapter *);
@@ -1535,17 +1534,12 @@
/* Setup VLAN support, basic and offload if available */
E1000_WRITE_REG(&adapter->hw, E1000_VET, ETHERTYPE_VLAN);
-#if __FreeBSD_version < 700029
if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING) {
u32 ctrl;
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL);
ctrl |= E1000_CTRL_VME;
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
}
-#else
- /* Use real VLAN Filter support */
- em_setup_vlan_hw_support(adapter);
-#endif
/* Set hardware offload abilities */
ifp->if_hwassist = 0;
@@ -4762,44 +4756,6 @@
em_init(adapter);
}
-static void
-em_setup_vlan_hw_support(struct adapter *adapter)
-{
- struct e1000_hw *hw = &adapter->hw;
- u32 reg;
-
- /*
- ** We get here thru init_locked, meaning
- ** a soft reset, this has already cleared
- ** the VFTA and other state, so if there
- ** have been no vlan's registered do nothing.
- */
- if (adapter->num_vlans == 0)
- return;
-
- /*
- ** A soft reset zero's out the VFTA, so
- ** we need to repopulate it now.
- */
- for (int i = 0; i < EM_VFTA_SIZE; i++)
- if (em_shadow_vfta[i] != 0)
- E1000_WRITE_REG_ARRAY(hw, E1000_VFTA,
- i, em_shadow_vfta[i]);
-
- reg = E1000_READ_REG(hw, E1000_CTRL);
- reg |= E1000_CTRL_VME;
- E1000_WRITE_REG(hw, E1000_CTRL, reg);
-
- /* Enable the Filter Table */
- reg = E1000_READ_REG(hw, E1000_RCTL);
- reg &= ~E1000_RCTL_CFIEN;
- reg |= E1000_RCTL_VFE;
- E1000_WRITE_REG(hw, E1000_RCTL, reg);
-
- /* Update the frame size */
- E1000_WRITE_REG(&adapter->hw, E1000_RLPML,
- adapter->max_frame_size + VLAN_TAG_SIZE);
-}
#endif
static void
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "[email protected]"