Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /********************************************************************* |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 2 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 3 | * Filename: irlan_event.c |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 4 | * Version: |
| 5 | * Description: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | * Status: Experimental. |
| 7 | * Author: Dag Brattli <dagb@cs.uit.no> |
| 8 | * Created at: Tue Oct 20 09:10:16 1998 |
| 9 | * Modified at: Sat Oct 30 12:59:01 1999 |
| 10 | * Modified by: Dag Brattli <dagb@cs.uit.no> |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 11 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 12 | * Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved. |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 13 | * |
| 14 | * This program is free software; you can redistribute it and/or |
| 15 | * modify it under the terms of the GNU General Public License as |
| 16 | * published by the Free Software Foundation; either version 2 of |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | * the License, or (at your option) any later version. |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 18 | * |
Jan Engelhardt | 96de0e2 | 2007-10-19 23:21:04 +0200 | [diff] [blame] | 19 | * Neither Dag Brattli nor University of Tromsø admit liability nor |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 20 | * provide warranty for any of this software. This material is |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 21 | * provided "AS-IS" and at no charge. |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 22 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 23 | ********************************************************************/ |
| 24 | |
| 25 | #include <net/irda/irlan_event.h> |
| 26 | |
Joe Perches | 55b1804 | 2010-09-13 18:24:01 +0000 | [diff] [blame] | 27 | const char * const irlan_state[] = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 28 | "IRLAN_IDLE", |
| 29 | "IRLAN_QUERY", |
| 30 | "IRLAN_CONN", |
| 31 | "IRLAN_INFO", |
| 32 | "IRLAN_MEDIA", |
| 33 | "IRLAN_OPEN", |
| 34 | "IRLAN_WAIT", |
| 35 | "IRLAN_ARB", |
| 36 | "IRLAN_DATA", |
| 37 | "IRLAN_CLOSE", |
| 38 | "IRLAN_SYNC", |
| 39 | }; |
| 40 | |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 41 | void irlan_next_client_state(struct irlan_cb *self, IRLAN_STATE state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 42 | { |
Joe Perches | 955a9d20 | 2014-11-11 14:44:57 -0800 | [diff] [blame] | 43 | pr_debug("%s(), %s\n", __func__ , irlan_state[state]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | |
| 45 | IRDA_ASSERT(self != NULL, return;); |
| 46 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
| 47 | |
| 48 | self->client.state = state; |
| 49 | } |
| 50 | |
YOSHIFUJI Hideaki | 6819bc2 | 2007-02-09 23:24:53 +0900 | [diff] [blame] | 51 | void irlan_next_provider_state(struct irlan_cb *self, IRLAN_STATE state) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 52 | { |
Joe Perches | 955a9d20 | 2014-11-11 14:44:57 -0800 | [diff] [blame] | 53 | pr_debug("%s(), %s\n", __func__ , irlan_state[state]); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 54 | |
| 55 | IRDA_ASSERT(self != NULL, return;); |
| 56 | IRDA_ASSERT(self->magic == IRLAN_MAGIC, return;); |
| 57 | |
| 58 | self->provider.state = state; |
| 59 | } |
| 60 | |