Lines Matching refs:fcf
115 static int fcoe_fcf_set_dev_loss_tmo(struct fcoe_fcf_device *fcf, in fcoe_fcf_set_dev_loss_tmo() argument
118 if ((fcf->state == FCOE_FCF_STATE_UNKNOWN) || in fcoe_fcf_set_dev_loss_tmo()
119 (fcf->state == FCOE_FCF_STATE_DISCONNECTED) || in fcoe_fcf_set_dev_loss_tmo()
120 (fcf->state == FCOE_FCF_STATE_DELETED)) in fcoe_fcf_set_dev_loss_tmo()
128 fcoe_fcf_dev_loss_tmo(fcf) = val; in fcoe_fcf_set_dev_loss_tmo()
153 struct fcoe_fcf_device *fcf = dev_to_fcf(dev); \
154 struct fcoe_ctlr_device *ctlr = fcoe_fcf_dev_to_ctlr_dev(fcf); \
156 ctlr->f->get_fcoe_fcf_##field(fcf); \
158 cast fcoe_fcf_##field(fcf)); \
175 struct fcoe_fcf_device *fcf = dev_to_fcf(dev); \
176 return snprintf(buf, sz, format_string, cast fcoe_fcf_##field(fcf)); \
191 static FCOE_DEVICE_ATTR(fcf, field, S_IRUGO, \
196 static FCOE_DEVICE_ATTR(fcf, field, S_IRUGO, \
206 static FCOE_DEVICE_ATTR(fcf, field, S_IRUGO, \
248 struct fcoe_fcf_device *fcf = dev_to_fcf(dev); in fcoe_enum_name_search() local
250 name = get_fcoe_fcf_state_name(fcf->state); in fcoe_enum_name_search()
255 static FCOE_DEVICE_ATTR(fcf, state, S_IRUGO, show_fcf_state, NULL);
497 struct fcoe_fcf_device *fcf; in store_private_fcoe_ctlr_fcf_dev_loss_tmo() local
507 list_for_each_entry(fcf, &ctlr->fcfs, peers) in store_private_fcoe_ctlr_fcf_dev_loss_tmo()
508 fcoe_fcf_set_dev_loss_tmo(fcf, val); in store_private_fcoe_ctlr_fcf_dev_loss_tmo()
540 struct fcoe_fcf_device *fcf = dev_to_fcf(dev); in store_fcoe_fcf_dev_loss_tmo() local
548 rc = fcoe_fcf_set_dev_loss_tmo(fcf, val); in store_fcoe_fcf_dev_loss_tmo()
553 static FCOE_DEVICE_ATTR(fcf, dev_loss_tmo, S_IRUGO | S_IWUSR,
646 struct fcoe_fcf_device *fcf = dev_to_fcf(dev); in fcoe_fcf_device_release() local
647 kfree(fcf); in fcoe_fcf_device_release()
874 struct fcoe_fcf_device *fcf, *next; in fcoe_ctlr_device_delete() local
877 list_for_each_entry_safe(fcf, next, in fcoe_ctlr_device_delete()
879 list_del(&fcf->peers); in fcoe_ctlr_device_delete()
880 fcf->state = FCOE_FCF_STATE_DELETED; in fcoe_ctlr_device_delete()
881 fcoe_ctlr_device_queue_work(ctlr, &fcf->delete_work); in fcoe_ctlr_device_delete()
905 struct fcoe_fcf_device *fcf = in fcoe_fcf_device_final_delete() local
907 struct fcoe_ctlr_device *ctlr = fcoe_fcf_dev_to_ctlr_dev(fcf); in fcoe_fcf_device_final_delete()
914 if (!cancel_delayed_work(&fcf->dev_loss_work)) in fcoe_fcf_device_final_delete()
917 device_unregister(&fcf->dev); in fcoe_fcf_device_final_delete()
929 struct fcoe_fcf_device *fcf = in fip_timeout_deleted_fcf() local
931 struct fcoe_ctlr_device *ctlr = fcoe_fcf_dev_to_ctlr_dev(fcf); in fip_timeout_deleted_fcf()
941 if (fcf->state != FCOE_FCF_STATE_DISCONNECTED) in fip_timeout_deleted_fcf()
944 dev_printk(KERN_ERR, &fcf->dev, in fip_timeout_deleted_fcf()
947 list_del(&fcf->peers); in fip_timeout_deleted_fcf()
948 fcf->state = FCOE_FCF_STATE_DELETED; in fip_timeout_deleted_fcf()
949 fcoe_ctlr_device_queue_work(ctlr, &fcf->delete_work); in fip_timeout_deleted_fcf()
964 void fcoe_fcf_device_delete(struct fcoe_fcf_device *fcf) in fcoe_fcf_device_delete() argument
966 struct fcoe_ctlr_device *ctlr = fcoe_fcf_dev_to_ctlr_dev(fcf); in fcoe_fcf_device_delete()
967 int timeout = fcf->dev_loss_tmo; in fcoe_fcf_device_delete()
969 if (fcf->state != FCOE_FCF_STATE_CONNECTED) in fcoe_fcf_device_delete()
972 fcf->state = FCOE_FCF_STATE_DISCONNECTED; in fcoe_fcf_device_delete()
979 fcf->priv = NULL; in fcoe_fcf_device_delete()
981 fcoe_ctlr_device_queue_devloss_work(ctlr, &fcf->dev_loss_work, in fcoe_fcf_device_delete()
996 struct fcoe_fcf_device *fcf; in fcoe_fcf_device_add() local
999 list_for_each_entry(fcf, &ctlr->fcfs, peers) { in fcoe_fcf_device_add()
1000 if (fcoe_fcf_device_match(new_fcf, fcf)) { in fcoe_fcf_device_add()
1001 if (fcf->state == FCOE_FCF_STATE_CONNECTED) in fcoe_fcf_device_add()
1002 return fcf; in fcoe_fcf_device_add()
1004 fcf->state = FCOE_FCF_STATE_CONNECTED; in fcoe_fcf_device_add()
1006 if (!cancel_delayed_work(&fcf->dev_loss_work)) in fcoe_fcf_device_add()
1009 return fcf; in fcoe_fcf_device_add()
1013 fcf = kzalloc(sizeof(struct fcoe_fcf_device), GFP_ATOMIC); in fcoe_fcf_device_add()
1014 if (unlikely(!fcf)) in fcoe_fcf_device_add()
1017 INIT_WORK(&fcf->delete_work, fcoe_fcf_device_final_delete); in fcoe_fcf_device_add()
1018 INIT_DELAYED_WORK(&fcf->dev_loss_work, fip_timeout_deleted_fcf); in fcoe_fcf_device_add()
1020 fcf->dev.parent = &ctlr->dev; in fcoe_fcf_device_add()
1021 fcf->dev.bus = &fcoe_bus_type; in fcoe_fcf_device_add()
1022 fcf->dev.type = &fcoe_fcf_device_type; in fcoe_fcf_device_add()
1023 fcf->id = atomic_inc_return(&fcf_num) - 1; in fcoe_fcf_device_add()
1024 fcf->state = FCOE_FCF_STATE_UNKNOWN; in fcoe_fcf_device_add()
1026 fcf->dev_loss_tmo = ctlr->fcf_dev_loss_tmo; in fcoe_fcf_device_add()
1028 dev_set_name(&fcf->dev, "fcf_%d", fcf->id); in fcoe_fcf_device_add()
1030 fcf->fabric_name = new_fcf->fabric_name; in fcoe_fcf_device_add()
1031 fcf->switch_name = new_fcf->switch_name; in fcoe_fcf_device_add()
1032 fcf->fc_map = new_fcf->fc_map; in fcoe_fcf_device_add()
1033 fcf->vfid = new_fcf->vfid; in fcoe_fcf_device_add()
1034 memcpy(fcf->mac, new_fcf->mac, ETH_ALEN); in fcoe_fcf_device_add()
1035 fcf->priority = new_fcf->priority; in fcoe_fcf_device_add()
1036 fcf->fka_period = new_fcf->fka_period; in fcoe_fcf_device_add()
1037 fcf->selected = new_fcf->selected; in fcoe_fcf_device_add()
1039 error = device_register(&fcf->dev); in fcoe_fcf_device_add()
1041 put_device(&fcf->dev); in fcoe_fcf_device_add()
1045 fcf->state = FCOE_FCF_STATE_CONNECTED; in fcoe_fcf_device_add()
1046 list_add_tail(&fcf->peers, &ctlr->fcfs); in fcoe_fcf_device_add()
1048 return fcf; in fcoe_fcf_device_add()