mirror of
https://github.com/ipxe/ipxe
synced 2025-12-20 12:00:19 +03:00
[hermon] Remove temporary workaround for missing BOFM mport support
This reverts commit 15c1200 ("[hermon] Work around missing mport
support in current BOFM implementations").
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -3382,56 +3382,32 @@ static int hermon_bofm_update ( struct bofm_device *bofm, unsigned int mport,
|
|||||||
union {
|
union {
|
||||||
uint8_t bytes[8];
|
uint8_t bytes[8];
|
||||||
uint32_t dwords[2];
|
uint32_t dwords[2];
|
||||||
uint64_t qword;
|
|
||||||
} buf;
|
} buf;
|
||||||
uint8_t *mac_copy = &buf.bytes[ sizeof ( buf.bytes ) - ETH_ALEN ];
|
|
||||||
int rc;
|
int rc;
|
||||||
|
|
||||||
/* Prepare MAC address */
|
/* Prepare MAC address */
|
||||||
memset ( &buf, 0, sizeof ( buf ) );
|
memset ( &buf, 0, sizeof ( buf ) );
|
||||||
memcpy ( mac_copy, mac, ETH_ALEN );
|
memcpy ( &buf.bytes[ sizeof ( buf.bytes ) - ETH_ALEN ], mac,
|
||||||
|
ETH_ALEN );
|
||||||
|
|
||||||
/* Current BOFM versions are unable to create entries with
|
/* Modify static configuration */
|
||||||
* mport>1, which means that only the port 1 MAC address can
|
memset ( &stat_cfg, 0, sizeof ( stat_cfg ) );
|
||||||
* be explicitly specified. Work around this by using the
|
MLX_FILL_2 ( &stat_cfg, 36,
|
||||||
* provided MAC address as a base address for all subsequent
|
mac_m, 1,
|
||||||
* ports. For example, if BOFM assigns the address
|
mac_high, ntohl ( buf.dwords[0] ) );
|
||||||
*
|
MLX_FILL_1 ( &stat_cfg, 37, mac_low, ntohl ( buf.dwords[1] ) );
|
||||||
* 00:1A:64:76:00:09 for port 1
|
if ( ( rc = hermon_mod_stat_cfg ( hermon, mport,
|
||||||
*
|
|
||||||
* then we will assign the addresses
|
|
||||||
*
|
|
||||||
* 00:1A:64:76:00:09 for port 1
|
|
||||||
* 00:1A:64:76:00:0a for port 2
|
|
||||||
*
|
|
||||||
* Note that hermon->cap.num_ports is not yet defined at this
|
|
||||||
* point.
|
|
||||||
*/
|
|
||||||
for ( ; mport <= HERMON_MAX_PORTS ; mport++ ) {
|
|
||||||
|
|
||||||
/* Modify static configuration */
|
|
||||||
memset ( &stat_cfg, 0, sizeof ( stat_cfg ) );
|
|
||||||
MLX_FILL_2 ( &stat_cfg, 36,
|
|
||||||
mac_m, 1,
|
|
||||||
mac_high, ntohl ( buf.dwords[0] ) );
|
|
||||||
MLX_FILL_1 ( &stat_cfg, 37, mac_low, ntohl ( buf.dwords[1] ) );
|
|
||||||
if ( ( rc = hermon_mod_stat_cfg ( hermon, mport,
|
|
||||||
HERMON_MOD_STAT_CFG_SET,
|
HERMON_MOD_STAT_CFG_SET,
|
||||||
HERMON_MOD_STAT_CFG_OFFSET ( mac_m ),
|
HERMON_MOD_STAT_CFG_OFFSET ( mac_m ),
|
||||||
&stat_cfg ) ) != 0 ) {
|
&stat_cfg ) ) != 0 ) {
|
||||||
DBGC ( hermon, "Hermon %p port %d could not modify "
|
DBGC ( hermon, "Hermon %p port %d could not modify "
|
||||||
"configuration: %s\n",
|
"configuration: %s\n", hermon, mport, strerror ( rc ) );
|
||||||
hermon, mport, strerror ( rc ) );
|
return rc;
|
||||||
return rc;
|
|
||||||
}
|
|
||||||
|
|
||||||
DBGC ( hermon, "Hermon %p port %d updated MAC address to %s\n",
|
|
||||||
hermon, mport, eth_ntoa ( mac_copy ) );
|
|
||||||
|
|
||||||
/* Increment MAC address */
|
|
||||||
buf.qword = cpu_to_be64 ( be64_to_cpu ( buf.qword ) + 1 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DBGC ( hermon, "Hermon %p port %d updated MAC address to %s\n",
|
||||||
|
hermon, mport, eth_ntoa ( mac ) );
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user