patch-2.2.16 linux/drivers/net/irda/w83977af_ir.c

Next file: linux/drivers/net/n2.c
Previous file: linux/drivers/net/irda/toshoboe.c
Back to the patch index
Back to the overall index

diff -urN v2.2.15/linux/drivers/net/irda/w83977af_ir.c linux/drivers/net/irda/w83977af_ir.c
@@ -6,7 +6,7 @@
  * Status:        Experimental.
  * Author:        Paul VanderSpek
  * Created at:    Wed Nov  4 11:46:16 1998
- * Modified at:   Fri Mar 10 11:53:53 2000
+ * Modified at:   Tue Apr 25 21:18:35 2000
  * Modified by:   Dag Brattli <dagb@cs.uit.no>
  * 
  *     Copyright (c) 1998-2000 Dag Brattli <dagb@cs.uit.no>
@@ -258,13 +258,12 @@
 	dev->get_stats	     = w83977af_net_get_stats;
 
 	rtnl_lock();
-	err = register_netdev(dev);
+	err = register_netdevice(dev);
 	rtnl_unlock();
 	if (err) {
-		ERROR(__FUNCTION__ "(), register_netdev() failed!\n");
+		ERROR(__FUNCTION__ "(), register_netdevice() failed!\n");
 		return -1;
 	}
-
 	MESSAGE("IrDA: Registered device %s\n", dev->name);
 	
 	return 0;
@@ -307,7 +306,7 @@
 
 	/* Release the PORT that this driver is using */
 	IRDA_DEBUG(0 , __FUNCTION__ "(), Releasing Region %03x\n", 
-	      self->io.fir_base);
+		   self->io.fir_base);
 	release_region(self->io.fir_base, self->io.fir_ext);
 
 	if (self->tx_buff.head)
@@ -1348,7 +1347,12 @@
 	
 	switch (cmd) {
 	case SIOCSBANDWIDTH: /* Set bandwidth */
-		if (!capable(CAP_NET_ADMIN))
+		/*
+		 * This function will also be used by IrLAP to change the
+		 * speed, so we still must allow for speed change within
+		 * interrupt context.
+		 */
+		if (!in_interrupt() && !capable(CAP_NET_ADMIN))
 			return -EPERM;
 		w83977af_change_speed(self, irq->ifr_baudrate);
 		break;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)