aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/sfxge/common/efx_phy.c
diff options
context:
space:
mode:
authorAndrew Rybchenko <arybchik@FreeBSD.org>2018-11-30 07:08:38 +0000
committerAndrew Rybchenko <arybchik@FreeBSD.org>2018-11-30 07:08:38 +0000
commit3c3b9542253952343bf223ebeba9595bd623a1ae (patch)
tree8e1e99a71ec5a0e767bd058df6113d662ec4dd61 /sys/dev/sfxge/common/efx_phy.c
parent0bc522c2d69313ff17ebf3841df28df7cd5686f3 (diff)
sfxge(4): adjust PHY module info interface
Adjust data types in interface to permit the complete module information buffer to be obtained in a single call. Submitted by: Richard Houldsworth <rhouldsworth at solarflare.com> Sponsored by: Solarflare Communications, Inc. Differential Revision: https://reviews.freebsd.org/D18275
Notes
Notes: svn path=/head/; revision=341313
Diffstat (limited to 'sys/dev/sfxge/common/efx_phy.c')
-rw-r--r--sys/dev/sfxge/common/efx_phy.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/dev/sfxge/common/efx_phy.c b/sys/dev/sfxge/common/efx_phy.c
index 8d5a34757466..1ebc63fa65f3 100644
--- a/sys/dev/sfxge/common/efx_phy.c
+++ b/sys/dev/sfxge/common/efx_phy.c
@@ -317,8 +317,8 @@ efx_phy_media_type_get(
efx_phy_module_get_info(
__in efx_nic_t *enp,
__in uint8_t dev_addr,
- __in uint8_t offset,
- __in uint8_t len,
+ __in size_t offset,
+ __in size_t len,
__out_bcount(len) uint8_t *data)
{
efx_rc_t rc;
@@ -326,7 +326,8 @@ efx_phy_module_get_info(
EFSYS_ASSERT3U(enp->en_magic, ==, EFX_NIC_MAGIC);
EFSYS_ASSERT(data != NULL);
- if ((uint32_t)offset + len > 0x100) {
+ if ((offset > EFX_PHY_MEDIA_INFO_MAX_OFFSET) ||
+ ((offset + len) > EFX_PHY_MEDIA_INFO_MAX_OFFSET)) {
rc = EINVAL;
goto fail1;
}