Skip to contentSkip to conversation

rt2x00: Add module parameter to disable HW crypto

PATCH In review Ivo van Doorn 2 participants 4 messages Aug 6, 2008 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt2x00: Add module parameter to disable HW crypto

Add a module parameter to rt61 and rt73 to disable HW crypto. The option should only be checked when determining if the SUPPORT_HW_CRYPTO flag should be set or not.

---
 drivers/net/wireless/rt2x00/rt61pci.c |   10 +++++++++-
 drivers/net/wireless/rt2x00/rt73usb.c |   10 +++++++++-
 2 files changed, 18 insertions(+), 2 deletions(-)
drivers/net/wireless/rt2x00/rt61pci.c +9 -1
index 0fcc456..23cf93d 100644
@@ -38,6 +38,13 @@
 #include "rt61pci.h"
 
 /*
+ * Allow hardware encryption to be disabled.
+ */
+static int modparam_nohwcrypt = 0;
+module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
+MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+
+/*
  * Register access.
  * BBP and RF register require indirect register access,
  * and use the CSR registers PHY_CSR3 and PHY_CSR4 to achieve this.
@@ -2617,7 +2624,8 @@ static int rt61pci_probe_hw(struct rt2x00_dev *rt2x00dev)
 	 */
 	__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
 	__set_bit(DRIVER_REQUIRE_DMA, &rt2x00dev->flags);
-	__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+	if (!modparam_nohwcrypt)
+		__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
 
 	/*
 	 * Set the rssi offset.
drivers/net/wireless/rt2x00/rt73usb.c +9 -1
index 4f2eb90..f58fd05 100644
@@ -37,6 +37,13 @@
 #include "rt73usb.h"
 
 /*
+ * Allow hardware encryption to be disabled.
+ */
+static int modparam_nohwcrypt = 0;
+module_param_named(nohwcrypt, modparam_nohwcrypt, bool, S_IRUGO);
+MODULE_PARM_DESC(nohwcrypt, "Disable hardware encryption.");
+
+/*
  * Register access.
  * All access to the CSR registers will go through the methods
  * rt73usb_register_read and rt73usb_register_write.
@@ -2211,7 +2218,8 @@ static int rt73usb_probe_hw(struct rt2x00_dev *rt2x00dev)
 	 */
 	__set_bit(DRIVER_REQUIRE_FIRMWARE, &rt2x00dev->flags);
 	__set_bit(DRIVER_REQUIRE_SCHEDULED, &rt2x00dev->flags);
-	__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
+	if (!modparam_nohwcrypt)
+		__set_bit(CONFIG_SUPPORT_HW_CRYPTO, &rt2x00dev->flags);
 
 	/*
 	 * Set the rssi offset.
Signature · 1 line
1.5.6.1
maintainer
#1 lore raw
Quoted 4 lines · Ivo van Doorn

Add a module parameter to rt61 and rt73 to disable HW crypto. The option should only be checked when determining if the SUPPORT_HW_CRYPTO flag should be set or not.

I wonder if instead mac80211 should have an option for this. It'd be trivial to simply not tell the hardware about the keys.

johannes

#2 lore raw
Quoted 8 lines · Johannes Berg
Quoted 4 lines · Ivo van Doorn

Add a module parameter to rt61 and rt73 to disable HW crypto. The option should only be checked when determining if the SUPPORT_HW_CRYPTO flag should be set or not.

I wonder if instead mac80211 should have an option for this. It'd be trivial to simply not tell the hardware about the keys.

Then it probably needs to be a per physical interface configuration option, which can only be toggled when the interface is down. Because I don't think you want the option to be global for all available physical interfaces.

Ivo

maintainer
#3 lore raw
Quoted 7 lines · Ivo van Doorn
Quoted 6 lines · Johannes Berg
Quoted 4 lines · Ivo van Doorn

Add a module parameter to rt61 and rt73 to disable HW crypto. The option should only be checked when determining if the SUPPORT_HW_CRYPTO flag should be set or not.

Quoted 6 lines
Quoted 2 lines

I wonder if instead mac80211 should have an option for this. It'd be trivial to simply not tell the hardware about the keys.

Then it probably needs to be a per physical interface configuration option, which can only be toggled when the interface is down. Because I don't think you want the option to be global for all available physical interfaces.

Why not? It's mostly a debug option anyway. We can hide it away in debugfs per phy, but I wouldn't really care if it was global since the driver isn't supposed to be broken :)

johannes