Module Name: src
Committed By: msaitoh
Date: Fri Dec 10 11:33:12 UTC 2021
Modified Files:
src/sys/dev/pci/ixgbe: ixgbe.c ixgbe.h
Log Message:
No functional change.
- Sync with FreeBSD ix-3.3.18.
- Rename ixgbe_get_advertise() to ixgbe_get_default_advertise.
- Sort lines, modify comment and whitespace to reduce diff against FreeBSD.
To generate a diff of this commit:
cvs rdiff -u -r1.295 -r1.296 src/sys/dev/pci/ixgbe/ixgbe.c
cvs rdiff -u -r1.83 -r1.84 src/sys/dev/pci/ixgbe/ixgbe.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/pci/ixgbe/ixgbe.c
diff -u src/sys/dev/pci/ixgbe/ixgbe.c:1.295 src/sys/dev/pci/ixgbe/ixgbe.c:1.296
--- src/sys/dev/pci/ixgbe/ixgbe.c:1.295 Tue Dec 7 22:13:56 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.c Fri Dec 10 11:33:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.c,v 1.295 2021/12/07 22:13:56 andvar Exp $ */
+/* $NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $ */
/******************************************************************************
@@ -64,7 +64,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.295 2021/12/07 22:13:56 andvar Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ixgbe.c,v 1.296 2021/12/10 11:33:11 msaitoh Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -235,7 +235,7 @@ static void ixgbe_add_hw_stats(struct ad
static void ixgbe_clear_evcnt(struct adapter *);
static int ixgbe_set_flowcntl(struct adapter *, int);
static int ixgbe_set_advertise(struct adapter *, int);
-static int ixgbe_get_advertise(struct adapter *);
+static int ixgbe_get_default_advertise(struct adapter *);
/* Sysctl handlers */
static void ixgbe_set_sysctl_value(struct adapter *, const char *,
@@ -1229,7 +1229,7 @@ ixgbe_attach(device_t parent, device_t d
/* Set an initial dmac value */
adapter->dmac = 0;
/* Set initial advertised speeds (if applicable) */
- adapter->advertise = ixgbe_get_advertise(adapter);
+ adapter->advertise = ixgbe_get_default_advertise(adapter);
if (adapter->feat_cap & IXGBE_FEATURE_SRIOV)
ixgbe_define_iov_schemas(dev, &error);
@@ -5536,10 +5536,10 @@ ixgbe_sysctl_advertise(SYSCTLFN_ARGS)
*
* Flags:
* 0x00 - Default (all capable link speed)
- * 0x01 - advertise 100 Mb
- * 0x02 - advertise 1G
- * 0x04 - advertise 10G
- * 0x08 - advertise 10 Mb
+ * 0x1 - advertise 100 Mb
+ * 0x2 - advertise 1G
+ * 0x4 - advertise 10G
+ * 0x8 - advertise 10 Mb (yes, Mb)
* 0x10 - advertise 2.5G
* 0x20 - advertise 5G
************************************************************************/
@@ -5640,19 +5640,19 @@ ixgbe_set_advertise(struct adapter *adap
} /* ixgbe_set_advertise */
/************************************************************************
- * ixgbe_get_advertise - Get current advertised speed settings
+ * ixgbe_get_default_advertise - Get default advertised speed settings
*
* Formatted for sysctl usage.
* Flags:
- * 0x01 - advertise 100 Mb
- * 0x02 - advertise 1G
- * 0x04 - advertise 10G
- * 0x08 - advertise 10 Mb (yes, Mb)
+ * 0x1 - advertise 100 Mb
+ * 0x2 - advertise 1G
+ * 0x4 - advertise 10G
+ * 0x8 - advertise 10 Mb (yes, Mb)
* 0x10 - advertise 2.5G
* 0x20 - advertise 5G
************************************************************************/
static int
-ixgbe_get_advertise(struct adapter *adapter)
+ixgbe_get_default_advertise(struct adapter *adapter)
{
struct ixgbe_hw *hw = &adapter->hw;
int speed;
@@ -5673,15 +5673,15 @@ ixgbe_get_advertise(struct adapter *adap
return (0);
speed =
- ((link_caps & IXGBE_LINK_SPEED_10GB_FULL) ? 0x04 : 0) |
- ((link_caps & IXGBE_LINK_SPEED_1GB_FULL) ? 0x02 : 0) |
- ((link_caps & IXGBE_LINK_SPEED_100_FULL) ? 0x01 : 0) |
- ((link_caps & IXGBE_LINK_SPEED_10_FULL) ? 0x08 : 0) |
+ ((link_caps & IXGBE_LINK_SPEED_10GB_FULL) ? 0x4 : 0) |
+ ((link_caps & IXGBE_LINK_SPEED_5GB_FULL) ? 0x20 : 0) |
((link_caps & IXGBE_LINK_SPEED_2_5GB_FULL) ? 0x10 : 0) |
- ((link_caps & IXGBE_LINK_SPEED_5GB_FULL) ? 0x20 : 0);
+ ((link_caps & IXGBE_LINK_SPEED_1GB_FULL) ? 0x2 : 0) |
+ ((link_caps & IXGBE_LINK_SPEED_100_FULL) ? 0x1 : 0) |
+ ((link_caps & IXGBE_LINK_SPEED_10_FULL) ? 0x8 : 0);
return speed;
-} /* ixgbe_get_advertise */
+} /* ixgbe_get_default_advertise */
/************************************************************************
* ixgbe_sysctl_dmac - Manage DMA Coalescing
Index: src/sys/dev/pci/ixgbe/ixgbe.h
diff -u src/sys/dev/pci/ixgbe/ixgbe.h:1.83 src/sys/dev/pci/ixgbe/ixgbe.h:1.84
--- src/sys/dev/pci/ixgbe/ixgbe.h:1.83 Wed Nov 17 06:37:44 2021
+++ src/sys/dev/pci/ixgbe/ixgbe.h Fri Dec 10 11:33:11 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: ixgbe.h,v 1.83 2021/11/17 06:37:44 msaitoh Exp $ */
+/* $NetBSD: ixgbe.h,v 1.84 2021/12/10 11:33:11 msaitoh Exp $ */
/******************************************************************************
SPDX-License-Identifier: BSD-3-Clause
@@ -676,10 +676,10 @@ struct adapter {
/* Sysctl help messages; displayed with sysctl -d */
#define IXGBE_SYSCTL_DESC_ADV_SPEED \
"\nControl advertised link speed using these flags:\n" \
- "\t0x01 - advertise 100M\n" \
- "\t0x02 - advertise 1G\n" \
- "\t0x04 - advertise 10G\n" \
- "\t0x08 - advertise 10M\n" \
+ "\t0x1 - advertise 100M\n" \
+ "\t0x2 - advertise 1G\n" \
+ "\t0x4 - advertise 10G\n" \
+ "\t0x8 - advertise 10M\n" \
"\t0x10 - advertise 2.5G\n" \
"\t0x20 - advertise 5G\n\n" \
"\t5G, 2.5G, 100M and 10M are only supported on certain adapters."