Re: [PATCH RFC V2 2/2] net: qualcomm: new Ethernet over SPI driver for QCA7000

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

 




On 2014-07-01 at 18:36:49 +0200, Stefan Wahren <stefan.wahren@xxxxxxxx> wrote:
> This patch adds the Ethernet over SPI driver for the
> Qualcomm QCA7000 HomePlug GreenPHY.
> 
> Signed-off-by: Stefan Wahren <stefan.wahren@xxxxxxxx>
> ---
>  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 devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux