Hello
the following patch, when applied on top of the irnet patches from
http://www.hpl.hp.com/personal/Jean_Tourrilhes/IrDA/IrNET.html
on top of 2.4.0-test4 allow the "irport" driver to work for me.
The patch is really more-or-less a port of Dag's 2.2.15 patch.
Just in case anyone else is trying to use the irport driver. I am not
exactly sure which part of the patch is the important part; my knowledge
of irda internals is still a bit limited.
To apply, cd to /usr/src/linux and do a
patch -p2 < irda-irport-vmw-1.patch
I have attached the patch; it can also be obtained from
http://www.glue.umd.edu/~weave/patches/irda-irport-vmw-1.patch
Vince
____________
\ /\ /\ / Vince Weaver
\/__\/__\/ [EMAIL PROTECTED] http://www.glue.umd.edu/~weave
diff -u -r ./linux-irda/drivers/net/irda/irport.c
./linux-2.4.0/drivers/net/irda/irport.c
--- ./linux-irda/drivers/net/irda/irport.c Tue Mar 21 14:17:28 2000
+++ ./linux-2.4.0/drivers/net/irda/irport.c Fri Jul 21 17:02:22 2000
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Sun Aug 3 13:49:59 1997
- * Modified at: Fri Jan 28 20:22:38 2000
+ * Modified at: Tue Apr 25 20:22:38 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
* Sources: serial.c by Linus Torvalds
*
@@ -230,7 +230,7 @@
dev->init = irport_net_init;
dev->hard_start_xmit = irport_hard_xmit;
dev->tx_timeout = irport_timeout;
- dev->watchdog_timeo = HZ/20;
+// dev->watchdog_timeo = HZ/20;
dev->open = irport_net_open;
dev->stop = irport_net_close;
dev->get_stats = irport_net_get_stats;
@@ -775,7 +775,7 @@
irport_start(self);
-
+netif_start_queue(dev);
/*
* Open new IrLAP layer instance, now that everything should be
* initialized properly
@@ -785,7 +785,7 @@
/* FIXME: change speed of dongle */
/* Ready to play! */
- netif_start_queue(dev);
+// netif_start_queue(dev);
MOD_INC_USE_COUNT;
diff -u -r ./linux-irda/include/net/irda/irlan_common.h
./linux-2.4.0/include/net/irda/irlan_common.h
--- ./linux-irda/include/net/irda/irlan_common.h Tue Jul 11 14:12:24 2000
+++ ./linux-2.4.0/include/net/irda/irlan_common.h Fri Jul 21 16:58:54 2000
@@ -169,15 +169,13 @@
__u32 saddr; /* Source device address */
__u32 daddr; /* Destination device address */
- int netdev_registered;
- int notify_irmanager;
+ int disconnect_reason;
int media; /* Media type */
__u8 version[2]; /* IrLAN version */
struct tsap_cb *tsap_data;
- int master; /* Master instance? */
int use_udata; /* Use Unit Data transfers */
__u8 stsap_sel_data; /* Source data TSAP selector */
@@ -193,7 +191,7 @@
struct timer_list watchdog_timer;
};
-struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr, int netdev);
+struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr);
void irlan_close(struct irlan_cb *self);
void irlan_close_tsaps(struct irlan_cb *self);
void irlan_mod_inc_use_count(void);
@@ -201,7 +199,6 @@
int irlan_register_netdev(struct irlan_cb *self);
void irlan_ias_register(struct irlan_cb *self, __u8 tsap_sel);
-void irlan_start_watchdog_timer(struct irlan_cb *self, int timeout);
void irlan_open_data_tsap(struct irlan_cb *self);
diff -u -r ./linux-irda/net/irda/irlan/irlan_client.c
./linux-2.4.0/net/irda/irlan/irlan_client.c
--- ./linux-irda/net/irda/irlan/irlan_client.c Fri Jul 21 18:00:57 2000
+++ ./linux-2.4.0/net/irda/irlan/irlan_client.c Fri Jul 21 15:56:58 2000
@@ -6,13 +6,13 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Tue Dec 14 15:47:02 1999
+ * Modified at: Fri Apr 21 14:57:47 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
* Sources: skeleton.c by Donald Becker <[EMAIL PROTECTED]>
* slip.c by Laurence Culhane, <[EMAIL PROTECTED]>
* Fred N. van Kempen, <[EMAIL PROTECTED]>
*
- * Copyright (c) 1998-1999 Dag Brattli <[EMAIL PROTECTED]>,
+ * Copyright (c) 1998-2000 Dag Brattli <[EMAIL PROTECTED]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -99,12 +99,12 @@
/*
* Function irlan_client_wakeup (self, saddr, daddr)
*
- * Wake up client
+ * Wake up client. This function is called when a remote IrLAN device
+ * is discovered, or ..
*
*/
void irlan_client_wakeup(struct irlan_cb *self, __u32 saddr, __u32 daddr)
{
- struct irmanager_event mgr_event;
IRDA_DEBUG(1, __FUNCTION__ "()\n");
@@ -119,40 +119,21 @@
(self->provider.access_type == ACCESS_DIRECT))
return;
- /* saddr may have changed! */
+ /* Addresses may have changed! */
self->saddr = saddr;
-
- /* Before we try to connect, we check if network device is up. If it
- * is up, that means that the "user" really wants to connect. If not
- * we notify the user about the possibility of an IrLAN connection
- */
- if (netif_running(&self->dev)) {
- /* Open TSAPs */
- irlan_client_open_ctrl_tsap(self);
- irlan_open_data_tsap(self);
-
- irlan_do_client_event(self, IRLAN_DISCOVERY_INDICATION, NULL);
- } else if (self->notify_irmanager) {
- /*
- * Tell irmanager that the device can now be
- * configured but only if the device was not taken
- * down by the user
- */
- mgr_event.event = EVENT_IRLAN_START;
- strcpy(mgr_event.devname, self->dev.name);
- irmanager_notify(&mgr_event);
-
- /*
- * We set this so that we only notify once, since if
- * configuration of the network device fails, the user
- * will have to sort it out first anyway. No need to
- * try again.
- */
- self->notify_irmanager = FALSE;
+ self->daddr = daddr;
+
+ if (self->disconnect_reason== LM_USER_REQUEST) {
+ return;
}
- /* Restart watchdog timer */
- irlan_start_watchdog_timer(self, IRLAN_TIMEOUT);
-
+
+ /* Open TSAPs */
+
+ irlan_client_open_ctrl_tsap(self);
+ irlan_open_data_tsap(self);
+
+ irlan_do_client_event(self, IRLAN_DISCOVERY_INDICATION, NULL);
+
/* Start kick timer */
irlan_client_start_kick_timer(self, 2*HZ);
}
@@ -176,10 +157,8 @@
saddr = discovery->saddr;
daddr = discovery->daddr;
- /*
- * Check if we already dealing with this provider.
- */
- self = (struct irlan_cb *) hashbin_find(irlan, daddr, NULL);
+ /* Find instance */
+ self = (struct irlan_cb *) hashbin_get_first(irlan);
if (self) {
ASSERT(self->magic == IRLAN_MAGIC, return;);
@@ -188,17 +167,8 @@
irlan_client_wakeup(self, saddr, daddr);
- return;
}
-
- /*
- * We have no instance for daddr, so start a new one
- */
- IRDA_DEBUG(1, __FUNCTION__ "(), starting new instance!\n");
- self = irlan_open(saddr, daddr, TRUE);
- /* Restart watchdog timer */
- irlan_start_watchdog_timer(self, IRLAN_TIMEOUT);
}
/*
diff -u -r ./linux-irda/net/irda/irlan/irlan_common.c
./linux-2.4.0/net/irda/irlan/irlan_common.c
--- ./linux-irda/net/irda/irlan/irlan_common.c Fri Jul 21 18:00:57 2000
+++ ./linux-2.4.0/net/irda/irlan/irlan_common.c Fri Jul 21 17:24:49 2000
@@ -6,10 +6,10 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Sun Dec 26 21:53:10 1999
+ * Modified at: Fri Apr 21 14:55:31 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
*
- * Copyright (c) 1997, 1999 Dag Brattli <[EMAIL PROTECTED]>,
+ * Copyright (c) 1997, 1999-2000 Dag Brattli <[EMAIL PROTECTED]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -50,6 +50,14 @@
#include <net/irda/irlan_eth.h>
#include <net/irda/irlan_filter.h>
+/*
+ * Send gratuitous ARP when connected to a new AP or not. May be a clever
+ * thing to do, but for some reason the machine crashes if you use DHCP. So
+ * lets not use it by default.
+ */
+
+#undef CONFIG_IRLAN_SEND_GRATUITOUS_ARP
+
/* extern char sysctl_devname[]; */
/*
@@ -102,59 +110,6 @@
#endif /* CONFIG_PROC_FS */
/*
- * Function irlan_watchdog_timer_expired (data)
- *
- * Something has gone wrong during the connection establishment
- *
- */
-void irlan_watchdog_timer_expired(void *data)
-{
- struct irmanager_event mgr_event;
- struct irlan_cb *self;
-
- IRDA_DEBUG(0, __FUNCTION__ "()\n");
-
- self = (struct irlan_cb *) data;
-
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IRLAN_MAGIC, return;);
-
- /* Check if device still configured */
- if (netif_running(&self->dev)) {
- IRDA_DEBUG(0, __FUNCTION__
- "(), notifying irmanager to stop irlan!\n");
- mgr_event.event = EVENT_IRLAN_STOP;
- sprintf(mgr_event.devname, "%s", self->dev.name);
- irmanager_notify(&mgr_event);
-
- /*
- * We set this to false, so that irlan_dev_close known that
- * notify_irmanager should actually be set to TRUE again
- * instead of FALSE, since this close has not been initiated
- * by the user.
- */
- self->notify_irmanager = FALSE;
- } else {
- IRDA_DEBUG(0, __FUNCTION__ "(), closing instance!\n");
- /*irlan_close(self);*/
- }
-}
-
-/*
- * Function irlan_start_watchdog_timer (self, timeout)
- *
- *
- *
- */
-void irlan_start_watchdog_timer(struct irlan_cb *self, int timeout)
-{
- IRDA_DEBUG(4, __FUNCTION__ "()\n");
-
- irda_start_timer(&self->watchdog_timer, timeout, (void *) self,
- irlan_watchdog_timer_expired);
-}
-
-/*
* Function irlan_init (void)
*
* Initialize IrLAN layer
@@ -188,12 +143,11 @@
/* Register with IrLMP as a service */
skey = irlmp_register_service(hints);
- /* Start the master IrLAN instance */
- new = irlan_open(DEV_ADDR_ANY, DEV_ADDR_ANY, FALSE);
+ /* Start the master IrLAN instance (the only one for now) */
+ new = irlan_open(DEV_ADDR_ANY, DEV_ADDR_ANY);
/* The master will only open its (listen) control TSAP */
irlan_provider_open_ctrl_tsap(new);
- new->master = TRUE;
/* Do some fast discovery! */
irlmp_discovery_request(DISCOVERY_DEFAULT_SLOTS);
@@ -242,7 +196,6 @@
IRDA_DEBUG(2, __FUNCTION__ "(), register_netdev() failed!\n");
return -1;
}
- self->netdev_registered = TRUE;
return 0;
}
@@ -253,7 +206,7 @@
* Open new instance of a client/provider, we should only register the
* network device if this instance is ment for a particular client/provider
*/
-struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr, int netdev)
+struct irlan_cb *irlan_open(__u32 saddr, __u32 daddr)
{
struct irlan_cb *self;
@@ -288,8 +241,6 @@
self->provider.access_type = access;
self->media = MEDIA_802_3;
- self->notify_irmanager = TRUE;
-
init_timer(&self->watchdog_timer);
init_timer(&self->client.kick_timer);
@@ -300,14 +251,12 @@
irlan_next_client_state(self, IRLAN_IDLE);
irlan_next_provider_state(self, IRLAN_IDLE);
- /* Register network device now, or wait until some later time? */
- if (netdev)
- irlan_register_netdev(self);
+ irlan_register_netdev(self);
return self;
}
/*
- * Function irlan_close (self)
+ * Function __irlan_close (self)
*
* This function closes and deallocates the IrLAN client instances. Be
* aware that other functions which calles client_close() must call
@@ -332,50 +281,9 @@
if (self->client.iriap)
iriap_close(self->client.iriap);
- /* Remove frames queued on the control channel */
- while ((skb = skb_dequeue(&self->client.txq))) {
- dev_kfree_skb(skb);
- }
-
- if (self->netdev_registered) {
- unregister_netdev(&self->dev);
- self->netdev_registered = FALSE;
- }
-
- self->magic = 0;
- kfree(self);
-}
-
-/*
- * Function irlan_close (self)
- *
- * Close instance
- *
- */
-void irlan_close(struct irlan_cb *self)
-{
- struct irlan_cb *entry;
-
- IRDA_DEBUG(0, __FUNCTION__ "()\n");
-
- ASSERT(self != NULL, return;);
- ASSERT(self->magic == IRLAN_MAGIC, return;);
-
- /* Check if device is still configured */
- if (netif_running(&self->dev)) {
- IRDA_DEBUG(0, __FUNCTION__
- "(), Device still configured, closing later!\n");
-
- /* Give it a chance to reconnect */
- irlan_start_watchdog_timer(self, IRLAN_TIMEOUT);
- return;
- }
- IRDA_DEBUG(2, __FUNCTION__ "(), daddr=%08x\n", self->daddr);
- entry = hashbin_remove(irlan, self->daddr, NULL);
-
- ASSERT(entry == self, return;);
-
- __irlan_close(self);
+ unregister_netdev(&self->dev);
+ self->magic=0;
+ kfree(self);
}
/*
@@ -420,6 +328,7 @@
}
/* Ready to transfer Ethernet frames (at last) */
netif_start_queue(&self->dev);
+ self->disconnect_reason = 0; /* Clear reason */
}
void irlan_connect_confirm(void *instance, void *sap, struct qos_info *qos,
@@ -453,8 +362,12 @@
irlan_set_multicast_filter(self, TRUE);
/* Ready to transfer Ethernet frames */
- netif_start_queue(&self->dev);
+ netif_start_queue(&self->dev);
+ self->disconnect_reason = 0; /* Clear reason */
+
+#ifdef CONFIG_IRLAN_SEND_GRATUITOUS_ARP
irlan_eth_send_gratuitous_arp(&self->dev);
+#endif
}
/*
@@ -483,23 +396,27 @@
IRDA_DEBUG(2, "IrLAN, data channel disconnected by peer!\n");
+ /* save reason, so we know if we should try to reconnect or not */
+ self->disconnect_reason=reason;
+
switch(reason) {
case LM_USER_REQUEST: /* User request */
- irlan_close(self);
+ IRDA_DEBUG(2, __FUNCTION__ "(), user request\n");
break;
case LM_LAP_DISCONNECT: /* Unexpected IrLAP disconnect */
- irlan_start_watchdog_timer(self, IRLAN_TIMEOUT);
+ IRDA_DEBUG(2, __FUNCTION__ "(), Unexpected IrLAP disconnect\n");
break;
case LM_CONNECT_FAILURE: /* Failed to establish IrLAP connection */
- IRDA_DEBUG(2, __FUNCTION__ "(), LM_CONNECT_FAILURE not impl\n");
+ IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP connect failed\n");
break;
case LM_LAP_RESET: /* IrLAP reset */
- IRDA_DEBUG(2, __FUNCTION__ "(), LM_CONNECT_FAILURE not impl\n");
+ IRDA_DEBUG(2, __FUNCTION__ "(), IrLAP reset\n");
break;
case LM_INIT_DISCONNECT:
- IRDA_DEBUG(2, __FUNCTION__ "(), LM_CONNECT_FAILURE not impl\n");
+ IRDA_DEBUG(2, __FUNCTION__ "(), IrLMP connect failed\n");
break;
default:
+ ERROR(__FUNCTION__ "(), Unknown disconnect reason\n");
break;
}
@@ -1175,8 +1092,6 @@
while (self != NULL) {
ASSERT(self->magic == IRLAN_MAGIC, return len;);
- /* Don't display the master server */
- if (self->master == 0) {
len += sprintf(buf+len, "ifname: %s,\n",
self->dev.name);
len += sprintf(buf+len, "client state: %s, ",
@@ -1203,7 +1118,7 @@
netif_queue_stopped(&self->dev) ? "TRUE" :
"FALSE");
len += sprintf(buf+len, "\n");
- }
+
self = (struct irlan_cb *) hashbin_get_next(irlan);
}
diff -u -r ./linux-irda/net/irda/irlan/irlan_eth.c
./linux-2.4.0/net/irda/irlan/irlan_eth.c
--- ./linux-irda/net/irda/irlan/irlan_eth.c Tue Jul 11 14:12:24 2000
+++ ./linux-2.4.0/net/irda/irlan/irlan_eth.c Fri Jul 21 17:26:49 2000
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Thu Oct 15 08:37:58 1998
- * Modified at: Tue Mar 21 09:06:41 2000
+ * Modified at: Fri Apr 21 14:54:42 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
* Sources: skeleton.c by Donald Becker <[EMAIL PROTECTED]>
* slip.c by Laurence Culhane, <[EMAIL PROTECTED]>
@@ -48,7 +48,6 @@
*/
int irlan_eth_init(struct net_device *dev)
{
- struct irmanager_event mgr_event;
struct irlan_cb *self;
IRDA_DEBUG(2, __FUNCTION__"()\n");
@@ -85,22 +84,6 @@
get_random_bytes(dev->dev_addr+5, 1);
}
- /*
- * Network device has now been registered, so tell irmanager about
- * it, so it can be configured with network parameters
- */
- mgr_event.event = EVENT_IRLAN_START;
- sprintf(mgr_event.devname, "%s", self->dev.name);
- irmanager_notify(&mgr_event);
-
- /*
- * We set this so that we only notify once, since if
- * configuration of the network device fails, the user
- * will have to sort it out first anyway. No need to
- * try again.
- */
- self->notify_irmanager = FALSE;
-
return 0;
}
@@ -123,12 +106,12 @@
ASSERT(self != NULL, return -1;);
/* Ready to play! */
-/* netif_start_queue(dev) */ /* Wait until data link is ready */
-
- self->notify_irmanager = TRUE;
+ /* Wait until data link is ready */
+
/* We are now open, so time to do some work */
- irlan_client_wakeup(self, self->saddr, self->daddr);
+ self->disconnect_reason = 0;
+ irlan_client_wakeup(self, self->saddr, self->daddr);
irlan_mod_inc_use_count();
@@ -147,6 +130,8 @@
{
struct irlan_cb *self = (struct irlan_cb *) dev->priv;
+ struct sk_buff *skb;
+
IRDA_DEBUG(2, __FUNCTION__ "()\n");
/* Stop device */
@@ -161,13 +146,11 @@
irlan_do_client_event(self, IRLAN_LMP_DISCONNECT, NULL);
irlan_do_provider_event(self, IRLAN_LMP_DISCONNECT, NULL);
- irlan_start_watchdog_timer(self, IRLAN_TIMEOUT);
-
- /* Device closed by user! */
- if (self->notify_irmanager)
- self->notify_irmanager = FALSE;
- else
- self->notify_irmanager = TRUE;
+ /* Remove frames queued on the control channel */
+ while ((skb = skb_dequeue(&self->client.txq))) {
+ dev_kfree_skb(skb);
+ }
+ self->client.tx_busy = 0;
return 0;
}
diff -u -r ./linux-irda/net/irda/irlan/irlan_provider.c
./linux-2.4.0/net/irda/irlan/irlan_provider.c
--- ./linux-irda/net/irda/irlan/irlan_provider.c Tue Nov 2 20:07:55 1999
+++ ./linux-2.4.0/net/irda/irlan/irlan_provider.c Fri Jul 21 16:39:05 2000
@@ -6,13 +6,13 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Sun Aug 31 20:14:37 1997
- * Modified at: Sat Oct 30 12:52:10 1999
+ * Modified at: Mon Apr 3 14:28:19 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
* Sources: skeleton.c by Donald Becker <[EMAIL PROTECTED]>
* slip.c by Laurence Culhane, <[EMAIL PROTECTED]>
* Fred N. van Kempen, <[EMAIL PROTECTED]>
*
- * Copyright (c) 1998-1999 Dag Brattli <[EMAIL PROTECTED]>,
+ * Copyright (c) 1998-2000 Dag Brattli <[EMAIL PROTECTED]>,
* All Rights Reserved.
*
* This program is free software; you can redistribute it and/or
@@ -116,7 +116,7 @@
/*
* Function irlan_provider_connect_indication (handle, skb, priv)
*
- * Got connection from peer IrLAN layer
+ * Got connection from peer IrLAN client
*
*/
static void irlan_provider_connect_indication(void *instance, void *sap,
@@ -137,79 +137,22 @@
ASSERT(self != NULL, return;);
ASSERT(self->magic == IRLAN_MAGIC, return;);
- self->provider.max_sdu_size = max_sdu_size;
- self->provider.max_header_size = max_header_size;
-
+
ASSERT(tsap == self->provider.tsap_ctrl,return;);
ASSERT(self->provider.state == IRLAN_IDLE, return;);
daddr = irttp_get_daddr(tsap);
saddr = irttp_get_saddr(tsap);
- /* Check if we already dealing with this client or peer */
- new = (struct irlan_cb *) hashbin_find(irlan, daddr, NULL);
- if (new) {
- ASSERT(new->magic == IRLAN_MAGIC, return;);
- IRDA_DEBUG(0, __FUNCTION__ "(), found instance!\n");
-
- /* Update saddr, since client may have moved to a new link */
- new->saddr = saddr;
- IRDA_DEBUG(2, __FUNCTION__ "(), saddr=%08x\n", new->saddr);
-
- /* Make sure that any old provider control TSAP is removed */
- if ((new != self) && new->provider.tsap_ctrl) {
- irttp_disconnect_request(new->provider.tsap_ctrl,
- NULL, P_NORMAL);
- irttp_close_tsap(new->provider.tsap_ctrl);
- new->provider.tsap_ctrl = NULL;
- }
- } else {
- /* This must be the master instance, so start a new instance */
- IRDA_DEBUG(0, __FUNCTION__ "(), starting new provider!\n");
-
- new = irlan_open(saddr, daddr, TRUE);
- }
-
- /*
- * Check if the connection came in on the master server, or the
- * slave server. If it came on the slave, then everything is
- * really, OK (reconnect), if not we need to dup the connection and
- * hand it over to the slave.
- */
- if (new != self) {
-
- /* Now attach up the new "socket" */
- new->provider.tsap_ctrl = irttp_dup(self->provider.tsap_ctrl,
- new);
- if (!new->provider.tsap_ctrl) {
- IRDA_DEBUG(0, __FUNCTION__ "(), dup failed!\n");
- return;
- }
-
- /* new->stsap_sel = new->tsap->stsap_sel; */
- new->dtsap_sel_ctrl = new->provider.tsap_ctrl->dtsap_sel;
-
- /* Clean up the original one to keep it in listen state */
- self->provider.tsap_ctrl->dtsap_sel = LSAP_ANY;
- self->provider.tsap_ctrl->lsap->dlsap_sel = LSAP_ANY;
- self->provider.tsap_ctrl->lsap->lsap_state = LSAP_DISCONNECTED;
-
- /*
- * Use the new instance from here instead of the master
- * struct!
- */
- self = new;
- }
- /* Check if network device has been registered */
- if (!self->netdev_registered)
- irlan_register_netdev(self);
+ self->provider.max_sdu_size = max_sdu_size;
+ self->provider.max_header_size = max_header_size;
irlan_do_provider_event(self, IRLAN_CONNECT_INDICATION, NULL);
/*
* If we are in peer mode, the client may not have got the discovery
* indication it needs to make progress. If the client is still in
- * IDLE state, we must kick it to
+ * IDLE state, we must kick it
*/
if ((self->provider.access_type == ACCESS_PEER) &&
(self->client.state == IRLAN_IDLE)) {
@@ -231,10 +174,6 @@
/* Just accept */
irttp_connect_response(tsap, IRLAN_MTU, NULL);
-
- /* Check if network device has been registered */
- if (!self->netdev_registered)
- irlan_register_netdev(self);
}
diff -u -r ./linux-irda/net/irda/irlap_event.c ./linux-2.4.0/net/irda/irlap_event.c
--- ./linux-irda/net/irda/irlap_event.c Thu Jan 6 17:46:18 2000
+++ ./linux-2.4.0/net/irda/irlap_event.c Fri Jul 21 16:50:45 2000
@@ -6,7 +6,7 @@
* Status: Experimental.
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Sat Aug 16 00:59:29 1997
- * Modified at: Sat Dec 25 21:07:57 1999
+ * Modified at: Fri Apr 21 21:07:57 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
*
* Copyright (c) 1998-1999 Dag Brattli <[EMAIL PROTECTED]>,
@@ -375,7 +375,8 @@
self->s = info->s;
irlap_send_discovery_xid_frame(self, info->S, info->s, TRUE,
info->discovery);
- self->s++;
+ self->frame_sent = FALSE;
+ self->s++;
irlap_start_slot_timer(self, self->slot_timeout);
irlap_next_state(self, LAP_QUERY);
@@ -385,12 +386,9 @@
/* Assert that this is not the final slot */
if (info->s <= info->S) {
- /* self->daddr = info->daddr; */
self->slot = irlap_generate_rand_time_slot(info->S,
info->s);
- IRDA_DEBUG(4, "XID_CMD: S=%d, s=%d, slot %d\n", info->S,
- info->s, self->slot);
-
+
if (self->slot == info->s) {
discovery_rsp = irlmp_get_discovery_response();
discovery_rsp->daddr = info->daddr;
@@ -505,6 +503,20 @@
dev_kfree_skb(skb);
break;
case SLOT_TIMER_EXPIRED:
+ /*
+ * Wait a little longer if we detect an incomming frame. This
+ * is not mentioned in the spec, but is a good thing to do,
+ * since we want to work even with devices that violate the
+ * timing requirements.
+ */
+ if (irda_device_is_receiving(self->netdev)) {
+ IRDA_DEBUG(1, __FUNCTION__
+ "(), device is slow to answer, "
+ "waiting some more!\n");
+ irlap_start_slot_timer(self, MSECS_TO_JIFFIES(10));
+ return ret;
+ }
+
if (self->s < self->S) {
irlap_send_discovery_xid_frame(self, self->S,
self->s, TRUE,
@@ -1957,7 +1969,8 @@
break;
case RECV_TEST_CMD:
/* Remove test frame header */
- skb_pull(skb, sizeof(struct test_frame));
+ skb_pull(skb, LAP_ADDR_HEADER + LAP_CTRL_HEADER);
+
irlap_wait_min_turn_around(self, &self->qos_tx);
irlap_start_wd_timer(self, self->wd_timeout);
diff -u -r ./linux-irda/net/irda/irlap_frame.c ./linux-2.4.0/net/irda/irlap_frame.c
--- ./linux-irda/net/irda/irlap_frame.c Thu Jan 6 17:46:18 2000
+++ ./linux-2.4.0/net/irda/irlap_frame.c Fri Jul 21 16:54:06 2000
@@ -6,7 +6,7 @@
* Status: Stable
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Tue Aug 19 10:27:26 1997
- * Modified at: Wed Jan 5 08:59:04 2000
+ * Modified at: Thu Apr 13 08:59:04 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
*
* Copyright (c) 1998-2000 Dag Brattli <[EMAIL PROTECTED]>,
@@ -1212,7 +1212,7 @@
struct test_frame *frame;
__u8 *info;
- skb = dev_alloc_skb(32);
+ skb = dev_alloc_skb(cmd->len+sizeof(struct test_frame));
if (!skb)
return;
@@ -1225,10 +1225,10 @@
frame->saddr = cpu_to_le32(self->saddr);
frame->daddr = cpu_to_le32(daddr);
} else
- frame = (struct test_frame *) skb_put(skb, LAP_MAX_HEADER);
+ frame = (struct test_frame *) skb_put(skb,
+LAP_ADDR_HEADER+LAP_CTRL_HEADER);
frame->caddr = caddr;
- frame->control = TEST_RSP;
+ frame->control = TEST_RSP | PF_BIT;
/* Copy info */
info = skb_put(skb, cmd->len);
diff -u -r ./linux-irda/net/irda/qos.c ./linux-2.4.0/net/irda/qos.c
--- ./linux-irda/net/irda/qos.c Tue Mar 21 14:17:28 2000
+++ ./linux-2.4.0/net/irda/qos.c Fri Jul 21 16:56:49 2000
@@ -6,7 +6,7 @@
* Status: Stable
* Author: Dag Brattli <[EMAIL PROTECTED]>
* Created at: Tue Sep 9 00:00:26 1997
- * Modified at: Sun Jan 30 14:29:16 2000
+ * Modified at: Fri Apr 14:29:16 2000
* Modified by: Dag Brattli <[EMAIL PROTECTED]>
*
* Copyright (c) 1998-2000 Dag Brattli <[EMAIL PROTECTED]>,
diff -u -r ./linux-irda/net/unix/af_unix.c ./linux-2.4.0/net/unix/af_unix.c
--- ./linux-irda/net/unix/af_unix.c Thu Jul 6 01:15:27 2000
+++ ./linux-2.4.0/net/unix/af_unix.c Tue Jul 18 18:16:11 2000
@@ -1670,7 +1670,7 @@
}
default:
- err = -EINVAL;
+ err = dev_ioctl(cmd, (void *)arg);
break;
}
return err;