patch-2.4.23 linux-2.4.23/net/irda/irttp.c
Next file: linux-2.4.23/net/irda/parameters.c
Previous file: linux-2.4.23/net/irda/irqueue.c
Back to the patch index
Back to the overall index
- Lines: 455
- Date:
2003-11-28 10:26:21.000000000 -0800
- Orig file:
linux-2.4.22/net/irda/irttp.c
- Orig date:
2003-06-13 07:51:39.000000000 -0700
diff -urN linux-2.4.22/net/irda/irttp.c linux-2.4.23/net/irda/irttp.c
@@ -94,7 +94,7 @@
irttp->tsaps = hashbin_new(HB_LOCAL);
if (!irttp->tsaps) {
- ERROR(__FUNCTION__ "(), can't allocate IrTTP hashbin!\n");
+ ERROR("%s(), can't allocate IrTTP hashbin!\n", __FUNCTION__);
return -ENOMEM;
}
@@ -165,7 +165,7 @@
if (!self || self->magic != TTP_TSAP_MAGIC)
return;
- IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
+ IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self);
/* Try to make some progress, especially on Tx side - Jean II */
irttp_run_rx_queue(self);
@@ -206,7 +206,7 @@
{
struct sk_buff* skb;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -239,7 +239,7 @@
ASSERT(self != NULL, return NULL;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return NULL;);
- IRDA_DEBUG(2, __FUNCTION__ "(), self->rx_sdu_size=%d\n",
+ IRDA_DEBUG(2, "%s(), self->rx_sdu_size=%d\n", __FUNCTION__,
self->rx_sdu_size);
skb = dev_alloc_skb(TTP_HEADER + self->rx_sdu_size);
@@ -262,9 +262,9 @@
dev_kfree_skb(frag);
}
- IRDA_DEBUG(2, __FUNCTION__ "(), frame len=%d\n", n);
+ IRDA_DEBUG(2, "%s(), frame len=%d\n", __FUNCTION__, n);
- IRDA_DEBUG(2, __FUNCTION__ "(), rx_sdu_size=%d\n", self->rx_sdu_size);
+ IRDA_DEBUG(2, "%s(), rx_sdu_size=%d\n", __FUNCTION__, self->rx_sdu_size);
ASSERT(n <= self->rx_sdu_size, return NULL;);
/* Set the new length */
@@ -287,7 +287,7 @@
struct sk_buff *frag;
__u8 *frame;
- IRDA_DEBUG(2, __FUNCTION__ "()\n");
+ IRDA_DEBUG(2, "%s()\n", __FUNCTION__);
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
@@ -297,7 +297,7 @@
* Split frame into a number of segments
*/
while (skb->len > self->max_seg_size) {
- IRDA_DEBUG(2, __FUNCTION__ "(), fragmenting ...\n");
+ IRDA_DEBUG(2, "%s(), fragmenting ...\n", __FUNCTION__);
/* Make new segment */
frag = dev_alloc_skb(self->max_seg_size+self->max_header_size);
@@ -321,7 +321,7 @@
skb_queue_tail(&self->tx_queue, frag);
}
/* Queue what is left of the original skb */
- IRDA_DEBUG(2, __FUNCTION__ "(), queuing last segment\n");
+ IRDA_DEBUG(2, "%s(), queuing last segment\n", __FUNCTION__);
frame = skb_push(skb, TTP_HEADER);
frame[0] = 0x00; /* Clear more bit */
@@ -352,7 +352,7 @@
else
self->tx_max_sdu_size = param->pv.i;
- IRDA_DEBUG(1, __FUNCTION__ "(), MaxSduSize=%d\n", param->pv.i);
+ IRDA_DEBUG(1, "%s(), MaxSduSize=%d\n", __FUNCTION__, param->pv.i);
return 0;
}
@@ -380,13 +380,13 @@
* JeanII */
if((stsap_sel != LSAP_ANY) &&
((stsap_sel < 0x01) || (stsap_sel >= 0x70))) {
- IRDA_DEBUG(0, __FUNCTION__ "(), invalid tsap!\n");
+ IRDA_DEBUG(0, "%s(), invalid tsap!\n", __FUNCTION__);
return NULL;
}
self = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC);
if (self == NULL) {
- IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc!\n");
+ IRDA_DEBUG(0, "%s(), unable to kmalloc!\n", __FUNCTION__);
return NULL;
}
memset(self, 0, sizeof(struct tsap_cb));
@@ -421,7 +421,7 @@
*/
lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
if (lsap == NULL) {
- WARNING(__FUNCTION__ "(), unable to allocate LSAP!!\n");
+ WARNING("%s(), unable to allocate LSAP!!\n", __FUNCTION__);
return NULL;
}
@@ -431,7 +431,7 @@
* the stsap_sel we have might not be valid anymore
*/
self->stsap_sel = lsap->slsap_sel;
- IRDA_DEBUG(4, __FUNCTION__ "(), stsap_sel=%02x\n", self->stsap_sel);
+ IRDA_DEBUG(4, "%s(), stsap_sel=%02x\n", __FUNCTION__, self->stsap_sel);
self->notify = *notify;
self->lsap = lsap;
@@ -488,7 +488,7 @@
{
struct tsap_cb *tsap;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
ASSERT(self != NULL, return -1;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
@@ -497,7 +497,7 @@
if (self->connected) {
/* Check if disconnect is not pending */
if (!test_bit(0, &self->disconnect_pend)) {
- WARNING(__FUNCTION__ "(), TSAP still connected!\n");
+ WARNING("%s(), TSAP still connected!\n", __FUNCTION__);
irttp_disconnect_request(self, NULL, P_NORMAL);
}
self->close_pend = TRUE;
@@ -533,16 +533,16 @@
ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
ASSERT(skb != NULL, return -1;);
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
/* Check that nothing bad happens */
if ((skb->len == 0) || (!self->connected)) {
- IRDA_DEBUG(1, __FUNCTION__ "(), No data, or not connected\n");
+ IRDA_DEBUG(1, "%s(), No data, or not connected\n", __FUNCTION__);
return -1;
}
if (skb->len > self->max_seg_size) {
- IRDA_DEBUG(1, __FUNCTION__ "(), UData is to large for IrLAP!\n");
+ IRDA_DEBUG(1, "%s(), UData is to large for IrLAP!\n", __FUNCTION__);
return -1;
}
@@ -566,12 +566,12 @@
ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
ASSERT(skb != NULL, return -1;);
- IRDA_DEBUG(2, __FUNCTION__ " : queue len = %d\n",
+ IRDA_DEBUG(2, "%s : queue len = %d\n", __FUNCTION__,
skb_queue_len(&self->tx_queue));
/* Check that nothing bad happens */
if ((skb->len == 0) || (!self->connected)) {
- WARNING(__FUNCTION__ "(), No data, or not connected\n");
+ WARNING("%s(), No data, or not connected\n", __FUNCTION__);
return -ENOTCONN;
}
@@ -580,8 +580,7 @@
* inside an IrLAP frame
*/
if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
- ERROR(__FUNCTION__
- "(), SAR disabled, and data is to large for IrLAP!\n");
+ ERROR("%s(), SAR disabled, and data is to large for IrLAP!\n", __FUNCTION__);
return -EMSGSIZE;
}
@@ -593,8 +592,8 @@
(self->tx_max_sdu_size != TTP_SAR_UNBOUND) &&
(skb->len > self->tx_max_sdu_size))
{
- ERROR(__FUNCTION__ "(), SAR enabled, "
- "but data is larger than TxMaxSduSize!\n");
+ ERROR("%s(), SAR enabled, "
+ "but data is larger than TxMaxSduSize!\n", __FUNCTION__);
return -EMSGSIZE;
}
/*
@@ -665,7 +664,7 @@
unsigned long flags;
int n;
- IRDA_DEBUG(2, __FUNCTION__ "() : send_credit = %d, queue_len = %d\n",
+ IRDA_DEBUG(2, "%s() : send_credit = %d, queue_len = %d\n", __FUNCTION__,
self->send_credit, skb_queue_len(&self->tx_queue));
/* Get exclusive access to the tx queue, otherwise don't touch it */
@@ -773,7 +772,7 @@
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
- IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
+ IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
self->send_credit, self->avail_credit, self->remote_credit);
/* Give credit to peer */
@@ -821,7 +820,7 @@
{
struct tsap_cb *self;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
self = (struct tsap_cb *) instance;
@@ -933,7 +932,7 @@
{
struct tsap_cb *self;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
self = (struct tsap_cb *) instance;
@@ -947,7 +946,7 @@
self->notify.status_indication(self->notify.instance,
link, lock);
else
- IRDA_DEBUG(2, __FUNCTION__ "(), no handler\n");
+ IRDA_DEBUG(2, "%s(), no handler\n", __FUNCTION__);
}
/*
@@ -965,7 +964,7 @@
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
- IRDA_DEBUG(4, __FUNCTION__ "(instance=%p)\n", self);
+ IRDA_DEBUG(4, "%s(instance=%p)\n", __FUNCTION__, self);
/* We are "polled" directly from LAP, and the LAP want to fill
* its Tx window. We want to do our best to send it data, so that
@@ -1003,18 +1002,18 @@
*/
void irttp_flow_request(struct tsap_cb *self, LOCAL_FLOW flow)
{
- IRDA_DEBUG(1, __FUNCTION__ "()\n");
+ IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
ASSERT(self != NULL, return;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return;);
switch (flow) {
case FLOW_STOP:
- IRDA_DEBUG(1, __FUNCTION__ "(), flow stop\n");
+ IRDA_DEBUG(1, "%s(), flow stop\n", __FUNCTION__);
self->rx_sdu_busy = TRUE;
break;
case FLOW_START:
- IRDA_DEBUG(1, __FUNCTION__ "(), flow start\n");
+ IRDA_DEBUG(1, "%s(), flow start\n", __FUNCTION__);
self->rx_sdu_busy = FALSE;
/* Client say he can accept more data, try to free our
@@ -1023,7 +1022,7 @@
break;
default:
- IRDA_DEBUG(1, __FUNCTION__ "(), Unknown flow command!\n");
+ IRDA_DEBUG(1, "%s(), Unknown flow command!\n", __FUNCTION__);
}
}
@@ -1042,7 +1041,7 @@
__u8 *frame;
__u8 n;
- IRDA_DEBUG(4, __FUNCTION__ "(), max_sdu_size=%d\n", max_sdu_size);
+ IRDA_DEBUG(4, "%s(), max_sdu_size=%d\n", __FUNCTION__, max_sdu_size);
ASSERT(self != NULL, return -EBADR;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return -EBADR;);
@@ -1134,7 +1133,7 @@
__u8 plen;
__u8 n;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
self = (struct tsap_cb *) instance;
@@ -1158,7 +1157,7 @@
n = skb->data[0] & 0x7f;
- IRDA_DEBUG(4, __FUNCTION__ "(), Initial send_credit=%d\n", n);
+ IRDA_DEBUG(4, "%s(), Initial send_credit=%d\n", __FUNCTION__, n);
self->send_credit = n;
self->tx_max_sdu_size = 0;
@@ -1178,8 +1177,7 @@
/* Any errors in the parameter list? */
if (ret < 0) {
- WARNING(__FUNCTION__
- "(), error extracting parameters\n");
+ WARNING("%s(), error extracting parameters\n", __FUNCTION__);
dev_kfree_skb(skb);
/* Do not accept this connection attempt */
@@ -1189,10 +1187,10 @@
skb_pull(skb, IRDA_MIN(skb->len, plen+1));
}
- IRDA_DEBUG(4, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
+ IRDA_DEBUG(4, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
self->send_credit, self->avail_credit, self->remote_credit);
- IRDA_DEBUG(2, __FUNCTION__ "(), MaxSduSize=%d\n", self->tx_max_sdu_size);
+ IRDA_DEBUG(2, "%s(), MaxSduSize=%d\n", __FUNCTION__, self->tx_max_sdu_size);
if (self->notify.connect_confirm) {
self->notify.connect_confirm(self->notify.instance, self, qos,
@@ -1229,7 +1227,7 @@
self->max_seg_size = max_seg_size - TTP_HEADER;;
self->max_header_size = max_header_size+TTP_HEADER;
- IRDA_DEBUG(4, __FUNCTION__ "(), TSAP sel=%02x\n", self->stsap_sel);
+ IRDA_DEBUG(4, "%s(), TSAP sel=%02x\n", __FUNCTION__, self->stsap_sel);
/* Need to update dtsap_sel if its equal to LSAP_ANY */
self->dtsap_sel = lsap->dlsap_sel;
@@ -1253,8 +1251,7 @@
/* Any errors in the parameter list? */
if (ret < 0) {
- WARNING(__FUNCTION__
- "(), error extracting parameters\n");
+ WARNING("%s(), error extracting parameters\n", __FUNCTION__);
dev_kfree_skb(skb);
/* Do not accept this connection attempt */
@@ -1291,7 +1288,7 @@
ASSERT(self != NULL, return -1;);
ASSERT(self->magic == TTP_TSAP_MAGIC, return -1;);
- IRDA_DEBUG(4, __FUNCTION__ "(), Source TSAP selector=%02x\n",
+ IRDA_DEBUG(4, "%s(), Source TSAP selector=%02x\n", __FUNCTION__,
self->stsap_sel);
/* Any userdata supplied? */
@@ -1369,15 +1366,15 @@
{
struct tsap_cb *new;
- IRDA_DEBUG(1, __FUNCTION__ "()\n");
+ IRDA_DEBUG(1, "%s()\n", __FUNCTION__);
if (!hashbin_find(irttp->tsaps, (int) orig, NULL)) {
- IRDA_DEBUG(0, __FUNCTION__ "(), unable to find TSAP\n");
+ IRDA_DEBUG(0, "%s(), unable to find TSAP\n", __FUNCTION__);
return NULL;
}
new = kmalloc(sizeof(struct tsap_cb), GFP_ATOMIC);
if (!new) {
- IRDA_DEBUG(0, __FUNCTION__ "(), unable to kmalloc\n");
+ IRDA_DEBUG(0, "%s(), unable to kmalloc\n", __FUNCTION__);
return NULL;
}
/* Dup */
@@ -1415,7 +1412,7 @@
/* Already disconnected? */
if (!self->connected) {
- IRDA_DEBUG(4, __FUNCTION__ "(), already disconnected!\n");
+ IRDA_DEBUG(4, "%s(), already disconnected!\n", __FUNCTION__);
if (userdata)
dev_kfree_skb(userdata);
return -1;
@@ -1427,7 +1424,7 @@
* for following a disconnect_indication() (i.e. net_bh).
* Jean II */
if(test_and_set_bit(0, &self->disconnect_pend)) {
- IRDA_DEBUG(0, __FUNCTION__ "(), disconnect already pending\n");
+ IRDA_DEBUG(0, "%s(), disconnect already pending\n", __FUNCTION__);
if (userdata)
dev_kfree_skb(userdata);
@@ -1446,7 +1443,7 @@
* disconnecting right now since the data will
* not have any usable connection to be sent on
*/
- IRDA_DEBUG(1, __FUNCTION__ "High priority!!()\n" );
+ IRDA_DEBUG(1, "%s High priority!!()\n", __FUNCTION__);
irttp_flush_queues(self);
} else if (priority == P_NORMAL) {
/*
@@ -1467,7 +1464,7 @@
* be sent at the LMP level (so even if the peer has its Tx queue
* full of data). - Jean II */
- IRDA_DEBUG(1, __FUNCTION__ "(), Disconnecting ...\n");
+ IRDA_DEBUG(1, "%s(), Disconnecting ...\n", __FUNCTION__);
self->connected = FALSE;
if (!userdata) {
@@ -1501,7 +1498,7 @@
{
struct tsap_cb *self;
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
+ IRDA_DEBUG(4, "%s()\n", __FUNCTION__);
self = (struct tsap_cb *) instance;
@@ -1561,7 +1558,7 @@
* give an error back
*/
if (err == -ENOMEM) {
- IRDA_DEBUG(0, __FUNCTION__ "() requeueing skb!\n");
+ IRDA_DEBUG(0, "%s() requeueing skb!\n", __FUNCTION__);
/* Make sure we take a break */
self->rx_sdu_busy = TRUE;
@@ -1586,7 +1583,7 @@
struct sk_buff *skb;
int more = 0;
- IRDA_DEBUG(2, __FUNCTION__ "() send=%d,avail=%d,remote=%d\n",
+ IRDA_DEBUG(2, "%s() send=%d,avail=%d,remote=%d\n", __FUNCTION__,
self->send_credit, self->avail_credit, self->remote_credit);
/* Get exclusive access to the rx queue, otherwise don't touch it */
@@ -1626,7 +1623,7 @@
* limits of the maximum size of the rx_sdu
*/
if (self->rx_sdu_size <= self->rx_max_sdu_size) {
- IRDA_DEBUG(4, __FUNCTION__ "(), queueing frag\n");
+ IRDA_DEBUG(4, "%s(), queueing frag\n", __FUNCTION__);
skb_queue_tail(&self->rx_fragments, skb);
} else {
/* Free the part of the SDU that is too big */
@@ -1656,7 +1653,7 @@
/* Now we can deliver the reassembled skb */
irttp_do_data_indication(self, skb);
} else {
- IRDA_DEBUG(1, __FUNCTION__ "(), Truncated frame\n");
+ IRDA_DEBUG(1, "%s(), Truncated frame\n", __FUNCTION__);
/* Free the part of the SDU that is too big */
dev_kfree_skb(skb);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)