patch-2.4.0-test11 linux/net/irda/irlan/irlan_eth.c
Next file: linux/net/irda/irlan/irlan_provider.c
Previous file: linux/net/irda/irlan/irlan_common.c
Back to the patch index
Back to the overall index
- Lines: 87
- Date:
Sat Nov 11 18:11:23 2000
- Orig file:
v2.4.0-test10/linux/net/irda/irlan/irlan_eth.c
- Orig date:
Tue Jul 11 11:12:24 2000
diff -u --recursive --new-file v2.4.0-test10/linux/net/irda/irlan/irlan_eth.c linux/net/irda/irlan/irlan_eth.c
@@ -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,14 +106,16 @@
ASSERT(self != NULL, return -1;);
/* Ready to play! */
-/* netif_start_queue(dev) */ /* Wait until data link is ready */
-
- self->notify_irmanager = TRUE;
+ netif_stop_queue(dev); /* Wait until data link is ready */
/* We are now open, so time to do some work */
+ self->disconnect_reason = 0;
irlan_client_wakeup(self, self->saddr, self->daddr);
irlan_mod_inc_use_count();
+
+ /* Make sure we have a hardware address before we return, so DHCP clients gets happy */
+ interruptible_sleep_on(&self->open_wait);
return 0;
}
@@ -146,7 +131,8 @@
int irlan_eth_close(struct net_device *dev)
{
struct irlan_cb *self = (struct irlan_cb *) dev->priv;
-
+ struct sk_buff *skb;
+
IRDA_DEBUG(2, __FUNCTION__ "()\n");
/* Stop device */
@@ -155,20 +141,17 @@
irlan_mod_dec_use_count();
irlan_close_data_channel(self);
-
irlan_close_tsaps(self);
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;
}
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)