Skip to contentSkip to conversation

prism54: Don't allow mib reads while unconfigured (resend)

PATCH In review Margit Schubert-While 1 participant 1 message Jun 5, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 11/17 prism54: Don't allow mib reads while unconfigured (resend)

004-04-17 Aurelien Alleaume <[email protected]>

* oid_mgt.c, isl_ioctl.c : Cleanup. Prevented real oid reading before the card is configured with mib values (might be related to
bug #53).

drivers/net/wireless/prism54/isl_ioctl.c +5 -31
diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.c linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.c
@@ -173,14 +173,6 @@
 	prism54_mib_mode_helper(priv, init_mode);
 }
 
-void
-prism54_mib_init_work(islpci_private *priv)
-{
-	down_write(&priv->mib_sem);
-	mgt_commit(priv);
-	up_write(&priv->mib_sem);
-}
-
 /* this will be executed outside of atomic context thanks to
  * schedule_work(), thus we can as well use sleeping semaphore
  * locking */
@@ -195,13 +187,6 @@
 	if (down_interruptible(&priv->stats_sem))
 		return;
 
-/* missing stats are :
- *  iwstatistics.qual.updated
- *  iwstatistics.discard.nwid	    
- *  iwstatistics.discard.fragment	    
- *  iwstatistics.discard.misc
- *  iwstatistics.miss.beacon */
-
 /* Noise floor.
  * I'm not sure if the unit is dBm.
  * Note : If we are not connected, this value seems to be irrelevant. */
@@ -425,7 +410,6 @@
 	/* by default  the card sets this to 20. */
 	sens = vwrq->disabled ? 20 : vwrq->value;
 
-	/* set the ed threshold. */
 	return mgt_set_request(priv, DOT11_OID_EDTHRESHOLD, 0, &sens);
 }
 
@@ -712,7 +696,7 @@
 
 	/* Ask the device for a list of known bss. We can report at most
 	 * IW_MAX_AP=64 to the range struct. But the device won't repport anything
-	 * if you change the value of MAXBSS=24. Anyway 24 AP It is probably enough.
+	 * if you change the value of IWMAX_BSS=24.
 	 */
 	rvalue |= mgt_get_request(priv, DOT11_OID_BSSLIST, 0, NULL, &r);
 	bsslist = r.ptr;
@@ -969,8 +953,6 @@
  * small frame <=>  smaller than the rts threshold
  * This is not really the behavior expected by the wireless tool but it seems
  * to be a common behavior in other drivers.
- * 
- * It seems that playing with this tends to hang the card -> DISABLED
  */
 
 static int
@@ -1002,14 +984,13 @@
 		lifetime = vwrq->value / 1024;
 
 	/* now set what is requested */
-
-	if (slimit != 0)
+	if (slimit)
 		rvalue =
 		    mgt_set_request(priv, DOT11_OID_SHORTRETRIES, 0, &slimit);
-	if (llimit != 0)
+	if (llimit)
 		rvalue |=
 		    mgt_set_request(priv, DOT11_OID_LONGRETRIES, 0, &llimit);
-	if (lifetime != 0)
+	if (lifetime)
 		rvalue |=
 		    mgt_set_request(priv, DOT11_OID_MAXTXLIFETIME, 0,
 				    &lifetime);
@@ -1261,11 +1242,6 @@
 prism54_set_u32(struct net_device *ndev, struct iw_request_info *info,
 		   __u32 * uwrq, char *extra)
 {
-	/*
-	   u32 *i = (int *) extra;
-	   int param = *i;
-	   int u = *(i + 1);
-	 */
 	u32 oid = uwrq[0], u = uwrq[1];
 
 	return mgt_set_request((islpci_private *) ndev->priv, oid, 0, &u);
@@ -1836,9 +1812,7 @@
 				     0);
 		break;
 
-		/* Note : the following should never happen since we don't run the card in
-		 * extended mode.
-		 * Note : "mlme" is actually a "struct obj_mlmeex *" here, but this
+		/* Note : "mlme" is actually a "struct obj_mlmeex *" here, but this
 		 * is backward compatible layout-wise with "struct obj_mlme".
 		 */
 
drivers/net/wireless/prism54/isl_ioctl.h +0 -1
diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/isl_ioctl.h linux-2.6.6-01/drivers/net/wireless/prism54/isl_ioctl.h
@@ -30,7 +30,6 @@
 #define SUPPORTED_WIRELESS_EXT                  16
 
 void prism54_mib_init(islpci_private *);
-void prism54_mib_init_work(islpci_private *);
 
 struct iw_statistics *prism54_get_wireless_stats(struct net_device *);
 void prism54_update_stats(islpci_private *);
drivers/net/wireless/prism54/islpci_dev.c +3 -1
diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_dev.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_dev.c
@@ -504,7 +504,9 @@
 	 * the IRQ line until we know for sure the reset went through */
 	isl38xx_enable_common_interrupts(priv->device_base);
 
-	prism54_mib_init_work(priv);
+	down_write(&priv->mib_sem);
+	mgt_commit(priv);
+	up_write(&priv->mib_sem);
 
 	islpci_set_state(priv, PRV_STATE_READY);
 
drivers/net/wireless/prism54/islpci_mgt.c +5 -3
diff -Naur linux-2.6.6ct/drivers/net/wireless/prism54/islpci_mgt.c linux-2.6.6-01/drivers/net/wireless/prism54/islpci_mgt.c
@@ -312,8 +312,9 @@
                  * size of a receive buffer.  Thus, if this check
                  * triggers, we likely have kernel heap corruption. */
                 if (frag_len > MGMT_FRAME_SIZE) {
-                        printk(KERN_WARNING "%s: Bogus packet size of %d (%#x).\
-n", ndev->name, frag_len, frag_len);
+			printk(KERN_WARNING
+				"%s: Bogus packet size of %d (%#x).\n",
+				ndev->name, frag_len, frag_len);
                         frag_len = MGMT_FRAME_SIZE;
                 }
 
@@ -488,7 +489,8 @@
 		}
 		if (timeleft == 0) {
 			printk(KERN_DEBUG
-			       "%s: timeout waiting for mgmt response %lu, trigging device\n",
+				"%s: timeout waiting for mgmt response %lu, "
+				"triggering device\n",
 			       ndev->name, timeout_left);
 			islpci_trigger(priv);
 		}
drivers/net/wireless/prism54/oid_mgt.c +40 -21

124 lines not on this page · raw message