From: Sujith Manoharan Date: Sun, 28 Apr 2013 21:01:20 +0530 Subject: [ath9k-devel] [PATCH 02/20] ath10k: Merge mac.h with core.h In-Reply-To: <1367163098-22787-1-git-send-email-sujith@msujith.org> References: <1367163098-22787-1-git-send-email-sujith@msujith.org> Message-ID: <1367163098-22787-2-git-send-email-sujith@msujith.org> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: ath9k-devel@lists.ath9k.org From: Sujith Manoharan Signed-off-by: Sujith Manoharan --- drivers/net/wireless/ath/ath10k/core.c | 1 - drivers/net/wireless/ath/ath10k/core.h | 20 +++++++++++ drivers/net/wireless/ath/ath10k/htt_tx.c | 1 - drivers/net/wireless/ath/ath10k/mac.c | 20 +++++++++-- drivers/net/wireless/ath/ath10k/mac.h | 61 -------------------------------- drivers/net/wireless/ath/ath10k/txrx.c | 1 - drivers/net/wireless/ath/ath10k/wmi.c | 1 - 7 files changed, 38 insertions(+), 67 deletions(-) delete mode 100644 drivers/net/wireless/ath/ath10k/mac.h diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 0ec7986..ec652b9 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -19,7 +19,6 @@ #include #include "core.h" -#include "mac.h" #include "htc.h" #include "hif.h" #include "wmi.h" diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 225089d..c040418 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -374,4 +374,24 @@ void ath10k_core_unregister(struct ath10k *ar); int ath10k_core_target_suspend(struct ath10k *ar); int ath10k_core_target_resume(struct ath10k *ar); +struct ath10k_generic_iter { + struct ath10k *ar; + int ret; +}; + +struct ath10k *ath10k_mac_create(void); +void ath10k_mac_destroy(struct ath10k *ar); +int ath10k_mac_register(struct ath10k *ar); +void ath10k_mac_unregister(struct ath10k *ar); +struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id); +void ath10k_reset_scan(unsigned long ptr); +void ath10k_offchan_tx_purge(struct ath10k *ar); +void ath10k_offchan_tx_work(struct work_struct *work); +void ath10k_tx_h_seq_no(struct sk_buff *skb); + +static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif) +{ + return (struct ath10k_vif *)vif->drv_priv; +} + #endif /* _CORE_H_ */ diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index edbe4f4..677f527 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -17,7 +17,6 @@ #include #include "htt.h" -#include "mac.h" #include "txrx.h" #include "debug.h" diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 4a11878..8e8987e 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -15,8 +15,6 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ -#include "mac.h" - #include #include @@ -218,6 +216,24 @@ static int ath10k_clear_vdev_key(struct ath10k_vif *arvif, /* General utilities */ /*********************/ +void ath10k_tx_h_seq_no(struct sk_buff *skb) +{ + struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); + struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; + struct ieee80211_vif *vif = info->control.vif; + struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); + + if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { + if (arvif->tx_seq_no == 0) + arvif->tx_seq_no = 0x1000; + + if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) + arvif->tx_seq_no += 0x10; + hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); + hdr->seq_ctrl |= cpu_to_le16(arvif->tx_seq_no); + } +} + static inline enum wmi_phy_mode chan_to_phymode(struct ieee80211_channel *chan, enum nl80211_channel_type channel_type) { diff --git a/drivers/net/wireless/ath/ath10k/mac.h b/drivers/net/wireless/ath/ath10k/mac.h deleted file mode 100644 index 58eed18..0000000 --- a/drivers/net/wireless/ath/ath10k/mac.h +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2005-2011 Atheros Communications Inc. - * Copyright (c) 2011-2013 Qualcomm Atheros, Inc. - * - * Permission to use, copy, modify, and/or distribute this software for any - * purpose with or without fee is hereby granted, provided that the above - * copyright notice and this permission notice appear in all copies. - * - * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES - * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF - * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR - * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES - * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN - * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF - * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. - */ - -#ifndef _MAC_H_ -#define _MAC_H_ - -#include -#include "core.h" - -struct ath10k_generic_iter { - struct ath10k *ar; - int ret; -}; - -struct ath10k *ath10k_mac_create(void); -void ath10k_mac_destroy(struct ath10k *ar); -int ath10k_mac_register(struct ath10k *ar); -void ath10k_mac_unregister(struct ath10k *ar); -struct ath10k_vif *ath10k_get_arvif(struct ath10k *ar, u32 vdev_id); -void ath10k_reset_scan(unsigned long ptr); -void ath10k_offchan_tx_purge(struct ath10k *ar); -void ath10k_offchan_tx_work(struct work_struct *work); - -static inline struct ath10k_vif *ath10k_vif_to_arvif(struct ieee80211_vif *vif) -{ - return (struct ath10k_vif *)vif->drv_priv; -} - -static inline void ath10k_tx_h_seq_no(struct sk_buff *skb) -{ - struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb); - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data; - struct ieee80211_vif *vif = info->control.vif; - struct ath10k_vif *arvif = ath10k_vif_to_arvif(vif); - - if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { - if (arvif->tx_seq_no == 0) - arvif->tx_seq_no = 0x1000; - - if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) - arvif->tx_seq_no += 0x10; - hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); - hdr->seq_ctrl |= cpu_to_le16(arvif->tx_seq_no); - } -} - -#endif /* _MAC_H_ */ diff --git a/drivers/net/wireless/ath/ath10k/txrx.c b/drivers/net/wireless/ath/ath10k/txrx.c index 9d0b1e2..d333f45 100644 --- a/drivers/net/wireless/ath/ath10k/txrx.c +++ b/drivers/net/wireless/ath/ath10k/txrx.c @@ -18,7 +18,6 @@ #include "core.h" #include "txrx.h" #include "htt.h" -#include "mac.h" #include "debug.h" static void ath10k_report_offchan_tx(struct ath10k *ar, struct sk_buff *skb) diff --git a/drivers/net/wireless/ath/ath10k/wmi.c b/drivers/net/wireless/ath/ath10k/wmi.c index 5272f18..8017a59 100644 --- a/drivers/net/wireless/ath/ath10k/wmi.c +++ b/drivers/net/wireless/ath/ath10k/wmi.c @@ -21,7 +21,6 @@ #include "htc.h" #include "debug.h" #include "wmi.h" -#include "mac.h" void ath10k_wmi_flush_tx(struct ath10k *ar) { -- 1.8.2.2