summaryrefslogtreecommitdiffstats
path: root/sys/dev/em
diff options
context:
space:
mode:
authorandre <andre@FreeBSD.org>2006-09-21 19:14:51 +0000
committerandre <andre@FreeBSD.org>2006-09-21 19:14:51 +0000
commitab54ab783bfc0a3afd305ba716c3dd42d6d38d80 (patch)
treea77e96185aa4c092edf3451a934b2280fd947f8e /sys/dev/em
parent74c395cf511f4bd7952ccb9da015142193d03bb3 (diff)
downloadFreeBSD-src-ab54ab783bfc0a3afd305ba716c3dd42d6d38d80.zip
FreeBSD-src-ab54ab783bfc0a3afd305ba716c3dd42d6d38d80.tar.gz
Move the initialization of the hardware capabilities in em_init_locked()
before em_setup_transmit_structures() as it needs this information to properly set up TSO parameters. Reviewed by: jfv
Diffstat (limited to 'sys/dev/em')
-rw-r--r--sys/dev/em/if_em.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c
index c31baac..ffc4988 100644
--- a/sys/dev/em/if_em.c
+++ b/sys/dev/em/if_em.c
@@ -1058,6 +1058,18 @@ em_init_locked(struct adapter *adapter)
if (ifp->if_capenable & IFCAP_VLAN_HWTAGGING)
em_enable_vlans(adapter);
+ ifp->if_hwassist = 0;
+ if (adapter->hw.mac_type >= em_82543) {
+ if (ifp->if_capenable & IFCAP_TXCSUM)
+ ifp->if_hwassist = EM_CHECKSUM_FEATURES;
+ /*
+ * em_setup_transmit_structures() will behave differently
+ * based on the state of TSO.
+ */
+ if (ifp->if_capenable & IFCAP_TSO)
+ ifp->if_hwassist |= EM_TCPSEG_FEATURES;
+ }
+
/* Prepare transmit descriptors and buffers */
if (em_setup_transmit_structures(adapter)) {
device_printf(dev, "Could not setup transmit structures\n");
@@ -1083,14 +1095,6 @@ em_init_locked(struct adapter *adapter)
ifp->if_drv_flags |= IFF_DRV_RUNNING;
ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
- ifp->if_hwassist = 0;
- if (adapter->hw.mac_type >= em_82543) {
- if (ifp->if_capenable & IFCAP_TXCSUM)
- ifp->if_hwassist = EM_CHECKSUM_FEATURES;
- if (ifp->if_capenable & IFCAP_TSO)
- ifp->if_hwassist |= EM_TCPSEG_FEATURES;
- }
-
callout_reset(&adapter->timer, hz, em_local_timer, adapter);
em_clear_hw_cntrs(&adapter->hw);
#ifdef DEVICE_POLLING
OpenPOWER on IntegriCloud