Petr Olivka wrote :
> thanks for explaining. It seem to be time to change phone...is new year...
> (or may I easy hack kernel to work with 6110? hm, obscure, I know.)
>
> And I have still problem to use desktop with 2.4.x as irda lpt server. If
> I print from notebook or from ipaq, then I do not obtain result.
> I am using "cat /dev/irlpt0" on desktop, but from notebook do not obtain
> anything.
>
> but my simple test work fine:
> on ipaq "echo blabla > /dev/ircomm0"
> on desktop "cat /dev/ircomm0" and obtain 'blabla'
>
> but over irlpt0 do not work.
>
> thanks and happy N.Y.
> poli
You are right, there was a bug in irlpt. With the patch
attached, the simple test now works on top of irlpt. As the patch is
obviously correct, I'll push that in the kernel. I've also added
something meaningfull in /proc/net/irda/ircomm ;-)
Also, I realised that my Tutorial is wrong with respect to
irlpt device number. I'll fix that.
Jean
diff -u -p -r linux/net/irda/ircomm-d8/ircomm_core.c
linux/net/irda/ircomm/ircomm_core.c
--- linux/net/irda/ircomm-d8/ircomm_core.c Sun Sep 30 12:26:09 2001
+++ linux/net/irda/ircomm/ircomm_core.c Tue Jan 8 14:00:55 2002
@@ -490,18 +490,34 @@ int ircomm_proc_read(char *buf, char **s
{
struct ircomm_cb *self;
unsigned long flags;
- int i=0;
save_flags(flags);
cli();
len = 0;
- len += sprintf(buf+len, "Instance %d:\n", i++);
-
self = (struct ircomm_cb *) hashbin_get_first(ircomm);
while (self != NULL) {
ASSERT(self->magic == IRCOMM_MAGIC, return len;);
+
+ if(self->line < 0x10)
+ len += sprintf(buf+len, "ircomm%d", self->line);
+ else
+ len += sprintf(buf+len, "irlpt%d", self->line - 0x10);
+ len += sprintf(buf+len, " state: %s, ",
+ ircomm_state[ self->state]);
+ len += sprintf(buf+len,
+ "slsap_sel: %#02x, dlsap_sel: %#02x, mode:",
+ self->slsap_sel, self->dlsap_sel);
+ if(self->service_type & IRCOMM_3_WIRE_RAW)
+ len += sprintf(buf+len, " 3-wire-raw");
+ if(self->service_type & IRCOMM_3_WIRE)
+ len += sprintf(buf+len, " 3-wire");
+ if(self->service_type & IRCOMM_9_WIRE)
+ len += sprintf(buf+len, " 9-wire");
+ if(self->service_type & IRCOMM_CENTRONICS)
+ len += sprintf(buf+len, " Centronics");
+ len += sprintf(buf+len, "\n");
self = (struct ircomm_cb *) hashbin_get_next(ircomm);
}
diff -u -p -r linux/net/irda/ircomm-d8/ircomm_lmp.c linux/net/irda/ircomm/ircomm_lmp.c
--- linux/net/irda/ircomm-d8/ircomm_lmp.c Fri Mar 2 11:12:12 2001
+++ linux/net/irda/ircomm/ircomm_lmp.c Tue Jan 8 14:10:27 2002
@@ -103,12 +103,30 @@ int ircomm_lmp_connect_request(struct ir
*
*
*/
-int ircomm_lmp_connect_response(struct ircomm_cb *self, struct sk_buff *skb)
+int ircomm_lmp_connect_response(struct ircomm_cb *self, struct sk_buff *userdata)
{
+ struct sk_buff *skb;
int ret;
IRDA_DEBUG(0, __FUNCTION__"()\n");
+ /* Any userdata supplied? */
+ if (userdata == NULL) {
+ skb = dev_alloc_skb(64);
+ if (!skb)
+ return -ENOMEM;
+
+ /* Reserve space for MUX and LAP header */
+ skb_reserve(skb, LMP_MAX_HEADER);
+ } else {
+ skb = userdata;
+ /*
+ * Check that the client has reserved enough space for
+ * headers
+ */
+ ASSERT(skb_headroom(skb) >= LMP_MAX_HEADER, return -1;);
+ }
+
ret = irlmp_connect_response(self->lsap, skb);
return 0;