diff options
author | Robert Mustacchi <rm@joyent.com> | 2014-01-29 00:19:33 +0000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2014-01-29 17:43:10 +0000 |
commit | 206425abd9c556b7b39c7249a80ea9b61335c97f (patch) | |
tree | 3c95a17c7062627013e32956b50e247a5e0ef6d1 | |
parent | c49aafc116ced842c08aa7493cd437943ba6dde3 (diff) | |
download | illumos-joyent-206425abd9c556b7b39c7249a80ea9b61335c97f.tar.gz |
OS-2744 e1000g common code doesn't account for LockMAC
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
-rw-r--r-- | usr/src/uts/common/io/e1000g/e1000g_main.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/usr/src/uts/common/io/e1000g/e1000g_main.c b/usr/src/uts/common/io/e1000g/e1000g_main.c index b05dd700ed..ad61f5cd4d 100644 --- a/usr/src/uts/common/io/e1000g/e1000g_main.c +++ b/usr/src/uts/common/io/e1000g/e1000g_main.c @@ -25,6 +25,7 @@ /* * Copyright 2012 DEY Storage Systems, Inc. All rights reserved. * Copyright 2013 Nexenta Systems, Inc. All rights reserved. + * Copyright (c) 2014, Joyent, Inc. All rights reserved. */ /* @@ -2445,6 +2446,34 @@ e1000g_init_unicst(struct e1000g *Adapter) Adapter->unicst_total = min(hw->mac.rar_entry_count, MAX_NUM_UNICAST_ADDRESSES); + /* + * The common code does not correctly calculate the number of + * rar's that could be reserved by firmware for the pch_lpt + * macs. The interface has one primary rar, and 11 additional + * ones. Those 11 additional ones are not always available. + * According to the datasheet, we need to check a few of the + * bits set in the FWSM register. If the value is zero, + * everything is available. If the value is 1, none of the + * additional registers are availabl.e If the value is 2-7, only + * that number are available. + */ + if (hw->mac.type == e1000_pch_lpt) { + uint32_t locked, rar; + + locked = E1000_READ_REG(hw, E1000_FWSM) & + E1000_FWSM_WLOCK_MAC_MASK; + locked >>= E1000_FWSM_WLOCK_MAC_SHIFT; + rar = 1; + if (locked == 0) + rar += 11; + else if (locked == 1) + rar += 0; + else + rar += locked; + Adapter->unicst_total = min(rar, + MAX_NUM_UNICAST_ADDRESSES); + } + /* Workaround for an erratum of 82571 chipst */ if ((hw->mac.type == e1000_82571) && (e1000_get_laa_state_82571(hw) == B_TRUE)) |