Lines Matching defs:ucap
90 * ib_ucaps_init - Initialization required before ucap creation.
119 struct ib_ucap *ucap = container_of(device, struct ib_ucap, dev);
121 kfree(ucap);
125 * ib_create_ucap - Add a ucap character device
128 * Creates a ucap character device in the /dev/infiniband directory. By default,
138 struct ib_ucap *ucap;
149 ucap = ucaps_list[type];
150 if (ucap) {
151 kref_get(&ucap->ref);
156 ucap = kzalloc_obj(*ucap);
157 if (!ucap) {
162 device_initialize(&ucap->dev);
163 ucap->dev.class = &ucaps_class;
164 ucap->dev.devt = MKDEV(MAJOR(ucaps_base_dev), type);
165 ucap->dev.release = ucap_dev_release;
166 ret = dev_set_name(&ucap->dev, "%s", ucap_names[type]);
170 cdev_init(&ucap->cdev, &ucaps_cdev_fops);
171 ucap->cdev.owner = THIS_MODULE;
173 ret = cdev_device_add(&ucap->cdev, &ucap->dev);
177 kref_init(&ucap->ref);
178 ucaps_list[type] = ucap;
184 put_device(&ucap->dev);
193 struct ib_ucap *ucap = container_of(ref, struct ib_ucap, ref);
197 if (ucaps_list[type] == ucap)
203 cdev_device_del(&ucap->cdev, &ucap->dev);
204 put_device(&ucap->dev);
208 * ib_remove_ucap - Remove a ucap character device
211 * Removes the ucap character device according to type. The device is completely
216 struct ib_ucap *ucap;
219 ucap = ucaps_list[type];
220 if (WARN_ON(!ucap))
223 kref_put(&ucap->ref, ib_release_ucap);
230 * ib_get_ucaps - Get bitmask of ucap types from file descriptors
236 * the ucaps where a bit is set if an FD for that ucap type was in the array.