Lines Matching refs:dst
218 struct dsa_switch_tree *dst = ds->dst; in dsa_switch_setup_one() local
235 if (dst->cpu_switch != -1) { in dsa_switch_setup_one()
236 netdev_err(dst->master_netdev, in dsa_switch_setup_one()
241 dst->cpu_switch = index; in dsa_switch_setup_one()
242 dst->cpu_port = i; in dsa_switch_setup_one()
266 if (dst->cpu_switch == index) { in dsa_switch_setup_one()
270 dst->rcv = dsa_netdev_ops.rcv; in dsa_switch_setup_one()
275 dst->rcv = edsa_netdev_ops.rcv; in dsa_switch_setup_one()
280 dst->rcv = trailer_netdev_ops.rcv; in dsa_switch_setup_one()
285 dst->rcv = brcm_netdev_ops.rcv; in dsa_switch_setup_one()
295 dst->tag_protocol = ds->tag_protocol; in dsa_switch_setup_one()
305 ret = drv->set_addr(ds, dst->master_netdev->dev_addr); in dsa_switch_setup_one()
330 netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s): %d\n", in dsa_switch_setup_one()
337 ret = dsa_cpu_dsa_setup(ds, dst->master_netdev); in dsa_switch_setup_one()
339 netdev_err(dst->master_netdev, "[%d] : can't configure CPU and DSA ports\n", in dsa_switch_setup_one()
350 const char *netname = netdev_name(dst->master_netdev); in dsa_switch_setup_one()
376 dsa_switch_setup(struct dsa_switch_tree *dst, int index, in dsa_switch_setup() argument
379 struct dsa_chip_data *pd = dst->pd->chip + index; in dsa_switch_setup()
390 netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", in dsa_switch_setup()
394 netdev_info(dst->master_netdev, "[%d]: detected a %s switch\n", in dsa_switch_setup()
405 ds->dst = dst; in dsa_switch_setup()
513 struct dsa_switch_tree *dst; in dsa_link_poll_work() local
516 dst = container_of(ugly, struct dsa_switch_tree, link_poll_work); in dsa_link_poll_work()
518 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_link_poll_work()
519 struct dsa_switch *ds = dst->ds[i]; in dsa_link_poll_work()
525 mod_timer(&dst->link_poll_timer, round_jiffies(jiffies + HZ)); in dsa_link_poll_work()
530 struct dsa_switch_tree *dst = (void *)_dst; in dsa_link_poll_timer() local
532 schedule_work(&dst->link_poll_work); in dsa_link_poll_timer()
840 static int dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, in dsa_setup_dst() argument
846 dst->pd = pd; in dsa_setup_dst()
847 dst->master_netdev = dev; in dsa_setup_dst()
848 dst->cpu_switch = -1; in dsa_setup_dst()
849 dst->cpu_port = -1; in dsa_setup_dst()
854 ds = dsa_switch_setup(dst, i, parent, pd->chip[i].host_dev); in dsa_setup_dst()
861 dst->ds[i] = ds; in dsa_setup_dst()
863 dst->link_poll_needed = 1; in dsa_setup_dst()
880 dev->dsa_ptr = (void *)dst; in dsa_setup_dst()
882 if (dst->link_poll_needed) { in dsa_setup_dst()
883 INIT_WORK(&dst->link_poll_work, dsa_link_poll_work); in dsa_setup_dst()
884 init_timer(&dst->link_poll_timer); in dsa_setup_dst()
885 dst->link_poll_timer.data = (unsigned long)dst; in dsa_setup_dst()
886 dst->link_poll_timer.function = dsa_link_poll_timer; in dsa_setup_dst()
887 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ); in dsa_setup_dst()
888 add_timer(&dst->link_poll_timer); in dsa_setup_dst()
898 struct dsa_switch_tree *dst; in dsa_probe() local
932 dst = devm_kzalloc(&pdev->dev, sizeof(*dst), GFP_KERNEL); in dsa_probe()
933 if (dst == NULL) { in dsa_probe()
939 platform_set_drvdata(pdev, dst); in dsa_probe()
941 ret = dsa_setup_dst(dst, dev, &pdev->dev, pd); in dsa_probe()
953 static void dsa_remove_dst(struct dsa_switch_tree *dst) in dsa_remove_dst() argument
957 if (dst->link_poll_needed) in dsa_remove_dst()
958 del_timer_sync(&dst->link_poll_timer); in dsa_remove_dst()
960 flush_work(&dst->link_poll_work); in dsa_remove_dst()
962 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_remove_dst()
963 struct dsa_switch *ds = dst->ds[i]; in dsa_remove_dst()
972 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_remove() local
974 dsa_remove_dst(dst); in dsa_remove()
987 struct dsa_switch_tree *dst = dev->dsa_ptr; in dsa_switch_rcv() local
989 if (unlikely(dst == NULL)) { in dsa_switch_rcv()
994 return dst->rcv(skb, dev, pt, orig_dev); in dsa_switch_rcv()
1010 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_suspend() local
1013 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_suspend()
1014 struct dsa_switch *ds = dst->ds[i]; in dsa_suspend()
1026 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_resume() local
1029 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_resume()
1030 struct dsa_switch *ds = dst->ds[i]; in dsa_resume()