projects
/
powerpc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
[powerpc.git]
/
net
/
irda
/
irttp.c
diff --git
a/net/irda/irttp.c
b/net/irda/irttp.c
index
03504f3
..
7069e4a
100644
(file)
--- a/
net/irda/irttp.c
+++ b/
net/irda/irttp.c
@@
-1,5
+1,5
@@
/*********************************************************************
/*********************************************************************
- *
+ *
* Filename: irttp.c
* Version: 1.2
* Description: Tiny Transport Protocol (TTP) implementation
* Filename: irttp.c
* Version: 1.2
* Description: Tiny Transport Protocol (TTP) implementation
@@
-8,18
+8,18
@@
* Created at: Sun Aug 31 20:14:31 1997
* Modified at: Wed Jan 5 11:31:27 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
* Created at: Sun Aug 31 20:14:31 1997
* Modified at: Wed Jan 5 11:31:27 2000
* Modified by: Dag Brattli <dagb@cs.uit.no>
- *
- * Copyright (c) 1998-2000 Dag Brattli <dagb@cs.uit.no>,
+ *
+ * Copyright (c) 1998-2000 Dag Brattli <dagb@cs.uit.no>,
* All Rights Reserved.
* Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com>
* All Rights Reserved.
* Copyright (c) 2000-2003 Jean Tourrilhes <jt@hpl.hp.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* Neither Dag Brattli nor University of Tromsø admit liability nor
* the License, or (at your option) any later version.
*
* Neither Dag Brattli nor University of Tromsø admit liability nor
- * provide warranty for any of this software. This material is
+ * provide warranty for any of this software. This material is
* provided "AS-IS" and at no charge.
*
********************************************************************/
* provided "AS-IS" and at no charge.
*
********************************************************************/
@@
-42,17
+42,17
@@
static struct irttp_cb *irttp;
static void __irttp_close_tsap(struct tsap_cb *self);
static void __irttp_close_tsap(struct tsap_cb *self);
-static int irttp_data_indication(void *instance, void *sap,
+static int irttp_data_indication(void *instance, void *sap,
struct sk_buff *skb);
struct sk_buff *skb);
-static int irttp_udata_indication(void *instance, void *sap,
+static int irttp_udata_indication(void *instance, void *sap,
struct sk_buff *skb);
struct sk_buff *skb);
-static void irttp_disconnect_indication(void *instance, void *sap,
+static void irttp_disconnect_indication(void *instance, void *sap,
LM_REASON reason, struct sk_buff *);
LM_REASON reason, struct sk_buff *);
-static void irttp_connect_indication(void *instance, void *sap,
+static void irttp_connect_indication(void *instance, void *sap,
struct qos_info *qos, __u32 max_sdu_size,
__u8 header_size, struct sk_buff *skb);
struct qos_info *qos, __u32 max_sdu_size,
__u8 header_size, struct sk_buff *skb);
-static void irttp_connect_confirm(void *instance, void *sap,
- struct qos_info *qos, __u32 max_sdu_size,
+static void irttp_connect_confirm(void *instance, void *sap,
+ struct qos_info *qos, __u32 max_sdu_size,
__u8 header_size, struct sk_buff *skb);
static void irttp_run_tx_queue(struct tsap_cb *self);
static void irttp_run_rx_queue(struct tsap_cb *self);
__u8 header_size, struct sk_buff *skb);
static void irttp_run_tx_queue(struct tsap_cb *self);
static void irttp_run_rx_queue(struct tsap_cb *self);
@@
-61,7
+61,7
@@
static void irttp_flush_queues(struct tsap_cb *self);
static void irttp_fragment_skb(struct tsap_cb *self, struct sk_buff *skb);
static struct sk_buff *irttp_reassemble_skb(struct tsap_cb *self);
static void irttp_todo_expired(unsigned long data);
static void irttp_fragment_skb(struct tsap_cb *self, struct sk_buff *skb);
static struct sk_buff *irttp_reassemble_skb(struct tsap_cb *self);
static void irttp_todo_expired(unsigned long data);
-static int irttp_param_max_sdu_size(void *instance, irda_param_t *param,
+static int irttp_param_max_sdu_size(void *instance, irda_param_t *param,
int get);
static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow);
int get);
static void irttp_flow_indication(void *instance, void *sap, LOCAL_FLOW flow);
@@
-109,7
+109,7
@@
int __init irttp_init(void)
* Called by module destruction/cleanup code
*
*/
* Called by module destruction/cleanup code
*
*/
-void __exit irttp_cleanup(void)
+void __exit irttp_cleanup(void)
{
/* Check for main structure */
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;);
{
/* Check for main structure */
IRDA_ASSERT(irttp->magic == TTP_MAGIC, return;);
@@
-256,7
+256,7
@@
static struct sk_buff *irttp_reassemble_skb(struct tsap_cb *self)
* Copy all fragments to a new buffer
*/
while ((frag = skb_dequeue(&self->rx_fragments)) != NULL) {
* Copy all fragments to a new buffer
*/
while ((frag = skb_dequeue(&self->rx_fragments)) != NULL) {
-
memcpy(skb->data+
n, frag->data, frag->len);
+
skb_copy_to_linear_data_offset(skb,
n, frag->data, frag->len);
n += frag->len;
dev_kfree_skb(frag);
n += frag->len;
dev_kfree_skb(frag);
@@
-314,8
+314,8
@@
static inline void irttp_fragment_skb(struct tsap_cb *self,
skb_reserve(frag, self->max_header_size);
/* Copy data from the original skb into this fragment. */
skb_reserve(frag, self->max_header_size);
/* Copy data from the original skb into this fragment. */
-
memcpy(skb_put(frag, self->max_seg_size), skb->data
,
- self->max_seg_size);
+
skb_copy_from_linear_data(skb, skb_put(frag, self->max_seg_size)
,
+
self->max_seg_size);
/* Insert TTP header, with the more bit set */
frame = skb_push(frag, TTP_HEADER);
/* Insert TTP header, with the more bit set */
frame = skb_push(frag, TTP_HEADER);
@@
-551,7
+551,7
@@
int irttp_udata_request(struct tsap_cb *self, struct sk_buff *skb)
}
if (skb->len > self->max_seg_size) {
}
if (skb->len > self->max_seg_size) {
- IRDA_DEBUG(1, "%s(), UData is to large for IrLAP!\n",
+ IRDA_DEBUG(1, "%s(), UData is to
o
large for IrLAP!\n",
__FUNCTION__);
goto err;
}
__FUNCTION__);
goto err;
}
@@
-598,7
+598,7
@@
int irttp_data_request(struct tsap_cb *self, struct sk_buff *skb)
* inside an IrLAP frame
*/
if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
* inside an IrLAP frame
*/
if ((self->tx_max_sdu_size == 0) && (skb->len > self->max_seg_size)) {
- IRDA_ERROR("%s: SAR disabled, and data is to large for IrLAP!\n",
+ IRDA_ERROR("%s: SAR disabled, and data is to
o
large for IrLAP!\n",
__FUNCTION__);
ret = -EMSGSIZE;
goto err;
__FUNCTION__);
ret = -EMSGSIZE;
goto err;
@@
-865,7
+865,7
@@
static int irttp_udata_indication(void *instance, void *sap,
err = self->notify.udata_indication(self->notify.instance,
self,skb);
/* Same comment as in irttp_do_data_indication() */
err = self->notify.udata_indication(self->notify.instance,
self,skb);
/* Same comment as in irttp_do_data_indication() */
- if (!err)
+ if (!err)
return 0;
}
/* Either no handler, or handler returns an error */
return 0;
}
/* Either no handler, or handler returns an error */
@@
-940,7
+940,7
@@
static int irttp_data_indication(void *instance, void *sap,
/*
* If the peer device has given us some credits and we didn't have
/*
* If the peer device has given us some credits and we didn't have
-
* anyone from before, then we need to shedule the tx queue.
+ * anyone from before, then we need to shedule the tx queue.
* We need to do that because our Tx have stopped (so we may not
* get any LAP flow indication) and the user may be stopped as
* well. - Jean II
* We need to do that because our Tx have stopped (so we may not
* get any LAP flow indication) and the user may be stopped as
* well. - Jean II
@@
-1455,6
+1455,7
@@
struct tsap_cb *irttp_dup(struct tsap_cb *orig, void *instance)
/* Not everything should be copied */
new->notify.instance = instance;
/* Not everything should be copied */
new->notify.instance = instance;
+ spin_lock_init(&new->lock);
init_timer(&new->todo_timer);
skb_queue_head_init(&new->rx_queue);
init_timer(&new->todo_timer);
skb_queue_head_init(&new->rx_queue);
@@
-1798,14
+1799,14
@@
static void *irttp_seq_start(struct seq_file *seq, loff_t *pos)
spin_lock_irq(&irttp->tsaps->hb_spinlock);
iter->id = 0;
spin_lock_irq(&irttp->tsaps->hb_spinlock);
iter->id = 0;
- for (self = (struct tsap_cb *) hashbin_get_first(irttp->tsaps);
+ for (self = (struct tsap_cb *) hashbin_get_first(irttp->tsaps);
self != NULL;
self = (struct tsap_cb *) hashbin_get_next(irttp->tsaps)) {
if (iter->id == *pos)
break;
++iter->id;
}
self != NULL;
self = (struct tsap_cb *) hashbin_get_next(irttp->tsaps)) {
if (iter->id == *pos)
break;
++iter->id;
}
-
+
return self;
}
return self;
}
@@
-1895,7
+1896,7
@@
out_kfree:
goto out;
}
goto out;
}
-struct file_operations irttp_seq_fops = {
+
const
struct file_operations irttp_seq_fops = {
.owner = THIS_MODULE,
.open = irttp_seq_open,
.read = seq_read,
.owner = THIS_MODULE,
.open = irttp_seq_open,
.read = seq_read,