|
@@ -1,7 +1,7 @@
|
|
|
/*******************************************************************************
|
|
|
|
|
|
Intel 10 Gigabit PCI Express Linux driver
|
|
|
- Copyright(c) 1999 - 2014 Intel Corporation.
|
|
|
+ Copyright(c) 1999 - 2016 Intel Corporation.
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
|
under the terms and conditions of the GNU General Public License,
|
|
@@ -48,10 +48,10 @@ s32 ixgbe_read_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
|
|
if (size > mbx->size)
|
|
|
size = mbx->size;
|
|
|
|
|
|
- if (!mbx->ops.read)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- return mbx->ops.read(hw, msg, size, mbx_id);
|
|
|
+ return mbx->ops->read(hw, msg, size, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -70,10 +70,10 @@ s32 ixgbe_write_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size, u16 mbx_id)
|
|
|
if (size > mbx->size)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- if (!mbx->ops.write)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- return mbx->ops.write(hw, msg, size, mbx_id);
|
|
|
+ return mbx->ops->write(hw, msg, size, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -87,10 +87,10 @@ s32 ixgbe_check_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
|
|
|
{
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
|
|
|
- if (!mbx->ops.check_for_msg)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- return mbx->ops.check_for_msg(hw, mbx_id);
|
|
|
+ return mbx->ops->check_for_msg(hw, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -104,10 +104,10 @@ s32 ixgbe_check_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
|
|
|
{
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
|
|
|
- if (!mbx->ops.check_for_ack)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- return mbx->ops.check_for_ack(hw, mbx_id);
|
|
|
+ return mbx->ops->check_for_ack(hw, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -121,10 +121,10 @@ s32 ixgbe_check_for_rst(struct ixgbe_hw *hw, u16 mbx_id)
|
|
|
{
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
|
|
|
- if (!mbx->ops.check_for_rst)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- return mbx->ops.check_for_rst(hw, mbx_id);
|
|
|
+ return mbx->ops->check_for_rst(hw, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -139,10 +139,10 @@ static s32 ixgbe_poll_for_msg(struct ixgbe_hw *hw, u16 mbx_id)
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
int countdown = mbx->timeout;
|
|
|
|
|
|
- if (!countdown || !mbx->ops.check_for_msg)
|
|
|
+ if (!countdown || !mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- while (mbx->ops.check_for_msg(hw, mbx_id)) {
|
|
|
+ while (mbx->ops->check_for_msg(hw, mbx_id)) {
|
|
|
countdown--;
|
|
|
if (!countdown)
|
|
|
return IXGBE_ERR_MBX;
|
|
@@ -164,10 +164,10 @@ static s32 ixgbe_poll_for_ack(struct ixgbe_hw *hw, u16 mbx_id)
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
int countdown = mbx->timeout;
|
|
|
|
|
|
- if (!countdown || !mbx->ops.check_for_ack)
|
|
|
+ if (!countdown || !mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
- while (mbx->ops.check_for_ack(hw, mbx_id)) {
|
|
|
+ while (mbx->ops->check_for_ack(hw, mbx_id)) {
|
|
|
countdown--;
|
|
|
if (!countdown)
|
|
|
return IXGBE_ERR_MBX;
|
|
@@ -193,7 +193,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
|
|
|
struct ixgbe_mbx_info *mbx = &hw->mbx;
|
|
|
s32 ret_val;
|
|
|
|
|
|
- if (!mbx->ops.read)
|
|
|
+ if (!mbx->ops)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
ret_val = ixgbe_poll_for_msg(hw, mbx_id);
|
|
@@ -201,7 +201,7 @@ static s32 ixgbe_read_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
|
|
|
return ret_val;
|
|
|
|
|
|
/* if ack received read message */
|
|
|
- return mbx->ops.read(hw, msg, size, mbx_id);
|
|
|
+ return mbx->ops->read(hw, msg, size, mbx_id);
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -221,11 +221,11 @@ static s32 ixgbe_write_posted_mbx(struct ixgbe_hw *hw, u32 *msg, u16 size,
|
|
|
s32 ret_val;
|
|
|
|
|
|
/* exit if either we can't write or there isn't a defined timeout */
|
|
|
- if (!mbx->ops.write || !mbx->timeout)
|
|
|
+ if (!mbx->ops || !mbx->timeout)
|
|
|
return IXGBE_ERR_MBX;
|
|
|
|
|
|
/* send msg */
|
|
|
- ret_val = mbx->ops.write(hw, msg, size, mbx_id);
|
|
|
+ ret_val = mbx->ops->write(hw, msg, size, mbx_id);
|
|
|
if (ret_val)
|
|
|
return ret_val;
|
|
|
|
|
@@ -446,7 +446,7 @@ void ixgbe_init_mbx_params_pf(struct ixgbe_hw *hw)
|
|
|
}
|
|
|
#endif /* CONFIG_PCI_IOV */
|
|
|
|
|
|
-struct ixgbe_mbx_operations mbx_ops_generic = {
|
|
|
+const struct ixgbe_mbx_operations mbx_ops_generic = {
|
|
|
.read = ixgbe_read_mbx_pf,
|
|
|
.write = ixgbe_write_mbx_pf,
|
|
|
.read_posted = ixgbe_read_posted_mbx,
|