Skip to content

Commit

Permalink
generic: ar8216: merge multiple if statements in ar8216_hw_apply
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@30928 3c298f89-4303-0410-b956-a3cf2f4a3e73
  • Loading branch information
juhosg committed Mar 13, 2012
1 parent 1faec31 commit ab881f8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions target/linux/generic/files/drivers/net/phy/ar8216.c
Expand Up @@ -621,24 +621,18 @@ ar8216_hw_apply(struct switch_dev *dev)
int egress, ingress;
int pvid;

if (priv->vlan)
pvid = priv->vlan_id[priv->pvid[i]];
else
pvid = i;

if (priv->vlan) {
pvid = priv->vlan_id[priv->pvid[i]];
if (priv->vlan_tagged & (1 << i))
egress = AR8216_OUT_ADD_VLAN;
else
egress = AR8216_OUT_STRIP_VLAN;
ingress = AR8216_IN_SECURE;
} else {
pvid = i;
egress = AR8216_OUT_KEEP;
}

if (priv->vlan)
ingress = AR8216_IN_SECURE;
else
ingress = AR8216_IN_PORT_ONLY;
}

if (priv->chip == AR8236)
ar8236_setup_port(priv, i, egress, ingress, portmask[i],
Expand Down

0 comments on commit ab881f8

Please sign in to comment.