Skip to contentSkip to conversation

ath9k_htc: Remove library

PATCH New Sujith 1 participant 1 message Mar 2, 2010 Qualcomm Atheros ATH9K wireless driver

lore
Share & tools
lore

Sujith

author
#0 lore raw

PATCH 2/2 ath9k_htc: Remove library

Use ath9k_common.ko to share code between ath9k and ath9k_htc.

---
 drivers/net/wireless/ath/ath9k/Kconfig        |    1 +
 drivers/net/wireless/ath/ath9k/Makefile       |    3 +-
 drivers/net/wireless/ath/ath9k/ath9k.h        |   33 +--
 drivers/net/wireless/ath/ath9k/common.c       |  410 +++++++++++++++++++--
 drivers/net/wireless/ath/ath9k/common.h       |   41 ++-
 drivers/net/wireless/ath/ath9k/htc.h          |    5 +-
 drivers/net/wireless/ath/ath9k/htc_drv_main.c |    2 +-
 drivers/net/wireless/ath/ath9k/htc_drv_txrx.c |   82 ++++-
 drivers/net/wireless/ath/ath9k/lib.c          |  487 -------------------------
 drivers/net/wireless/ath/ath9k/lib.h          |   85 -----
 drivers/net/wireless/ath/ath9k/main.c         |   87 +-----
 drivers/net/wireless/ath/ath9k/virtual.c      |    2 +-
 12 files changed, 509 insertions(+), 729 deletions(-)
 delete mode 100644 drivers/net/wireless/ath/ath9k/lib.c
 delete mode 100644 drivers/net/wireless/ath/ath9k/lib.h
drivers/net/wireless/ath/ath9k/Kconfig +1 -0
index fd28803..35f23bd 100644
@@ -39,6 +39,7 @@ config ATH9K_HTC
        select MAC80211_LEDS
        select LEDS_CLASS
        select NEW_LEDS
+       select ATH9K_COMMON
        ---help---
 	 Support for Atheros HTC based cards.
 	 Chipsets supported: AR9271
drivers/net/wireless/ath/ath9k/Makefile +1 -2
index b1af5d5..97133be 100644
@@ -35,7 +35,6 @@ ath9k_htc-y +=	htc_hst.o \
 		htc_drv_txrx.o \
 		htc_drv_main.o \
 		htc_drv_beacon.o \
-		htc_drv_init.o \
-		lib.o
+		htc_drv_init.o
 
 obj-$(CONFIG_ATH9K_HTC) += ath9k_htc.o
drivers/net/wireless/ath/ath9k/ath9k.h +2 -31
index 83c7ea4..c18d1e1 100644
@@ -55,9 +55,6 @@ struct ath_node;
 
 #define A_MAX(a, b) ((a) > (b) ? (a) : (b))
 
-#define TSF_TO_TU(_h,_l) \
-	((((u32)(_h)) << 22) | (((u32)(_l)) >> 10))
-
 #define	ATH_TXQ_SETUP(sc, i)        ((sc)->tx.txqsetup & (1<<i))
 
 struct ath_config {
@@ -294,8 +291,6 @@ struct ath_vif {
 #define BSTUCK_THRESH           	(9 * ATH_BCBUF)
 #define	ATH_BCBUF               	4
 #define ATH_DEFAULT_BINTVAL     	100 /* TU */
-#define ATH_DEFAULT_BMISS_LIMIT 	10
-#define IEEE80211_MS_TO_TU(x)           (((x) * 1000) / 1024)
 
 struct ath_beacon_config {
 	u16 beacon_interval;
@@ -332,18 +327,6 @@ int ath_beacon_alloc(struct ath_wiphy *aphy, struct ieee80211_vif *vif);
 void ath_beacon_return(struct ath_softc *sc, struct ath_vif *avp);
 int ath_beaconq_config(struct ath_softc *sc);
 
-/*******/
-/* ANI */
-/*******/
-
-#define ATH_STA_SHORT_CALINTERVAL 1000    /* 1 second */
-#define ATH_AP_SHORT_CALINTERVAL  100     /* 100 ms */
-#define ATH_ANI_POLLINTERVAL      100     /* 100 ms */
-#define ATH_LONG_CALINTERVAL      30000   /* 30 seconds */
-#define ATH_RESTART_CALINTERVAL   1200000 /* 20 minutes */
-
-void ath_ani_calibrate(unsigned long data);
-
 /**********/
 /* BTCOEX */
 /**********/
@@ -377,18 +360,6 @@ void ath9k_btcoex_timer_pause(struct ath_softc *sc);
 /*   LED Control    */
 /********************/
 
-#define ATH_LED_PIN_DEF 		1
-#define ATH_LED_PIN_9287		8
-#define ATH_LED_ON_DURATION_IDLE	350	/* in msecs */
-#define ATH_LED_OFF_DURATION_IDLE	250	/* in msecs */
-
-enum ath_led_type {
-	ATH_LED_RADIO,
-	ATH_LED_ASSOC,
-	ATH_LED_TX,
-	ATH_LED_RX
-};
-
 struct ath_led {
 	struct ath_softc *sc;
 	struct led_classdev led_cdev;
@@ -549,8 +520,6 @@ void ath9k_deinit_device(struct ath_softc *sc);
 const char *ath_mac_bb_name(u32 mac_bb_version);
 const char *ath_rf_name(u16 rf_version);
 void ath9k_set_hw_capab(struct ath_softc *sc, struct ieee80211_hw *hw);
-void ath9k_update_ichannel(struct ath_softc *sc, struct ieee80211_hw *hw,
-			   struct ath9k_channel *ichan);
 void ath_update_chainmask(struct ath_softc *sc, int is_ht);
 int ath_set_channel(struct ath_softc *sc, struct ieee80211_hw *hw,
 		    struct ath9k_channel *hchan);
@@ -600,6 +569,8 @@ void ath_mac80211_start_queue(struct ath_softc *sc, u16 skb_queue);
 
 int ath_tx_get_qnum(struct ath_softc *sc, int qtype, int haltype);
 
+void ath_ani_calibrate(unsigned long data);
+
 void ath_start_rfkill_poll(struct ath_softc *sc);
 extern void ath9k_rfkill_poll_state(struct ieee80211_hw *hw);
 
drivers/net/wireless/ath/ath9k/common.c +375 -35

435 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/common.h +39 -2

62 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/htc.h +4 -1
index fc9de89..232958a 100644
@@ -29,7 +29,6 @@
 #include "htc_hst.h"
 #include "hif_usb.h"
 #include "wmi.h"
-#include "lib.h"
 
 extern struct ieee80211_ops ath9k_htc_ops;
 extern int modparam_htc_nohwcrypt;
@@ -392,6 +391,10 @@ int ath9k_rx_init(struct ath9k_htc_priv *priv);
 void ath9k_rx_cleanup(struct ath9k_htc_priv *priv);
 void ath9k_host_rx_init(struct ath9k_htc_priv *priv);
 void ath9k_rx_tasklet(unsigned long data);
+u32 ath9k_calcrxfilter(struct ieee80211_hw *hw, struct ath_hw *ah,
+		       unsigned int rxfilter);
+void ath9k_opmode_init(struct ieee80211_hw *hw, struct ath_hw *ah,
+		       unsigned int rxfilter);
 
 void ath9k_start_rfkill_poll(struct ath9k_htc_priv *priv);
 void ath9k_init_leds(struct ath9k_htc_priv *priv);
drivers/net/wireless/ath/ath9k/htc_drv_main.c +1 -1
index e137b6b..578e505 100644
@@ -977,7 +977,7 @@ static int ath9k_htc_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 	hdr = (struct ieee80211_hdr *) skb->data;
 
 	/* Add the padding after the header if this is not already done */
-	padpos = ath9k_padpos(hdr->frame_control);
+	padpos = ath9k_cmn_padpos(hdr->frame_control);
 	padsize = padpos & 3;
 	if (padsize && skb->len > padpos) {
 		if (skb_headroom(skb) < padsize)
drivers/net/wireless/ath/ath9k/htc_drv_txrx.c +81 -1

94 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/lib.c deleted +0 -487

487 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/lib.h deleted +0 -85

85 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/main.c +4 -83

129 lines not on this page · raw message

drivers/net/wireless/ath/ath9k/virtual.c +1 -1
index a43fbf8..593a52a 100644
@@ -312,7 +312,7 @@ void ath9k_wiphy_chan_work(struct work_struct *work)
 	/* Change channels */
 	mutex_lock(&sc->mutex);
 	/* XXX: remove me eventually */
-	ath9k_update_ichannel(sc, aphy->hw,
+	ath9k_update_ichannel(aphy->hw,
 			      &sc->sc_ah->channels[sc->chan_idx]);
 
 	/* sync hw configuration for hw code */
Signature · 1 line
1.7.0.1