Linux Audio

Check our new training course

Loading...
v3.15
  1/*********************************************************************
  2 *                
  3 * Filename:      ircomm_core.h
  4 * Version:       
  5 * Description:   
  6 * Status:        Experimental.
  7 * Author:        Dag Brattli <dagb@cs.uit.no>
  8 * Created at:    Wed Jun  9 08:58:43 1999
  9 * Modified at:   Mon Dec 13 11:52:29 1999
 10 * Modified by:   Dag Brattli <dagb@cs.uit.no>
 11 * 
 12 *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
 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 
 17 *     the License, or (at your option) any later version.
 18 * 
 19 *     This program is distributed in the hope that it will be useful,
 20 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 21 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 22 *     GNU General Public License for more details.
 23 * 
 24 *     You should have received a copy of the GNU General Public License 
 25 *     along with this program; if not, see <http://www.gnu.org/licenses/>.
 
 
 26 *     
 27 ********************************************************************/
 28
 29#ifndef IRCOMM_CORE_H
 30#define IRCOMM_CORE_H
 31
 32#include <net/irda/irda.h>
 33#include <net/irda/irqueue.h>
 34#include <net/irda/ircomm_event.h>
 35
 36#define IRCOMM_MAGIC 0x98347298
 37#define IRCOMM_HEADER_SIZE 1
 38
 39struct ircomm_cb;   /* Forward decl. */
 40
 41/*
 42 * A small call-table, so we don't have to check the service-type whenever
 43 * we want to do something
 44 */
 45typedef struct {
 46	int (*data_request)(struct ircomm_cb *, struct sk_buff *, int clen);
 47	int (*connect_request)(struct ircomm_cb *, struct sk_buff *, 
 48			       struct ircomm_info *);
 49	int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
 50	int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *, 
 51				  struct ircomm_info *);	
 52} call_t;
 53
 54struct ircomm_cb {
 55	irda_queue_t queue;
 56	magic_t magic;
 57
 58	notify_t notify;
 59	call_t   issue;
 60
 61	int state;
 62	int line;            /* Which TTY line we are using */
 63
 64	struct tsap_cb *tsap;
 65	struct lsap_cb *lsap;
 66	
 67	__u8 dlsap_sel;      /* Destination LSAP/TSAP selector */
 68	__u8 slsap_sel;      /* Source LSAP/TSAP selector */
 69
 70	__u32 saddr;         /* Source device address (link we are using) */
 71	__u32 daddr;         /* Destination device address */
 72
 73	int max_header_size; /* Header space we must reserve for each frame */
 74	int max_data_size;   /* The amount of data we can fill in each frame */
 75
 76	LOCAL_FLOW flow_status; /* Used by ircomm_lmp */
 77	int pkt_count;          /* Number of frames we have sent to IrLAP */
 78
 79	__u8 service_type;
 80};
 81
 82extern hashbin_t *ircomm;
 83
 84struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line);
 85int ircomm_close(struct ircomm_cb *self);
 86
 87int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb);
 88void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb);
 89void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb);
 90int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb);
 91int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel, 
 92			   __u32 saddr, __u32 daddr, struct sk_buff *skb,
 93			   __u8 service_type);
 94void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,
 95			       struct ircomm_info *info);
 96void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,
 97			    struct ircomm_info *info);
 98int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata);
 99int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata);
100void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
101				  struct ircomm_info *info);
102void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow);
103
104#define ircomm_is_connected(self) (self->state == IRCOMM_CONN)
105
106#endif
v3.5.6
  1/*********************************************************************
  2 *                
  3 * Filename:      ircomm_core.h
  4 * Version:       
  5 * Description:   
  6 * Status:        Experimental.
  7 * Author:        Dag Brattli <dagb@cs.uit.no>
  8 * Created at:    Wed Jun  9 08:58:43 1999
  9 * Modified at:   Mon Dec 13 11:52:29 1999
 10 * Modified by:   Dag Brattli <dagb@cs.uit.no>
 11 * 
 12 *     Copyright (c) 1999 Dag Brattli, All Rights Reserved.
 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 
 17 *     the License, or (at your option) any later version.
 18 * 
 19 *     This program is distributed in the hope that it will be useful,
 20 *     but WITHOUT ANY WARRANTY; without even the implied warranty of
 21 *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 22 *     GNU General Public License for more details.
 23 * 
 24 *     You should have received a copy of the GNU General Public License 
 25 *     along with this program; if not, write to the Free Software 
 26 *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, 
 27 *     MA 02111-1307 USA
 28 *     
 29 ********************************************************************/
 30
 31#ifndef IRCOMM_CORE_H
 32#define IRCOMM_CORE_H
 33
 34#include <net/irda/irda.h>
 35#include <net/irda/irqueue.h>
 36#include <net/irda/ircomm_event.h>
 37
 38#define IRCOMM_MAGIC 0x98347298
 39#define IRCOMM_HEADER_SIZE 1
 40
 41struct ircomm_cb;   /* Forward decl. */
 42
 43/*
 44 * A small call-table, so we don't have to check the service-type whenever
 45 * we want to do something
 46 */
 47typedef struct {
 48	int (*data_request)(struct ircomm_cb *, struct sk_buff *, int clen);
 49	int (*connect_request)(struct ircomm_cb *, struct sk_buff *, 
 50			       struct ircomm_info *);
 51	int (*connect_response)(struct ircomm_cb *, struct sk_buff *);
 52	int (*disconnect_request)(struct ircomm_cb *, struct sk_buff *, 
 53				  struct ircomm_info *);	
 54} call_t;
 55
 56struct ircomm_cb {
 57	irda_queue_t queue;
 58	magic_t magic;
 59
 60	notify_t notify;
 61	call_t   issue;
 62
 63	int state;
 64	int line;            /* Which TTY line we are using */
 65
 66	struct tsap_cb *tsap;
 67	struct lsap_cb *lsap;
 68	
 69	__u8 dlsap_sel;      /* Destination LSAP/TSAP selector */
 70	__u8 slsap_sel;      /* Source LSAP/TSAP selector */
 71
 72	__u32 saddr;         /* Source device address (link we are using) */
 73	__u32 daddr;         /* Destination device address */
 74
 75	int max_header_size; /* Header space we must reserve for each frame */
 76	int max_data_size;   /* The amount of data we can fill in each frame */
 77
 78	LOCAL_FLOW flow_status; /* Used by ircomm_lmp */
 79	int pkt_count;          /* Number of frames we have sent to IrLAP */
 80
 81	__u8 service_type;
 82};
 83
 84extern hashbin_t *ircomm;
 85
 86struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line);
 87int ircomm_close(struct ircomm_cb *self);
 88
 89int ircomm_data_request(struct ircomm_cb *self, struct sk_buff *skb);
 90void ircomm_data_indication(struct ircomm_cb *self, struct sk_buff *skb);
 91void ircomm_process_data(struct ircomm_cb *self, struct sk_buff *skb);
 92int ircomm_control_request(struct ircomm_cb *self, struct sk_buff *skb);
 93int ircomm_connect_request(struct ircomm_cb *self, __u8 dlsap_sel, 
 94			   __u32 saddr, __u32 daddr, struct sk_buff *skb,
 95			   __u8 service_type);
 96void ircomm_connect_indication(struct ircomm_cb *self, struct sk_buff *skb,
 97			       struct ircomm_info *info);
 98void ircomm_connect_confirm(struct ircomm_cb *self, struct sk_buff *skb,
 99			    struct ircomm_info *info);
100int ircomm_connect_response(struct ircomm_cb *self, struct sk_buff *userdata);
101int ircomm_disconnect_request(struct ircomm_cb *self, struct sk_buff *userdata);
102void ircomm_disconnect_indication(struct ircomm_cb *self, struct sk_buff *skb,
103				  struct ircomm_info *info);
104void ircomm_flow_request(struct ircomm_cb *self, LOCAL_FLOW flow);
105
106#define ircomm_is_connected(self) (self->state == IRCOMM_CONN)
107
108#endif