From 6819bc2e1e46c71711a8dddf4040e706b02973c0 Mon Sep 17 00:00:00 2001 From: YOSHIFUJI Hideaki Date: Fri, 9 Feb 2007 23:24:53 +0900 Subject: [NET] IRDA: Fix whitespace errors. Signed-off-by: YOSHIFUJI Hideaki Signed-off-by: David S. Miller --- net/irda/af_irda.c | 12 +- net/irda/discovery.c | 58 +++---- net/irda/ircomm/ircomm_core.c | 98 +++++------ net/irda/ircomm/ircomm_event.c | 72 ++++---- net/irda/ircomm/ircomm_lmp.c | 110 ++++++------ net/irda/ircomm/ircomm_param.c | 94 +++++----- net/irda/ircomm/ircomm_ttp.c | 88 +++++----- net/irda/ircomm/ircomm_tty.c | 288 +++++++++++++++--------------- net/irda/ircomm/ircomm_tty_attach.c | 236 ++++++++++++------------- net/irda/ircomm/ircomm_tty_ioctl.c | 86 ++++----- net/irda/irda_device.c | 22 +-- net/irda/iriap.c | 20 +-- net/irda/irias_object.c | 6 +- net/irda/irlan/irlan_client.c | 150 ++++++++-------- net/irda/irlan/irlan_client_event.c | 190 ++++++++++---------- net/irda/irlan/irlan_common.c | 318 +++++++++++++++++----------------- net/irda/irlan/irlan_eth.c | 102 +++++------ net/irda/irlan/irlan_event.c | 26 +-- net/irda/irlan/irlan_filter.c | 48 ++--- net/irda/irlan/irlan_provider.c | 102 +++++------ net/irda/irlan/irlan_provider_event.c | 68 ++++---- net/irda/irlap.c | 14 +- net/irda/irlap_event.c | 6 +- net/irda/irlap_frame.c | 6 +- net/irda/irlmp.c | 16 +- net/irda/irlmp_event.c | 2 +- net/irda/irlmp_frame.c | 122 ++++++------- net/irda/irmod.c | 42 ++--- net/irda/irnet/irnet.h | 4 +- net/irda/irnet/irnet_irda.c | 38 ++-- net/irda/irnet/irnet_irda.h | 2 +- net/irda/irnet/irnet_ppp.c | 10 +- net/irda/irproc.c | 40 ++--- net/irda/irqueue.c | 106 ++++++------ net/irda/irsysctl.c | 24 +-- net/irda/irttp.c | 40 ++--- net/irda/parameters.c | 2 +- net/irda/qos.c | 150 ++++++++-------- net/irda/timer.c | 62 +++---- net/irda/wrapper.c | 2 +- 40 files changed, 1441 insertions(+), 1441 deletions(-) (limited to 'net/irda') diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 7e1aea89ef05..eabd6838f50a 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -138,7 +138,7 @@ static void irda_disconnect_indication(void *instance, void *sap, sk->sk_shutdown |= SEND_SHUTDOWN; sk->sk_state_change(sk); - sock_orphan(sk); + sock_orphan(sk); release_sock(sk); /* Close our TSAP. @@ -158,7 +158,7 @@ static void irda_disconnect_indication(void *instance, void *sap, irttp_close_tsap(self->tsap); self->tsap = NULL; } - } + } /* Note : once we are there, there is not much you want to do * with the socket anymore, apart from closing it. @@ -1211,7 +1211,7 @@ static int irda_release(struct socket *sock) IRDA_DEBUG(2, "%s()\n", __FUNCTION__); - if (sk == NULL) + if (sk == NULL) return 0; lock_sock(sk); @@ -1259,7 +1259,7 @@ static int irda_release(struct socket *sock) * memory leak is now gone... - Jean II */ - return 0; + return 0; } /* @@ -1312,7 +1312,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock, len = self->max_data_size; } - skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16, + skb = sock_alloc_send_skb(sk, len + self->max_header_size + 16, msg->msg_flags & MSG_DONTWAIT, &err); if (!skb) return -ENOBUFS; @@ -1714,7 +1714,7 @@ static int irda_shutdown(struct socket *sock, int how) self->daddr = DEV_ADDR_ANY; /* Until we get re-connected */ self->saddr = 0x0; /* so IrLMP assign us any link */ - return 0; + return 0; } /* diff --git a/net/irda/discovery.c b/net/irda/discovery.c index 89fd2a2cbca6..789478bc3009 100644 --- a/net/irda/discovery.c +++ b/net/irda/discovery.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: discovery.c * Version: 0.1 * Description: Routines for handling discoveries at the IrLMP layer @@ -10,24 +10,24 @@ * Modified by: Dag Brattli * Modified at: Fri May 28 3:11 CST 1999 * Modified by: Horst von Brand - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -65,9 +65,9 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new) spin_lock_irqsave(&cachelog->hb_spinlock, flags); - /* - * Remove all discoveries of devices that has previously been - * discovered on the same link with the same name (info), or the + /* + * Remove all discoveries of devices that has previously been + * discovered on the same link with the same name (info), or the * same daddr. We do this since some devices (mostly PDAs) change * their device address between every discovery. */ @@ -79,10 +79,10 @@ void irlmp_add_discovery(hashbin_t *cachelog, discovery_t *new) discovery = (discovery_t *) hashbin_get_next(cachelog); if ((node->data.saddr == new->data.saddr) && - ((node->data.daddr == new->data.daddr) || + ((node->data.daddr == new->data.daddr) || (strcmp(node->data.info, new->data.info) == 0))) { - /* This discovery is a previous discovery + /* This discovery is a previous discovery * from the same device, so just remove it */ hashbin_remove_this(cachelog, (irda_queue_t *) node); @@ -134,7 +134,7 @@ void irlmp_add_discovery_log(hashbin_t *cachelog, hashbin_t *log) discovery = (discovery_t *) hashbin_remove_first(log); } - + /* Delete the now empty log */ hashbin_delete(log, (FREE_FUNC) kfree); } @@ -232,7 +232,7 @@ void irlmp_dump_discoveries(hashbin_t *log) while (discovery != NULL) { IRDA_DEBUG(0, "Discovery:\n"); IRDA_DEBUG(0, " daddr=%08x\n", discovery->data.daddr); - IRDA_DEBUG(0, " saddr=%08x\n", discovery->data.saddr); + IRDA_DEBUG(0, " saddr=%08x\n", discovery->data.saddr); IRDA_DEBUG(0, " nickname=%s\n", discovery->data.info); discovery = (discovery_t *) hashbin_get_next(log); @@ -321,26 +321,26 @@ static inline discovery_t *discovery_seq_idx(loff_t pos) { discovery_t *discovery; - for (discovery = (discovery_t *) hashbin_get_first(irlmp->cachelog); + for (discovery = (discovery_t *) hashbin_get_first(irlmp->cachelog); discovery != NULL; discovery = (discovery_t *) hashbin_get_next(irlmp->cachelog)) { if (pos-- == 0) break; } - + return discovery; } static void *discovery_seq_start(struct seq_file *seq, loff_t *pos) { spin_lock_irq(&irlmp->cachelog->hb_spinlock); - return *pos ? discovery_seq_idx(*pos - 1) : SEQ_START_TOKEN; + return *pos ? discovery_seq_idx(*pos - 1) : SEQ_START_TOKEN; } static void *discovery_seq_next(struct seq_file *seq, void *v, loff_t *pos) { ++*pos; - return (v == SEQ_START_TOKEN) + return (v == SEQ_START_TOKEN) ? (void *) hashbin_get_first(irlmp->cachelog) : (void *) hashbin_get_next(irlmp->cachelog); } @@ -357,9 +357,9 @@ static int discovery_seq_show(struct seq_file *seq, void *v) else { const discovery_t *discovery = v; - seq_printf(seq, "nickname: %s, hint: 0x%02x%02x", + seq_printf(seq, "nickname: %s, hint: 0x%02x%02x", discovery->data.info, - discovery->data.hints[0], + discovery->data.hints[0], discovery->data.hints[1]); #if 0 if ( discovery->data.hints[0] & HINT_PNP) @@ -376,20 +376,20 @@ static int discovery_seq_show(struct seq_file *seq, void *v) seq_puts(seq, "Fax "); if ( discovery->data.hints[0] & HINT_LAN) seq_puts(seq, "LAN Access "); - + if ( discovery->data.hints[1] & HINT_TELEPHONY) seq_puts(seq, "Telephony "); if ( discovery->data.hints[1] & HINT_FILE_SERVER) - seq_puts(seq, "File Server "); + seq_puts(seq, "File Server "); if ( discovery->data.hints[1] & HINT_COMM) seq_puts(seq, "IrCOMM "); if ( discovery->data.hints[1] & HINT_OBEX) seq_puts(seq, "IrOBEX "); -#endif +#endif seq_printf(seq,", saddr: 0x%08x, daddr: 0x%08x\n\n", discovery->data.saddr, discovery->data.daddr); - + seq_putc(seq, '\n'); } return 0; diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index ad6b6af3dd97..c28ee7bce26a 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_core.c * Version: 1.0 * Description: IrCOMM service interface @@ -8,25 +8,25 @@ * Created at: Sun Jun 6 20:37:34 1999 * Modified at: Tue Dec 21 13:26:41 1999 * Modified by: Dag Brattli - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. * Copyright (c) 2000-2003 Jean Tourrilhes - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -49,7 +49,7 @@ #include static int __ircomm_close(struct ircomm_cb *self); -static void ircomm_control_indication(struct ircomm_cb *self, +static void ircomm_control_indication(struct ircomm_cb *self, struct sk_buff *skb, int clen); #ifdef CONFIG_PROC_FS @@ -69,22 +69,22 @@ hashbin_t *ircomm = NULL; static int __init ircomm_init(void) { - ircomm = hashbin_new(HB_LOCK); + ircomm = hashbin_new(HB_LOCK); if (ircomm == NULL) { IRDA_ERROR("%s(), can't allocate hashbin!\n", __FUNCTION__); return -ENOMEM; } - + #ifdef CONFIG_PROC_FS { struct proc_dir_entry *ent; ent = create_proc_entry("ircomm", 0, proc_irda); - if (ent) + if (ent) ent->proc_fops = &ircomm_proc_fops; } #endif /* CONFIG_PROC_FS */ - + IRDA_MESSAGE("IrCOMM protocol (Dag Brattli)\n"); - + return 0; } @@ -139,7 +139,7 @@ struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line) hashbin_insert(ircomm, (irda_queue_t *) self, line, NULL); - ircomm_next_state(self, IRCOMM_IDLE); + ircomm_next_state(self, IRCOMM_IDLE); return self; } @@ -195,8 +195,8 @@ int ircomm_close(struct ircomm_cb *self) entry = hashbin_remove(ircomm, self->line, NULL); IRDA_ASSERT(entry == self, return -1;); - - return __ircomm_close(self); + + return __ircomm_close(self); } EXPORT_SYMBOL(ircomm_close); @@ -206,9 +206,9 @@ EXPORT_SYMBOL(ircomm_close); * * Impl. of this function is differ from one of the reference. This * function does discovery as well as sending connect request - * + * */ -int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel, +int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel, __u32 saddr, __u32 daddr, struct sk_buff *skb, __u8 service_type) { @@ -243,20 +243,20 @@ void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb, struct ircomm_info *info) { int clen = 0; - + IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); /* Check if the packet contains data on the control channel */ if (skb->len > 0) clen = skb->data[0]; - - /* - * If there are any data hiding in the control channel, we must - * deliver it first. The side effect is that the control channel + + /* + * If there are any data hiding in the control channel, we must + * deliver it first. The side effect is that the control channel * will be removed from the skb */ if (self->notify.connect_indication) - self->notify.connect_indication(self->notify.instance, self, + self->notify.connect_indication(self->notify.instance, self, info->qos, info->max_data_size, info->max_header_size, skb); else { @@ -282,7 +282,7 @@ int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata) ret = ircomm_do_event(self, IRCOMM_CONNECT_RESPONSE, userdata, NULL); return ret; -} +} EXPORT_SYMBOL(ircomm_connect_response); @@ -299,7 +299,7 @@ void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb, if (self->notify.connect_confirm ) self->notify.connect_confirm(self->notify.instance, - self, info->qos, + self, info->qos, info->max_data_size, info->max_header_size, skb); else { @@ -322,7 +322,7 @@ int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb) IRDA_ASSERT(self != NULL, return -EFAULT;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;); IRDA_ASSERT(skb != NULL, return -EFAULT;); - + ret = ircomm_do_event(self, IRCOMM_DATA_REQUEST, skb, NULL); return ret; @@ -337,7 +337,7 @@ EXPORT_SYMBOL(ircomm_data_request); * */ void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb) -{ +{ IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); IRDA_ASSERT(skb->len > 0, return;); @@ -363,9 +363,9 @@ void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb) clen = skb->data[0]; - /* - * If there are any data hiding in the control channel, we must - * deliver it first. The side effect is that the control channel + /* + * If there are any data hiding in the control channel, we must + * deliver it first. The side effect is that the control channel * will be removed from the skb */ if (clen > 0) @@ -375,7 +375,7 @@ void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb) skb_pull(skb, clen+1); if (skb->len) - ircomm_data_indication(self, skb); + ircomm_data_indication(self, skb); else { IRDA_DEBUG(4, "%s(), data was control info only!\n", __FUNCTION__ ); @@ -391,13 +391,13 @@ void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb) int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb) { int ret; - + IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); IRDA_ASSERT(self != NULL, return -EFAULT;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -EFAULT;); IRDA_ASSERT(skb != NULL, return -EFAULT;); - + ret = ircomm_do_event(self, IRCOMM_CONTROL_REQUEST, skb, NULL); return ret; @@ -411,10 +411,10 @@ EXPORT_SYMBOL(ircomm_control_request); * Data has arrived on the control channel * */ -static void ircomm_control_indication(struct ircomm_cb *self, +static void ircomm_control_indication(struct ircomm_cb *self, struct sk_buff *skb, int clen) { - IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); + IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); /* Use udata for delivering data on the control channel */ if (self->notify.udata_indication) { @@ -427,8 +427,8 @@ static void ircomm_control_indication(struct ircomm_cb *self, /* Remove data channel from control channel */ skb_trim(ctrl_skb, clen+1); - - self->notify.udata_indication(self->notify.instance, self, + + self->notify.udata_indication(self->notify.instance, self, ctrl_skb); /* Drop reference count - @@ -455,7 +455,7 @@ int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata) IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -1;); - ret = ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, userdata, + ret = ircomm_do_event(self, IRCOMM_DISCONNECT_REQUEST, userdata, &info); return ret; } @@ -472,7 +472,7 @@ void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb, struct ircomm_info *info) { IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); - + IRDA_ASSERT(info != NULL, return;); if (self->notify.disconnect_indication) { @@ -486,7 +486,7 @@ void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb, /* * Function ircomm_flow_request (self, flow) * - * + * * */ void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow) @@ -517,7 +517,7 @@ static void *ircomm_seq_start(struct seq_file *seq, loff_t *pos) self = (struct ircomm_cb *) hashbin_get_next(ircomm)) { if (off++ == *pos) break; - + } return self; } @@ -535,7 +535,7 @@ static void ircomm_seq_stop(struct seq_file *seq, void *v) } static int ircomm_seq_show(struct seq_file *seq, void *v) -{ +{ const struct ircomm_cb *self = v; IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -EINVAL; ); @@ -548,7 +548,7 @@ static int ircomm_seq_show(struct seq_file *seq, void *v) seq_printf(seq, " state: %s, slsap_sel: %#02x, dlsap_sel: %#02x, mode:", ircomm_state[ self->state], - self->slsap_sel, self->dlsap_sel); + self->slsap_sel, self->dlsap_sel); if(self->service_type & IRCOMM_3_WIRE_RAW) seq_printf(seq, " 3-wire-raw"); diff --git a/net/irda/ircomm/ircomm_event.c b/net/irda/ircomm/ircomm_event.c index 01f4e801a1ba..23d0468794e2 100644 --- a/net/irda/ircomm/ircomm_event.c +++ b/net/irda/ircomm/ircomm_event.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_event.c * Version: 1.0 * Description: IrCOMM layer state machine @@ -8,24 +8,24 @@ * Created at: Sun Jun 6 20:33:11 1999 * Modified at: Sun Dec 12 13:44:32 1999 * Modified by: Dag Brattli - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -41,13 +41,13 @@ #include #include -static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info); -static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info); -static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info); -static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info); char *ircomm_state[] = { @@ -60,26 +60,26 @@ char *ircomm_state[] = { #ifdef CONFIG_IRDA_DEBUG static char *ircomm_event[] = { "IRCOMM_CONNECT_REQUEST", - "IRCOMM_CONNECT_RESPONSE", - "IRCOMM_TTP_CONNECT_INDICATION", + "IRCOMM_CONNECT_RESPONSE", + "IRCOMM_TTP_CONNECT_INDICATION", "IRCOMM_LMP_CONNECT_INDICATION", - "IRCOMM_TTP_CONNECT_CONFIRM", + "IRCOMM_TTP_CONNECT_CONFIRM", "IRCOMM_LMP_CONNECT_CONFIRM", - "IRCOMM_LMP_DISCONNECT_INDICATION", + "IRCOMM_LMP_DISCONNECT_INDICATION", "IRCOMM_TTP_DISCONNECT_INDICATION", - "IRCOMM_DISCONNECT_REQUEST", + "IRCOMM_DISCONNECT_REQUEST", - "IRCOMM_TTP_DATA_INDICATION", + "IRCOMM_TTP_DATA_INDICATION", "IRCOMM_LMP_DATA_INDICATION", - "IRCOMM_DATA_REQUEST", - "IRCOMM_CONTROL_REQUEST", - "IRCOMM_CONTROL_INDICATION", + "IRCOMM_DATA_REQUEST", + "IRCOMM_CONTROL_REQUEST", + "IRCOMM_CONTROL_INDICATION", }; #endif /* CONFIG_IRDA_DEBUG */ static int (*state[])(struct ircomm_cb *self, IRCOMM_EVENT event, - struct sk_buff *skb, struct ircomm_info *info) = + struct sk_buff *skb, struct ircomm_info *info) = { ircomm_state_idle, ircomm_state_waiti, @@ -93,14 +93,14 @@ static int (*state[])(struct ircomm_cb *self, IRCOMM_EVENT event, * IrCOMM is currently idle * */ -static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info) { int ret = 0; switch (event) { case IRCOMM_CONNECT_REQUEST: - ircomm_next_state(self, IRCOMM_WAITI); + ircomm_next_state(self, IRCOMM_WAITI); ret = self->issue.connect_request(self, skb, info); break; case IRCOMM_TTP_CONNECT_INDICATION: @@ -119,10 +119,10 @@ static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event, /* * Function ircomm_state_waiti (self, event, skb) * - * The IrCOMM user has requested an IrCOMM connection to the remote + * The IrCOMM user has requested an IrCOMM connection to the remote * device and is awaiting confirmation */ -static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info) { int ret = 0; @@ -152,8 +152,8 @@ static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event, * IrCOMM has received an incoming connection request and is awaiting * response from the user */ -static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, - struct sk_buff *skb, struct ircomm_info *info) +static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, + struct sk_buff *skb, struct ircomm_info *info) { int ret = 0; @@ -185,7 +185,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event, * IrCOMM is connected to the peer IrCOMM device * */ -static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, +static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, struct sk_buff *skb, struct ircomm_info *info) { int ret = 0; @@ -228,7 +228,7 @@ static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event, * */ int ircomm_do_event(struct ircomm_cb *self, IRCOMM_EVENT event, - struct sk_buff *skb, struct ircomm_info *info) + struct sk_buff *skb, struct ircomm_info *info) { IRDA_DEBUG(4, "%s: state=%s, event=%s\n", __FUNCTION__ , ircomm_state[self->state], ircomm_event[event]); @@ -245,7 +245,7 @@ int ircomm_do_event(struct ircomm_cb *self, IRCOMM_EVENT event, void ircomm_next_state(struct ircomm_cb *self, IRCOMM_STATE state) { self->state = state; - - IRDA_DEBUG(4, "%s: next state=%s, service type=%d\n", __FUNCTION__ , + + IRDA_DEBUG(4, "%s: next state=%s, service type=%d\n", __FUNCTION__ , ircomm_state[self->state], self->service_type); } diff --git a/net/irda/ircomm/ircomm_lmp.c b/net/irda/ircomm/ircomm_lmp.c index c8e0d89ee11f..22bd75299104 100644 --- a/net/irda/ircomm/ircomm_lmp.c +++ b/net/irda/ircomm/ircomm_lmp.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_lmp.c * Version: 1.0 * Description: Interface between IrCOMM and IrLMP @@ -9,25 +9,25 @@ * Modified at: Sun Dec 12 13:44:17 1999 * Modified by: Dag Brattli * Sources: Previous IrLPT work by Thomas Davis - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. * Copyright (c) 2000-2003 Jean Tourrilhes - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -45,11 +45,11 @@ /* * Function ircomm_lmp_connect_request (self, userdata) * - * + * * */ -static int ircomm_lmp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_lmp_connect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info) { int ret = 0; @@ -61,14 +61,14 @@ static int ircomm_lmp_connect_request(struct ircomm_cb *self, skb_get(userdata); ret = irlmp_connect_request(self->lsap, info->dlsap_sel, - info->saddr, info->daddr, NULL, userdata); + info->saddr, info->daddr, NULL, userdata); return ret; -} +} /* * Function ircomm_lmp_connect_response (self, skb) * - * + * * */ static int ircomm_lmp_connect_response(struct ircomm_cb *self, @@ -78,7 +78,7 @@ static int ircomm_lmp_connect_response(struct ircomm_cb *self, int ret; IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); - + /* Any userdata supplied? */ if (userdata == NULL) { tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC); @@ -88,8 +88,8 @@ static int ircomm_lmp_connect_response(struct ircomm_cb *self, /* Reserve space for MUX and LAP header */ skb_reserve(tx_skb, LMP_MAX_HEADER); } else { - /* - * Check that the client has reserved enough space for + /* + * Check that the client has reserved enough space for * headers */ IRDA_ASSERT(skb_headroom(userdata) >= LMP_MAX_HEADER, @@ -105,22 +105,22 @@ static int ircomm_lmp_connect_response(struct ircomm_cb *self, return 0; } -static int ircomm_lmp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_lmp_disconnect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info) { - struct sk_buff *tx_skb; + struct sk_buff *tx_skb; int ret; IRDA_DEBUG(0, "%s()\n", __FUNCTION__ ); - if (!userdata) { + if (!userdata) { tx_skb = alloc_skb(LMP_MAX_HEADER, GFP_ATOMIC); if (!tx_skb) return -ENOMEM; - + /* Reserve space for MUX and LAP header */ - skb_reserve(tx_skb, LMP_MAX_HEADER); + skb_reserve(tx_skb, LMP_MAX_HEADER); userdata = tx_skb; } else { /* Don't forget to refcount it - should be NULL anyway */ @@ -136,7 +136,7 @@ static int ircomm_lmp_disconnect_request(struct ircomm_cb *self, * Function ircomm_lmp_flow_control (skb) * * This function is called when a data frame we have sent to IrLAP has - * been deallocated. We do this to make sure we don't flood IrLAP with + * been deallocated. We do this to make sure we don't flood IrLAP with * frames, since we are not using the IrTTP flow control mechanism */ static void ircomm_lmp_flow_control(struct sk_buff *skb) @@ -150,29 +150,29 @@ static void ircomm_lmp_flow_control(struct sk_buff *skb) cb = (struct irda_skb_cb *) skb->cb; IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); - - line = cb->line; + + line = cb->line; self = (struct ircomm_cb *) hashbin_lock_find(ircomm, line, NULL); - if (!self) { + if (!self) { IRDA_DEBUG(2, "%s(), didn't find myself\n", __FUNCTION__ ); - return; + return; } - IRDA_ASSERT(self != NULL, return;); + IRDA_ASSERT(self != NULL, return;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return;); self->pkt_count--; - if ((self->pkt_count < 2) && (self->flow_status == FLOW_STOP)) { - IRDA_DEBUG(2, "%s(), asking TTY to start again!\n", __FUNCTION__ ); - self->flow_status = FLOW_START; - if (self->notify.flow_indication) - self->notify.flow_indication(self->notify.instance, + if ((self->pkt_count < 2) && (self->flow_status == FLOW_STOP)) { + IRDA_DEBUG(2, "%s(), asking TTY to start again!\n", __FUNCTION__ ); + self->flow_status = FLOW_START; + if (self->notify.flow_indication) + self->notify.flow_indication(self->notify.instance, self, FLOW_START); - } + } } - + /* * Function ircomm_lmp_data_request (self, userdata) * @@ -180,7 +180,7 @@ static void ircomm_lmp_flow_control(struct sk_buff *skb) * */ static int ircomm_lmp_data_request(struct ircomm_cb *self, - struct sk_buff *skb, + struct sk_buff *skb, int not_used) { struct irda_skb_cb *cb; @@ -189,8 +189,8 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, IRDA_ASSERT(skb != NULL, return -1;); cb = (struct irda_skb_cb *) skb->cb; - - cb->line = self->line; + + cb->line = self->line; IRDA_DEBUG(4, "%s(), sending frame\n", __FUNCTION__ ); @@ -199,13 +199,13 @@ static int ircomm_lmp_data_request(struct ircomm_cb *self, skb->destructor = ircomm_lmp_flow_control; - if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) { + if ((self->pkt_count++ > 7) && (self->flow_status == FLOW_START)) { IRDA_DEBUG(2, "%s(), asking TTY to slow down!\n", __FUNCTION__ ); - self->flow_status = FLOW_STOP; - if (self->notify.flow_indication) - self->notify.flow_indication(self->notify.instance, - self, FLOW_STOP); - } + self->flow_status = FLOW_STOP; + if (self->notify.flow_indication) + self->notify.flow_indication(self->notify.instance, + self, FLOW_STOP); + } ret = irlmp_data_request(self->lsap, skb); if (ret) { IRDA_ERROR("%s(), failed\n", __FUNCTION__); @@ -227,11 +227,11 @@ static int ircomm_lmp_data_indication(void *instance, void *sap, struct ircomm_cb *self = (struct ircomm_cb *) instance; IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); - + IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -1;); IRDA_ASSERT(skb != NULL, return -1;); - + ircomm_do_event(self, IRCOMM_LMP_DATA_INDICATION, skb, NULL); /* Drop reference count - see ircomm_tty_data_indication(). */ @@ -241,15 +241,15 @@ static int ircomm_lmp_data_indication(void *instance, void *sap, } /* - * Function ircomm_lmp_connect_confirm (instance, sap, qos, max_sdu_size, + * Function ircomm_lmp_connect_confirm (instance, sap, qos, max_sdu_size, * max_header_size, skb) * * Connection has been confirmed by peer device * */ static void ircomm_lmp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_seg_size, + struct qos_info *qos, + __u32 max_seg_size, __u8 max_header_size, struct sk_buff *skb) { @@ -312,7 +312,7 @@ static void ircomm_lmp_connect_indication(void *instance, void *sap, * Peer device has closed the connection, or the link went down for some * other reason */ -static void ircomm_lmp_disconnect_indication(void *instance, void *sap, +static void ircomm_lmp_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb) { diff --git a/net/irda/ircomm/ircomm_param.c b/net/irda/ircomm/ircomm_param.c index a39f5735a90b..fbac13e95b28 100644 --- a/net/irda/ircomm/ircomm_param.c +++ b/net/irda/ircomm/ircomm_param.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_param.c * Version: 1.0 * Description: Parameter handling for the IrCOMM protocol @@ -8,24 +8,24 @@ * Created at: Mon Jun 7 10:25:11 1999 * Modified at: Sun Jan 30 14:32:03 2000 * Modified by: Dag Brattli - * + * * Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved. - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -41,23 +41,23 @@ #include -static int ircomm_param_service_type(void *instance, irda_param_t *param, +static int ircomm_param_service_type(void *instance, irda_param_t *param, int get); -static int ircomm_param_port_type(void *instance, irda_param_t *param, +static int ircomm_param_port_type(void *instance, irda_param_t *param, int get); -static int ircomm_param_port_name(void *instance, irda_param_t *param, +static int ircomm_param_port_name(void *instance, irda_param_t *param, int get); -static int ircomm_param_service_type(void *instance, irda_param_t *param, +static int ircomm_param_service_type(void *instance, irda_param_t *param, int get); -static int ircomm_param_data_rate(void *instance, irda_param_t *param, +static int ircomm_param_data_rate(void *instance, irda_param_t *param, int get); -static int ircomm_param_data_format(void *instance, irda_param_t *param, +static int ircomm_param_data_format(void *instance, irda_param_t *param, int get); -static int ircomm_param_flow_control(void *instance, irda_param_t *param, +static int ircomm_param_flow_control(void *instance, irda_param_t *param, int get); static int ircomm_param_xon_xoff(void *instance, irda_param_t *param, int get); static int ircomm_param_enq_ack(void *instance, irda_param_t *param, int get); -static int ircomm_param_line_status(void *instance, irda_param_t *param, +static int ircomm_param_line_status(void *instance, irda_param_t *param, int get); static int ircomm_param_dte(void *instance, irda_param_t *param, int get); static int ircomm_param_dce(void *instance, irda_param_t *param, int get); @@ -85,7 +85,7 @@ static pi_minor_info_t pi_minor_call_table_9_wire[] = { static pi_major_info_t pi_major_call_table[] = { { pi_minor_call_table_common, 3 }, { pi_minor_call_table_non_raw, 6 }, - { pi_minor_call_table_9_wire, 3 } + { pi_minor_call_table_9_wire, 3 } /* { pi_minor_call_table_centronics } */ }; @@ -119,20 +119,20 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) spin_lock_irqsave(&self->spinlock, flags); - skb = self->ctrl_skb; + skb = self->ctrl_skb; if (!skb) { skb = alloc_skb(256, GFP_ATOMIC); if (!skb) { spin_unlock_irqrestore(&self->spinlock, flags); return -ENOMEM; } - + skb_reserve(skb, self->max_header_size); self->ctrl_skb = skb; } - /* + /* * Inserting is a little bit tricky since we don't know how much - * room we will need. But this should hopefully work OK + * room we will need. But this should hopefully work OK */ count = irda_param_insert(self, pi, skb->tail, skb_tailroom(skb), &ircomm_param_info); @@ -162,7 +162,7 @@ int ircomm_param_request(struct ircomm_tty_cb *self, __u8 pi, int flush) * query and then the remote device sends its initial parameters * */ -static int ircomm_param_service_type(void *instance, irda_param_t *param, +static int ircomm_param_service_type(void *instance, irda_param_t *param, int get) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; @@ -179,7 +179,7 @@ static int ircomm_param_service_type(void *instance, irda_param_t *param, /* Find all common service types */ service_type &= self->service_type; if (!service_type) { - IRDA_DEBUG(2, + IRDA_DEBUG(2, "%s(), No common service type to use!\n", __FUNCTION__ ); return -1; } @@ -198,12 +198,12 @@ static int ircomm_param_service_type(void *instance, irda_param_t *param, else if (service_type & IRCOMM_3_WIRE_RAW) self->settings.service_type = IRCOMM_3_WIRE_RAW; - IRDA_DEBUG(0, "%s(), resulting service type=0x%02x\n", __FUNCTION__ , + IRDA_DEBUG(0, "%s(), resulting service type=0x%02x\n", __FUNCTION__ , self->settings.service_type); - /* + /* * Now the line is ready for some communication. Check if we are a - * server, and send over some initial parameters. + * server, and send over some initial parameters. * Client do it in ircomm_tty_state_setup(). * Note : we may get called from ircomm_tty_getvalue_confirm(), * therefore before we even have open any socket. And self->client @@ -235,13 +235,13 @@ static int ircomm_param_port_type(void *instance, irda_param_t *param, int get) IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); - + if (get) param->pv.i = IRCOMM_SERIAL; else { self->settings.port_type = (__u8) param->pv.i; - IRDA_DEBUG(0, "%s(), port type=%d\n", __FUNCTION__ , + IRDA_DEBUG(0, "%s(), port type=%d\n", __FUNCTION__ , self->settings.port_type); } return 0; @@ -256,7 +256,7 @@ static int ircomm_param_port_type(void *instance, irda_param_t *param, int get) static int ircomm_param_port_name(void *instance, irda_param_t *param, int get) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; - + IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); @@ -279,7 +279,7 @@ static int ircomm_param_port_name(void *instance, irda_param_t *param, int get) static int ircomm_param_data_rate(void *instance, irda_param_t *param, int get) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; - + IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); @@ -287,7 +287,7 @@ static int ircomm_param_data_rate(void *instance, irda_param_t *param, int get) param->pv.i = self->settings.data_rate; else self->settings.data_rate = param->pv.i; - + IRDA_DEBUG(2, "%s(), data rate = %d\n", __FUNCTION__ , param->pv.i); return 0; @@ -299,7 +299,7 @@ static int ircomm_param_data_rate(void *instance, irda_param_t *param, int get) * Exchange data format to be used in this settings * */ -static int ircomm_param_data_format(void *instance, irda_param_t *param, +static int ircomm_param_data_format(void *instance, irda_param_t *param, int get) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; @@ -311,7 +311,7 @@ static int ircomm_param_data_format(void *instance, irda_param_t *param, param->pv.i = self->settings.data_format; else self->settings.data_format = (__u8) param->pv.i; - + return 0; } @@ -321,14 +321,14 @@ static int ircomm_param_data_format(void *instance, irda_param_t *param, * Exchange flow control settings to be used in this settings * */ -static int ircomm_param_flow_control(void *instance, irda_param_t *param, +static int ircomm_param_flow_control(void *instance, irda_param_t *param, int get) { struct ircomm_tty_cb *self = (struct ircomm_tty_cb *) instance; IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); - + if (get) param->pv.i = self->settings.flow_control; else @@ -351,7 +351,7 @@ static int ircomm_param_xon_xoff(void *instance, irda_param_t *param, int get) IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); - + if (get) { param->pv.i = self->settings.xonxoff[0]; param->pv.i |= self->settings.xonxoff[1] << 8; @@ -360,7 +360,7 @@ static int ircomm_param_xon_xoff(void *instance, irda_param_t *param, int get) self->settings.xonxoff[1] = (__u16) param->pv.i >> 8; } - IRDA_DEBUG(0, "%s(), XON/XOFF = 0x%02x,0x%02x\n", __FUNCTION__ , + IRDA_DEBUG(0, "%s(), XON/XOFF = 0x%02x,0x%02x\n", __FUNCTION__ , param->pv.i & 0xff, param->pv.i >> 8); return 0; @@ -378,7 +378,7 @@ static int ircomm_param_enq_ack(void *instance, irda_param_t *param, int get) IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_TTY_MAGIC, return -1;); - + if (get) { param->pv.i = self->settings.enqack[0]; param->pv.i |= self->settings.enqack[1] << 8; @@ -396,10 +396,10 @@ static int ircomm_param_enq_ack(void *instance, irda_param_t *param, int get) /* * Function ircomm_param_line_status (self, param) * - * + * * */ -static int ircomm_param_line_status(void *instance, irda_param_t *param, +static int ircomm_param_line_status(void *instance, irda_param_t *param, int get) { IRDA_DEBUG(2, "%s(), not impl.\n", __FUNCTION__ ); @@ -427,7 +427,7 @@ static int ircomm_param_dte(void *instance, irda_param_t *param, int get) dte = (__u8) param->pv.i; self->settings.dce = 0; - + if (dte & IRCOMM_DELTA_DTR) self->settings.dce |= (IRCOMM_DELTA_DSR| IRCOMM_DELTA_RI | @@ -436,7 +436,7 @@ static int ircomm_param_dte(void *instance, irda_param_t *param, int get) self->settings.dce |= (IRCOMM_DSR| IRCOMM_RI | IRCOMM_CD); - + if (dte & IRCOMM_DELTA_RTS) self->settings.dce |= IRCOMM_DELTA_CTS; if (dte & IRCOMM_RTS) @@ -455,7 +455,7 @@ static int ircomm_param_dte(void *instance, irda_param_t *param, int get) /* * Function ircomm_param_dce (instance, param) * - * + * * */ static int ircomm_param_dce(void *instance, irda_param_t *param, int get) diff --git a/net/irda/ircomm/ircomm_ttp.c b/net/irda/ircomm/ircomm_ttp.c index d98bf3570d29..bb06ebaadd16 100644 --- a/net/irda/ircomm/ircomm_ttp.c +++ b/net/irda/ircomm/ircomm_ttp.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_ttp.c * Version: 1.0 * Description: Interface between IrCOMM and IrTTP @@ -8,25 +8,25 @@ * Created at: Sun Jun 6 20:48:27 1999 * Modified at: Mon Dec 13 11:35:13 1999 * Modified by: Dag Brattli - * + * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. * Copyright (c) 2000-2003 Jean Tourrilhes - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -43,8 +43,8 @@ static int ircomm_ttp_data_indication(void *instance, void *sap, struct sk_buff *skb); static void ircomm_ttp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, + struct qos_info *qos, + __u32 max_sdu_size, __u8 max_header_size, struct sk_buff *skb); static void ircomm_ttp_connect_indication(void *instance, void *sap, @@ -54,25 +54,25 @@ static void ircomm_ttp_connect_indication(void *instance, void *sap, struct sk_buff *skb); static void ircomm_ttp_flow_indication(void *instance, void *sap, LOCAL_FLOW cmd); -static void ircomm_ttp_disconnect_indication(void *instance, void *sap, +static void ircomm_ttp_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb); static int ircomm_ttp_data_request(struct ircomm_cb *self, - struct sk_buff *skb, + struct sk_buff *skb, int clen); -static int ircomm_ttp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_ttp_connect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info); static int ircomm_ttp_connect_response(struct ircomm_cb *self, struct sk_buff *userdata); -static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info); /* * Function ircomm_open_tsap (self) * - * + * * */ int ircomm_open_tsap(struct ircomm_cb *self) @@ -113,11 +113,11 @@ int ircomm_open_tsap(struct ircomm_cb *self) /* * Function ircomm_ttp_connect_request (self, userdata) * - * + * * */ -static int ircomm_ttp_connect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_ttp_connect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info) { int ret = 0; @@ -129,16 +129,16 @@ static int ircomm_ttp_connect_request(struct ircomm_cb *self, skb_get(userdata); ret = irttp_connect_request(self->tsap, info->dlsap_sel, - info->saddr, info->daddr, NULL, - TTP_SAR_DISABLE, userdata); + info->saddr, info->daddr, NULL, + TTP_SAR_DISABLE, userdata); return ret; -} +} /* * Function ircomm_ttp_connect_response (self, skb) * - * + * * */ static int ircomm_ttp_connect_response(struct ircomm_cb *self, @@ -147,7 +147,7 @@ static int ircomm_ttp_connect_response(struct ircomm_cb *self, int ret; IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); - + /* Don't forget to refcount it - should be NULL anyway */ if(userdata) skb_get(userdata); @@ -160,14 +160,14 @@ static int ircomm_ttp_connect_response(struct ircomm_cb *self, /* * Function ircomm_ttp_data_request (self, userdata) * - * Send IrCOMM data to IrTTP layer. Currently we do not try to combine - * control data with pure data, so they will be sent as separate frames. + * Send IrCOMM data to IrTTP layer. Currently we do not try to combine + * control data with pure data, so they will be sent as separate frames. * Should not be a big problem though, since control frames are rare. But - * some of them are sent after connection establishment, so this can + * some of them are sent after connection establishment, so this can * increase the latency a bit. */ static int ircomm_ttp_data_request(struct ircomm_cb *self, - struct sk_buff *skb, + struct sk_buff *skb, int clen) { int ret; @@ -176,7 +176,7 @@ static int ircomm_ttp_data_request(struct ircomm_cb *self, IRDA_DEBUG(2, "%s(), clen=%d\n", __FUNCTION__ , clen); - /* + /* * Insert clen field, currently we either send data only, or control * only frames, to make things easier and avoid queueing */ @@ -210,7 +210,7 @@ static int ircomm_ttp_data_indication(void *instance, void *sap, struct ircomm_cb *self = (struct ircomm_cb *) instance; IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); - + IRDA_ASSERT(self != NULL, return -1;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return -1;); IRDA_ASSERT(skb != NULL, return -1;); @@ -224,8 +224,8 @@ static int ircomm_ttp_data_indication(void *instance, void *sap, } static void ircomm_ttp_connect_confirm(void *instance, void *sap, - struct qos_info *qos, - __u32 max_sdu_size, + struct qos_info *qos, + __u32 max_sdu_size, __u8 max_header_size, struct sk_buff *skb) { @@ -261,7 +261,7 @@ out: * Function ircomm_ttp_connect_indication (instance, sap, qos, max_sdu_size, * max_header_size, skb) * - * + * * */ static void ircomm_ttp_connect_indication(void *instance, void *sap, @@ -301,11 +301,11 @@ out: /* * Function ircomm_ttp_disconnect_request (self, userdata, info) * - * + * * */ -static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, - struct sk_buff *userdata, +static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, + struct sk_buff *userdata, struct ircomm_info *info) { int ret; @@ -322,10 +322,10 @@ static int ircomm_ttp_disconnect_request(struct ircomm_cb *self, /* * Function ircomm_ttp_disconnect_indication (instance, sap, reason, skb) * - * + * * */ -static void ircomm_ttp_disconnect_indication(void *instance, void *sap, +static void ircomm_ttp_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb) { @@ -361,7 +361,7 @@ static void ircomm_ttp_flow_indication(void *instance, void *sap, IRDA_ASSERT(self != NULL, return;); IRDA_ASSERT(self->magic == IRCOMM_MAGIC, return;); - + if (self->notify.flow_indication) self->notify.flow_indication(self->notify.instance, self, cmd); } diff --git a/net/irda/ircomm/ircomm_tty.c b/net/irda/ircomm/ircomm_tty.c index 262bda808d96..3d241e415a2a 100644 --- a/net/irda/ircomm/ircomm_tty.c +++ b/net/irda/ircomm/ircomm_tty.c @@ -1,5 +1,5 @@ /********************************************************************* - * + * * Filename: ircomm_tty.c * Version: 1.0 * Description: IrCOMM serial TTY driver @@ -9,25 +9,25 @@ * Modified at: Wed Feb 23 00:09:02 2000 * Modified by: Dag Brattli * Sources: serial.c and previous IrCOMM work by Takahide Higuchi - * + * * Copyright (c) 1999-2000 Dag Brattli, All Rights Reserved. * Copyright (c) 2000-2003 Jean Tourrilhes - * - * 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. - * + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA - * + * ********************************************************************/ #include @@ -69,7 +69,7 @@ static int ircomm_tty_data_indication(void *instance, void *sap, struct sk_buff *skb); static int ircomm_tty_control_indication(void *instance, void *sap, struct sk_buff *skb); -static void ircomm_tty_flow_indication(void *instance, void *sap, +static void ircomm_tty_flow_indication(void *instance, void *sap, LOCAL_FLOW cmd); #ifdef CONFIG_PROC_FS static int ircomm_tty_read_proc(char *buf, char **start, off_t offset, int len, @@ -113,7 +113,7 @@ static int __init ircomm_tty_init(void) driver = alloc_tty_driver(IRCOMM_TTY_PORTS); if (!driver) return -ENOMEM; - ircomm_tty = hashbin_new(HB_LOCK); + ircomm_tty = hashbin_new(HB_LOCK); if (ircomm_tty == NULL) { IRDA_ERROR("%s(), can't allocate hashbin!\n", __FUNCTION__); put_tty_driver(driver); @@ -163,11 +163,11 @@ static void __exit ircomm_tty_cleanup(void) { int ret; - IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); + IRDA_DEBUG(4, "%s()\n", __FUNCTION__ ); ret = tty_unregister_driver(driver); - if (ret) { - IRDA_ERROR("%s(), failed to unregister driver\n", + if (ret) { + IRDA_ERROR("%s(), failed to unregister driver\n", __FUNCTION__); return; } @@ -179,7 +179,7 @@ static void __exit ircomm_tty_cleanup(void) /* * Function ircomm_startup (self) * - * + * * */ static int ircomm_tty_startup(struct ircomm_tty_cb *self) @@ -203,17 +203,17 @@ static int ircomm_tty_startup(struct ircomm_tty_cb *self) /* These callbacks we must handle ourselves */ notify.data_indication = ircomm_tty_data_indication; notify.udata_indication = ircomm_tty_control_indication; - notify.flow_indication = ircomm_tty_flow_indication; + notify.flow_indication = ircomm_tty_flow_indication; /* Use the ircomm_tty interface for these ones */ - notify.disconnect_indication = ircomm_tty_disconnect_indication; + notify.disconnect_indication = ircomm_tty_disconnect_indication; notify.connect_confirm = ircomm_tty_connect_confirm; - notify.connect_indication = ircomm_tty_connect_indication; + notify.connect_indication = ircomm_tty_connect_indication; strlcpy(notify.name, "ircomm_tty", sizeof(notify.name)); notify.instance = self; if (!self->ircomm) { - self->ircomm = ircomm_open(¬ify, self->service_type, + self->ircomm = ircomm_open(¬ify, self->service_type, self->line); } if (!self->ircomm) @@ -237,10 +237,10 @@ err: /* * Function ircomm_block_til_ready (self, filp) * - * + * * */ -static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, +static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, struct file *filp) { DECLARE_WAITQUEUE(wait, current); @@ -248,7 +248,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, int do_clocal = 0, extra_count = 0; unsigned long flags; struct tty_struct *tty; - + IRDA_DEBUG(2, "%s()\n", __FUNCTION__ ); tty = self->tty; @@ -256,7 +256,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, /* * If non-blocking mode is set, or the port is not enabled, * then make the check up front and then exit. - */ + */ if (filp->f_flags & O_NONBLOCK || tty->flags & (1 << TTY_IO_ERROR)){ /* nonblock mode is set or port is not enabled */ self->flags |= ASYNC_NORMAL_ACTIVE; @@ -268,17 +268,17 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, IRDA_DEBUG(1, "%s(), doing CLOCAL!\n", __FUNCTION__ ); do_clocal = 1; } - + /* Wait for carrier detect and the line to become * free (i.e., not in use by the callout). While we are in * this loop, self->open_count is dropped by one, so that * mgsl_close() knows when to free things. We restore it upon * exit, either normal or abnormal. */ - + retval = 0; add_wait_queue(&self->open_wait, &wait); - + IRDA_DEBUG(2, "%s(%d):block_til_ready before block on %s open_count=%d\n", __FILE__,__LINE__, tty->driver->name, self->open_count ); @@ -290,7 +290,7 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, } spin_unlock_irqrestore(&self->spinlock, flags); self->blocked_open++; - + while (1) { if (tty->termios->c_cflag & CBAUD) { /* Here, we use to lock those two guys, but @@ -298,45 +298,45 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, * I don't see the point (and I see the deadlock). * Jean II */ self->settings.dte |= IRCOMM_RTS + IRCOMM_DTR; - + ircomm_param_request(self, IRCOMM_DTE, TRUE); } - + current->state = TASK_INTERRUPTIBLE; - + if (tty_hung_up_p(filp) || !test_bit(ASYNC_B_INITIALIZED, &self->flags)) { retval = (self->flags & ASYNC_HUP_NOTIFY) ? -EAGAIN : -ERESTARTSYS; break; } - - /* + + /* * Check if link is ready now. Even if CLOCAL is * specified, we cannot return before the IrCOMM link is - * ready + * ready */ - if (!test_bit(ASYNC_B_CLOSING, &self->flags) && - (do_clocal || (self->settings.dce & IRCOMM_CD)) && + if (!test_bit(ASYNC_B_CLOSING, &self->flags) && + (do_clocal || (self->settings.dce & IRCOMM_CD)) && self->state == IRCOMM_TTY_READY) { - break; + break; } - + if (signal_pending(current)) { retval = -ERESTARTSYS; break; } - + IRDA_DEBUG(1, "%s(%d):block_til_ready blocking on %s open_count=%d\n", __FILE__,__LINE__, tty->driver->name, self->open_count ); - + schedule(); } - + __set_current_state(TASK_RUNNING); remove_wait_queue(&self->open_wait, &wait); - + if (extra_count) { /* ++ is not atomic, so this should be protected - Jean II */ spin_lock_irqsave(&self->spinlock, flags); @@ -344,14 +344,14 @@ static int ircomm_tty_block_til_ready(struct ircomm_tty_cb *self, spin_unlock_irqrestore(&self->spinlock, flags); } self->blocked_open--; - + IRDA_DEBUG(1, "%s(%d):block_til_ready after blocking on %s open_count=%d\n", __FILE__,__LINE__, tty->driver->name, self->open_count); - + if (!retval) self->flags |= ASYNC_NORMAL_ACTIVE; - - return retval; + + return retval; } /* @@ -384,7 +384,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) IRDA_ERROR("%s(), kmalloc failed!\n", __FUNCTION__); return -ENOMEM; } - + self->magic = IRCOMM_TTY_MAGIC; self->flow = FLOW_STOP; @@ -398,13 +398,13 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) /* Init some important stuff */ init_timer(&self->watchdog_timer); init_waitqueue_head(&self->open_wait); - init_waitqueue_head(&self->close_wait); + init_waitqueue_head(&self->close_wait); spin_lock_init(&self->spinlock); - /* + /* * Force TTY into raw mode by default which is usually what * we want for IrCOMM and IrLPT. This way applications will - * not have to twiddle with printcap etc. + * not have to twiddle with printcap etc. */ tty->termios->c_iflag = 0; tty->termios->c_oflag = 0; @@ -420,7 +420,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) self->tty = tty; spin_unlock_irqrestore(&self->spinlock, flags); - IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver->name, + IRDA_DEBUG(1, "%s(), %s%d, count = %d\n", __FUNCTION__ , tty->driver->name, self->line, self->open_count); /* Not really used by us, but lets do it anyway */ @@ -473,7 +473,7 @@ static int ircomm_tty_open(struct tty_struct *tty, struct file *filp) ret = ircomm_tty_block_til_ready(self, filp); if (ret) { - IRDA_DEBUG(2, + IRDA_DEBUG(2, "%s(), returning after block_til_ready with %d\n", __FUNCTION__ , ret); @@ -519,7 +519,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) * serial port won't be shutdown. */ IRDA_DEBUG(0, "%s(), bad serial port count; " - "tty->count is 1, state->count is %d\n", __FUNCTION__ , + "tty->count is 1, state->count is %d\n", __FUNCTION__ , self->open_count); self->open_count = 1; } @@ -546,7 +546,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) spin_unlock_irqrestore(&self->spinlock, flags); /* - * Now we wait for the transmit buffer to clear; and we notify + * Now we wait for the transmit buffer to clear; and we notify * the line discipline to only process XON/XOFF characters. */ tty->closing = 1; @@ -576,7 +576,7 @@ static void ircomm_tty_close(struct tty_struct *tty, struct file *filp) /* * Function ircomm_tty_flush_buffer (tty) * - *