static int iriap_data_indication(void *instance, void *sap,
struct sk_buff *skb);
+static void iriap_watchdog_timer_expired(void *data);
+
+static inline void iriap_start_watchdog_timer(struct iriap_cb *self,
+ int timeout)
+{
+ irda_start_timer(&self->watchdog_timer, timeout, self,
+ iriap_watchdog_timer_expired);
+}
+
/*
* Function iriap_init (void)
*
/* Object repository - defined in irias_object.c */
irias_objects = hashbin_new(HB_LOCK);
if (!irias_objects) {
- WARNING("%s: Can't allocate irias_objects hashbin!\n",
- __FUNCTION__);
+ IRDA_WARNING("%s: Can't allocate irias_objects hashbin!\n",
+ __FUNCTION__);
hashbin_delete(iriap, NULL);
return -ENOMEM;
}
self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC);
if (!self) {
- WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
+ IRDA_WARNING("%s: Unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
{
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
del_timer(&self->watchdog_timer);
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
if (self->lsap) {
irlmp_close_lsap(self->lsap);
}
entry = (struct iriap_cb *) hashbin_remove(iriap, (long) self, NULL);
- ASSERT(entry == self, return;);
+ IRDA_ASSERT(entry == self, return;);
__iriap_close(self);
}
self->lsap = irlmp_open_lsap(slsap_sel, ¬ify, 0);
if (self->lsap == NULL) {
- ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
+ IRDA_ERROR("%s: Unable to allocated LSAP!\n", __FUNCTION__);
return -1;
}
self->slsap_sel = self->lsap->slsap_sel;
self = (struct iriap_cb *) instance;
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(iriap != NULL, return;);
+ IRDA_ASSERT(iriap != NULL, return;);
del_timer(&self->watchdog_timer);
/*
* Function iriap_disconnect_request (handle)
*/
-void iriap_disconnect_request(struct iriap_cb *self)
+static void iriap_disconnect_request(struct iriap_cb *self)
{
struct sk_buff *tx_skb;
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
tx_skb = dev_alloc_skb(64);
if (tx_skb == NULL) {
irlmp_disconnect_request(self->lsap, tx_skb);
}
-void iriap_getinfobasedetails_request(void)
-{
- IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__);
-}
-
-void iriap_getinfobasedetails_confirm(void)
-{
- IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__);
-}
-
-void iriap_getobjects_request(void)
-{
- IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__);
-}
-
-void iriap_getobjects_confirm(void)
-{
- IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__);
-}
-
-void iriap_getvalue(void)
-{
- IRDA_DEBUG(0, "%s(), Not implemented!\n", __FUNCTION__);
-}
-
/*
* Function iriap_getvaluebyclass (addr, name, attr)
*
- * Retreive all values from attribute in all objects with given class
+ * Retrieve all values from attribute in all objects with given class
* name
*/
int iriap_getvaluebyclass_request(struct iriap_cb *self,
int name_len, attr_len, skb_len;
__u8 *frame;
- ASSERT(self != NULL, return -1;);
- ASSERT(self->magic == IAS_MAGIC, return -1;);
+ IRDA_ASSERT(self != NULL, return -1;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return -1;);
/* Client must supply the destination device address */
if (!daddr)
* to service user.
*
*/
-void iriap_getvaluebyclass_confirm(struct iriap_cb *self, struct sk_buff *skb)
+static void iriap_getvaluebyclass_confirm(struct iriap_cb *self,
+ struct sk_buff *skb)
{
struct ias_value *value;
int charset;
__u8 *fp;
int n;
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(skb != NULL, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(skb != NULL, return;);
/* Initialize variables */
fp = skb->data;
* Send answer back to remote LM-IAS
*
*/
-void iriap_getvaluebyclass_response(struct iriap_cb *self, __u16 obj_id,
- __u8 ret_code, struct ias_value *value)
+static void iriap_getvaluebyclass_response(struct iriap_cb *self,
+ __u16 obj_id,
+ __u8 ret_code,
+ struct ias_value *value)
{
struct sk_buff *tx_skb;
int n;
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(value != NULL, return;);
- ASSERT(value->len <= 1024, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(value != NULL, return;);
+ IRDA_ASSERT(value->len <= 1024, return;);
/* Initialize variables */
n = 0;
* getvaluebyclass is requested from peer LM-IAS
*
*/
-void iriap_getvaluebyclass_indication(struct iriap_cb *self,
- struct sk_buff *skb)
+static void iriap_getvaluebyclass_indication(struct iriap_cb *self,
+ struct sk_buff *skb)
{
struct ias_object *obj;
struct ias_attrib *attrib;
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(skb != NULL, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(skb != NULL, return;);
fp = skb->data;
n = 1;
IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
tx_skb = dev_alloc_skb(64);
if (!tx_skb)
{
int ret;
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
ret = irlmp_connect_request(self->lsap, LSAP_IAS,
self->saddr, self->daddr,
self = (struct iriap_cb *) instance;
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(skb != NULL, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(skb != NULL, return;);
self->max_data_size = max_seg_size;
self->max_header_size = max_header_size;
self = (struct iriap_cb *) instance;
- ASSERT(skb != NULL, return;);
- ASSERT(self != NULL, goto out;);
- ASSERT(self->magic == IAS_MAGIC, goto out;);
+ IRDA_ASSERT(skb != NULL, return;);
+ IRDA_ASSERT(self != NULL, goto out;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, goto out;);
/* Start new server */
new = iriap_open(LSAP_IAS, IAS_SERVER, NULL, NULL);
self = (struct iriap_cb *) instance;
- ASSERT(skb != NULL, return 0;);
- ASSERT(self != NULL, goto out;);
- ASSERT(self->magic == IAS_MAGIC, goto out;);
+ IRDA_ASSERT(skb != NULL, return 0;);
+ IRDA_ASSERT(self != NULL, goto out;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, goto out;);
frame = skb->data;
}
opcode = frame[0];
if (~opcode & IAP_LST) {
- WARNING("%s:, IrIAS multiframe commands or "
- "results is not implemented yet!\n", __FUNCTION__);
+ IRDA_WARNING("%s:, IrIAS multiframe commands or "
+ "results is not implemented yet!\n",
+ __FUNCTION__);
goto out;
}
IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
- ASSERT(skb != NULL, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(skb != NULL, return;);
fp = skb->data;
opcode = fp[0];
if (~opcode & 0x80) {
- WARNING("%s: IrIAS multiframe commands or results"
- "is not implemented yet!\n", __FUNCTION__);
+ IRDA_WARNING("%s: IrIAS multiframe commands or results"
+ "is not implemented yet!\n", __FUNCTION__);
return;
}
opcode &= 0x7f; /* Mask away LST bit */
switch (opcode) {
case GET_INFO_BASE:
- WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
- __FUNCTION__);
+ IRDA_WARNING("%s: GetInfoBaseDetails not implemented yet!\n",
+ __FUNCTION__);
break;
case GET_VALUE_BY_CLASS:
iriap_getvaluebyclass_indication(self, skb);
* Query has taken too long time, so abort
*
*/
-void iriap_watchdog_timer_expired(void *data)
+static void iriap_watchdog_timer_expired(void *data)
{
struct iriap_cb *self = (struct iriap_cb *) data;
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IAS_MAGIC, return;);
+ IRDA_ASSERT(self != NULL, return;);
+ IRDA_ASSERT(self->magic == IAS_MAGIC, return;);
/* iriap_close(self); */
}
struct ias_object *obj = v;
struct ias_attrib *attrib;
- ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -EINVAL;);
+ IRDA_ASSERT(obj->magic == IAS_OBJECT_MAGIC, return -EINVAL;);
seq_printf(seq, "name: %s, id=%d\n",
obj->name, obj->id);
attrib != NULL;
attrib = (struct ias_attrib *) hashbin_get_next(obj->attribs)) {
- ASSERT(attrib->magic == IAS_ATTRIB_MAGIC, break; );
+ IRDA_ASSERT(attrib->magic == IAS_ATTRIB_MAGIC,
+ goto outloop; );
seq_printf(seq, " - Attribute name: \"%s\", ",
attrib->name);
seq_putc(seq, '\n');
}
+ IRDA_ASSERT_LABEL(outloop:)
spin_unlock(&obj->attribs->hb_spinlock);
}
static int irias_seq_open(struct inode *inode, struct file *file)
{
- ASSERT( irias_objects != NULL, return -EINVAL;);
+ IRDA_ASSERT( irias_objects != NULL, return -EINVAL;);
return seq_open(file, &irias_seq_ops);
}
.open = irias_seq_open,
.read = seq_read,
.llseek = seq_lseek,
- .release = seq_release_private,
+ .release = seq_release,
};
#endif /* PROC_FS */