Linux on ARM based TI OMAP SoCs
 help / color / mirror / Atom feed
From: Felipe Balbi <balbi@ti.com>
To: Mugunthan V N <mugunthanvnm@ti.com>
Cc: netdev@vger.kernel.org, davem@davemloft.net,
	linux-arm-kernel@lists.infradead.org, linux-omap@vger.kernel.org
Subject: Re: [PATCH 2/2] drivers: net:ethernet: cpsw: add support for VLAN
Date: Mon, 28 Jan 2013 22:44:46 +0200	[thread overview]
Message-ID: <20130128204446.GB5509@arwen.pp.htv.fi> (raw)
In-Reply-To: <1359403945-28585-3-git-send-email-mugunthanvnm@ti.com>

[-- Attachment #1: Type: text/plain, Size: 2409 bytes --]

On Tue, Jan 29, 2013 at 01:42:25AM +0530, Mugunthan V N wrote:
> adding support for VLAN interface for cpsw.
> 
> CPSW VLAN Capability
> * Can filter VLAN packets in Hardware
> 
> Signed-off-by: Mugunthan V N <mugunthanvnm@ti.com>
> ---
>  Documentation/devicetree/bindings/net/cpsw.txt |    2 +
>  drivers/net/ethernet/ti/cpsw.c                 |  108 +++++++++++++++++++++++-
>  include/linux/platform_data/cpsw.h             |    1 +
>  3 files changed, 110 insertions(+), 1 deletion(-)
> 
> diff --git a/Documentation/devicetree/bindings/net/cpsw.txt b/Documentation/devicetree/bindings/net/cpsw.txt
> index 6ddd028..99696bf 100644
> --- a/Documentation/devicetree/bindings/net/cpsw.txt
> +++ b/Documentation/devicetree/bindings/net/cpsw.txt
> @@ -24,6 +24,8 @@ Required properties:
>  Optional properties:
>  - ti,hwmods		: Must be "cpgmac0"
>  - no_bd_ram		: Must be 0 or 1
> +- default_vlan		: Specifies Default VLAN for non tagged packets
> +			  ALE processing
>  
>  Note: "ti,hwmods" field is used to fetch the base address and irq
>  resources from TI, omap hwmod data base during device registration.
> diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
> index b35e6a7..dee6951 100644
> --- a/drivers/net/ethernet/ti/cpsw.c
> +++ b/drivers/net/ethernet/ti/cpsw.c
> @@ -32,6 +32,7 @@
>  #include <linux/of.h>
>  #include <linux/of_net.h>
>  #include <linux/of_device.h>
> +#include <linux/if_vlan.h>
>  
>  #include <linux/platform_data/cpsw.h>
>  
> @@ -72,6 +73,11 @@ do {								\
>  		dev_notice(priv->dev, format, ## __VA_ARGS__);	\
>  } while (0)
>  
> +#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)

use IS_ENABLED() instead.

> +#define VLAN_SUPPORT
> +#define CPSW_VLAN_AWARE_MODE
> +#endif
> +
>  #define ALE_ALL_PORTS		0x7
>  
>  #define CPSW_MAJOR_VERSION(reg)		(reg >> 8 & 0x7)
> @@ -118,6 +124,14 @@ do {								\
>  #define TX_PRIORITY_MAPPING	0x33221100
>  #define CPDMA_TX_PRIORITY_MAP	0x76543210
>  
> +#ifdef CPSW_VLAN_AWARE_MODE
> +#define CPSW_VLAN_AWARE		BIT(1)
> +#define CPSW_ALE_VLAN_AWARE	1
> +#else
> +#define CPSW_VLAN_AWARE		0x0
> +#define CPSW_ALE_VLAN_AWARE	0
> +#endif

you should really figure out a way of doing runtime detection for this.
Depending on driver recompilation just to enable/disable VLAN support
will be quite boring.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  reply	other threads:[~2013-01-28 20:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-28 20:12 [PATCH 0/2] Add CPSW VLAN Support Mugunthan V N
2013-01-28 20:12 ` [PATCH 1/2] drivers: net: cpsw: Add helper functions for VLAN ALE implementation Mugunthan V N
2013-01-29 23:38   ` Cyril Chemparathy
2013-01-30  4:17     ` Mugunthan V N
2013-01-28 20:12 ` [PATCH 2/2] drivers: net:ethernet: cpsw: add support for VLAN Mugunthan V N
2013-01-28 20:44   ` Felipe Balbi [this message]
2013-01-29  5:05     ` Mugunthan V N
2013-01-29  7:21       ` Felipe Balbi
2013-01-29  7:36   ` Richard Cochran
2013-01-29 12:33     ` Mugunthan V N
2013-01-29  9:48   ` Jan Lübbe
2013-01-29 12:09     ` Mugunthan V N

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130128204446.GB5509@arwen.pp.htv.fi \
    --to=balbi@ti.com \
    --cc=davem@davemloft.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox