aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorReece R. Pollack2015-02-16 13:44:19 -0600
committerReece R. Pollack2015-02-16 16:30:35 -0600
commitdadb6a5634a3ed8138f577e98715fbc378841b5a (patch)
tree6433cbbe3e29f1897c2c6694bc6a48903098e274 /drivers/net/ethernet/ti/keystone_ethss2.c
parent1cd9632166b2863dfe5bebe8f19ce085cf9fb754 (diff)
downloadlinux-dadb6a5634a3ed8138f577e98715fbc378841b5a.tar.gz
linux-dadb6a5634a3ed8138f577e98715fbc378841b5a.tar.xz
linux-dadb6a5634a3ed8138f577e98715fbc378841b5a.zip
net: keystone: Remove NetCP CPSW ALE VLAN configuration
An early implementation of the NetCP CPSW module configured the Address Lookup Engine (ALE) to be VLAN-aware. This was later determined to be undesirable, and the VLAN-aware bit in the ALE Control register was changed to 0. However, the code to configure VLAN-specific entries remained. This patch removes this unneeded code, and addresses a NULL pointer dereference in the process. Signed-off-by: Reece R. Pollack <x0183204@ti.com>
Diffstat (limited to 'drivers/net/ethernet/ti/keystone_ethss2.c')
-rw-r--r--drivers/net/ethernet/ti/keystone_ethss2.c53
1 files changed, 0 insertions, 53 deletions
diff --git a/drivers/net/ethernet/ti/keystone_ethss2.c b/drivers/net/ethernet/ti/keystone_ethss2.c
index 5560d6e2c00..5f2c64f56c4 100644
--- a/drivers/net/ethernet/ti/keystone_ethss2.c
+++ b/drivers/net/ethernet/ti/keystone_ethss2.c
@@ -913,7 +913,6 @@ struct cpsw2_intf {
913 struct list_head cpsw_intf_list; 913 struct list_head cpsw_intf_list;
914 struct timer_list timer; 914 struct timer_list timer;
915 u32 sgmii_link; 915 u32 sgmii_link;
916 unsigned long active_vlans[BITS_TO_LONGS(VLAN_N_VID)];
917}; 916};
918 917
919struct cpsw2_attribute { 918struct cpsw2_attribute {
@@ -2725,53 +2724,31 @@ static void cpsw2_slave_init(struct cpsw2_slave *slave, struct cpsw2_priv *priv)
2725static void cpsw2_add_mcast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr) 2724static void cpsw2_add_mcast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr)
2726{ 2725{
2727 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2726 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2728 u16 vlan_id;
2729 2727
2730 cpsw_ale_add_mcast(cpsw_dev->ale, addr, 2728 cpsw_ale_add_mcast(cpsw_dev->ale, addr,
2731 CPSW2_MASK_ALL_PORTS(cpsw_dev->num_slaves + 1), 0, 0, 2729 CPSW2_MASK_ALL_PORTS(cpsw_dev->num_slaves + 1), 0, 0,
2732 ALE_MCAST_FWD_2); 2730 ALE_MCAST_FWD_2);
2733 for_each_set_bit(vlan_id, cpsw_intf->active_vlans, VLAN_N_VID) {
2734 cpsw_ale_add_mcast(cpsw_dev->ale, addr,
2735 CPSW2_MASK_ALL_PORTS(cpsw_dev->num_slaves + 1),
2736 ALE_VLAN, vlan_id, ALE_MCAST_FWD_2);
2737 }
2738} 2731}
2739 2732
2740static void cpsw2_add_ucast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr) 2733static void cpsw2_add_ucast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr)
2741{ 2734{
2742 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2735 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2743 u16 vlan_id;
2744 2736
2745 cpsw_ale_add_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port, 0, 0); 2737 cpsw_ale_add_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port, 0, 0);
2746
2747 for_each_set_bit(vlan_id, cpsw_intf->active_vlans, VLAN_N_VID)
2748 cpsw_ale_add_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port,
2749 ALE_VLAN, vlan_id);
2750} 2738}
2751 2739
2752static void cpsw2_del_mcast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr) 2740static void cpsw2_del_mcast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr)
2753{ 2741{
2754 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2742 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2755 u16 vlan_id;
2756 2743
2757 cpsw_ale_del_mcast(cpsw_dev->ale, addr, 0, 0, 0); 2744 cpsw_ale_del_mcast(cpsw_dev->ale, addr, 0, 0, 0);
2758
2759 for_each_set_bit(vlan_id, cpsw_intf->active_vlans, VLAN_N_VID) {
2760 cpsw_ale_del_mcast(cpsw_dev->ale, addr, 0, ALE_VLAN, vlan_id);
2761 }
2762} 2745}
2763 2746
2764static void cpsw2_del_ucast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr) 2747static void cpsw2_del_ucast_addr(struct cpsw2_intf *cpsw_intf, u8 *addr)
2765{ 2748{
2766 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv; 2749 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2767 u16 vlan_id;
2768 2750
2769 cpsw_ale_del_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port, 0, 0); 2751 cpsw_ale_del_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port, 0, 0);
2770
2771 for_each_set_bit(vlan_id, cpsw_intf->active_vlans, VLAN_N_VID) {
2772 cpsw_ale_del_ucast(cpsw_dev->ale, addr, cpsw_dev->host_port,
2773 ALE_VLAN, vlan_id);
2774 }
2775} 2752}
2776 2753
2777static int cpsw2_add_addr(void *intf_priv, struct netcp_addr *naddr) 2754static int cpsw2_add_addr(void *intf_priv, struct netcp_addr *naddr)
@@ -2826,34 +2803,6 @@ static int cpsw2_del_addr(void *intf_priv, struct netcp_addr *naddr)
2826 return 0; 2803 return 0;
2827} 2804}
2828 2805
2829static int cpsw2_add_vid(void *intf_priv, int vid)
2830{
2831 struct cpsw2_intf *cpsw_intf = intf_priv;
2832 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2833
2834 set_bit(vid, cpsw_intf->active_vlans);
2835
2836 cpsw_ale_add_vlan(cpsw_dev->ale, vid,
2837 CPSW2_MASK_ALL_PORTS(cpsw_dev->num_slaves + 1),
2838 CPSW2_MASK_NO_PORTS,
2839 CPSW2_MASK_ALL_PORTS(cpsw_dev->num_slaves + 1),
2840 CPSW2_MASK_PHYS_PORTS(cpsw_dev->num_slaves + 1));
2841
2842 return 0;
2843}
2844
2845static int cpsw2_del_vid(void *intf_priv, int vid)
2846{
2847 struct cpsw2_intf *cpsw_intf = intf_priv;
2848 struct cpsw2_priv *cpsw_dev = cpsw_intf->cpsw_priv;
2849
2850 cpsw_ale_del_vlan(cpsw_dev->ale, vid, 0);
2851
2852 clear_bit(vid, cpsw_intf->active_vlans);
2853
2854 return 0;
2855}
2856
2857#ifdef CONFIG_TI_CPTS 2806#ifdef CONFIG_TI_CPTS
2858#define KEYSTONE_PTP_FILTER2 \ 2807#define KEYSTONE_PTP_FILTER2 \
2859{ \ 2808{ \
@@ -4101,8 +4050,6 @@ static struct netcp_module cpsw_module = {
4101 .release = cpsw2_release, 4050 .release = cpsw2_release,
4102 .add_addr = cpsw2_add_addr, 4051 .add_addr = cpsw2_add_addr,
4103 .del_addr = cpsw2_del_addr, 4052 .del_addr = cpsw2_del_addr,
4104 .add_vid = cpsw2_add_vid,
4105 .del_vid = cpsw2_del_vid,
4106 .ioctl = cpsw2_ioctl, 4053 .ioctl = cpsw2_ioctl,
4107}; 4054};
4108 4055