Selaa lähdekoodia

Merge branch 'qed-link-fixes'

Yuval Mintz says:

====================
qed*: Fix ethtool issues relating to link

This series addresses two issues that were introduced when adding
support for ethtool's link_ksettings support - the first fixes a
regression and second incorrect functionallity in the submission.

Although these are fixes, as the feature currently exists only in
'next-next' I'm aiming them for it.

Dave, please consider applying this series to 'net-next'.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
David S. Miller 9 vuotta sitten
vanhempi
commit
92bcdcc672
2 muutettua tiedostoa jossa 8 lisäystä ja 6 poistoa
  1. 3 3
      drivers/net/ethernet/qlogic/qede/qede_ethtool.c
  2. 5 3
      include/linux/qed/qed_if.h

+ 3 - 3
drivers/net/ethernet/qlogic/qede/qede_ethtool.c

@@ -414,7 +414,7 @@ static int qede_set_link_ksettings(struct net_device *dev,
 			}
 			params.adv_speeds = QED_LM_40000baseLR4_Full_BIT;
 			break;
-		case 0xdead:
+		case SPEED_50000:
 			if (!(current_link.supported_caps &
 			      QED_LM_50000baseKR2_Full_BIT)) {
 				DP_INFO(edev, "50G speed not supported\n");
@@ -422,7 +422,7 @@ static int qede_set_link_ksettings(struct net_device *dev,
 			}
 			params.adv_speeds = QED_LM_50000baseKR2_Full_BIT;
 			break;
-		case 0xbeef:
+		case SPEED_100000:
 			if (!(current_link.supported_caps &
 			      QED_LM_100000baseKR4_Full_BIT)) {
 				DP_INFO(edev, "100G speed not supported\n");
@@ -672,7 +672,7 @@ static int qede_set_pauseparam(struct net_device *dev,
 	memset(&params, 0, sizeof(params));
 	params.override_flags |= QED_LINK_OVERRIDE_PAUSE_CONFIG;
 	if (epause->autoneg) {
-		if (!(current_link.supported_caps & SUPPORTED_Autoneg)) {
+		if (!(current_link.supported_caps & QED_LM_Autoneg_BIT)) {
 			DP_INFO(edev, "autoneg not supported\n");
 			return -EINVAL;
 		}

+ 5 - 3
include/linux/qed/qed_if.h

@@ -318,9 +318,11 @@ struct qed_link_params {
 struct qed_link_output {
 	bool	link_up;
 
-	u32	supported_caps;         /* In SUPPORTED defs */
-	u32	advertised_caps;        /* In ADVERTISED defs */
-	u32	lp_caps;                /* In ADVERTISED defs */
+	/* In QED_LM_* defs */
+	u32	supported_caps;
+	u32	advertised_caps;
+	u32	lp_caps;
+
 	u32	speed;                  /* In Mb/s */
 	u8	duplex;                 /* In DUPLEX defs */
 	u8	port;                   /* In PORT defs */