Lines Matching defs:cdev

18 /* cdev list lock */
23 struct cxgbit_device *cdev;
25 cdev = container_of(kref, struct cxgbit_device, kref);
27 cxgbi_ppm_release(cdev2ppm(cdev));
28 kfree(cdev);
31 static void cxgbit_set_mdsl(struct cxgbit_device *cdev)
33 struct cxgb4_lld_info *lldi = &cdev->lldi;
50 cdev->mdsl = mdsl;
55 struct cxgbit_device *cdev;
60 cdev = kzalloc(sizeof(*cdev), GFP_KERNEL);
61 if (!cdev)
64 kref_init(&cdev->kref);
65 spin_lock_init(&cdev->np_lock);
67 cdev->lldi = *lldi;
69 cxgbit_set_mdsl(cdev);
71 if (cxgbit_ddp_init(cdev) < 0) {
72 kfree(cdev);
76 if (!test_bit(CDEV_DDP_ENABLE, &cdev->flags))
77 pr_info("cdev %s ddp init failed\n",
81 set_bit(CDEV_ISO_ENABLE, &cdev->flags);
83 spin_lock_init(&cdev->cskq.lock);
84 INIT_LIST_HEAD(&cdev->cskq.list);
87 list_add_tail(&cdev->list, &cdev_list_head);
90 pr_info("cdev %s added for iSCSI target transport\n",
93 return cdev;
96 static void cxgbit_close_conn(struct cxgbit_device *cdev)
102 spin_lock_bh(&cdev->cskq.lock);
103 list_for_each_entry(csk, &cdev->cskq.list, list) {
119 spin_unlock_bh(&cdev->cskq.lock);
122 static void cxgbit_detach_cdev(struct cxgbit_device *cdev)
126 spin_lock_bh(&cdev->cskq.lock);
127 if (list_empty(&cdev->cskq.list))
129 spin_unlock_bh(&cdev->cskq.lock);
133 list_del(&cdev->list);
136 cxgbit_put_cdev(cdev);
138 cxgbit_close_conn(cdev);
144 struct cxgbit_device *cdev = handle;
148 set_bit(CDEV_STATE_UP, &cdev->flags);
149 pr_info("cdev %s state UP.\n", pci_name(cdev->lldi.pdev));
152 clear_bit(CDEV_STATE_UP, &cdev->flags);
153 cxgbit_close_conn(cdev);
154 pr_info("cdev %s state RECOVERY.\n", pci_name(cdev->lldi.pdev));
157 pr_info("cdev %s state DOWN.\n", pci_name(cdev->lldi.pdev));
160 clear_bit(CDEV_STATE_UP, &cdev->flags);
161 pr_info("cdev %s state DETACH.\n", pci_name(cdev->lldi.pdev));
162 cxgbit_detach_cdev(cdev);
165 pr_info("cdev %s unknown state %d.\n",
166 pci_name(cdev->lldi.pdev), state);
438 struct cxgbit_device *cdev = hndl;
439 struct cxgb4_lld_info *lldi = &cdev->lldi;
515 pr_debug("cdev %p, opcode 0x%x(0x%x,0x%x), skb %p.\n",
516 cdev, op, rpl->ot.opcode_tid,
520 cxgbit_cplhandlers[op](cdev, skb);
538 cxgbit_update_dcb_priority(struct cxgbit_device *cdev, u8 port_id,
546 spin_lock_bh(&cdev->cskq.lock);
547 list_for_each_entry(csk, &cdev->cskq.list, list) {
584 spin_unlock_bh(&cdev->cskq.lock);
591 struct cxgbit_device *cdev = NULL;
626 cdev = cxgbit_find_device(ndev, &port_id);
630 if (!cdev) {
635 cxgbit_update_dcb_priority(cdev, port_id, priority,
725 struct cxgbit_device *cdev, *tmp;
731 list_for_each_entry_safe(cdev, tmp, &cdev_list_head, list) {
732 list_del(&cdev->list);
733 cxgbit_put_cdev(cdev);