Lines Matching refs:dst

182 	struct dsa_switch_tree *dst = ds->dst;  in dsa_switch_setup_one()  local
199 if (dst->cpu_switch != -1) { in dsa_switch_setup_one()
200 netdev_err(dst->master_netdev, in dsa_switch_setup_one()
205 dst->cpu_switch = index; in dsa_switch_setup_one()
206 dst->cpu_port = i; in dsa_switch_setup_one()
230 if (dst->cpu_switch == index) { in dsa_switch_setup_one()
234 dst->rcv = dsa_netdev_ops.rcv; in dsa_switch_setup_one()
239 dst->rcv = edsa_netdev_ops.rcv; in dsa_switch_setup_one()
244 dst->rcv = trailer_netdev_ops.rcv; in dsa_switch_setup_one()
249 dst->rcv = brcm_netdev_ops.rcv; in dsa_switch_setup_one()
259 dst->tag_protocol = ds->tag_protocol; in dsa_switch_setup_one()
269 ret = drv->set_addr(ds, dst->master_netdev->dev_addr); in dsa_switch_setup_one()
294 netdev_err(dst->master_netdev, "[%d]: can't create dsa slave device for port %d(%s)\n", in dsa_switch_setup_one()
306 const char *netname = netdev_name(dst->master_netdev); in dsa_switch_setup_one()
335 dsa_switch_setup(struct dsa_switch_tree *dst, int index, in dsa_switch_setup() argument
338 struct dsa_chip_data *pd = dst->pd->chip + index; in dsa_switch_setup()
349 netdev_err(dst->master_netdev, "[%d]: could not detect attached switch\n", in dsa_switch_setup()
353 netdev_info(dst->master_netdev, "[%d]: detected a %s switch\n", in dsa_switch_setup()
364 ds->dst = dst; in dsa_switch_setup()
435 struct dsa_switch_tree *dst; in dsa_link_poll_work() local
438 dst = container_of(ugly, struct dsa_switch_tree, link_poll_work); in dsa_link_poll_work()
440 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_link_poll_work()
441 struct dsa_switch *ds = dst->ds[i]; in dsa_link_poll_work()
447 mod_timer(&dst->link_poll_timer, round_jiffies(jiffies + HZ)); in dsa_link_poll_work()
452 struct dsa_switch_tree *dst = (void *)_dst; in dsa_link_poll_timer() local
454 schedule_work(&dst->link_poll_work); in dsa_link_poll_timer()
705 static void dsa_setup_dst(struct dsa_switch_tree *dst, struct net_device *dev, in dsa_setup_dst() argument
710 dst->pd = pd; in dsa_setup_dst()
711 dst->master_netdev = dev; in dsa_setup_dst()
712 dst->cpu_switch = -1; in dsa_setup_dst()
713 dst->cpu_port = -1; in dsa_setup_dst()
718 ds = dsa_switch_setup(dst, i, parent, pd->chip[i].host_dev); in dsa_setup_dst()
725 dst->ds[i] = ds; in dsa_setup_dst()
727 dst->link_poll_needed = 1; in dsa_setup_dst()
736 dev->dsa_ptr = (void *)dst; in dsa_setup_dst()
738 if (dst->link_poll_needed) { in dsa_setup_dst()
739 INIT_WORK(&dst->link_poll_work, dsa_link_poll_work); in dsa_setup_dst()
740 init_timer(&dst->link_poll_timer); in dsa_setup_dst()
741 dst->link_poll_timer.data = (unsigned long)dst; in dsa_setup_dst()
742 dst->link_poll_timer.function = dsa_link_poll_timer; in dsa_setup_dst()
743 dst->link_poll_timer.expires = round_jiffies(jiffies + HZ); in dsa_setup_dst()
744 add_timer(&dst->link_poll_timer); in dsa_setup_dst()
752 struct dsa_switch_tree *dst; in dsa_probe() local
786 dst = kzalloc(sizeof(*dst), GFP_KERNEL); in dsa_probe()
787 if (dst == NULL) { in dsa_probe()
793 platform_set_drvdata(pdev, dst); in dsa_probe()
795 dsa_setup_dst(dst, dev, &pdev->dev, pd); in dsa_probe()
805 static void dsa_remove_dst(struct dsa_switch_tree *dst) in dsa_remove_dst() argument
809 if (dst->link_poll_needed) in dsa_remove_dst()
810 del_timer_sync(&dst->link_poll_timer); in dsa_remove_dst()
812 flush_work(&dst->link_poll_work); in dsa_remove_dst()
814 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_remove_dst()
815 struct dsa_switch *ds = dst->ds[i]; in dsa_remove_dst()
824 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_remove() local
826 dsa_remove_dst(dst); in dsa_remove()
839 struct dsa_switch_tree *dst = dev->dsa_ptr; in dsa_switch_rcv() local
841 if (unlikely(dst == NULL)) { in dsa_switch_rcv()
846 return dst->rcv(skb, dev, pt, orig_dev); in dsa_switch_rcv()
862 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_suspend() local
865 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_suspend()
866 struct dsa_switch *ds = dst->ds[i]; in dsa_suspend()
878 struct dsa_switch_tree *dst = platform_get_drvdata(pdev); in dsa_resume() local
881 for (i = 0; i < dst->pd->nr_chips; i++) { in dsa_resume()
882 struct dsa_switch *ds = dst->ds[i]; in dsa_resume()