From ba04adb0f99935f49c15b5f2c2b332cdeb8a5764 Mon Sep 17 00:00:00 2001 From: Andre Oppermann Date: Thu, 21 Sep 2006 19:14:51 +0000 Subject: [PATCH] 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 --- sys/dev/em/if_em.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/sys/dev/em/if_em.c b/sys/dev/em/if_em.c index c31baac5b3f4..ffc4988f3ca7 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