aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2004-08-09 02:33:10 -0700
committerStephen Hemminger <shemminger@osdl.org>2004-08-09 02:33:10 -0700
commitea130a63d821474e01afcd94f3057a54faf39457 (patch)
tree0712c9b973d5e998d3475c10a8d572c2211c4599 /net
parent4a6d387e1576d261dc55ddf78f8a5d44b22a7965 (diff)
downloadhistory-ea130a63d821474e01afcd94f3057a54faf39457.tar.gz
[VLAN]: Propagate ethtool/mii ioctls to the real device.
Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@redhat.com>
Diffstat (limited to 'net')
-rw-r--r--net/8021q/vlan.c1
-rw-r--r--net/8021q/vlan.h1
-rw-r--r--net/8021q/vlan_dev.c28
3 files changed, 30 insertions, 0 deletions
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c
index a44c900ac08bad..96e2391f3d6c99 100644
--- a/net/8021q/vlan.c
+++ b/net/8021q/vlan.c
@@ -358,6 +358,7 @@ static void vlan_setup(struct net_device *new_dev)
new_dev->set_mac_address = vlan_dev_set_mac_address;
new_dev->set_multicast_list = vlan_dev_set_multicast_list;
new_dev->destructor = free_netdev;
+ new_dev->do_ioctl = vlan_dev_ioctl;
}
/* Attach a VLAN device to a mac address (ie Ethernet Card).
diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
index 3a5ae433438991..5d9b7a1d2a8b1c 100644
--- a/net/8021q/vlan.h
+++ b/net/8021q/vlan.h
@@ -65,6 +65,7 @@ int vlan_dev_change_mtu(struct net_device *dev, int new_mtu);
int vlan_dev_set_mac_address(struct net_device *dev, void* addr);
int vlan_dev_open(struct net_device* dev);
int vlan_dev_stop(struct net_device* dev);
+int vlan_dev_ioctl(struct net_device* dev, struct ifreq *ifr, int cmd);
int vlan_dev_set_ingress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
int vlan_dev_set_egress_priority(char* dev_name, __u32 skb_prio, short vlan_prio);
int vlan_dev_set_vlan_flag(char* dev_name, __u32 flag, short flag_val);
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index bea6963654d14c..9dfce1bc7d0a12 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -757,6 +757,34 @@ int vlan_dev_stop(struct net_device *dev)
vlan_flush_mc_list(dev);
return 0;
}
+
+int vlan_dev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+ struct net_device *real_dev = VLAN_DEV_INFO(dev)->real_dev;
+ struct ifreq ifrr;
+ int err = -EOPNOTSUPP;
+
+ strncpy(ifrr.ifr_name, real_dev->name, IFNAMSIZ);
+ ifrr.ifr_ifru = ifr->ifr_ifru;
+
+ switch(cmd) {
+ case SIOCGMIIPHY:
+ case SIOCGMIIREG:
+ case SIOCSMIIREG:
+ if (real_dev->do_ioctl && netif_device_present(real_dev))
+ err = real_dev->do_ioctl(dev, &ifrr, cmd);
+ break;
+
+ case SIOCETHTOOL:
+ err = dev_ethtool(&ifrr);
+ }
+
+ if (!err)
+ ifr->ifr_ifru = ifrr.ifr_ifru;
+
+ return err;
+}
+
/** Taken from Gleb + Lennert's VLAN code, and modified... */
void vlan_dev_set_multicast_list(struct net_device *vlan_dev)
{