Restore SIOCGI2C functionality to ixgbe
When ixgbe was converted to iflib, it lost the SIOCGI2C support that allows ifconfig to print SFP state, optical light levels, etc. Restore this by plugging in to the ifdi_i2c_req iflib method. Note that the sanity checking on dev_addr that used to be done in ixgbe is now done in iflib. Reviewed by: erj, Matthew Macy <mmacy@mattmacy.io> Sponsored by: Netflix
This commit is contained in:
parent
a397def9fb
commit
bca3808097
@ -137,7 +137,7 @@ static void ixgbe_if_timer(if_ctx_t ctx, uint16_t);
|
||||
static void ixgbe_if_update_admin_status(if_ctx_t ctx);
|
||||
static void ixgbe_if_vlan_register(if_ctx_t ctx, u16 vtag);
|
||||
static void ixgbe_if_vlan_unregister(if_ctx_t ctx, u16 vtag);
|
||||
|
||||
static int ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req);
|
||||
int ixgbe_intr(void *arg);
|
||||
|
||||
/************************************************************************
|
||||
@ -270,6 +270,7 @@ static device_method_t ixgbe_if_methods[] = {
|
||||
DEVMETHOD(ifdi_vlan_register, ixgbe_if_vlan_register),
|
||||
DEVMETHOD(ifdi_vlan_unregister, ixgbe_if_vlan_unregister),
|
||||
DEVMETHOD(ifdi_get_counter, ixgbe_if_get_counter),
|
||||
DEVMETHOD(ifdi_i2c_req, ixgbe_if_i2c_req),
|
||||
#ifdef PCI_IOV
|
||||
DEVMETHOD(ifdi_iov_init, ixgbe_if_iov_init),
|
||||
DEVMETHOD(ifdi_iov_uninit, ixgbe_if_iov_uninit),
|
||||
@ -1231,6 +1232,25 @@ ixgbe_if_get_counter(if_ctx_t ctx, ift_counter cnt)
|
||||
}
|
||||
} /* ixgbe_if_get_counter */
|
||||
|
||||
/************************************************************************
|
||||
* ixgbe_if_i2c_req
|
||||
************************************************************************/
|
||||
static int
|
||||
ixgbe_if_i2c_req(if_ctx_t ctx, struct ifi2creq *req)
|
||||
{
|
||||
struct adapter *adapter = iflib_get_softc(ctx);
|
||||
struct ixgbe_hw *hw = &adapter->hw;
|
||||
int i;
|
||||
|
||||
|
||||
if (hw->phy.ops.read_i2c_byte == NULL)
|
||||
return (ENXIO);
|
||||
for (i = 0; i < req->len; i++)
|
||||
hw->phy.ops.read_i2c_byte(hw, req->offset + i,
|
||||
req->dev_addr, &req->data[i]);
|
||||
return (0);
|
||||
} /* ixgbe_if_i2c_req */
|
||||
|
||||
/************************************************************************
|
||||
* ixgbe_add_media_types
|
||||
************************************************************************/
|
||||
@ -4547,4 +4567,3 @@ ixgbe_check_fan_failure(struct adapter *adapter, u32 reg, bool in_interrupt)
|
||||
if (reg & mask)
|
||||
device_printf(adapter->dev, "\nCRITICAL: FAN FAILURE!! REPLACE IMMEDIATELY!!\n");
|
||||
} /* ixgbe_check_fan_failure */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user