patch-2.3.24 linux/net/irda/iriap.c
Next file: linux/net/irda/iriap_event.c
Previous file: linux/net/irda/irda_device.c
Back to the patch index
Back to the overall index
- Lines: 315
- Date:
Mon Oct 25 20:49:42 1999
- Orig file:
v2.3.23/linux/net/irda/iriap.c
- Orig date:
Tue Aug 31 17:29:15 1999
diff -u --recursive --new-file v2.3.23/linux/net/irda/iriap.c linux/net/irda/iriap.c
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Thu Aug 21 00:02:07 1997
- * Modified at: Fri Aug 20 10:26:39 1999
+ * Modified at: Sat Oct 9 17:00:56 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli <dagb@cs.uit.no>,
@@ -28,7 +28,6 @@
#include <linux/skbuff.h>
#include <linux/string.h>
#include <linux/init.h>
-#include <linux/irda.h>
#include <asm/byteorder.h>
#include <asm/unaligned.h>
@@ -146,7 +145,7 @@
struct lsap_cb *lsap;
notify_t notify;
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
self = kmalloc(sizeof(struct iriap_cb), GFP_ATOMIC);
if (!self) {
@@ -184,7 +183,7 @@
init_timer(&self->watchdog_timer);
- hashbin_insert(iriap, (QUEUE*) self, slsap_sel, NULL);
+ hashbin_insert(iriap, (queue_t *) self, slsap_sel, NULL);
/* Initialize state machines */
iriap_next_client_state(self, S_DISCONNECT);
@@ -203,7 +202,7 @@
*/
static void __iriap_close(struct iriap_cb *self)
{
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
@@ -251,7 +250,7 @@
{
struct iriap_cb *self;
- DEBUG(4, __FUNCTION__ "(), reason=%s\n", lmp_reasons[reason]);
+ IRDA_DEBUG(4, __FUNCTION__ "(), reason=%s\n", lmp_reasons[reason]);
self = (struct iriap_cb *) instance;
@@ -263,7 +262,7 @@
del_timer(&self->watchdog_timer);
if (self->mode == IAS_CLIENT) {
- DEBUG(4, __FUNCTION__ "(), disconnect as client\n");
+ IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as client\n");
/*
* Inform service user that the request failed by sending
@@ -279,7 +278,7 @@
iriap_close(self);
} else {
- DEBUG(4, __FUNCTION__ "(), disconnect as server\n");
+ IRDA_DEBUG(4, __FUNCTION__ "(), disconnect as server\n");
iriap_do_server_event(self, IAP_LM_DISCONNECT_INDICATION,
NULL);
}
@@ -298,14 +297,14 @@
{
struct sk_buff *skb;
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
skb = dev_alloc_skb(64);
if (skb == NULL) {
- DEBUG(0, __FUNCTION__
+ IRDA_DEBUG(0, __FUNCTION__
"(), Could not allocate an sk_buff of length %d\n", 64);
return;
}
@@ -320,27 +319,27 @@
void iriap_getinfobasedetails_request(void)
{
- DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
}
void iriap_getinfobasedetails_confirm(void)
{
- DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
}
void iriap_getobjects_request(void)
{
- DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
}
void iriap_getobjects_confirm(void)
{
- DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
}
void iriap_getvalue(void)
{
- DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), Not implemented!\n");
}
/*
@@ -434,13 +433,13 @@
/* Get length, MSB first */
len = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2;
- DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
+ IRDA_DEBUG(4, __FUNCTION__ "(), len=%d\n", len);
/* Get object ID, MSB first */
obj_id = be16_to_cpu(get_unaligned((__u16 *)(fp+n))); n += 2;
type = fp[n++];
- DEBUG(4, __FUNCTION__ "(), Value type = %d\n", type);
+ IRDA_DEBUG(4, __FUNCTION__ "(), Value type = %d\n", type);
switch (type) {
case IAS_INTEGER:
@@ -449,7 +448,7 @@
value = irias_new_integer_value(tmp_cpu32);
/* Legal values restricted to 0x01-0x6f, page 15 irttp */
- DEBUG(4, __FUNCTION__ "(), lsap=%d\n", value->t.integer);
+ IRDA_DEBUG(4, __FUNCTION__ "(), lsap=%d\n", value->t.integer);
break;
case IAS_STRING:
charset = fp[n++];
@@ -468,19 +467,19 @@
/* case CS_ISO_8859_9: */
/* case CS_UNICODE: */
default:
- DEBUG(0, __FUNCTION__"(), charset %s, not supported\n",
+ IRDA_DEBUG(0, __FUNCTION__"(), charset %s, not supported\n",
ias_charset_types[charset]);
return;
/* break; */
}
value_len = fp[n++];
- DEBUG(4, __FUNCTION__ "(), strlen=%d\n", value_len);
+ IRDA_DEBUG(4, __FUNCTION__ "(), strlen=%d\n", value_len);
ASSERT(value_len < 64, return;);
/* Make sure the string is null-terminated */
fp[n+value_len] = 0x00;
- DEBUG(4, "Got string %s\n", fp+n);
+ IRDA_DEBUG(4, "Got string %s\n", fp+n);
value = irias_new_string_value(fp+n);
break;
case IAS_OCT_SEQ:
@@ -517,7 +516,7 @@
__u32 tmp_be32, tmp_be16;
__u8 *fp;
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
@@ -578,12 +577,12 @@
memcpy(fp+n, value->t.oct_seq, value->len); n+=value->len;
break;
case IAS_MISSING:
- DEBUG( 3, __FUNCTION__ ": sending IAS_MISSING\n");
+ IRDA_DEBUG( 3, __FUNCTION__ ": sending IAS_MISSING\n");
skb_put( skb, 1);
fp[n++] = value->type;
break;
default:
- DEBUG(0, __FUNCTION__ "(), type not implemented!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "(), type not implemented!\n");
break;
}
iriap_do_r_connect_event(self, IAP_CALL_RESPONSE, skb);
@@ -607,7 +606,7 @@
__u8 *fp;
int n;
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
@@ -629,26 +628,26 @@
/*
* Now, do some advanced parsing! :-)
*/
- DEBUG(4, "LM-IAS: Looking up %s: %s\n", name, attr);
+ IRDA_DEBUG(4, "LM-IAS: Looking up %s: %s\n", name, attr);
obj = irias_find_object(name);
if (obj == NULL) {
- DEBUG(0, "LM-IAS: Object not found\n");
+ IRDA_DEBUG(0, "LM-IAS: Object not found\n");
iriap_getvaluebyclass_response(self, 0x1235, IAS_CLASS_UNKNOWN,
&missing);
return;
}
- DEBUG(4, "LM-IAS: found %s, id=%d\n", obj->name, obj->id);
+ IRDA_DEBUG(4, "LM-IAS: found %s, id=%d\n", obj->name, obj->id);
attrib = irias_find_attrib(obj, attr);
if (attrib == NULL) {
- DEBUG(0, "LM-IAS: Attribute %s not found\n", attr);
+ IRDA_DEBUG(0, "LM-IAS: Attribute %s not found\n", attr);
iriap_getvaluebyclass_response(self, obj->id,
IAS_ATTRIB_UNKNOWN, &missing);
return;
}
- DEBUG(4, "LM-IAS: found %s\n", attrib->name);
+ IRDA_DEBUG(4, "LM-IAS: found %s\n", attrib->name);
/*
* We have a match; send the value.
@@ -670,7 +669,7 @@
struct sk_buff *skb;
__u8 *frame;
- DEBUG(6, __FUNCTION__ "()\n");
+ IRDA_DEBUG(6, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
@@ -707,7 +706,7 @@
ASSERT(self->magic == IAS_MAGIC, return;);
ASSERT(userdata != NULL, return;);
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
del_timer(&self->watchdog_timer);
@@ -748,7 +747,7 @@
__u8 *frame;
__u8 opcode;
- DEBUG( 4, __FUNCTION__ "()\n");
+ IRDA_DEBUG( 4, __FUNCTION__ "()\n");
self = (struct iriap_cb *) instance;
@@ -761,7 +760,7 @@
if (self->mode == IAS_SERVER) {
/* Call server */
- DEBUG(4, __FUNCTION__ "(), Calling server!\n");
+ IRDA_DEBUG(4, __FUNCTION__ "(), Calling server!\n");
iriap_do_r_connect_event( self, IAP_RECV_F_LST, skb);
return 0;
@@ -775,7 +774,7 @@
/* Check for ack frames since they don't contain any data */
if (opcode & IAP_ACK) {
- DEBUG(0, __FUNCTION__ "() Got ack frame!\n");
+ IRDA_DEBUG(0, __FUNCTION__ "() Got ack frame!\n");
return 0;
}
@@ -783,7 +782,7 @@
switch (opcode) {
case GET_INFO_BASE:
- DEBUG(0, "IrLMP GetInfoBaseDetails not implemented!\n");
+ IRDA_DEBUG(0, "IrLMP GetInfoBaseDetails not implemented!\n");
break;
case GET_VALUE_BY_CLASS:
switch (frame[1]) {
@@ -818,7 +817,7 @@
iriap_close(self);
break;
default:
- DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", opcode);
+ IRDA_DEBUG(0, __FUNCTION__ "(), Unknown op-code: %02x\n", opcode);
break;
}
return 0;
@@ -835,7 +834,7 @@
__u8 *fp;
__u8 opcode;
- DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(self != NULL, return;);
ASSERT(self->magic == IAS_MAGIC, return;);
@@ -938,7 +937,7 @@
len += sprintf(buf+len, "missing\n");
break;
default:
- DEBUG(0, __FUNCTION__
+ IRDA_DEBUG(0, __FUNCTION__
"(), Unknown value type!\n");
return -1;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)