Lines Matching defs:interface

64 static void __bnx2fc_destroy(struct bnx2fc_interface *interface);
69 /* fcoe_syfs control interface handlers */
75 static void bnx2fc_start_disc(struct bnx2fc_interface *interface);
83 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
90 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface);
97 static void bnx2fc_stop(struct bnx2fc_interface *interface);
192 struct bnx2fc_interface *interface = port->priv;
193 struct bnx2fc_hba *hba = interface->hba;
270 struct bnx2fc_interface *interface;
282 interface = port->priv;
283 ctlr = bnx2fc_to_ctlr(interface);
284 hba = interface->hba;
369 skb->dev = interface->netdev;
428 struct bnx2fc_interface *interface;
433 interface = container_of(ptype, struct bnx2fc_interface,
435 ctlr = bnx2fc_to_ctlr(interface);
517 struct bnx2fc_interface *interface;
558 interface = phys_port->priv;
559 ctlr = bnx2fc_to_ctlr(interface);
681 struct bnx2fc_interface *interface = port->priv;
682 struct bnx2fc_hba *hba = interface->hba;
731 struct bnx2fc_interface *interface = port->priv;
732 struct bnx2fc_hba *hba = interface->hba;
756 interface->netdev->name);
764 struct bnx2fc_interface *interface = port->priv;
765 struct bnx2fc_hba *hba = interface->hba;
796 struct bnx2fc_interface *interface;
802 interface = port->priv;
803 ctlr = bnx2fc_to_ctlr(interface);
804 hba = interface->hba;
865 struct bnx2fc_interface *interface, *tmp;
898 list_for_each_entry_safe(interface, tmp, &if_list, list) {
899 if (interface->hba == hba &&
900 interface->vlan_id == (vlan_id & VLAN_VID_MASK))
901 __bnx2fc_destroy(interface);
911 list_for_each_entry(interface, &if_list, list) {
913 if (interface->hba != hba)
916 ctlr = bnx2fc_to_ctlr(interface);
919 interface->netdev->name, event);
928 pr_info("Link up while interface is disabled.\n");
939 if (interface->enabled)
945 pr_info("Link down while interface is disabled.\n");
1053 struct bnx2fc_interface *interface;
1055 interface = container_of(ptype, struct bnx2fc_interface,
1057 ctlr = bnx2fc_to_ctlr(interface);
1122 struct bnx2fc_interface *interface = port->priv;
1123 struct net_device *netdev = interface->netdev;
1137 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) {
1139 "this interface\n");
1144 vn_port = bnx2fc_if_create(interface, &vport->dev, 1);
1188 struct bnx2fc_interface *interface = port->priv;
1205 bnx2fc_free_vport(interface->hba, port->lport);
1208 bnx2fc_interface_put(interface);
1228 static int bnx2fc_interface_setup(struct bnx2fc_interface *interface)
1230 struct net_device *netdev = interface->netdev;
1231 struct net_device *physdev = interface->hba->phys_dev;
1232 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1258 interface->fip_packet_type.func = bnx2fc_fip_recv;
1259 interface->fip_packet_type.type = htons(ETH_P_FIP);
1260 interface->fip_packet_type.dev = netdev;
1261 dev_add_pack(&interface->fip_packet_type);
1263 interface->fcoe_packet_type.func = bnx2fc_rcv;
1264 interface->fcoe_packet_type.type = __constant_htons(ETH_P_FCOE);
1265 interface->fcoe_packet_type.dev = netdev;
1266 dev_add_pack(&interface->fcoe_packet_type);
1303 struct bnx2fc_interface *interface;
1307 interface = container_of(kref, struct bnx2fc_interface, kref);
1310 ctlr = bnx2fc_to_ctlr(interface);
1312 netdev = interface->netdev;
1315 if (test_and_clear_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags))
1324 static inline void bnx2fc_interface_get(struct bnx2fc_interface *interface)
1326 kref_get(&interface->kref);
1329 static inline void bnx2fc_interface_put(struct bnx2fc_interface *interface)
1331 kref_put(&interface->kref, bnx2fc_interface_release);
1435 struct bnx2fc_interface *interface;
1440 size = (sizeof(*interface) + sizeof(struct fcoe_ctlr));
1444 printk(KERN_ERR PFX "Unable to allocate interface structure\n");
1449 interface = fcoe_ctlr_priv(ctlr);
1451 kref_init(&interface->kref);
1452 interface->hba = hba;
1453 interface->netdev = netdev;
1460 set_bit(BNX2FC_CTLR_INIT_DONE, &interface->if_flags);
1462 rc = bnx2fc_interface_setup(interface);
1464 return interface;
1473 * bnx2fc_if_create - Create FCoE instance on a given interface
1475 * @interface: FCoE interface to create a local port on
1483 static struct fc_lport *bnx2fc_if_create(struct bnx2fc_interface *interface,
1486 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1492 struct bnx2fc_hba *hba = interface->hba;
1515 port->priv = interface;
1530 rc = bnx2fc_net_config(lport, interface->netdev);
1539 interface->netdev->name);
1568 bnx2fc_interface_get(interface);
1586 static void bnx2fc_net_cleanup(struct bnx2fc_interface *interface)
1589 __dev_remove_pack(&interface->fcoe_packet_type);
1590 __dev_remove_pack(&interface->fip_packet_type);
1594 static void bnx2fc_interface_cleanup(struct bnx2fc_interface *interface)
1596 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1599 struct bnx2fc_hba *hba = interface->hba;
1607 bnx2fc_net_cleanup(interface);
1635 static void __bnx2fc_destroy(struct bnx2fc_interface *interface)
1637 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1641 bnx2fc_interface_cleanup(interface);
1642 bnx2fc_stop(interface);
1643 list_del(&interface->list);
1645 bnx2fc_interface_put(interface);
1649 * bnx2fc_destroy - Destroy a bnx2fc FCoE interface
1651 * @netdev: The net device that the FCoE interface is on
1659 struct bnx2fc_interface *interface = NULL;
1667 interface = bnx2fc_interface_lookup(netdev);
1668 ctlr = bnx2fc_to_ctlr(interface);
1669 if (!interface || !ctlr->lp) {
1671 printk(KERN_ERR PFX "bnx2fc_destroy: interface or lport not found\n");
1675 timer_work_queue = interface->timer_work_queue;
1676 __bnx2fc_destroy(interface);
1816 * This bnx2fc - cnic interface api callback is used after following
1818 * a) underlying network interface is up (marked by event NETDEV_UP
1825 struct bnx2fc_interface *interface;
1836 list_for_each_entry(interface, &if_list, list) {
1837 if (interface->hba == hba) {
1838 ctlr = bnx2fc_to_ctlr(interface);
1843 bnx2fc_start_disc(interface);
1857 static void bnx2fc_stop(struct bnx2fc_interface *interface)
1859 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1863 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags))
1958 struct bnx2fc_interface *interface;
1965 list_for_each_entry(interface, &if_list, list) {
1966 if (interface->hba == hba)
1967 bnx2fc_stop(interface);
1984 static void bnx2fc_start_disc(struct bnx2fc_interface *interface)
1986 struct fcoe_ctlr *ctlr = bnx2fc_to_ctlr(interface);
1992 if (!test_bit(BNX2FC_FLAG_FW_INIT_DONE, &interface->hba->flags)) {
2000 if (!bnx2fc_link_ok(lport) && interface->enabled) {
2004 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state);
2074 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
2076 if (interface->enabled) {
2081 interface->enabled = false;
2094 struct bnx2fc_interface *interface;
2101 interface = bnx2fc_interface_lookup(netdev);
2102 ctlr = bnx2fc_to_ctlr(interface);
2104 if (!interface) {
2106 pr_err(PFX "bnx2fc_disable: interface not found\n");
2169 struct bnx2fc_interface *interface = fcoe_ctlr_priv(ctlr);
2174 if (!interface->enabled) {
2180 interface->enabled = true;
2185 hba = interface->hba;
2222 struct bnx2fc_interface *interface;
2229 interface = bnx2fc_interface_lookup(netdev);
2230 ctlr = bnx2fc_to_ctlr(interface);
2231 if (!interface) {
2233 pr_err(PFX "bnx2fc_enable: interface not found\n");
2274 * _bnx2fc_create() - Create bnx2fc FCoE interface
2275 * @netdev : The net_device object the Ethernet interface to create on
2283 * consolidation of code can be done when that interface is
2294 struct bnx2fc_interface *interface;
2336 /* obtain interface and initialize rest of the structure */
2349 interface = bnx2fc_interface_create(hba, netdev, fip_mode);
2350 if (!interface) {
2358 interface->vlan_enabled = 1;
2361 ctlr = bnx2fc_to_ctlr(interface);
2363 interface->vlan_id = vlan_id;
2364 interface->tm_timeout = BNX2FC_TM_TIMEOUT;
2366 interface->timer_work_queue =
2368 if (!interface->timer_work_queue) {
2374 lport = bnx2fc_if_create(interface, &cdev->dev, 0);
2376 printk(KERN_ERR PFX "Failed to create interface (%s)\n",
2382 /* Add interface to if_list */
2383 list_add_tail(&interface->list, &if_list);
2399 set_bit(ADAPTER_STATE_READY, &interface->hba->adapter_state);
2403 bnx2fc_start_disc(interface);
2406 interface->enabled = true;
2412 bnx2fc_interface_put(interface);
2419 destroy_workqueue(interface->timer_work_queue);
2421 bnx2fc_net_cleanup(interface);
2422 bnx2fc_interface_put(interface);
2433 * bnx2fc_create() - Create a bnx2fc interface
2434 * @netdev : The net_device object the Ethernet interface to create on
2447 * bnx2fc_ctlr_alloc() - Allocate a bnx2fc interface from fcoe_sysfs
2484 struct bnx2fc_interface *interface;
2487 list_for_each_entry(interface, &if_list, list) {
2488 if (interface->netdev == netdev)
2489 return interface;
2516 struct bnx2fc_interface *interface, *tmp;
2538 list_for_each_entry_safe(interface, tmp, &if_list, list)
2540 if (interface->hba == hba)
2541 __bnx2fc_destroy(interface);
2906 struct bnx2fc_interface *interface = port->priv;
2908 sprintf(buf, "%u\n", interface->tm_timeout);
2919 struct bnx2fc_interface *interface = port->priv;
2928 interface->tm_timeout = (u8)val;
2977 * bnx2fc_cnic_cb - global template of bnx2fc - cnic driver interface