lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20140703094939.GB27655@distanz.ch>
Date:	Thu, 3 Jul 2014 11:49:40 +0200
From:	Tobias Klauser <tklauser@...tanz.ch>
To:	Stefan Wahren <stefan.wahren@...e.com>
Cc:	davem@...emloft.net, robh+dt@...nel.org, pawel.moll@....com,
	mark.rutland@....com, ijc+devicetree@...lion.org.uk,
	galak@...eaurora.org, f.fainelli@...il.com, eric.dumazet@...il.com,
	dave.taht@...il.com, netdev@...r.kernel.org,
	devicetree@...r.kernel.org
Subject: Re: [PATCH RFC V2 2/2] net: qualcomm: new Ethernet over SPI driver
 for QCA7000

On 2014-07-01 at 18:36:49 +0200, Stefan Wahren <stefan.wahren@...e.com> wrote:
> This patch adds the Ethernet over SPI driver for the
> Qualcomm QCA7000 HomePlug GreenPHY.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@...e.com>
> ---
>  drivers/net/ethernet/Kconfig                |    1 +
>  drivers/net/ethernet/Makefile               |    1 +
>  drivers/net/ethernet/qualcomm/Kconfig       |   30 +
>  drivers/net/ethernet/qualcomm/Makefile      |    6 +
>  drivers/net/ethernet/qualcomm/qca_7k.c      |  149 ++++
>  drivers/net/ethernet/qualcomm/qca_7k.h      |   72 ++
>  drivers/net/ethernet/qualcomm/qca_debug.c   |  311 +++++++++
>  drivers/net/ethernet/qualcomm/qca_debug.h   |   34 +
>  drivers/net/ethernet/qualcomm/qca_framing.c |  155 +++++
>  drivers/net/ethernet/qualcomm/qca_framing.h |  134 ++++
>  drivers/net/ethernet/qualcomm/qca_spi.c     | 1001 +++++++++++++++++++++++++++
>  drivers/net/ethernet/qualcomm/qca_spi.h     |  114 +++
>  12 files changed, 2008 insertions(+)
>  create mode 100644 drivers/net/ethernet/qualcomm/Kconfig
>  create mode 100644 drivers/net/ethernet/qualcomm/Makefile
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_7k.c
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_7k.h
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_debug.c
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_debug.h
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_framing.c
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_framing.h
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_spi.c
>  create mode 100644 drivers/net/ethernet/qualcomm/qca_spi.h

[...]

> +static int
> +qcaspi_netdev_set_mac_address(struct net_device *dev, void *addr)
> +{
> +	struct sockaddr *sa = addr;
> +
> +	if (netif_running(dev))
> +		return -EBUSY;
> +
> +	if (!is_valid_ether_addr(sa->sa_data))
> +		return -EADDRNOTAVAIL;
> +
> +	memcpy(dev->dev_addr, sa->sa_data, dev->addr_len);
> +	return 0;
> +}
> +
> +static const struct net_device_ops qcaspi_netdev_ops = {
> +	.ndo_init = qcaspi_netdev_init,
> +	.ndo_uninit = qcaspi_netdev_uninit,
> +	.ndo_open = qcaspi_netdev_open,
> +	.ndo_stop = qcaspi_netdev_close,
> +	.ndo_start_xmit = qcaspi_netdev_xmit,
> +	.ndo_change_mtu = qcaspi_netdev_change_mtu,
> +	.ndo_set_mac_address = qcaspi_netdev_set_mac_address,

You can use eth_mac_addr here which does the same thing as your
implementation.

> +	.ndo_tx_timeout = qcaspi_netdev_tx_timeout,
> +	.ndo_validate_addr = eth_validate_addr,
> +};
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ