Release 4.9 drivers/net/wireless/marvell/libertas/ethtool.c
  
  
#include <linux/hardirq.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/delay.h>
#include "decl.h"
#include "cmd.h"
#include "mesh.h"
static void lbs_ethtool_get_drvinfo(struct net_device *dev,
					 struct ethtool_drvinfo *info)
{
	struct lbs_private *priv = dev->ml_priv;
	snprintf(info->fw_version, sizeof(info->fw_version),
		"%u.%u.%u.p%u",
		priv->fwrelease >> 24 & 0xff,
		priv->fwrelease >> 16 & 0xff,
		priv->fwrelease >>  8 & 0xff,
		priv->fwrelease       & 0xff);
	strlcpy(info->driver, "libertas", sizeof(info->driver));
	strlcpy(info->version, lbs_driver_version, sizeof(info->version));
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| marcelo tosatti | marcelo tosatti | 41 | 39.81% | 1 | 16.67% | 
| holger schurig | holger schurig | 38 | 36.89% | 3 | 50.00% | 
| rick jones | rick jones | 22 | 21.36% | 1 | 16.67% | 
| kiran divekar | kiran divekar | 2 | 1.94% | 1 | 16.67% | 
 | Total | 103 | 100.00% | 6 | 100.00% | 
/*
 * All 8388 parts have 16KiB EEPROM size at the time of writing.
 * In case that changes this needs fixing.
 */
#define LBS_EEPROM_LEN 16384
static int lbs_ethtool_get_eeprom_len(struct net_device *dev)
{
	return LBS_EEPROM_LEN;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| marcelo tosatti | marcelo tosatti | 12 | 85.71% | 1 | 50.00% | 
| holger schurig | holger schurig | 2 | 14.29% | 1 | 50.00% | 
 | Total | 14 | 100.00% | 2 | 100.00% | 
static int lbs_ethtool_get_eeprom(struct net_device *dev,
                                  struct ethtool_eeprom *eeprom, u8 * bytes)
{
	struct lbs_private *priv = dev->ml_priv;
	struct cmd_ds_802_11_eeprom_access cmd;
	int ret;
	lbs_deb_enter(LBS_DEB_ETHTOOL);
	if (eeprom->offset + eeprom->len > LBS_EEPROM_LEN ||
	    eeprom->len > LBS_EEPROM_READ_LEN) {
		ret = -EINVAL;
		goto out;
	}
	cmd.hdr.size = cpu_to_le16(sizeof(struct cmd_ds_802_11_eeprom_access) -
		LBS_EEPROM_READ_LEN + eeprom->len);
	cmd.action = cpu_to_le16(CMD_ACT_GET);
	cmd.offset = cpu_to_le16(eeprom->offset);
	cmd.len    = cpu_to_le16(eeprom->len);
	ret = lbs_cmd_with_response(priv, CMD_802_11_EEPROM_ACCESS, &cmd);
	if (!ret)
		memcpy(bytes, cmd.value, eeprom->len);
out:
	lbs_deb_leave_args(LBS_DEB_ETHTOOL, "ret %d", ret);
        return ret;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| marcelo tosatti | marcelo tosatti | 82 | 49.70% | 1 | 14.29% | 
| holger schurig | holger schurig | 80 | 48.48% | 4 | 57.14% | 
| kiran divekar | kiran divekar | 2 | 1.21% | 1 | 14.29% | 
| dan williams | dan williams | 1 | 0.61% | 1 | 14.29% | 
 | Total | 165 | 100.00% | 7 | 100.00% | 
static void lbs_ethtool_get_wol(struct net_device *dev,
				struct ethtool_wolinfo *wol)
{
	struct lbs_private *priv = dev->ml_priv;
	wol->supported = WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY;
	if (priv->wol_criteria == EHS_REMOVE_WAKEUP)
		return;
	if (priv->wol_criteria & EHS_WAKE_ON_UNICAST_DATA)
		wol->wolopts |= WAKE_UCAST;
	if (priv->wol_criteria & EHS_WAKE_ON_MULTICAST_DATA)
		wol->wolopts |= WAKE_MCAST;
	if (priv->wol_criteria & EHS_WAKE_ON_BROADCAST_DATA)
		wol->wolopts |= WAKE_BCAST;
	if (priv->wol_criteria & EHS_WAKE_ON_MAC_EVENT)
		wol->wolopts |= WAKE_PHY;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david woodhouse | david woodhouse | 91 | 89.22% | 1 | 33.33% | 
| sascha silbe | sascha silbe | 9 | 8.82% | 1 | 33.33% | 
| kiran divekar | kiran divekar | 2 | 1.96% | 1 | 33.33% | 
 | Total | 102 | 100.00% | 3 | 100.00% | 
static int lbs_ethtool_set_wol(struct net_device *dev,
			       struct ethtool_wolinfo *wol)
{
	struct lbs_private *priv = dev->ml_priv;
	if (wol->wolopts & ~(WAKE_UCAST|WAKE_MCAST|WAKE_BCAST|WAKE_PHY))
		return -EOPNOTSUPP;
	priv->wol_criteria = 0;
	if (wol->wolopts & WAKE_UCAST)
		priv->wol_criteria |= EHS_WAKE_ON_UNICAST_DATA;
	if (wol->wolopts & WAKE_MCAST)
		priv->wol_criteria |= EHS_WAKE_ON_MULTICAST_DATA;
	if (wol->wolopts & WAKE_BCAST)
		priv->wol_criteria |= EHS_WAKE_ON_BROADCAST_DATA;
	if (wol->wolopts & WAKE_PHY)
		priv->wol_criteria |= EHS_WAKE_ON_MAC_EVENT;
	if (wol->wolopts == 0)
		priv->wol_criteria |= EHS_REMOVE_WAKEUP;
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david woodhouse | david woodhouse | 90 | 72.00% | 1 | 25.00% | 
| amitkumar karwar | amitkumar karwar | 22 | 17.60% | 1 | 25.00% | 
| bing zhao | bing zhao | 11 | 8.80% | 1 | 25.00% | 
| kiran divekar | kiran divekar | 2 | 1.60% | 1 | 25.00% | 
 | Total | 125 | 100.00% | 4 | 100.00% | 
const struct ethtool_ops lbs_ethtool_ops = {
	.get_drvinfo = lbs_ethtool_get_drvinfo,
	.get_eeprom =  lbs_ethtool_get_eeprom,
	.get_eeprom_len = lbs_ethtool_get_eeprom_len,
#ifdef CONFIG_LIBERTAS_MESH
	.get_sset_count = lbs_mesh_ethtool_get_sset_count,
	.get_ethtool_stats = lbs_mesh_ethtool_get_stats,
	.get_strings = lbs_mesh_ethtool_get_strings,
#endif
	.get_wol = lbs_ethtool_get_wol,
	.set_wol = lbs_ethtool_set_wol,
};
Overall Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| david woodhouse | david woodhouse | 192 | 32.71% | 1 | 5.00% | 
| marcelo tosatti | marcelo tosatti | 180 | 30.66% | 1 | 5.00% | 
| holger schurig | holger schurig | 133 | 22.66% | 7 | 35.00% | 
| rick jones | rick jones | 22 | 3.75% | 1 | 5.00% | 
| amitkumar karwar | amitkumar karwar | 22 | 3.75% | 1 | 5.00% | 
| bing zhao | bing zhao | 11 | 1.87% | 1 | 5.00% | 
| sascha silbe | sascha silbe | 9 | 1.53% | 1 | 5.00% | 
| kiran divekar | kiran divekar | 8 | 1.36% | 1 | 5.00% | 
| alexey dobriyan | alexey dobriyan | 3 | 0.51% | 1 | 5.00% | 
| daniel drake | daniel drake | 3 | 0.51% | 1 | 5.00% | 
| randy dunlap | randy dunlap | 1 | 0.17% | 1 | 5.00% | 
| stephen hemminger | stephen hemminger | 1 | 0.17% | 1 | 5.00% | 
| dan williams | dan williams | 1 | 0.17% | 1 | 5.00% | 
| jeff garzik | jeff garzik | 1 | 0.17% | 1 | 5.00% | 
 | Total | 587 | 100.00% | 20 | 100.00% |