Lines Matching defs:obj

49 	struct ias_object *obj;
53 obj = kzalloc(sizeof(struct ias_object), GFP_ATOMIC);
54 if (obj == NULL) {
60 obj->magic = IAS_OBJECT_MAGIC;
61 obj->name = kstrndup(name, IAS_MAX_CLASSNAME, GFP_ATOMIC);
62 if (!obj->name) {
65 kfree(obj);
68 obj->id = id;
73 obj->attribs = hashbin_new(HB_LOCK);
75 if (obj->attribs == NULL) {
78 kfree(obj->name);
79 kfree(obj);
83 return obj;
106 void __irias_delete_object(struct ias_object *obj)
108 IRDA_ASSERT(obj != NULL, return;);
109 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
111 kfree(obj->name);
113 hashbin_delete(obj->attribs, (FREE_FUNC) __irias_delete_attrib);
115 obj->magic = ~IAS_OBJECT_MAGIC;
117 kfree(obj);
121 * Function irias_delete_object (obj)
127 int irias_delete_object(struct ias_object *obj)
131 IRDA_ASSERT(obj != NULL, return -1;);
132 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -1;);
135 node = hashbin_remove_this(irias_objects, (irda_queue_t *) obj);
141 __irias_delete_object(obj);
148 * Function irias_delete_attrib (obj)
154 int irias_delete_attrib(struct ias_object *obj, struct ias_attrib *attrib,
159 IRDA_ASSERT(obj != NULL, return -1;);
160 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -1;);
164 node = hashbin_remove_this(obj->attribs, (irda_queue_t *) attrib);
176 node = (struct ias_attrib *) hashbin_get_first(obj->attribs);
178 irias_delete_object(obj);
184 * Function irias_insert_object (obj)
189 void irias_insert_object(struct ias_object *obj)
191 IRDA_ASSERT(obj != NULL, return;);
192 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
194 hashbin_insert(irias_objects, (irda_queue_t *) obj, 0, obj->name);
214 * Function irias_find_attrib (obj, name)
219 struct ias_attrib *irias_find_attrib(struct ias_object *obj, char *name)
223 IRDA_ASSERT(obj != NULL, return NULL;);
224 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return NULL;);
227 attrib = hashbin_lock_find(obj->attribs, 0, name);
236 * Function irias_add_attribute (obj, attrib)
241 static void irias_add_attrib(struct ias_object *obj, struct ias_attrib *attrib,
244 IRDA_ASSERT(obj != NULL, return;);
245 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
253 hashbin_insert(obj->attribs, (irda_queue_t *) attrib, 0, attrib->name);
265 struct ias_object *obj;
270 obj = hashbin_lock_find(irias_objects, 0, obj_name);
271 if (obj == NULL) {
277 /* Slightly unsafe (obj might get removed under us) */
278 spin_lock_irqsave(&obj->attribs->hb_spinlock, flags);
281 attrib = hashbin_find(obj->attribs, 0, attrib_name);
285 spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
292 spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
303 spin_unlock_irqrestore(&obj->attribs->hb_spinlock, flags);
309 * Function irias_object_add_integer_attrib (obj, name, value)
314 void irias_add_integer_attrib(struct ias_object *obj, char *name, int value,
319 IRDA_ASSERT(obj != NULL, return;);
320 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
345 irias_add_attrib(obj, attrib, owner);
350 * Function irias_add_octseq_attrib (obj, name, octet_seq, len)
356 void irias_add_octseq_attrib(struct ias_object *obj, char *name, __u8 *octets,
361 IRDA_ASSERT(obj != NULL, return;);
362 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
388 irias_add_attrib(obj, attrib, owner);
393 * Function irias_object_add_string_attrib (obj, string)
398 void irias_add_string_attrib(struct ias_object *obj, char *name, char *value,
403 IRDA_ASSERT(obj != NULL, return;);
404 IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return;);
430 irias_add_attrib(obj, attrib, owner);