Lines Matching refs:netdev

97 		if (other_dev == port_priv->netdev)  in dpaa2_switch_port_set_fdb()
211 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_is_up() local
219 netdev_err(netdev, "dpsw_if_get_link_state() err %d\n", err); in dpaa2_switch_port_is_up()
231 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_set_pvid() local
239 netdev_err(netdev, "dpsw_if_get_tci err %d\n", err); in dpaa2_switch_port_set_pvid()
252 netdev_err(netdev, "dpsw_if_disable err %d\n", err); in dpaa2_switch_port_set_pvid()
260 netdev_err(netdev, "dpsw_if_set_tci err %d\n", err); in dpaa2_switch_port_set_pvid()
275 netdev_err(netdev, "dpsw_if_enable err %d\n", ret); in dpaa2_switch_port_set_pvid()
287 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_add_vlan() local
292 netdev_warn(netdev, "VLAN %d already configured\n", vid); in dpaa2_switch_port_add_vlan()
305 netdev_err(netdev, "dpsw_vlan_add_if err %d\n", err); in dpaa2_switch_port_add_vlan()
316 netdev_err(netdev, in dpaa2_switch_port_add_vlan()
356 if (!netif_running(port_priv->netdev) || state == port_priv->stp_state) in dpaa2_switch_port_set_stp_state()
367 netdev_err(port_priv->netdev, in dpaa2_switch_port_set_stp_state()
419 netdev_err(port_priv->netdev, in dpaa2_switch_port_fdb_add_uc()
441 netdev_err(port_priv->netdev, in dpaa2_switch_port_fdb_del_uc()
464 netdev_err(port_priv->netdev, "dpsw_fdb_add_multicast err %d\n", in dpaa2_switch_port_fdb_add_mc()
487 netdev_err(port_priv->netdev, in dpaa2_switch_port_fdb_del_mc()
492 static void dpaa2_switch_port_get_stats(struct net_device *netdev, in dpaa2_switch_port_get_stats() argument
495 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_get_stats()
555 netdev_err(netdev, "dpsw_if_get_counter err %d\n", err); in dpaa2_switch_port_get_stats()
558 static bool dpaa2_switch_port_has_offload_stats(const struct net_device *netdev, in dpaa2_switch_port_has_offload_stats() argument
565 const struct net_device *netdev, in dpaa2_switch_port_get_offload_stats() argument
570 dpaa2_switch_port_get_stats((struct net_device *)netdev, sp); in dpaa2_switch_port_get_offload_stats()
577 static int dpaa2_switch_port_change_mtu(struct net_device *netdev, int mtu) in dpaa2_switch_port_change_mtu() argument
579 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_change_mtu()
588 netdev_err(netdev, in dpaa2_switch_port_change_mtu()
593 netdev->mtu = mtu; in dpaa2_switch_port_change_mtu()
597 static int dpaa2_switch_port_link_state_update(struct net_device *netdev) in dpaa2_switch_port_link_state_update() argument
599 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_link_state_update()
615 if (!netif_running(netdev)) in dpaa2_switch_port_link_state_update()
622 netdev_err(netdev, "dpsw_if_get_link_state() err %d\n", err); in dpaa2_switch_port_link_state_update()
630 netif_carrier_on(netdev); in dpaa2_switch_port_link_state_update()
631 netif_tx_start_all_queues(netdev); in dpaa2_switch_port_link_state_update()
633 netif_carrier_off(netdev); in dpaa2_switch_port_link_state_update()
634 netif_tx_stop_all_queues(netdev); in dpaa2_switch_port_link_state_update()
683 static int dpaa2_switch_port_open(struct net_device *netdev) in dpaa2_switch_port_open() argument
685 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_open()
697 netif_carrier_off(netdev); in dpaa2_switch_port_open()
705 netdev_err(netdev, "dpsw_if_enable err %d\n", err); in dpaa2_switch_port_open()
719 static int dpaa2_switch_port_stop(struct net_device *netdev) in dpaa2_switch_port_stop() argument
721 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_stop()
730 netif_tx_stop_all_queues(netdev); in dpaa2_switch_port_stop()
731 netif_carrier_off(netdev); in dpaa2_switch_port_stop()
740 netdev_err(netdev, "dpsw_if_disable err %d\n", err); in dpaa2_switch_port_stop()
760 static int dpaa2_switch_port_get_phys_name(struct net_device *netdev, char *name, in dpaa2_switch_port_get_phys_name() argument
763 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_get_phys_name()
837 struct net_device *net_dev = port_priv->netdev; in dpaa2_switch_fdb_iterate()
946 static int dpaa2_switch_port_vlan_add(struct net_device *netdev, __be16 proto, in dpaa2_switch_port_vlan_add() argument
952 .obj.orig_dev = netdev, in dpaa2_switch_port_vlan_add()
957 return dpaa2_switch_port_vlans_add(netdev, &vlan); in dpaa2_switch_port_vlan_add()
960 static int dpaa2_switch_port_vlan_kill(struct net_device *netdev, __be16 proto, in dpaa2_switch_port_vlan_kill() argument
966 .obj.orig_dev = netdev, in dpaa2_switch_port_vlan_kill()
971 return dpaa2_switch_port_vlans_del(netdev, &vlan); in dpaa2_switch_port_vlan_kill()
977 struct net_device *net_dev = port_priv->netdev; in dpaa2_switch_port_set_mac_addr()
1194 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_acl_tbl_bind() local
1206 netdev_err(netdev, "dpsw_acl_add_if err %d\n", err); in dpaa2_switch_port_acl_tbl_bind()
1221 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_acl_tbl_unbind() local
1233 netdev_err(netdev, "dpsw_acl_add_if err %d\n", err); in dpaa2_switch_port_acl_tbl_unbind()
1307 static int dpaa2_switch_setup_tc_block_bind(struct net_device *netdev, in dpaa2_switch_setup_tc_block_bind() argument
1310 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_setup_tc_block_bind()
1357 static void dpaa2_switch_setup_tc_block_unbind(struct net_device *netdev, in dpaa2_switch_setup_tc_block_unbind() argument
1360 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_setup_tc_block_unbind()
1380 static int dpaa2_switch_setup_tc_block(struct net_device *netdev, in dpaa2_switch_setup_tc_block() argument
1390 return dpaa2_switch_setup_tc_block_bind(netdev, f); in dpaa2_switch_setup_tc_block()
1392 dpaa2_switch_setup_tc_block_unbind(netdev, f); in dpaa2_switch_setup_tc_block()
1399 static int dpaa2_switch_port_setup_tc(struct net_device *netdev, in dpaa2_switch_port_setup_tc() argument
1405 return dpaa2_switch_setup_tc_block(netdev, type_data); in dpaa2_switch_port_setup_tc()
1433 bool dpaa2_switch_port_dev_check(const struct net_device *netdev) in dpaa2_switch_port_dev_check() argument
1435 return netdev->netdev_ops == &dpaa2_switch_port_ops; in dpaa2_switch_port_dev_check()
1444 dpsw_port_dev = to_fsl_mc_device(port_priv->netdev->dev.parent); in dpaa2_switch_port_connect_mac()
1459 mac->net_dev = port_priv->netdev; in dpaa2_switch_port_connect_mac()
1468 netdev_err(port_priv->netdev, in dpaa2_switch_port_connect_mac()
1527 dpaa2_switch_port_link_state_update(port_priv->netdev); in dpaa2_switch_irq0_handler_thread()
1640 netdev_err(port_priv->netdev, "dpsw_if_set_learning_mode err %d\n", err); in dpaa2_switch_port_set_learning()
1648 static int dpaa2_switch_port_attr_stp_state_set(struct net_device *netdev, in dpaa2_switch_port_attr_stp_state_set() argument
1651 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_attr_stp_state_set()
1688 static int dpaa2_switch_port_pre_bridge_flags(struct net_device *netdev, in dpaa2_switch_port_pre_bridge_flags() argument
1710 static int dpaa2_switch_port_bridge_flags(struct net_device *netdev, in dpaa2_switch_port_bridge_flags() argument
1714 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_bridge_flags()
1735 static int dpaa2_switch_port_attr_set(struct net_device *netdev, const void *ctx, in dpaa2_switch_port_attr_set() argument
1743 err = dpaa2_switch_port_attr_stp_state_set(netdev, in dpaa2_switch_port_attr_set()
1754 err = dpaa2_switch_port_pre_bridge_flags(netdev, attr->u.brport_flags, extack); in dpaa2_switch_port_attr_set()
1757 err = dpaa2_switch_port_bridge_flags(netdev, attr->u.brport_flags, extack); in dpaa2_switch_port_attr_set()
1767 int dpaa2_switch_port_vlans_add(struct net_device *netdev, in dpaa2_switch_port_vlans_add() argument
1770 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_vlans_add()
1785 netdev_err(netdev, "dpsw_get_attributes err %d\n", err); in dpaa2_switch_port_vlans_add()
1795 netdev_err(netdev, "dpsw_get_attributes err %d\n", err); in dpaa2_switch_port_vlans_add()
1813 static int dpaa2_switch_port_lookup_address(struct net_device *netdev, int is_uc, in dpaa2_switch_port_lookup_address() argument
1816 struct netdev_hw_addr_list *list = (is_uc) ? &netdev->uc : &netdev->mc; in dpaa2_switch_port_lookup_address()
1819 netif_addr_lock_bh(netdev); in dpaa2_switch_port_lookup_address()
1822 netif_addr_unlock_bh(netdev); in dpaa2_switch_port_lookup_address()
1826 netif_addr_unlock_bh(netdev); in dpaa2_switch_port_lookup_address()
1830 static int dpaa2_switch_port_mdb_add(struct net_device *netdev, in dpaa2_switch_port_mdb_add() argument
1833 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_mdb_add()
1837 if (dpaa2_switch_port_lookup_address(netdev, 0, mdb->addr)) in dpaa2_switch_port_mdb_add()
1844 err = dev_mc_add(netdev, mdb->addr); in dpaa2_switch_port_mdb_add()
1846 netdev_err(netdev, "dev_mc_add err %d\n", err); in dpaa2_switch_port_mdb_add()
1853 static int dpaa2_switch_port_obj_add(struct net_device *netdev, in dpaa2_switch_port_obj_add() argument
1860 err = dpaa2_switch_port_vlans_add(netdev, in dpaa2_switch_port_obj_add()
1864 err = dpaa2_switch_port_mdb_add(netdev, in dpaa2_switch_port_obj_add()
1878 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_del_vlan() local
1902 netdev_err(netdev, in dpaa2_switch_port_del_vlan()
1913 netdev_err(netdev, in dpaa2_switch_port_del_vlan()
1938 int dpaa2_switch_port_vlans_del(struct net_device *netdev, in dpaa2_switch_port_vlans_del() argument
1941 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_vlans_del()
1949 static int dpaa2_switch_port_mdb_del(struct net_device *netdev, in dpaa2_switch_port_mdb_del() argument
1952 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_mdb_del()
1955 if (!dpaa2_switch_port_lookup_address(netdev, 0, mdb->addr)) in dpaa2_switch_port_mdb_del()
1962 err = dev_mc_del(netdev, mdb->addr); in dpaa2_switch_port_mdb_del()
1964 netdev_err(netdev, "dev_mc_del err %d\n", err); in dpaa2_switch_port_mdb_del()
1971 static int dpaa2_switch_port_obj_del(struct net_device *netdev, in dpaa2_switch_port_obj_del() argument
1978 err = dpaa2_switch_port_vlans_del(netdev, SWITCHDEV_OBJ_PORT_VLAN(obj)); in dpaa2_switch_port_obj_del()
1981 err = dpaa2_switch_port_mdb_del(netdev, SWITCHDEV_OBJ_PORT_MDB(obj)); in dpaa2_switch_port_obj_del()
1990 static int dpaa2_switch_port_attr_set_event(struct net_device *netdev, in dpaa2_switch_port_attr_set_event() argument
1995 err = switchdev_handle_port_attr_set(netdev, ptr, in dpaa2_switch_port_attr_set_event()
2001 static int dpaa2_switch_port_bridge_join(struct net_device *netdev, in dpaa2_switch_port_bridge_join() argument
2005 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_bridge_join()
2033 learn_ena = br_port_flag_is_set(netdev, BR_LEARNING); in dpaa2_switch_port_bridge_join()
2042 err = switchdev_bridge_port_offload(netdev, netdev, NULL, in dpaa2_switch_port_bridge_join()
2075 static void dpaa2_switch_port_pre_bridge_leave(struct net_device *netdev) in dpaa2_switch_port_pre_bridge_leave() argument
2077 switchdev_bridge_port_unoffload(netdev, NULL, NULL, NULL); in dpaa2_switch_port_pre_bridge_leave()
2080 static int dpaa2_switch_port_bridge_leave(struct net_device *netdev) in dpaa2_switch_port_bridge_leave() argument
2082 struct ethsw_port_priv *port_priv = netdev_priv(netdev); in dpaa2_switch_port_bridge_leave()
2094 err = vlan_for_each(netdev, dpaa2_switch_port_clear_rxvlan, netdev); in dpaa2_switch_port_bridge_leave()
2096 netdev_err(netdev, "Unable to clear RX VLANs from old FDB table, err (%d)\n", err); in dpaa2_switch_port_bridge_leave()
2101 err = vlan_for_each(netdev, dpaa2_switch_port_restore_rxvlan, netdev); in dpaa2_switch_port_bridge_leave()
2103 netdev_err(netdev, "Unable to restore RX VLANs to the new FDB, err (%d)\n", err); in dpaa2_switch_port_bridge_leave()
2138 static int dpaa2_switch_prevent_bridging_with_8021q_upper(struct net_device *netdev) in dpaa2_switch_prevent_bridging_with_8021q_upper() argument
2146 netdev_for_each_upper_dev_rcu(netdev, upper_dev, iter) in dpaa2_switch_prevent_bridging_with_8021q_upper()
2154 dpaa2_switch_prechangeupper_sanity_checks(struct net_device *netdev, in dpaa2_switch_prechangeupper_sanity_checks() argument
2165 err = dpaa2_switch_prevent_bridging_with_8021q_upper(netdev); in dpaa2_switch_prechangeupper_sanity_checks()
2178 struct net_device *netdev = netdev_notifier_info_to_dev(ptr); in dpaa2_switch_port_netdevice_event() local
2184 if (!dpaa2_switch_port_dev_check(netdev)) in dpaa2_switch_port_netdevice_event()
2195 err = dpaa2_switch_prechangeupper_sanity_checks(netdev, in dpaa2_switch_port_netdevice_event()
2202 dpaa2_switch_port_pre_bridge_leave(netdev); in dpaa2_switch_port_netdevice_event()
2209 err = dpaa2_switch_port_bridge_join(netdev, in dpaa2_switch_port_netdevice_event()
2213 err = dpaa2_switch_port_bridge_leave(netdev); in dpaa2_switch_port_netdevice_event()
2326 struct net_device *netdev, in dpaa2_switch_port_obj_event() argument
2331 if (!dpaa2_switch_port_dev_check(netdev)) in dpaa2_switch_port_obj_event()
2336 err = dpaa2_switch_port_obj_add(netdev, port_obj_info->obj); in dpaa2_switch_port_obj_event()
2339 err = dpaa2_switch_port_obj_del(netdev, port_obj_info->obj); in dpaa2_switch_port_obj_event()
2404 struct net_device *netdev; in dpaa2_switch_rx() local
2418 netdev = port_priv->netdev; in dpaa2_switch_rx()
2423 netdev_err(netdev, "Received invalid frame format\n"); in dpaa2_switch_rx()
2450 skb->dev = netdev; in dpaa2_switch_rx()
2953 free_netdev(port_priv->netdev); in dpaa2_switch_remove_port()
3118 struct net_device *netdev = port_priv->netdev; in dpaa2_switch_port_init() local
3132 netdev_err(netdev, "dpsw_if_get_attributes err %d\n", err); in dpaa2_switch_port_init()
3142 netdev_err(netdev, "dpsw_fdb_add err %d\n", err); in dpaa2_switch_port_init()
3157 err = dpaa2_switch_port_vlans_add(netdev, &vlan); in dpaa2_switch_port_init()
3171 netdev_err(netdev, "dpsw_acl_add err %d\n", err); in dpaa2_switch_port_init()
3234 unregister_netdev(port_priv->netdev); in dpaa2_switch_remove()
3266 port_priv->netdev = port_netdev; in dpaa2_switch_probe_port()
3388 netif_napi_add(ethsw->ports[0]->netdev, &ethsw->fq[i].napi, in dpaa2_switch_probe()
3405 err = register_netdev(ethsw->ports[i]->netdev); in dpaa2_switch_probe()
3416 unregister_netdev(ethsw->ports[i]->netdev); in dpaa2_switch_probe()