Lines Matching refs:netdev
114 static bool fcoe_match(struct net_device *netdev);
115 static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode);
116 static int fcoe_destroy(struct net_device *netdev);
117 static int fcoe_enable(struct net_device *netdev);
118 static int fcoe_disable(struct net_device *netdev);
121 static int fcoe_ctlr_alloc(struct net_device *netdev);
302 struct net_device *netdev) in fcoe_interface_setup() argument
310 fcoe->netdev = netdev; in fcoe_interface_setup()
313 ops = netdev->netdev_ops; in fcoe_interface_setup()
315 if (ops->ndo_fcoe_enable(netdev)) in fcoe_interface_setup()
316 FCOE_NETDEV_DBG(netdev, "Failed to enable FCoE" in fcoe_interface_setup()
321 if (netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER) { in fcoe_interface_setup()
322 FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n"); in fcoe_interface_setup()
328 real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ? in fcoe_interface_setup()
329 vlan_dev_real_dev(netdev) : netdev; in fcoe_interface_setup()
344 memcpy(fip->ctl_src_addr, netdev->dev_addr, netdev->addr_len); in fcoe_interface_setup()
352 dev_uc_add(netdev, flogi_maddr); in fcoe_interface_setup()
354 dev_uc_add(netdev, fip->ctl_src_addr); in fcoe_interface_setup()
356 dev_mc_add(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_setup()
357 dev_mc_add(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_setup()
359 dev_mc_add(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_setup()
367 fcoe->fcoe_packet_type.dev = netdev; in fcoe_interface_setup()
372 fcoe->fip_packet_type.dev = netdev; in fcoe_interface_setup()
385 static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev, in fcoe_interface_create() argument
395 FCOE_NETDEV_DBG(netdev, in fcoe_interface_create()
402 ctlr_dev = fcoe_ctlr_device_add(&netdev->dev, &fcoe_sysfs_templ, in fcoe_interface_create()
414 dev_hold(netdev); in fcoe_interface_create()
424 err = fcoe_interface_setup(fcoe, netdev); in fcoe_interface_create()
428 dev_put(netdev); in fcoe_interface_create()
449 struct net_device *netdev = fcoe->netdev; in fcoe_interface_remove() local
466 dev_uc_del(netdev, flogi_maddr); in fcoe_interface_remove()
468 dev_uc_del(netdev, fip->ctl_src_addr); in fcoe_interface_remove()
470 dev_mc_del(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_remove()
471 dev_mc_del(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_remove()
473 dev_mc_del(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_remove()
476 ops = netdev->netdev_ops; in fcoe_interface_remove()
478 if (ops->ndo_fcoe_disable(netdev)) in fcoe_interface_remove()
479 FCOE_NETDEV_DBG(netdev, "Failed to disable FCoE" in fcoe_interface_remove()
492 struct net_device *netdev = fcoe->netdev; in fcoe_interface_cleanup() local
504 dev_put(netdev); in fcoe_interface_cleanup()
518 static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev, in fcoe_fip_recv() argument
551 skb->dev = fcoe_from_ctlr(fip)->netdev; in fcoe_fip_send()
569 dev_uc_del(fcoe->netdev, port->data_src_addr); in fcoe_update_src_mac()
571 dev_uc_add(fcoe->netdev, addr); in fcoe_update_src_mac()
624 struct net_device *netdev) in fcoe_netdev_features_change() argument
628 if (netdev->features & NETIF_F_SG) in fcoe_netdev_features_change()
633 if (netdev->features & NETIF_F_FCOE_CRC) { in fcoe_netdev_features_change()
635 FCOE_NETDEV_DBG(netdev, "Supports FCCRC offload\n"); in fcoe_netdev_features_change()
640 if (netdev->features & NETIF_F_FSO) { in fcoe_netdev_features_change()
642 lport->lso_max = netdev->gso_max_size; in fcoe_netdev_features_change()
643 FCOE_NETDEV_DBG(netdev, "Supports LSO for max len 0x%x\n", in fcoe_netdev_features_change()
650 if (netdev->fcoe_ddp_xid) { in fcoe_netdev_features_change()
652 lport->lro_xid = netdev->fcoe_ddp_xid; in fcoe_netdev_features_change()
653 FCOE_NETDEV_DBG(netdev, "Supports LRO for max xid 0x%x\n", in fcoe_netdev_features_change()
672 static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) in fcoe_netdev_config() argument
690 mfs = netdev->mtu; in fcoe_netdev_config()
691 if (netdev->features & NETIF_F_FCOE_MTU) { in fcoe_netdev_config()
693 FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs); in fcoe_netdev_config()
700 fcoe_netdev_features_change(lport, netdev); in fcoe_netdev_config()
709 if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) in fcoe_netdev_config()
712 if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN)) in fcoe_netdev_config()
772 static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) in fcoe_fdmi_info() argument
912 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_em_config()
913 cur_real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_em_config()
915 cur_real_dev = fcoe->netdev; in fcoe_em_config()
918 if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_em_config()
919 old_real_dev = vlan_dev_real_dev(oldfcoe->netdev); in fcoe_em_config()
921 old_real_dev = oldfcoe->netdev; in fcoe_em_config()
933 fcoe->oem, fcoe->netdev->name); in fcoe_em_config()
943 fcoe->netdev->name); in fcoe_em_config()
956 "allocate em on interface %s\n", fcoe->netdev->name); in fcoe_em_config()
972 struct net_device *netdev = fcoe->netdev; in fcoe_if_destroy() local
974 FCOE_NETDEV_DBG(netdev, "Destroying interface\n"); in fcoe_if_destroy()
990 dev_uc_del(netdev, port->data_src_addr); in fcoe_if_destroy()
1033 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_setup() local
1035 if (netdev->netdev_ops->ndo_fcoe_ddp_setup) in fcoe_ddp_setup()
1036 return netdev->netdev_ops->ndo_fcoe_ddp_setup(netdev, in fcoe_ddp_setup()
1055 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_target() local
1057 if (netdev->netdev_ops->ndo_fcoe_ddp_target) in fcoe_ddp_target()
1058 return netdev->netdev_ops->ndo_fcoe_ddp_target(netdev, xid, in fcoe_ddp_target()
1074 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_done() local
1076 if (netdev->netdev_ops->ndo_fcoe_ddp_done) in fcoe_ddp_done()
1077 return netdev->netdev_ops->ndo_fcoe_ddp_done(netdev, xid); in fcoe_ddp_done()
1095 struct net_device *netdev = fcoe->netdev; in fcoe_if_create() local
1106 FCOE_NETDEV_DBG(netdev, "Create Interface\n"); in fcoe_if_create()
1114 FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n"); in fcoe_if_create()
1135 FCOE_NETDEV_DBG(netdev, "Could not configure lport for the " in fcoe_if_create()
1141 FCOE_NETDEV_DBG(netdev, "Setting vport names, " in fcoe_if_create()
1149 rc = fcoe_netdev_config(lport, netdev); in fcoe_if_create()
1151 FCOE_NETDEV_DBG(netdev, "Could not configure netdev for the " in fcoe_if_create()
1159 FCOE_NETDEV_DBG(netdev, "Could not configure shost for the " in fcoe_if_create()
1167 FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the " in fcoe_if_create()
1173 fcoe_fdmi_info(lport, netdev); in fcoe_if_create()
1194 FCOE_NETDEV_DBG(netdev, "Could not configure the EM\n"); in fcoe_if_create()
1428 static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, in fcoe_rcv() argument
1444 FCOE_NETDEV_DBG(netdev, "Cannot find hba structure\n"); in fcoe_rcv()
1450 FCOE_NETDEV_DBG(netdev, in fcoe_rcv()
1466 FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n", in fcoe_rcv()
1483 FCOE_NETDEV_DBG(netdev, "FC frame d_id mismatch with MAC:%pM\n", in fcoe_rcv()
1518 FCOE_NETDEV_DBG(netdev, "CPU is online, but no receive thread " in fcoe_rcv()
1668 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN && in fcoe_xmit()
1673 vlan_dev_vlan_id(fcoe->netdev)); in fcoe_xmit()
1675 skb->dev = fcoe->netdev; in fcoe_xmit()
1915 fcoe_hostlist_lookup_realdev_port(struct net_device *netdev) in fcoe_hostlist_lookup_realdev_port() argument
1921 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_hostlist_lookup_realdev_port()
1922 real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_hostlist_lookup_realdev_port()
1924 real_dev = fcoe->netdev; in fcoe_hostlist_lookup_realdev_port()
1926 if (netdev == real_dev) in fcoe_hostlist_lookup_realdev_port()
1938 struct net_device *netdev; in fcoe_dcb_app_notification() local
1944 netdev = dev_get_by_index(&init_net, entry->ifindex); in fcoe_dcb_app_notification()
1945 if (!netdev) in fcoe_dcb_app_notification()
1948 fcoe = fcoe_hostlist_lookup_realdev_port(netdev); in fcoe_dcb_app_notification()
1949 dev_put(netdev); in fcoe_dcb_app_notification()
1988 struct net_device *netdev = netdev_notifier_info_to_dev(ptr); in fcoe_device_notification() local
1998 if (fcoe->netdev == netdev) { in fcoe_device_notification()
2018 if (netdev->features & NETIF_F_FCOE_MTU) in fcoe_device_notification()
2020 mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + in fcoe_device_notification()
2034 fcoe_netdev_features_change(lport, netdev); in fcoe_device_notification()
2037 FCOE_NETDEV_DBG(netdev, "Unknown event %ld " in fcoe_device_notification()
2081 static int fcoe_disable(struct net_device *netdev) in fcoe_disable() argument
2090 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_disable()
2112 static int fcoe_enable(struct net_device *netdev) in fcoe_enable() argument
2120 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_enable()
2152 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ctlr_enabled() local
2156 return fcoe_enable(netdev); in fcoe_ctlr_enabled()
2158 return fcoe_disable(netdev); in fcoe_ctlr_enabled()
2173 static int fcoe_destroy(struct net_device *netdev) in fcoe_destroy() argument
2183 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_destroy()
2257 static bool fcoe_match(struct net_device *netdev) in fcoe_match() argument
2273 struct net_device *netdev = fcoe->realdev; in fcoe_dcb_create() local
2281 if (netdev && netdev->dcbnl_ops && netdev->dcbnl_ops->getdcbx) { in fcoe_dcb_create()
2282 dcbx = netdev->dcbnl_ops->getdcbx(netdev); in fcoe_dcb_create()
2286 up = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2288 fup = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2291 up = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2293 fup = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2320 static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, in _fcoe_create() argument
2333 if (fcoe_hostlist_lookup(netdev)) { in _fcoe_create()
2338 fcoe = fcoe_interface_create(netdev, fip_mode); in _fcoe_create()
2349 netdev->name); in _fcoe_create()
2409 static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode) in fcoe_create() argument
2411 return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP); in fcoe_create()
2425 static int fcoe_ctlr_alloc(struct net_device *netdev) in fcoe_ctlr_alloc() argument
2427 return _fcoe_create(netdev, FIP_MODE_FABRIC, in fcoe_ctlr_alloc()
2440 struct net_device *netdev = fcoe_netdev(lport); in fcoe_link_ok() local
2442 if (netif_oper_up(netdev)) in fcoe_link_ok()
2518 fcoe_hostlist_lookup_port(const struct net_device *netdev) in fcoe_hostlist_lookup_port() argument
2523 if (fcoe->netdev == netdev) in fcoe_hostlist_lookup_port()
2538 static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *netdev) in fcoe_hostlist_lookup() argument
2543 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_hostlist_lookup()
2821 struct net_device *netdev = fcoe->netdev; in fcoe_vport_create() local
2843 netdev->name); in fcoe_vport_create()
2939 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev); in fcoe_fcf_get_vlan_id()