aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRajkumar Manoharan <rmanohar@qca.qualcomm.com>2011-08-13 00:58:15 -0400
committerJohn W. Linville <linville@tuxdriver.com>2011-08-24 13:59:45 -0400
commitf82b4bde17aeb6c2f8bf0540ee44811de4651cf6 (patch)
tree00ea645c48534e8e66261d432a862d5a5762c266
parentd77bf3eb5160c1356d7d7620b7d2fbe28e5e6257 (diff)
ath9k: Move ath9k_init_crypto to common
Signed-off-by: Rajkumar Manoharan <rmanohar@qca.qualcomm.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r--drivers/net/wireless/ath/ath9k/ath9k.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/common.c26
-rw-r--r--drivers/net/wireless/ath/ath9k/common.h1
-rw-r--r--drivers/net/wireless/ath/ath9k/htc_drv_init.c21
-rw-r--r--drivers/net/wireless/ath/ath9k/init.c27
-rw-r--r--drivers/net/wireless/ath/ath9k/pci.c2
6 files changed, 30 insertions, 48 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 4b08a3d3195d..3a893e19d6c3 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -663,7 +663,6 @@ extern int led_blink;
663extern bool is_ath9k_unloaded; 663extern bool is_ath9k_unloaded;
664 664
665irqreturn_t ath_isr(int irq, void *dev); 665irqreturn_t ath_isr(int irq, void *dev);
666void ath9k_init_crypto(struct ath_softc *sc);
667int ath9k_init_device(u16 devid, struct ath_softc *sc, 666int ath9k_init_device(u16 devid, struct ath_softc *sc,
668 const struct ath_bus_ops *bus_ops); 667 const struct ath_bus_ops *bus_ops);
669void ath9k_deinit_device(struct ath_softc *sc); 668void ath9k_deinit_device(struct ath_softc *sc);
diff --git a/drivers/net/wireless/ath/ath9k/common.c b/drivers/net/wireless/ath/ath9k/common.c
index fa6bd2d189e5..dc705a224952 100644
--- a/drivers/net/wireless/ath/ath9k/common.c
+++ b/drivers/net/wireless/ath/ath9k/common.c
@@ -169,6 +169,32 @@ void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
169} 169}
170EXPORT_SYMBOL(ath9k_cmn_update_txpow); 170EXPORT_SYMBOL(ath9k_cmn_update_txpow);
171 171
172void ath9k_cmn_init_crypto(struct ath_hw *ah)
173{
174 struct ath_common *common = ath9k_hw_common(ah);
175 int i = 0;
176
177 /* Get the hardware key cache size. */
178 common->keymax = AR_KEYTABLE_SIZE;
179
180 /*
181 * Check whether the separate key cache entries
182 * are required to handle both tx+rx MIC keys.
183 * With split mic keys the number of stations is limited
184 * to 27 otherwise 59.
185 */
186 if (ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA)
187 common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED;
188
189 /*
190 * Reset the key cache since some parts do not
191 * reset the contents on initial power up.
192 */
193 for (i = 0; i < common->keymax; i++)
194 ath_hw_keyreset(common, (u16) i);
195}
196EXPORT_SYMBOL(ath9k_cmn_init_crypto);
197
172static int __init ath9k_cmn_init(void) 198static int __init ath9k_cmn_init(void)
173{ 199{
174 return 0; 200 return 0;
diff --git a/drivers/net/wireless/ath/ath9k/common.h b/drivers/net/wireless/ath/ath9k/common.h
index 77ec288b5a70..ad14fecc76c6 100644
--- a/drivers/net/wireless/ath/ath9k/common.h
+++ b/drivers/net/wireless/ath/ath9k/common.h
@@ -62,3 +62,4 @@ void ath9k_cmn_btcoex_bt_stomp(struct ath_common *common,
62 enum ath_stomp_type stomp_type); 62 enum ath_stomp_type stomp_type);
63void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow, 63void ath9k_cmn_update_txpow(struct ath_hw *ah, u16 cur_txpow,
64 u16 new_txpow, u16 *txpower); 64 u16 new_txpow, u16 *txpower);
65void ath9k_cmn_init_crypto(struct ath_hw *ah);
diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
index 19aa5b724887..9cf42f6973aa 100644
--- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c
+++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c
@@ -572,25 +572,6 @@ err:
572 return -EINVAL; 572 return -EINVAL;
573} 573}
574 574
575static void ath9k_init_crypto(struct ath9k_htc_priv *priv)
576{
577 struct ath_common *common = ath9k_hw_common(priv->ah);
578 int i = 0;
579
580 /* Get the hardware key cache size. */
581 common->keymax = AR_KEYTABLE_SIZE;
582
583 if (priv->ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA)
584 common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED;
585
586 /*
587 * Reset the key cache since some parts do not
588 * reset the contents on initial power up.
589 */
590 for (i = 0; i < common->keymax; i++)
591 ath_hw_keyreset(common, (u16) i);
592}
593
594static void ath9k_init_channels_rates(struct ath9k_htc_priv *priv) 575static void ath9k_init_channels_rates(struct ath9k_htc_priv *priv)
595{ 576{
596 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) { 577 if (priv->ah->caps.hw_caps & ATH9K_HW_CAP_2GHZ) {
@@ -720,7 +701,7 @@ static int ath9k_init_priv(struct ath9k_htc_priv *priv,
720 for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++) 701 for (i = 0; i < ATH9K_HTC_MAX_BCN_VIF; i++)
721 priv->cur_beacon_conf.bslot[i] = NULL; 702 priv->cur_beacon_conf.bslot[i] = NULL;
722 703
723 ath9k_init_crypto(priv); 704 ath9k_cmn_init_crypto(ah);
724 ath9k_init_channels_rates(priv); 705 ath9k_init_channels_rates(priv);
725 ath9k_init_misc(priv); 706 ath9k_init_misc(priv);
726 707
diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c
index db38a58e752d..d7761d1fc5ba 100644
--- a/drivers/net/wireless/ath/ath9k/init.c
+++ b/drivers/net/wireless/ath/ath9k/init.c
@@ -404,31 +404,6 @@ fail:
404 return error; 404 return error;
405} 405}
406 406
407void ath9k_init_crypto(struct ath_softc *sc)
408{
409 struct ath_common *common = ath9k_hw_common(sc->sc_ah);
410 int i = 0;
411
412 /* Get the hardware key cache size. */
413 common->keymax = AR_KEYTABLE_SIZE;
414
415 /*
416 * Reset the key cache since some parts do not
417 * reset the contents on initial power up.
418 */
419 for (i = 0; i < common->keymax; i++)
420 ath_hw_keyreset(common, (u16) i);
421
422 /*
423 * Check whether the separate key cache entries
424 * are required to handle both tx+rx MIC keys.
425 * With split mic keys the number of stations is limited
426 * to 27 otherwise 59.
427 */
428 if (sc->sc_ah->misc_mode & AR_PCU_MIC_NEW_LOC_ENA)
429 common->crypt_caps |= ATH_CRYPT_CAP_MIC_COMBINED;
430}
431
432static int ath9k_init_btcoex(struct ath_softc *sc) 407static int ath9k_init_btcoex(struct ath_softc *sc)
433{ 408{
434 struct ath_txq *txq; 409 struct ath_txq *txq;
@@ -630,7 +605,7 @@ static int ath9k_init_softc(u16 devid, struct ath_softc *sc,
630 if (ret) 605 if (ret)
631 goto err_btcoex; 606 goto err_btcoex;
632 607
633 ath9k_init_crypto(sc); 608 ath9k_cmn_init_crypto(sc->sc_ah);
634 ath9k_init_misc(sc); 609 ath9k_init_misc(sc);
635 610
636 return 0; 611 return 0;
diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c
index daa26b5d7455..8bd8e85ece42 100644
--- a/drivers/net/wireless/ath/ath9k/pci.c
+++ b/drivers/net/wireless/ath/ath9k/pci.c
@@ -345,7 +345,7 @@ static int ath_pci_resume(struct device *device)
345 * semi-random values after suspend/resume. 345 * semi-random values after suspend/resume.
346 */ 346 */
347 ath9k_ps_wakeup(sc); 347 ath9k_ps_wakeup(sc);
348 ath9k_init_crypto(sc); 348 ath9k_cmn_init_crypto(sc->sc_ah);
349 ath9k_ps_restore(sc); 349 ath9k_ps_restore(sc);
350 350
351 sc->ps_idle = true; 351 sc->ps_idle = true;