提交 c599bd6b 编写于 作者: M Mike Frysinger 提交者: David S. Miller

netdev: bfin_mac: let boards set vlan masks

Signed-off-by: NMike Frysinger <vapier@gentoo.org>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 2d70a3d4
...@@ -588,6 +588,10 @@ static void setup_system_regs(struct net_device *dev) ...@@ -588,6 +588,10 @@ static void setup_system_regs(struct net_device *dev)
bfin_write_EMAC_MMC_CTL(RSTC | CROLL); bfin_write_EMAC_MMC_CTL(RSTC | CROLL);
/* Set vlan regs to let 1522 bytes long packets pass through */
bfin_write_EMAC_VLAN1(lp->vlan1_mask);
bfin_write_EMAC_VLAN2(lp->vlan2_mask);
/* Initialize the TX DMA channel registers */ /* Initialize the TX DMA channel registers */
bfin_write_DMA2_X_COUNT(0); bfin_write_DMA2_X_COUNT(0);
bfin_write_DMA2_X_MODIFY(4); bfin_write_DMA2_X_MODIFY(4);
...@@ -1520,6 +1524,9 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev) ...@@ -1520,6 +1524,9 @@ static int __devinit bfin_mac_probe(struct platform_device *pdev)
goto out_err_mii_probe; goto out_err_mii_probe;
} }
lp->vlan1_mask = ETH_P_8021Q | mii_bus_data->vlan1_mask;
lp->vlan2_mask = ETH_P_8021Q | mii_bus_data->vlan2_mask;
/* Fill in the fields of the device structure with ethernet values. */ /* Fill in the fields of the device structure with ethernet values. */
ether_setup(ndev); ether_setup(ndev);
......
...@@ -82,6 +82,9 @@ struct bfin_mac_local { ...@@ -82,6 +82,9 @@ struct bfin_mac_local {
struct timer_list tx_reclaim_timer; struct timer_list tx_reclaim_timer;
struct net_device *ndev; struct net_device *ndev;
/* Data for EMAC_VLAN1 regs */
u16 vlan1_mask, vlan2_mask;
/* MII and PHY stuffs */ /* MII and PHY stuffs */
int old_link; /* used by bf537_adjust_link */ int old_link; /* used by bf537_adjust_link */
int old_speed; int old_speed;
......
...@@ -24,6 +24,7 @@ struct bfin_mii_bus_platform_data { ...@@ -24,6 +24,7 @@ struct bfin_mii_bus_platform_data {
const unsigned short *mac_peripherals; const unsigned short *mac_peripherals;
int phy_mode; int phy_mode;
unsigned int phy_mask; unsigned int phy_mask;
unsigned short vlan1_mask, vlan2_mask;
}; };
#endif #endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册