<div>Linux "igb" driver also reads the address for NVM_ALT_MAC_ADDR_PTR from EEPROM, iPXE has hardcoded value (0x00) to NVM_ALT_MAC location.</div><div> </div><div>Probably you need to add a few lines more (untested :)):</div><div> </div><div><div>static int intel_fetch_mac_eeprom ( struct intel_nic *intel,<br />                                    uint8_t *hw_addr ) {<br />        int rc;</div><span style="color:#008000;"><strong>        uint16_t offset;</strong></span><br /><div><br />        /* Initialise EEPROM */<br />        if ( ( rc = intel_init_eeprom ( intel ) ) != 0 )<br />                return rc;</div><div> </div><div><span style="color:#008000;"><strong>        if ( ( rc = nvs_read ( &intel->eeprom, 0x37 /* NVM_ALT_MAC_ADDR_PTR */,</strong></span><br /><span style="color:#008000;"><strong>                                &offset, sizeof(offset) ) ) != 0 ) {</strong></span><br /><span style="color:#008000;"><strong>                 DBGC ( intel, "INTEL %p could not read EEPROM alternate MAC"</strong></span><br /><span style="color:#008000;"><strong>                        "address PTR: %s\n", intel, strerror ( rc ) );</strong></span><br /><span style="color:#008000;"><strong>                 return rc;</strong></span><br /><span style="color:#008000;"><strong>         }</strong></span></div><div> </div><div><span style="color:#008000;"><strong>        if (offset == 0xffff) {</strong></span></div><div><span style="color:#008000;"><strong>                /* There is no Alternate MAC Address */</strong></span></div><div><span style="color:#008000;"><strong>                return rc;</strong></span></div><div><span style="color:#008000;"><strong>        }</strong></span></div><div>        </div><div>        /* Read base MAC address from EEPROM */</div><div><span style="color:#008000;"><strong>        if (intel->port == 1)</strong></span></div><span style="color:#008000;"><strong>                offset += 3; /* E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 */</strong></span><br />        if ( ( rc = nvs_read ( &intel->eeprom, <span style="color:#008000;"><strong>offset << 1</strong></span>,<br />                               hw_addr, ETH_ALEN ) ) != 0 ) {<br />                DBGC ( intel, "INTEL %p could not read EEPROM base MAC "<br />                       "address: %s\n", intel, strerror ( rc ) );<br />                return rc;<br />        }<br /><br />        /* Adjust MAC address for multi-port devices */<br />        hw_addr[ETH_ALEN-1] ^= intel->port;<br /><br />        DBGC ( intel, "INTEL %p has EEPROM MAC address %s (port %d)\n",<br />               intel, eth_ntoa ( hw_addr ), intel->port );<br />        return 0;<br />}</div><div> </div><div>27.07.2012, 15:22, "Anton D. Kachalov" <mouse@yandex-team.ru>:</div><blockquote type="cite"><div>Oh, sorry. Got you.</div><div> </div><div>From the Linux igb driver:</div><div>/**<br /> *  igb_check_alt_mac_addr - Check for alternate MAC addr<br /> *  @hw: pointer to the HW structure<br /> *<br /> *  Checks the nvm for an alternate MAC address.  An alternate MAC address<br /> *  can be setup by pre-boot software and must be treated like a permanent<br /> *  address and must override the actual permanent MAC address.  If an<br /> *  alternate MAC address is <em>fopund</em> it is saved in the hw struct and<br /> *  <em>prgrammed</em> into RAR0 and the cuntion returns success, otherwise the<br /> *  function returns an error.<br /> **/</div><div> </div><div>igb_check_alt_mac_addr()</div><div>{</div><div>     …</div><div>     if (hw->bus.func == E1000_FUNC_1)</div><div>        <strong> nvm_alt_mac_addr_offset += E1000_ALT_MAC_ADDRESS_OFFSET_LAN1;</strong></div><div>     for (i = 0; i < ETH_ALEN; i += 2) {</div><div>         offset = nvm_alt_mac_addr_offset + (i >> 1);</div><div>         …</div><div>     }</div><div>}</div><div>and general function:</div><div> </div><div>static s32 igb_read_mac_addr_82575(struct e1000_hw *hw)<br />{<br />        s32 ret_val = 0;<br /><br />        /*<br />         * If there's an alternate MAC address place it in RAR0<br />         * so that it will override the Si installed default perm<br />         * address.<br />         */<br />        ret_val = igb_check_alt_mac_addr(hw);<br />        if (ret_val)<br />                goto out;<br /><br />        ret_val = igb_read_mac_addr(hw);<br /><br />out:<br />        return ret_val;<br />}<br /><br /></div><div>So, the "intel" driver in iPXE works almost correctly at this point except that for PORT_ONE it reads EEPROM from the same location instead of shifted by 6 bytes (3 words).</div><div> </div><div>Try to modify "intel_fetch_mac_eeprom()" routine:</div><div> </div><div>static int intel_fetch_mac_eeprom ( struct intel_nic *intel,<br />                                    uint8_t *hw_addr ) {<br />        int rc;</div><div><span style="color:#008000;"><strong>        int offset = 0;</strong></span><br /><br />        /* Initialise EEPROM */<br />        if ( ( rc = intel_init_eeprom ( intel ) ) != 0 )<br />                return rc;<br /><br />        /* Read base MAC address from EEPROM */</div><div><span style="color:#008000;"><strong>        if (intel->port == 1)</strong></span></div><div><span style="color:#008000;"><strong>                offset = 6; /* E1000_ALT_MAC_ADDRESS_OFFSET_LAN1 */</strong></span><br />        if ( ( rc = nvs_read ( &intel->eeprom, INTEL_EEPROM_MAC<span style="color:#008000;"><strong> + offset</strong></span>,<br />                               hw_addr, ETH_ALEN ) ) != 0 ) {<br />                DBGC ( intel, "INTEL %p could not read EEPROM base MAC "<br />                       "address: %s\n", intel, strerror ( rc ) );<br />                return rc;<br />        }<br /><br />        /* Adjust MAC address for multi-port devices */<br />        hw_addr[ETH_ALEN-1] ^= intel->port;<br /><br />        DBGC ( intel, "INTEL %p has EEPROM MAC address %s (port %d)\n",<br />               intel, eth_ntoa ( hw_addr ), intel->port );<br />        return 0;<br />}<br /><br /></div></blockquote><div>-- <br />Anton D. Kachalov<br /><br />ITO, R&D group, Senior System Engineer<br />Tel: +7 (495) 739-70-00 ext.7613</div>