* Re: [PATCH] rt2x00: Add module parameter to disable HW crypto
2008-08-06 15:27 [PATCH] rt2x00: Add module parameter to disable HW crypto Ivo van Doorn
@ 2008-08-06 15:22 ` Johannes Berg
2008-08-06 16:06 ` Ivo van Doorn
0 siblings, 1 reply; 4+ messages in thread
From: Johannes Berg @ 2008-08-06 15:22 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless, rt2400-devel
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
On Wed, 2008-08-06 at 17:27 +0200, Ivo van Doorn wrote:
> 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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] rt2x00: Add module parameter to disable HW crypto
@ 2008-08-06 15:27 Ivo van Doorn
2008-08-06 15:22 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Ivo van Doorn @ 2008-08-06 15:27 UTC (permalink / raw)
To: John W. Linville; +Cc: linux-wireless, rt2400-devel
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.
Signed-off-by: Ivo van Doorn <IvDoorn@gmail.com>
---
drivers/net/wireless/rt2x00/rt61pci.c | 10 +++++++++-
drivers/net/wireless/rt2x00/rt73usb.c | 10 +++++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rt2x00/rt61pci.c b/drivers/net/wireless/rt2x00/rt61pci.c
index 0fcc456..23cf93d 100644
--- a/drivers/net/wireless/rt2x00/rt61pci.c
+++ b/drivers/net/wireless/rt2x00/rt61pci.c
@@ -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.
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 4f2eb90..f58fd05 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -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.
--
1.5.6.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] rt2x00: Add module parameter to disable HW crypto
2008-08-06 16:06 ` Ivo van Doorn
@ 2008-08-06 15:42 ` Johannes Berg
0 siblings, 0 replies; 4+ messages in thread
From: Johannes Berg @ 2008-08-06 15:42 UTC (permalink / raw)
To: Ivo van Doorn; +Cc: John W. Linville, linux-wireless, rt2400-devel
[-- Attachment #1: Type: text/plain, Size: 935 bytes --]
On Wed, 2008-08-06 at 18:06 +0200, Ivo van Doorn wrote:
> On Wednesday 06 August 2008, Johannes Berg wrote:
> > On Wed, 2008-08-06 at 17:27 +0200, Ivo van Doorn wrote:
> > > 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.
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
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] rt2x00: Add module parameter to disable HW crypto
2008-08-06 15:22 ` Johannes Berg
@ 2008-08-06 16:06 ` Ivo van Doorn
2008-08-06 15:42 ` Johannes Berg
0 siblings, 1 reply; 4+ messages in thread
From: Ivo van Doorn @ 2008-08-06 16:06 UTC (permalink / raw)
To: Johannes Berg; +Cc: John W. Linville, linux-wireless, rt2400-devel
On Wednesday 06 August 2008, Johannes Berg wrote:
> On Wed, 2008-08-06 at 17:27 +0200, Ivo van Doorn wrote:
> > 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
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-08-06 15:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-06 15:27 [PATCH] rt2x00: Add module parameter to disable HW crypto Ivo van Doorn
2008-08-06 15:22 ` Johannes Berg
2008-08-06 16:06 ` Ivo van Doorn
2008-08-06 15:42 ` Johannes Berg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox