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);
303 struct net_device *netdev) in fcoe_interface_setup() argument
311 fcoe->netdev = netdev; in fcoe_interface_setup()
314 ops = netdev->netdev_ops; in fcoe_interface_setup()
316 if (ops->ndo_fcoe_enable(netdev)) in fcoe_interface_setup()
317 FCOE_NETDEV_DBG(netdev, "Failed to enable FCoE" in fcoe_interface_setup()
322 if (netdev->priv_flags & IFF_BONDING && netdev->flags & IFF_MASTER) { in fcoe_interface_setup()
323 FCOE_NETDEV_DBG(netdev, "Bonded interfaces not supported\n"); in fcoe_interface_setup()
329 real_dev = (netdev->priv_flags & IFF_802_1Q_VLAN) ? in fcoe_interface_setup()
330 vlan_dev_real_dev(netdev) : netdev; in fcoe_interface_setup()
345 memcpy(fip->ctl_src_addr, netdev->dev_addr, netdev->addr_len); in fcoe_interface_setup()
353 dev_uc_add(netdev, flogi_maddr); in fcoe_interface_setup()
355 dev_uc_add(netdev, fip->ctl_src_addr); in fcoe_interface_setup()
357 dev_mc_add(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_setup()
358 dev_mc_add(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_setup()
360 dev_mc_add(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_setup()
368 fcoe->fcoe_packet_type.dev = netdev; in fcoe_interface_setup()
373 fcoe->fip_packet_type.dev = netdev; in fcoe_interface_setup()
386 static struct fcoe_interface *fcoe_interface_create(struct net_device *netdev, in fcoe_interface_create() argument
396 FCOE_NETDEV_DBG(netdev, in fcoe_interface_create()
403 ctlr_dev = fcoe_ctlr_device_add(&netdev->dev, &fcoe_sysfs_templ, in fcoe_interface_create()
415 dev_hold(netdev); in fcoe_interface_create()
425 err = fcoe_interface_setup(fcoe, netdev); in fcoe_interface_create()
429 dev_put(netdev); in fcoe_interface_create()
450 struct net_device *netdev = fcoe->netdev; in fcoe_interface_remove() local
467 dev_uc_del(netdev, flogi_maddr); in fcoe_interface_remove()
469 dev_uc_del(netdev, fip->ctl_src_addr); in fcoe_interface_remove()
471 dev_mc_del(netdev, FIP_ALL_VN2VN_MACS); in fcoe_interface_remove()
472 dev_mc_del(netdev, FIP_ALL_P2P_MACS); in fcoe_interface_remove()
474 dev_mc_del(netdev, FIP_ALL_ENODE_MACS); in fcoe_interface_remove()
477 ops = netdev->netdev_ops; in fcoe_interface_remove()
479 if (ops->ndo_fcoe_disable(netdev)) in fcoe_interface_remove()
480 FCOE_NETDEV_DBG(netdev, "Failed to disable FCoE" in fcoe_interface_remove()
493 struct net_device *netdev = fcoe->netdev; in fcoe_interface_cleanup() local
505 dev_put(netdev); in fcoe_interface_cleanup()
519 static int fcoe_fip_recv(struct sk_buff *skb, struct net_device *netdev, in fcoe_fip_recv() argument
552 skb->dev = fcoe_from_ctlr(fip)->netdev; in fcoe_fip_send()
570 dev_uc_del(fcoe->netdev, port->data_src_addr); in fcoe_update_src_mac()
572 dev_uc_add(fcoe->netdev, addr); in fcoe_update_src_mac()
625 struct net_device *netdev) in fcoe_netdev_features_change() argument
629 if (netdev->features & NETIF_F_SG) in fcoe_netdev_features_change()
634 if (netdev->features & NETIF_F_FCOE_CRC) { in fcoe_netdev_features_change()
636 FCOE_NETDEV_DBG(netdev, "Supports FCCRC offload\n"); in fcoe_netdev_features_change()
641 if (netdev->features & NETIF_F_FSO) { in fcoe_netdev_features_change()
643 lport->lso_max = netdev->gso_max_size; in fcoe_netdev_features_change()
644 FCOE_NETDEV_DBG(netdev, "Supports LSO for max len 0x%x\n", in fcoe_netdev_features_change()
651 if (netdev->fcoe_ddp_xid) { in fcoe_netdev_features_change()
653 lport->lro_xid = netdev->fcoe_ddp_xid; in fcoe_netdev_features_change()
654 FCOE_NETDEV_DBG(netdev, "Supports LRO for max xid 0x%x\n", in fcoe_netdev_features_change()
673 static int fcoe_netdev_config(struct fc_lport *lport, struct net_device *netdev) in fcoe_netdev_config() argument
691 mfs = netdev->mtu; in fcoe_netdev_config()
692 if (netdev->features & NETIF_F_FCOE_MTU) { in fcoe_netdev_config()
694 FCOE_NETDEV_DBG(netdev, "Supports FCOE_MTU of %d bytes\n", mfs); in fcoe_netdev_config()
701 fcoe_netdev_features_change(lport, netdev); in fcoe_netdev_config()
710 if (fcoe_get_wwn(netdev, &wwnn, NETDEV_FCOE_WWNN)) in fcoe_netdev_config()
713 if (fcoe_get_wwn(netdev, &wwpn, NETDEV_FCOE_WWPN)) in fcoe_netdev_config()
773 static void fcoe_fdmi_info(struct fc_lport *lport, struct net_device *netdev) in fcoe_fdmi_info() argument
913 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_em_config()
914 cur_real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_em_config()
916 cur_real_dev = fcoe->netdev; in fcoe_em_config()
919 if (oldfcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_em_config()
920 old_real_dev = vlan_dev_real_dev(oldfcoe->netdev); in fcoe_em_config()
922 old_real_dev = oldfcoe->netdev; in fcoe_em_config()
934 fcoe->oem, fcoe->netdev->name); in fcoe_em_config()
944 fcoe->netdev->name); in fcoe_em_config()
957 "allocate em on interface %s\n", fcoe->netdev->name); in fcoe_em_config()
973 struct net_device *netdev = fcoe->netdev; in fcoe_if_destroy() local
975 FCOE_NETDEV_DBG(netdev, "Destroying interface\n"); in fcoe_if_destroy()
991 dev_uc_del(netdev, port->data_src_addr); in fcoe_if_destroy()
1034 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_setup() local
1036 if (netdev->netdev_ops->ndo_fcoe_ddp_setup) in fcoe_ddp_setup()
1037 return netdev->netdev_ops->ndo_fcoe_ddp_setup(netdev, in fcoe_ddp_setup()
1056 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_target() local
1058 if (netdev->netdev_ops->ndo_fcoe_ddp_target) in fcoe_ddp_target()
1059 return netdev->netdev_ops->ndo_fcoe_ddp_target(netdev, xid, in fcoe_ddp_target()
1075 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ddp_done() local
1077 if (netdev->netdev_ops->ndo_fcoe_ddp_done) in fcoe_ddp_done()
1078 return netdev->netdev_ops->ndo_fcoe_ddp_done(netdev, xid); in fcoe_ddp_done()
1096 struct net_device *netdev = fcoe->netdev; in fcoe_if_create() local
1107 FCOE_NETDEV_DBG(netdev, "Create Interface\n"); in fcoe_if_create()
1115 FCOE_NETDEV_DBG(netdev, "Could not allocate host structure\n"); in fcoe_if_create()
1136 FCOE_NETDEV_DBG(netdev, "Could not configure lport for the " in fcoe_if_create()
1142 FCOE_NETDEV_DBG(netdev, "Setting vport names, " in fcoe_if_create()
1150 rc = fcoe_netdev_config(lport, netdev); in fcoe_if_create()
1152 FCOE_NETDEV_DBG(netdev, "Could not configure netdev for the " in fcoe_if_create()
1160 FCOE_NETDEV_DBG(netdev, "Could not configure shost for the " in fcoe_if_create()
1168 FCOE_NETDEV_DBG(netdev, "Could not configure libfc for the " in fcoe_if_create()
1174 fcoe_fdmi_info(lport, netdev); in fcoe_if_create()
1195 FCOE_NETDEV_DBG(netdev, "Could not configure the EM\n"); in fcoe_if_create()
1429 static int fcoe_rcv(struct sk_buff *skb, struct net_device *netdev, in fcoe_rcv() argument
1445 FCOE_NETDEV_DBG(netdev, "Cannot find hba structure\n"); in fcoe_rcv()
1451 FCOE_NETDEV_DBG(netdev, in fcoe_rcv()
1467 FCOE_NETDEV_DBG(netdev, "wrong source mac address:%pM\n", in fcoe_rcv()
1484 FCOE_NETDEV_DBG(netdev, "FC frame d_id mismatch with MAC:%pM\n", in fcoe_rcv()
1519 FCOE_NETDEV_DBG(netdev, "CPU is online, but no receive thread " in fcoe_rcv()
1669 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN && in fcoe_xmit()
1674 vlan_dev_vlan_id(fcoe->netdev)); in fcoe_xmit()
1676 skb->dev = fcoe->netdev; in fcoe_xmit()
1917 fcoe_hostlist_lookup_realdev_port(struct net_device *netdev) in fcoe_hostlist_lookup_realdev_port() argument
1923 if (fcoe->netdev->priv_flags & IFF_802_1Q_VLAN) in fcoe_hostlist_lookup_realdev_port()
1924 real_dev = vlan_dev_real_dev(fcoe->netdev); in fcoe_hostlist_lookup_realdev_port()
1926 real_dev = fcoe->netdev; in fcoe_hostlist_lookup_realdev_port()
1928 if (netdev == real_dev) in fcoe_hostlist_lookup_realdev_port()
1940 struct net_device *netdev; in fcoe_dcb_app_notification() local
1946 netdev = dev_get_by_index(&init_net, entry->ifindex); in fcoe_dcb_app_notification()
1947 if (!netdev) in fcoe_dcb_app_notification()
1950 fcoe = fcoe_hostlist_lookup_realdev_port(netdev); in fcoe_dcb_app_notification()
1951 dev_put(netdev); in fcoe_dcb_app_notification()
1990 struct net_device *netdev = netdev_notifier_info_to_dev(ptr); in fcoe_device_notification() local
2000 if (fcoe->netdev == netdev) { in fcoe_device_notification()
2020 if (netdev->features & NETIF_F_FCOE_MTU) in fcoe_device_notification()
2022 mfs = netdev->mtu - (sizeof(struct fcoe_hdr) + in fcoe_device_notification()
2036 fcoe_netdev_features_change(lport, netdev); in fcoe_device_notification()
2039 FCOE_NETDEV_DBG(netdev, "Unknown event %ld " in fcoe_device_notification()
2083 static int fcoe_disable(struct net_device *netdev) in fcoe_disable() argument
2092 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_disable()
2114 static int fcoe_enable(struct net_device *netdev) in fcoe_enable() argument
2122 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_enable()
2154 struct net_device *netdev = fcoe_netdev(lport); in fcoe_ctlr_enabled() local
2158 return fcoe_enable(netdev); in fcoe_ctlr_enabled()
2160 return fcoe_disable(netdev); in fcoe_ctlr_enabled()
2175 static int fcoe_destroy(struct net_device *netdev) in fcoe_destroy() argument
2185 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_destroy()
2259 static bool fcoe_match(struct net_device *netdev) in fcoe_match() argument
2275 struct net_device *netdev = fcoe->realdev; in fcoe_dcb_create() local
2283 if (netdev && netdev->dcbnl_ops && netdev->dcbnl_ops->getdcbx) { in fcoe_dcb_create()
2284 dcbx = netdev->dcbnl_ops->getdcbx(netdev); in fcoe_dcb_create()
2288 up = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2290 fup = dcb_ieee_getapp_mask(netdev, &app); in fcoe_dcb_create()
2293 up = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2295 fup = dcb_getapp(netdev, &app); in fcoe_dcb_create()
2322 static int _fcoe_create(struct net_device *netdev, enum fip_state fip_mode, in _fcoe_create() argument
2335 if (fcoe_hostlist_lookup(netdev)) { in _fcoe_create()
2340 fcoe = fcoe_interface_create(netdev, fip_mode); in _fcoe_create()
2351 netdev->name); in _fcoe_create()
2411 static int fcoe_create(struct net_device *netdev, enum fip_state fip_mode) in fcoe_create() argument
2413 return _fcoe_create(netdev, fip_mode, FCOE_CREATE_LINK_UP); in fcoe_create()
2427 static int fcoe_ctlr_alloc(struct net_device *netdev) in fcoe_ctlr_alloc() argument
2429 return _fcoe_create(netdev, FIP_MODE_FABRIC, in fcoe_ctlr_alloc()
2442 struct net_device *netdev = fcoe_netdev(lport); in fcoe_link_ok() local
2444 if (netif_oper_up(netdev)) in fcoe_link_ok()
2520 fcoe_hostlist_lookup_port(const struct net_device *netdev) in fcoe_hostlist_lookup_port() argument
2525 if (fcoe->netdev == netdev) in fcoe_hostlist_lookup_port()
2540 static struct fc_lport *fcoe_hostlist_lookup(const struct net_device *netdev) in fcoe_hostlist_lookup() argument
2545 fcoe = fcoe_hostlist_lookup_port(netdev); in fcoe_hostlist_lookup()
2823 struct net_device *netdev = fcoe->netdev; in fcoe_vport_create() local
2845 netdev->name); in fcoe_vport_create()
2941 fcf_dev->vlan_id = vlan_dev_vlan_id(fcoe->netdev); in fcoe_fcf_get_vlan_id()