Re: [PATCH v2 1/2] drivers: net: cpsw: Add helper functions for VLAN ALE implementation

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

 



Mugunthan V N <mugunthanvnm@xxxxxx> :
[...]
> diff --git a/drivers/net/ethernet/ti/cpsw_ale.c b/drivers/net/ethernet/ti/cpsw_ale.c
> index 0e9ccc2..18b88ce 100644
> --- a/drivers/net/ethernet/ti/cpsw_ale.c
> +++ b/drivers/net/ethernet/ti/cpsw_ale.c
[...]
> @@ -274,19 +292,26 @@ int cpsw_ale_flush(struct cpsw_ale *ale, int port_mask)
>  	return 0;
>  }
>  
> -int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port, int flags)
> +int cpsw_ale_add_ucast(struct cpsw_ale *ale, u8 *addr, int port,
> +		       int flags, u16 vid)
>  {
>  	u32 ale_entry[ALE_ENTRY_WORDS] = {0, 0, 0};
>  	int idx;
>  
> -	cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR);
> +	if (flags & ALE_VLAN) {
> +		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_VLAN_ADDR);
> +		cpsw_ale_set_vlan_id(ale_entry, vid);
> +	} else {
> +		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR);
> +	}
> +
[...]
> +	if (flags & ALE_VLAN) {
> +		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_VLAN_ADDR);
> +		cpsw_ale_set_vlan_id(ale_entry, vid);
> +	} else {
> +		cpsw_ale_set_entry_type(ale_entry, ALE_TYPE_ADDR);
> +	}
> +

It could be fctored out.

[...]
> @@ -362,6 +395,55 @@ int cpsw_ale_del_mcast(struct cpsw_ale *ale, u8 *addr, int port_mask)
>  	return 0;
>  }
>  
> +int cpsw_ale_add_vlan(struct cpsw_ale *ale, u16 vid, int port, int untag,
> +		      int reg_mcast, int unreg_mcast)
> +{
[...]
> +int cpsw_ale_del_vlan(struct cpsw_ale *ale, u16 vid, int port_mask)
[...]

Patch #2 doesn't use the returned status code.

-- 
Ueimor
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux