ath5k: move nohwcrypt to ath_common structure
Subsystems (3)
PATCH 1/3 ath5k: move nohwcrypt to ath_common structure
--- drivers/net/wireless/ath/ath.h | 1 + drivers/net/wireless/ath/ath5k/base.c | 3 ++- drivers/net/wireless/ath/ath5k/mac80211-ops.c | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-)
drivers/net/wireless/ath/ath.h +1 -0
@@ -165,6 +165,7 @@ struct ath_common {const struct ath_bus_ops *bus_ops;bool btcoex_enabled; +bool nohwcrypt; }; struct sk_buff *ath_rxbuf_alloc(struct ath_common *common,
drivers/net/wireless/ath/ath5k/base.c +2 -1
@@ -61,7 +61,7 @@#include "debug.h" #include "ani.h" -int modparam_nohwcrypt; +static int modparam_nohwcrypt;module_param_named (nohwcrypt, modparam_nohwcrypt, bool,S_IRUGO );MODULE_PARM_DESC (nohwcrypt,"Disable hardware encryption." );
@@ -2395,6 +2395,7 @@ ath5k_init_softc(struct ath5k_softc *sc, const struct ath_bus_ops *bus_ops) common->ah = sc->ah; common->hw = hw; common->priv = sc; + common->nohwcrypt = modparam_nohwcrypt;/* * Cache line size is used to size and align various
drivers/net/wireless/ath/ath5k/mac80211-ops.c +1 -2
@@ -46,7 +46,6 @@#include "base.h" #include "reg.h" -extern int modparam_nohwcrypt;/* functions used from base.c */ void set_beacon_filter (struct ieee80211_hw *hw,bool enable);
@@ -485,7 +484,7 @@ ath5k_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,struct ath_common *common =ath5k_hw_common (ah);int ret =0 ; -if (modparam_nohwcrypt) +if (common->nohwcrypt)return -EOPNOTSUPP ;switch (key->cipher) {
Signature · 1 line
1.7.3.4
PATCH 2/3 ath9k: use nohwcrypt in ath_common structure
--- drivers/net/wireless/ath/ath9k/ath9k.h | 1 - drivers/net/wireless/ath/ath9k/init.c | 5 +++-- drivers/net/wireless/ath/ath9k/main.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/ath9k.h +0 -1
@@ -664,7 +664,6 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) }extern struct ieee80211_ops ath9k_ops; -extern int modparam_nohwcrypt;extern int led_blink;extern int ath9k_pm_qos_value;extern bool is_ath9k_unloaded;
drivers/net/wireless/ath/ath9k/init.c +3 -2
@@ -29,7 +29,7 @@ static unsigned int ath9k_debug = ATH_DBG_DEFAULT;module_param_named (debug, ath9k_debug, uint,0 );MODULE_PARM_DESC (debug,"Debugging mask" ); -int modparam_nohwcrypt; +static int modparam_nohwcrypt;module_param_named (nohwcrypt, modparam_nohwcrypt, int,0444 );MODULE_PARM_DESC (nohwcrypt,"Disable hardware encryption" );
@@ -552,6 +552,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc, u16 subsysid, common->priv = sc; common->debug_mask = ath9k_debug; common->btcoex_enabled = ath9k_btcoex_enable ==1 ; + common->nohwcrypt = modparam_nohwcrypt;spin_lock_init (&common->cc_lock);spin_lock_init (&sc->wiphy_lock);
@@ -653,7 +654,7 @@ void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw)if (sc->sc_ah->caps.hw_caps &ATH9K_HW_CAP_HT ) hw->flags |=IEEE80211_HW_AMPDU_AGGREGATION ; -if (AR_SREV_9160_10_OR_LATER (sc->sc_ah) || modparam_nohwcrypt) +if (AR_SREV_9160_10_OR_LATER (sc->sc_ah) || common->nohwcrypt) hw->flags |=IEEE80211_HW_MFP_CAPABLE ; hw->wiphy->interface_modes =
drivers/net/wireless/ath/ath9k/main.c +1 -1
@@ -1829,7 +1829,7 @@ static int ath9k_set_key(struct ieee80211_hw *hw,struct ath_common *common =ath9k_hw_common (sc->sc_ah);int ret =0 ; -if (modparam_nohwcrypt) +if (common->nohwcrypt)return -ENOSPC ;mutex_lock (&sc->mutex);
Signature · 1 line
1.7.3.4
PATCH 3/3 ath9k_htc: use nohwcrypt in ath_common structure
In reply to John W. Linville--- drivers/net/wireless/ath/ath9k/htc.h | 1 - drivers/net/wireless/ath/ath9k/htc_drv_init.c | 5 +++-- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath9k/htc.h +0 -1
@@ -42,7 +42,6 @@ ((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))extern struct ieee80211_ops ath9k_htc_ops; -extern int htc_modparam_nohwcrypt;enum htc_phymode {HTC_MODE_AUTO =0 ,
drivers/net/wireless/ath/ath9k/htc_drv_init.c +3 -2
@@ -24,8 +24,8 @@ static unsigned int ath9k_debug = ATH_DBG_DEFAULT;module_param_named (debug, ath9k_debug, uint,0 );MODULE_PARM_DESC (debug,"Debugging mask" ); -int htc_modparam_nohwcrypt; -module_param_named (nohwcrypt, htc_modparam_nohwcrypt, int,0444 ); +static int modparam_nohwcrypt; +module_param_named (nohwcrypt, modparam_nohwcrypt, int,0444 );MODULE_PARM_DESC (nohwcrypt,"Disable hardware encryption" );#define CHAN2G (_freq, _idx) { \
@@ -641,6 +641,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv, common->hw = priv->hw; common->priv = priv; common->debug_mask = ath9k_debug; + common->nohwcrypt = modparam_nohwcrypt;spin_lock_init (&priv->wmi->wmi_lock);spin_lock_init (&priv->beacon_lock);
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1 -1
@@ -1372,7 +1372,7 @@ static int ath9k_htc_set_key(struct ieee80211_hw *hw,struct ath_common *common =ath9k_hw_common (priv->ah);int ret =0 ; -if (htc_modparam_nohwcrypt) +if (common->nohwcrypt)return -ENOSPC ;mutex_lock (&priv->mutex);
Signature · 1 line
1.7.3.4
PATCH 1/3 ath5k: move nohwcrypt to ath_common structure
In reply to John W. Linvilledrivers/net/wireless/ath/ath.h
Quoted 1 line · John W. Linville
drivers/net/wireless/ath/ath.h +0
-0
[]
drivers/net/wireless/ath/ath5k/base.c line 65
Quoted 6 lines
drivers/net/wireless/ath/ath.h +1
-0+bool nohwcrypt;drivers/net/wireless/ath/ath5k/base.c +1
-1-int modparam_nohwcrypt; +static int modparam_nohwcrypt;module_param_named (nohwcrypt, modparam_nohwcrypt, bool,S_IRUGO );
bool/int matching?
Perhaps the modparam_nohwcrypts should be
bool and S_IRUGO
Review
Quoted 1 line
(quoted diff) +0
-0
[]
Review
Quoted 5 lines
drivers/net/wireless/ath/ath5k/base.c +1
-1-int modparam_nohwcrypt; +static int modparam_nohwcrypt;module_param_named (nohwcrypt, modparam_nohwcrypt, int,0444 );(quoted diff) +0
-0
[]
Quoted 4 lines
(quoted diff) +2
-2-int htc_modparam_nohwcrypt; -module_param_named(nohwcrypt, htc_modparam_nohwcrypt, int, 0444); +static int modparam_nohwcrypt; +module_param_named(nohwcrypt, modparam_nohwcrypt, int, 0444);
PATCH 1/3 ath5k: move nohwcrypt to ath_common structure
Quoted 4 lines · Joe Perches
drivers/net/wireless/ath/ath.h
Quoted 1 line · John W. Linville
drivers/net/wireless/ath/ath.h +0
-0[]
Quoted 8 lines
Quoted 6 lines
+ ? ? bool nohwcrypt;
drivers/net/wireless/ath/ath5k/base.c +1
-1-int modparam_nohwcrypt; +static int modparam_nohwcrypt;?module_param_named(nohwcrypt,
modparam_nohwcrypt, bool,S_IRUGO);bool/int matching?
It used to be the case that you had to use ints here. Google tells me that changed about 2 years ago, so bool should be ok.
Signature · 1 line
Bob Copeland %% www.bobcopeland.com
PATCH 1/3 ath5k: move nohwcrypt to ath_common structure
Quoted 4 lines · Bob Copeland
Quoted 3 lines · Joe Perches
drivers/net/wireless/ath/ath.h
Quoted 1 line · John W. Linville
drivers/net/wireless/ath/ath.h +0
-0[]
Quoted 8 lines
Quoted 6 lines
drivers/net/wireless/ath/ath5k/base.c line 65
Quoted 5 lines
drivers/net/wireless/ath/ath.h +1
-0+bool nohwcrypt;drivers/net/wireless/ath/ath5k/base.c +1
-1-int modparam_nohwcrypt; +static int modparam_nohwcrypt;module_param_named (nohwcrypt, modparam_nohwcrypt, bool,S_IRUGO );bool/int matching?
It used to be the case that you had to use ints here. Google tells me that changed about 2 years ago, so bool should be ok.
bool is OK.
modparam_nohwcrypt is declared int and should be declared bool. Also should be declared and used as bool in ath9k and ath9k_htc too.
PATCH 1/3 ath5k: move nohwcrypt to ath_common structure
Quoted 3 lines · Joe Perches
bool is OK.
Yes, I was agreeing, just pointing out (for my own benefit, I guess) that the old rule of using int for bool modparams no longer holds.
Signature · 1 line
Bob Copeland %% www.bobcopeland.com