32 #include <linux/module.h>
36 #include <linux/slab.h>
51 static int __ircomm_close(
struct ircomm_cb *
self);
52 static void ircomm_control_indication(
struct ircomm_cb *
self,
57 static int ircomm_seq_open(
struct inode *,
struct file *);
61 .open = ircomm_seq_open,
70 static int __init ircomm_init(
void)
74 IRDA_ERROR(
"%s(), can't allocate hashbin!\n", __func__);
80 ent = proc_create(
"ircomm", 0, proc_irda, &ircomm_proc_fops);
93 static void __exit ircomm_cleanup(
void)
115 IRDA_DEBUG(2,
"%s(), service_type=0x%02x\n", __func__ ,
157 static int __ircomm_close(
struct ircomm_cb *
self)
201 return __ircomm_close(
self);
225 self->service_type= service_type;
254 if (self->notify.connect_indication)
255 self->notify.connect_indication(self->notify.instance,
self,
259 IRDA_DEBUG(0,
"%s(), missing handler\n", __func__ );
296 if (self->notify.connect_confirm )
297 self->notify.connect_confirm(self->notify.instance,
302 IRDA_DEBUG(0,
"%s(), missing handler\n", __func__ );
341 if (self->notify.data_indication)
342 self->notify.data_indication(self->notify.instance,
self, skb);
344 IRDA_DEBUG(0,
"%s(), missing handler\n", __func__ );
369 IRDA_DEBUG(2,
"%s() throwing away illegal frame\n",
380 ircomm_control_indication(
self, skb, clen);
388 IRDA_DEBUG(4,
"%s(), data was control info only!\n",
422 static void ircomm_control_indication(
struct ircomm_cb *
self,
428 if (self->notify.udata_indication) {
439 self->notify.udata_indication(self->notify.instance,
self,
444 dev_kfree_skb(ctrl_skb);
446 IRDA_DEBUG(0,
"%s(), missing handler\n", __func__ );
486 if (self->notify.disconnect_indication) {
487 self->notify.disconnect_indication(self->notify.instance,
self,
490 IRDA_DEBUG(0,
"%s(), missing handler\n", __func__ );
515 #ifdef CONFIG_PROC_FS
516 static void *ircomm_seq_start(
struct seq_file *seq, loff_t *
pos)
533 static void *ircomm_seq_next(
struct seq_file *seq,
void *
v, loff_t *pos)
540 static void ircomm_seq_stop(
struct seq_file *seq,
void *v)
545 static int ircomm_seq_show(
struct seq_file *seq,
void *v)
551 if(self->line < 0x10)
554 seq_printf(seq,
"irlpt%d", self->line - 0x10);
557 " state: %s, slsap_sel: %#02x, dlsap_sel: %#02x, mode:",
559 self->slsap_sel, self->dlsap_sel);
575 .
start = ircomm_seq_start,
576 .next = ircomm_seq_next,
577 .stop = ircomm_seq_stop,
578 .show = ircomm_seq_show,
583 return seq_open(file, &ircomm_seq_ops);