Check EEPROM twice in em_hardware_init(), because for some PCIe em(4) first
authorSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 23 Jan 2007 11:09:25 +0000 (11:09 +0000)
committerSepherosa Ziehau <sephe@dragonflybsd.org>
Tue, 23 Jan 2007 11:09:25 +0000 (11:09 +0000)
checking will fail if link is down.  Add comment about it.

This should solve the problem for Lenovo/IBM laptop users: if link is down,
then em(4) will not be initialized properly.

Submitted-and-Tested-by: Michal Belczyk <belczyk@bsd.krakow.pl>
Obtained-from: FreeBSD current list, Jack Vogel <jfvogel@gmail.com>

sys/dev/netif/em/if_em.c

index 718ab95..c8a6a55 100644 (file)
@@ -64,7 +64,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  * 
- * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.54 2007/01/21 10:44:45 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/em/if_em.c,v 1.55 2007/01/23 11:09:25 sephe Exp $
  * $FreeBSD$
  */
 /*
@@ -2035,9 +2035,11 @@ em_hardware_init(struct adapter *adapter)
 
        /* Make sure we have a good EEPROM before we read from it */
        if (em_validate_eeprom_checksum(&adapter->hw) < 0) {
-               device_printf(adapter->dev,
-                             "The EEPROM Checksum Is Not Valid\n");
-               return (EIO);
+               if (em_validate_eeprom_checksum(&adapter->hw) < 0) {
+                       device_printf(adapter->dev,
+                                     "The EEPROM Checksum Is Not Valid\n");
+                       return (EIO);
+               }
        }
 
        if (em_read_part_num(&adapter->hw, &(adapter->part_num)) < 0) {