[PATCH] Allow FCoE to run on top of VLAN driver even though it has no pause.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If the net_device has no ethtool ops and it is a VLAN,
find the underlying physical device using the VLAN driver's macro, and
use it's ethtool ops.

Signed-off-by: Vasu Dev <vasu.dev@xxxxxxxxx>
---

 drivers/scsi/ofc/fcoe/fcoe_def.h |    1 +
 drivers/scsi/ofc/fcoe/fcoe_if.c  |   10 ++++++++--
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/ofc/fcoe/fcoe_def.h b/drivers/scsi/ofc/fcoe/fcoe_def.h
index 6550c73..22c5934 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_def.h
+++ b/drivers/scsi/ofc/fcoe/fcoe_def.h
@@ -67,6 +67,7 @@ struct fcoe_softc {
 	struct list_head list;
 	struct fcdev *fd;
 	struct net_device *real_dev;
+	struct net_device *phys_dev;		/* device with ethtool_ops */
 	struct packet_type  fcoe_packet_type;
 	struct sk_buff_head fcoe_pending_queue;
 
diff --git a/drivers/scsi/ofc/fcoe/fcoe_if.c b/drivers/scsi/ofc/fcoe/fcoe_if.c
index 74e5ffc..9963593 100644
--- a/drivers/scsi/ofc/fcoe/fcoe_if.c
+++ b/drivers/scsi/ofc/fcoe/fcoe_if.c
@@ -34,6 +34,7 @@
 #include <linux/etherdevice.h>
 #include <linux/ethtool.h>
 #include <linux/if_ether.h>
+#include <linux/if_vlan.h>
 #include <net/rtnetlink.h>
 
 /*
@@ -174,6 +175,7 @@ int fcoe_link_ok(struct fcdev *fdev)
 	int rc = 0;
 
 	if ((dev->flags & IFF_UP) && netif_carrier_ok(dev)) {
+		dev = fc->phys_dev;
 		dev->ethtool_ops->get_pauseparam(dev, &pause);
 		if (dev->ethtool_ops->get_settings) {
 			dev->ethtool_ops->get_settings(dev, &ecmd);
@@ -213,6 +215,7 @@ int fcoe_create_interface(struct fcoe_info *fci, void *ptr)
 	struct fcoe_cfg *cfg = ptr;
 	struct fcoe_softc *fc;
 	struct fcoe_dev_stats *p;
+	struct net_device *net_dev;
 	int rc = 0;
 	int i;
 #ifdef HAVE_SET_RX_MODE
@@ -260,11 +263,14 @@ int fcoe_create_interface(struct fcoe_info *fci, void *ptr)
 	/*
 	 * Require support for get_pauseparam ethtool op.
 	 */
-	if (!fc->real_dev->ethtool_ops ||
-	    !fc->real_dev->ethtool_ops->get_pauseparam) {
+	net_dev = fc->real_dev;
+	if (!net_dev->ethtool_ops && (net_dev->priv_flags & IFF_802_1Q_VLAN))
+		net_dev = VLAN_DEV_INFO(net_dev)->real_dev;
+	if (!net_dev->ethtool_ops || !net_dev->ethtool_ops->get_pauseparam) {
 		rc = -EOPNOTSUPP;
 		goto out;
 	}
+	fc->phys_dev = net_dev;
 	fdev->fd_link_status = TRANS_LINK_DOWN;
 	if (fcoe_link_ok(fdev))
 		fdev->fd_link_status = TRANS_LINK_UP;

-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux