Skip to contentSkip to conversation

Net: ath5k, make its own directory

PATCH New Jiri Slaby 1 participant 4 messages Sep 26, 2007 Networking drivers (wireless)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/4 Net: ath5k, make its own directory

ath5k, make its own directory

also remove ath5_ prefix from the filenames

Changes-licensed-under: ISC

Cc Luis R. Rodriguez <[email protected]>

---
commit 4dae5c12636df0f0ee94fc2d6a9ab53c24873878
tree 9dbe7eb60ff0255e60c40e04beb741b9c2fb7cb0
parent 657bdad86e3a284f0195df4b78b833d21beb727f
author Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:41:14 +0200 committer Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:41:14 +0200

 drivers/net/wireless/Makefile       |    3 +--
 drivers/net/wireless/ath5k/Makefile |    2 ++
 drivers/net/wireless/ath5k/ath5k.h  |    4 ++--
 drivers/net/wireless/ath5k/base.c   |    4 ++--
 drivers/net/wireless/ath5k/base.h   |    0 
 drivers/net/wireless/ath5k/hw.c     |    2 +-
 drivers/net/wireless/ath5k/hw.h     |    0 
 drivers/net/wireless/ath5k/reg.h    |    0 
 drivers/net/wireless/ath5k/regdom.c |    2 +-
 drivers/net/wireless/ath5k/regdom.h |    0 
 10 files changed, 9 insertions(+), 8 deletions(-)
drivers/net/wireless/Makefile +1 -2
index 02f8b71..638865d 100644
@@ -48,5 +48,4 @@ obj-$(CONFIG_LIBERTAS)      += libertas/
 rtl8187-objs		:= rtl8187_dev.o rtl8187_rtl8225.o
 obj-$(CONFIG_RTL8187)	+= rtl8187.o
 
-obj-$(CONFIG_ATH5K)	+= ath5k.o
-ath5k-objs		= ath5k_base.o ath5k_hw.o ath5k_regdom.o
+obj-$(CONFIG_ATH5K)	+= ath5k/
drivers/net/wireless/ath5k/Makefile new file +2 -0
new file mode 100644
index 0000000..b145c03
@@ -0,0 +1,2 @@
+ath5k-objs		= base.o hw.o regdom.o
+obj-$(CONFIG_ATH5K)	+= ath5k.o
drivers/net/wireless/ath5k/ath5k.h renamed from drivers/net/wireless/ath5k.h +2 -2
similarity index 100%
rename from drivers/net/wireless/ath5k.h
rename to drivers/net/wireless/ath5k/ath5k.h
index a6f7995..da9547d 100644
@@ -31,8 +31,8 @@
 #include <linux/types.h>
 #include <net/mac80211.h>
 
-#include "ath5k_hw.h"
-#include "ath5k_regdom.h"
+#include "hw.h"
+#include "regdom.h"
 
 /* PCI IDs */
 #define PCI_DEVICE_ID_ATHEROS_AR5210 		0x0007 /* AR5210 */
drivers/net/wireless/ath5k/base.c renamed from drivers/net/wireless/ath5k_base.c +2 -2
similarity index 100%
rename from drivers/net/wireless/ath5k_base.c
rename to drivers/net/wireless/ath5k/base.c
index fead9a7..716b10c 100644
@@ -41,8 +41,8 @@
 
 #include <asm/unaligned.h>
 
-#include "ath5k_base.h"
-#include "ath5k_reg.h"
+#include "base.h"
+#include "reg.h"
 
 #define ATH_DEBUG_MODES		0 /* Show found modes in the log? */
 #define ATH_DUMP_SKB		0 /* show skb contents */
drivers/net/wireless/ath5k/base.h renamed from drivers/net/wireless/ath5k_base.h +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_base.h
rename to drivers/net/wireless/ath5k/base.h
drivers/net/wireless/ath5k/hw.c renamed from drivers/net/wireless/ath5k_hw.c +1 -1
similarity index 100%
rename from drivers/net/wireless/ath5k_hw.c
rename to drivers/net/wireless/ath5k/hw.c
index e4cc307..48c5be4 100644
@@ -25,7 +25,7 @@
 #include <linux/delay.h>
 
 #include "ath5k.h"
-#include "ath5k_reg.h"
+#include "reg.h"
 
 /*Rate tables*/
 static const struct ath5k_rate_table ath5k_rt_11a = AR5K_RATES_11A;
drivers/net/wireless/ath5k/hw.h renamed from drivers/net/wireless/ath5k_hw.h +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_hw.h
rename to drivers/net/wireless/ath5k/hw.h
drivers/net/wireless/ath5k/reg.h renamed from drivers/net/wireless/ath5k_reg.h +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_reg.h
rename to drivers/net/wireless/ath5k/reg.h
drivers/net/wireless/ath5k/regdom.c renamed from drivers/net/wireless/ath5k_regdom.c +1 -1
similarity index 99%
rename from drivers/net/wireless/ath5k_regdom.c
rename to drivers/net/wireless/ath5k/regdom.c
index 10d3158..e851957 100644
@@ -21,7 +21,7 @@
 #include <linux/kernel.h>
 #include <linux/string.h>
 
-#include "ath5k_regdom.h"
+#include "regdom.h"
 
 static const struct ath5k_regdommap {
 	enum ath5k_regdom dmn;
drivers/net/wireless/ath5k/regdom.h renamed from drivers/net/wireless/ath5k_regdom.h +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_regdom.h
rename to drivers/net/wireless/ath5k/regdom.h
author
#1 lore raw

PATCH 2/4 Net: ath5k, split hw into hw, phy and initvals

From: Nick Kossifidis <[email protected]>

ath5k, split hw into hw, phy and initvals

Separate the hw code into logical pieces hw, phy and initvals for better readability and maintainability.

This includes suggested file renames (_hw removal).

Changes-licensed-under: ISC

---
commit 7a40afffb6c663bd3f31c2cdd2e9263b68e5e609
tree 1a30acaa9d24a7489dc1f2018f9eccf4322784b9
parent 4dae5c12636df0f0ee94fc2d6a9ab53c24873878
author Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:46:32 +0200 committer Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:46:32 +0200

 drivers/net/wireless/ath5k/Makefile   |    2 
 drivers/net/wireless/ath5k/ath5k.h    |  221 ++--
 drivers/net/wireless/ath5k/hw.c       | 1306 -------------------------
 drivers/net/wireless/ath5k/hw.h       | 1513 -----------------------------
 drivers/net/wireless/ath5k/initvals.c | 1121 ++++++++++++++++++++++
 drivers/net/wireless/ath5k/phy.c      | 1704 +++++++++++++++++++++++++++++++++
 6 files changed, 2949 insertions(+), 2918 deletions(-)
drivers/net/wireless/ath5k/Makefile +1 -1
index b145c03..f27560b 100644
@@ -1,2 +1,2 @@
-ath5k-objs		= base.o hw.o regdom.o
+ath5k-objs		= base.o hw.o regdom.o initvals.o phy.o
 obj-$(CONFIG_ATH5K)	+= ath5k.o
drivers/net/wireless/ath5k/ath5k.h +103 -118

271 lines not on this page · raw message

drivers/net/wireless/ath5k/hw.c +8 -1298

1,392 lines not on this page · raw message

drivers/net/wireless/ath5k/hw.h +12 -1501

1,334 lines not on this page · raw message

drivers/net/wireless/ath5k/initvals.c new file +1121 -0

1,121 lines not on this page · raw message

drivers/net/wireless/ath5k/phy.c new file +1704 -0

1,704 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

Part of the diff is not shown here. View the raw message.

author
#2 lore raw

PATCH 3/4 Net: ath5k, use int as retval

In reply to Jiri Slaby

ath5k, use int as retval

Changes-licensed-under: ISC

Cc Luis R. Rodriguez <[email protected]>

---
commit f8eb6398d305c122ed72887a13625c2e7a992981
tree 54dff607e08a2f4487f3db252b08cb6b96e384e5
parent 7a40afffb6c663bd3f31c2cdd2e9263b68e5e609
author Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:47:33 +0200 committer Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:47:33 +0200

 drivers/net/wireless/ath5k/ath5k.h |   27 +++---
 drivers/net/wireless/ath5k/base.c  |    2 
 drivers/net/wireless/ath5k/hw.c    |  169 +++++++++++++++++-------------------
 3 files changed, 91 insertions(+), 107 deletions(-)
drivers/net/wireless/ath5k/ath5k.h +12 -15
index 3a94b15..39cdb5f 100644
@@ -979,10 +979,10 @@ extern int ath5k_hw_stop_rx_dma(struct ath_hw *hal);
 extern u32 ath5k_hw_get_rx_buf(struct ath_hw *hal);
 extern void ath5k_hw_put_rx_buf(struct ath_hw *hal, u32 phys_addr);
 extern int ath5k_hw_tx_start(struct ath_hw *hal, unsigned int queue);
-extern bool ath5k_hw_stop_tx_dma(struct ath_hw *hal, unsigned int queue);
+extern int ath5k_hw_stop_tx_dma(struct ath_hw *hal, unsigned int queue);
 extern u32 ath5k_hw_get_tx_buf(struct ath_hw *hal, unsigned int queue);
 extern int ath5k_hw_put_tx_buf(struct ath_hw *hal, unsigned int queue, u32 phys_addr);
-extern bool ath5k_hw_update_tx_triglevel(struct ath_hw *hal, bool increase);
+extern int ath5k_hw_update_tx_triglevel(struct ath_hw *hal, bool increase);
 /* Interrupt handling */
 extern bool ath5k_hw_is_intr_pending(struct ath_hw *hal);
 extern int ath5k_hw_get_isr(struct ath_hw *hal, enum ath5k_int *interrupt_mask);
@@ -990,19 +990,19 @@ extern enum ath5k_int ath5k_hw_set_intr(struct ath_hw *hal, enum ath5k_int new_m
 /* EEPROM access functions */
 extern int ath5k_hw_set_regdomain(struct ath_hw *hal, u16 regdomain);
 /* Protocol Control Unit Functions */
-extern void ath5k_hw_set_opmode(struct ath_hw *hal);
+extern int ath5k_hw_set_opmode(struct ath_hw *hal);
 /* BSSID Functions */
 extern void ath5k_hw_get_lladdr(struct ath_hw *hal, u8 *mac);
-extern bool ath5k_hw_set_lladdr(struct ath_hw *hal, const u8 *mac);
+extern int ath5k_hw_set_lladdr(struct ath_hw *hal, const u8 *mac);
 extern void ath5k_hw_set_associd(struct ath_hw *hal, const u8 *bssid, u16 assoc_id);
-extern bool ath5k_hw_set_bssid_mask(struct ath_hw *hal, const u8 *mask);
+extern int ath5k_hw_set_bssid_mask(struct ath_hw *hal, const u8 *mask);
 /* Receive start/stop functions */
 extern void ath5k_hw_start_rx_pcu(struct ath_hw *hal);
 extern void ath5k_hw_stop_pcu_recv(struct ath_hw *hal);
 /* RX Filter functions */
 extern void ath5k_hw_set_mcast_filter(struct ath_hw *hal, u32 filter0, u32 filter1);
-extern bool ath5k_hw_set_mcast_filterindex(struct ath_hw *hal, u32 index);
-extern bool ath5k_hw_clear_mcast_filter_idx(struct ath_hw *hal, u32 index);
+extern int ath5k_hw_set_mcast_filterindex(struct ath_hw *hal, u32 index);
+extern int ath5k_hw_clear_mcast_filter_idx(struct ath_hw *hal, u32 index);
 extern u32 ath5k_hw_get_rx_filter(struct ath_hw *ah);
 extern void ath5k_hw_set_rx_filter(struct ath_hw *ah, u32 filter);
 /* Beacon related functions */
@@ -1010,14 +1010,14 @@ extern u32 ath5k_hw_get_tsf32(struct ath_hw *hal);
 extern u64 ath5k_hw_get_tsf64(struct ath_hw *hal);
 extern void ath5k_hw_reset_tsf(struct ath_hw *hal);
 extern void ath5k_hw_init_beacon(struct ath_hw *hal, u32 next_beacon, u32 interval);
-extern void ath5k_hw_set_beacon_timers(struct ath_hw *hal, const struct ath5k_beacon_state *state);
+extern int ath5k_hw_set_beacon_timers(struct ath_hw *hal, const struct ath5k_beacon_state *state);
 extern void ath5k_hw_reset_beacon(struct ath_hw *hal);
-extern bool ath5k_hw_wait_for_beacon(struct ath_hw *hal, unsigned long phys_addr);
+extern int ath5k_hw_wait_for_beacon(struct ath_hw *hal, unsigned long phys_addr);
 extern void ath5k_hw_update_mib_counters(struct ath_hw *hal, struct ath5k_mib_stats *statistics);
 /* ACK/CTS Timeouts */
-extern bool ath5k_hw_set_ack_timeout(struct ath_hw *hal, unsigned int timeout);
+extern int ath5k_hw_set_ack_timeout(struct ath_hw *hal, unsigned int timeout);
 extern unsigned int ath5k_hw_get_ack_timeout(struct ath_hw *hal);
-extern bool ath5k_hw_set_cts_timeout(struct ath_hw *hal, unsigned int timeout);
+extern int ath5k_hw_set_cts_timeout(struct ath_hw *hal, unsigned int timeout);
 extern unsigned int ath5k_hw_get_cts_timeout(struct ath_hw *hal);
 /* Key table (WEP) functions */
 extern int ath5k_hw_reset_key(struct ath_hw *hal, u16 entry);
@@ -1031,7 +1031,7 @@ extern int ath5k_hw_get_tx_queueprops(struct ath_hw *hal, int queue, struct ath5
 extern void ath5k_hw_release_tx_queue(struct ath_hw *hal, unsigned int queue);
 extern int ath5k_hw_reset_tx_queue(struct ath_hw *hal, unsigned int queue);
 extern u32 ath5k_hw_num_tx_pending(struct ath_hw *hal, unsigned int queue);
-extern bool ath5k_hw_set_slot_time(struct ath_hw *hal, unsigned int slot_time);
+extern int ath5k_hw_set_slot_time(struct ath_hw *hal, unsigned int slot_time);
 extern unsigned int ath5k_hw_get_slot_time(struct ath_hw *hal);
 /* Hardware Descriptor Functions */
 extern int ath5k_hw_setup_rx_desc(struct ath_hw *hal, struct ath_desc *desc, u32 size, unsigned int flags);
@@ -1047,9 +1047,6 @@ extern u16 ath5k_get_regdomain(struct ath_hw *hal);
 /* Misc functions */
 extern void ath5k_hw_dump_state(struct ath_hw *hal);
 extern int ath5k_hw_get_capability(struct ath_hw *hal, enum ath5k_capability_type cap_type, u32 capability, u32 *result);
-bool ath5k_hw_query_pspoll_support(struct ath_hw *hal);
-bool ath5k_hw_enable_pspoll(struct ath_hw *hal, u8 *bssid, u16 assoc_id);
-bool ath5k_hw_disable_pspoll(struct ath_hw *hal);
 
 
 /* Initial register settings functions */
drivers/net/wireless/ath5k/base.c +1 -1
index 716b10c..64b2ffe 100644
@@ -579,7 +579,7 @@ static void ath_beacon_send(struct ath_softc *sc)
 	 * This should never fail since we check above that no frames
 	 * are still pending on the queue.
 	 */
-	if (unlikely(!ath5k_hw_stop_tx_dma(ah, sc->bhalq))) {
+	if (unlikely(ath5k_hw_stop_tx_dma(ah, sc->bhalq))) {
 		printk(KERN_WARNING "ath: beacon queue %u didn't stop?\n",
 				sc->bhalq);
 		/* NB: the HAL still stops DMA, so proceed */
drivers/net/wireless/ath5k/hw.c +78 -91

476 lines not on this page · raw message

author
#3 lore raw

PATCH 4/4 Net: ath5k, remove unused/dead code

In reply to Jiri Slaby

ath5k, remove unused/dead code

Remove ifdeffed code, which is currently (and might not be in the future too) unused. If it was ever really needed, it could be easily ported back from the madwifi-old-openhal repository.

Cc Luis R. Rodriguez <[email protected]>

---
commit ec6042026ddc40bf55846c3b3a19a78ff57eda30
tree 3f620c10b52e10204fc08cf042c73795fc8fe027
parent f8eb6398d305c122ed72887a13625c2e7a992981
author Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:51:21 +0200 committer Jiri Slaby <[email protected]> Tue, 25 Sep 2007 09:51:21 +0200

 drivers/net/wireless/ath5k/hw.c |   71 ---------------------------------------
 1 files changed, 0 insertions(+), 71 deletions(-)
drivers/net/wireless/ath5k/hw.c +0 -71
index f74f0ca..3a865cc 100644
@@ -1140,19 +1140,6 @@ commit:
 	return 0;
 }
 
-#if 0
-/*
- * Get power mode (sleep state)
- * TODO:Remove ?
- */
-enum ath5k_power_mode
-ath5k_hw_get_power_mode(struct ath_hw *hal)
-{
-	AR5K_TRACE;
-	return hal->ah_power_mode;
-}
-#endif
-
 /***********************\
   DMA Related Functions
 \***********************/
@@ -1580,52 +1567,6 @@ enum ath5k_int ath5k_hw_set_intr(struct ath_hw *hal, enum ath5k_int new_mask)
 	return old_mask;
 }
 
-#if 0
-/*
- * Enable HW radar detection
- */
-void
-ath5k_hw_radar_alert(struct ath_hw *hal, bool enable)
-{
-
-	AR5K_TRACE;
-	/*
-	 * Enable radar detection
-	 */
-
-	/*Disable interupts*/
-	ath5k_hw_reg_write(hal, AR5K_IER_DISABLE, AR5K_IER);
-
-	/*
-	 * Set the RXPHY interrupt to be able to detect
-	 * possible radar activity.
-	 */
-	if (hal->ah_version == AR5K_AR5210) {
-		if (enable == true)
-			AR5K_REG_ENABLE_BITS(hal, AR5K_IMR, AR5K_IMR_RXPHY);
-		else
-			AR5K_REG_DISABLE_BITS(hal, AR5K_IMR, AR5K_IMR_RXPHY);
-	} else {
-		/*Also set AR5K_PHY_RADAR register on 5111/5112*/
-		if (enable == true) {
-			ath5k_hw_reg_write(hal, AR5K_PHY_RADAR_ENABLE,
-				AR5K_PHY_RADAR);
-			AR5K_REG_ENABLE_BITS(hal, AR5K_PIMR,
-				AR5K_IMR_RXPHY);
-		} else {
-			ath5k_hw_reg_write(hal, AR5K_PHY_RADAR_DISABLE,
-				AR5K_PHY_RADAR);
-			AR5K_REG_DISABLE_BITS(hal, AR5K_PIMR,
-				AR5K_IMR_RXPHY);
-		}
-	}
-
-	/*Re-enable interrupts*/
-	ath5k_hw_reg_write(hal, AR5K_IER_ENABLE, AR5K_IER);
-}
-#endif
-
-
 
 /*************************\
   EEPROM access functions
@@ -4344,18 +4285,6 @@ yes:
 	return 0;
 }
 
-#if 0
-static bool ath5k_hw_query_pspoll_support(struct ath_hw *hal)
-{
-	AR5K_TRACE;
-
-	if (hal->ah_version == AR5K_AR5210)
-		return true;
-
-	return false;
-}
-#endif
-
 static int ath5k_hw_enable_pspoll(struct ath_hw *hal, u8 *bssid,
 		u16 assoc_id)
 {