From patchwork Wed Nov 10 09:56:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vivek Natarajan X-Patchwork-Id: 313472 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oAA9uHcn022995 for ; Wed, 10 Nov 2010 09:56:17 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755236Ab0KJJ4P (ORCPT ); Wed, 10 Nov 2010 04:56:15 -0500 Received: from mail.atheros.com ([12.19.149.2]:21164 "EHLO mail.atheros.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755227Ab0KJJ4P (ORCPT ); Wed, 10 Nov 2010 04:56:15 -0500 Received: from mail.atheros.com ([10.10.20.108]) by sidewinder.atheros.com for ; Wed, 10 Nov 2010 01:56:02 -0800 Received: from smtp.atheros.com (10.12.4.60) by SC1EXHC-02.global.atheros.com (10.10.20.111) with Microsoft SMTP Server (TLS) id 8.2.213.0; Wed, 10 Nov 2010 01:56:13 -0800 Received: by smtp.atheros.com (sSMTP sendmail emulation); Wed, 10 Nov 2010 15:26:08 +0530 From: Vivek Natarajan To: CC: Subject: [PATCH v2] compat/ath9k: pm-qos params patch Date: Wed, 10 Nov 2010 15:26:08 +0530 Message-ID: <1289382968-4165-1-git-send-email-vnatarajan@atheros.com> X-Mailer: git-send-email 1.6.3.3 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 10 Nov 2010 09:56:17 +0000 (UTC) diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h index 170d44a..ab920fb 100644 --- a/drivers/net/wireless/ath/ath9k/ath9k.h +++ b/drivers/net/wireless/ath/ath9k/ath9k.h @@ -675,7 +675,11 @@ static inline void ath_read_cachesize(struct ath_common *common, int *csz) } extern struct ieee80211_ops ath9k_ops; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) extern struct pm_qos_request_list ath9k_pm_qos_req; +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) +extern struct pm_qos_request_list *ath9k_pm_qos_req; +#endif extern int modparam_nohwcrypt; extern int led_blink; diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index 92bc5c5..56182fe 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -180,7 +180,12 @@ static const struct ath_ops ath9k_common_ops = { .write = ath9k_iowrite32, }; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) struct pm_qos_request_list ath9k_pm_qos_req; +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) +struct pm_qos_request_list *ath9k_pm_qos_req; +#endif + /**************************/ /* Initialization */ @@ -759,8 +764,16 @@ int ath9k_init_device(u16 devid, struct ath_softc *sc, u16 subsysid, ath_init_leds(sc); ath_start_rfkill_poll(sc); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) pm_qos_add_request(&ath9k_pm_qos_req, PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + ath9k_pm_qos_req = pm_qos_add_request(PM_QOS_CPU_DMA_LATENCY, + PM_QOS_DEFAULT_VALUE); +#else + pm_qos_add_requirement(PM_QOS_CPU_DMA_LATENCY, "ath9k", + PM_QOS_DEFAULT_VALUE); +#endif return 0; @@ -830,7 +843,13 @@ void ath9k_deinit_device(struct ath_softc *sc) } ieee80211_unregister_hw(hw); +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) pm_qos_remove_request(&ath9k_pm_qos_req); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + pm_qos_remove_request(ath9k_pm_qos_req); +#else + pm_qos_remove_requirement(PM_QOS_CPU_DMA_LATENCY, "ath9k"); +#endif ath_rx_cleanup(sc); ath_tx_cleanup(sc); ath9k_deinit_softc(sc); diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c index 25d3ef4..fa378bc 100644 --- a/drivers/net/wireless/ath/ath9k/main.c +++ b/drivers/net/wireless/ath/ath9k/main.c @@ -1244,7 +1244,14 @@ static int ath9k_start(struct ieee80211_hw *hw) ath9k_btcoex_timer_resume(sc); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) pm_qos_update_request(&ath9k_pm_qos_req, 55); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + pm_qos_update_request(ath9k_pm_qos_req, 55); +#else + pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ath9k", 55); +#endif + mutex_unlock: mutex_unlock(&sc->mutex); @@ -1423,7 +1430,15 @@ static void ath9k_stop(struct ieee80211_hw *hw) sc->sc_flags |= SC_OP_INVALID; +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) pm_qos_update_request(&ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); +#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35)) + pm_qos_update_request(ath9k_pm_qos_req, PM_QOS_DEFAULT_VALUE); +#else + pm_qos_update_requirement(PM_QOS_CPU_DMA_LATENCY, "ath9k", + PM_QOS_DEFAULT_VALUE); +#endif + mutex_unlock(&sc->mutex);