2 * Copyright 2012 Luis R. Rodriguez <mcgrof@frijolero.org>
3 * Copyright (c) 2012 Mellanox Technologies. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Compatibility file for Linux wireless for kernels 3.2.
12 #include <linux/kernel.h>
13 #include <linux/device.h>
14 #include <linux/ethtool.h>
15 #include <linux/rtnetlink.h>
17 int __netdev_printk(const char *level, const struct net_device *dev,
18 struct va_format *vaf)
22 if (dev && dev->dev.parent)
23 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,35))
24 r = dev_printk(level, dev->dev.parent, "%s: %pV",
25 netdev_name(dev), vaf);
27 /* XXX: this could likely be done better but I'm lazy */
28 r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
31 r = printk("%s%s: %pV", level, netdev_name(dev), vaf);
33 r = printk("%s(NULL net_device): %pV", level, vaf);
37 EXPORT_SYMBOL(__netdev_printk);
39 int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
43 if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings)
46 memset(cmd, 0, sizeof(struct ethtool_cmd));
47 cmd->cmd = ETHTOOL_GSET;
48 return dev->ethtool_ops->get_settings(dev, cmd);
50 EXPORT_SYMBOL(__ethtool_get_settings);