]> err.no Git - linux-2.6/blobdiff - net/irda/ircomm/ircomm_event.c
Merge branch 'merge'
[linux-2.6] / net / irda / ircomm / ircomm_event.c
index 01f4e801a1ba6b7ec1c485eebb2785b8571c336d..c35b3ef5c2f083778728b33e0657a946b0f05bfe 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************************
- *                
+ *
  * Filename:      ircomm_event.c
  * Version:       1.0
  * Description:   IrCOMM layer state machine
@@ -8,27 +8,26 @@
  * Created at:    Sun Jun  6 20:33:11 1999
  * Modified at:   Sun Dec 12 13:44:32 1999
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
- * 
+ *
  *     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 <linux/sched.h>
 #include <linux/proc_fs.h>
 #include <linux/init.h>
 
 #include <net/irda/ircomm_core.h>
 #include <net/irda/ircomm_event.h>
 
-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 +59,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 +92,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:
@@ -109,7 +108,7 @@ static int ircomm_state_idle(struct ircomm_cb *self, IRCOMM_EVENT event,
                ircomm_connect_indication(self, skb, info);
                break;
        default:
-               IRDA_DEBUG(4, "%s(), unknown event: %s\n", __FUNCTION__ ,
+               IRDA_DEBUG(4, "%s(), unknown event: %s\n", __func__ ,
                           ircomm_event[event]);
                ret = -EINVAL;
        }
@@ -119,10 +118,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;
@@ -139,7 +138,7 @@ static int ircomm_state_waiti(struct ircomm_cb *self, IRCOMM_EVENT event,
                ircomm_disconnect_indication(self, skb, info);
                break;
        default:
-               IRDA_DEBUG(0, "%s(), unknown event: %s\n", __FUNCTION__ ,
+               IRDA_DEBUG(0, "%s(), unknown event: %s\n", __func__ ,
                           ircomm_event[event]);
                ret = -EINVAL;
        }
@@ -152,8 +151,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;
 
@@ -172,7 +171,7 @@ static int ircomm_state_waitr(struct ircomm_cb *self, IRCOMM_EVENT event,
                ircomm_disconnect_indication(self, skb, info);
                break;
        default:
-               IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__ ,
+               IRDA_DEBUG(0, "%s(), unknown event = %s\n", __func__ ,
                           ircomm_event[event]);
                ret = -EINVAL;
        }
@@ -185,7 +184,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;
@@ -214,7 +213,7 @@ static int ircomm_state_conn(struct ircomm_cb *self, IRCOMM_EVENT event,
                ret = self->issue.disconnect_request(self, skb, info);
                break;
        default:
-               IRDA_DEBUG(0, "%s(), unknown event = %s\n", __FUNCTION__ ,
+               IRDA_DEBUG(0, "%s(), unknown event = %s\n", __func__ ,
                           ircomm_event[event]);
                ret = -EINVAL;
        }
@@ -228,9 +227,9 @@ 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__ ,
+       IRDA_DEBUG(4, "%s: state=%s, event=%s\n", __func__ ,
                   ircomm_state[self->state], ircomm_event[event]);
 
        return (*state[self->state])(self, event, skb, info);
@@ -245,7 +244,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", __func__ ,
                   ircomm_state[self->state], self->service_type);
 }