Skip to contentSkip to conversation

Net: ath5k, make its own directory

PATCH In review Jiri Slaby 4 participants 9 messages Sep 24, 2007 – Sep 26, 2007 Networking drivers (wireless)

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

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

ath5k, make its own directory

Changes-licensed-under: ISC

Cc Luis R. Rodriguez <[email protected]>

---
commit 83e027e3714be11155c100a8e4ea7c0eb2a14f0a
tree 989dc0a74ddf3b54fc28a9196bd2048cb39f8529
parent 657bdad86e3a284f0195df4b78b833d21beb727f
author Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:23:34 +0200 committer Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:23:34 +0200

 drivers/net/wireless/Makefile             |    3 +--
 drivers/net/wireless/ath5k/Makefile       |    2 ++
 drivers/net/wireless/ath5k/ath5k.h        |    0 
 drivers/net/wireless/ath5k/ath5k_base.c   |    0 
 drivers/net/wireless/ath5k/ath5k_base.h   |    0 
 drivers/net/wireless/ath5k/ath5k_hw.c     |    0 
 drivers/net/wireless/ath5k/ath5k_hw.h     |    0 
 drivers/net/wireless/ath5k/ath5k_reg.h    |    0 
 drivers/net/wireless/ath5k/ath5k_regdom.c |    0 
 drivers/net/wireless/ath5k/ath5k_regdom.h |    0 
 10 files changed, 3 insertions(+), 2 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..cf04c90
@@ -0,0 +1,2 @@
+ath5k-objs		= ath5k_base.o ath5k_hw.o ath5k_regdom.o
+obj-$(CONFIG_ATH5K)	+= ath5k.o
drivers/net/wireless/ath5k/ath5k.h renamed from drivers/net/wireless/ath5k.h +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k.h
rename to drivers/net/wireless/ath5k/ath5k.h
drivers/net/wireless/ath5k/ath5k_base.c renamed from drivers/net/wireless/ath5k_base.c +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_base.c
rename to drivers/net/wireless/ath5k/ath5k_base.c
drivers/net/wireless/ath5k/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/ath5k_base.h
drivers/net/wireless/ath5k/ath5k_hw.c renamed from drivers/net/wireless/ath5k_hw.c +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_hw.c
rename to drivers/net/wireless/ath5k/ath5k_hw.c
drivers/net/wireless/ath5k/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/ath5k_hw.h
drivers/net/wireless/ath5k/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/ath5k_reg.h
drivers/net/wireless/ath5k/ath5k_regdom.c renamed from drivers/net/wireless/ath5k_regdom.c +0 -0
similarity index 100%
rename from drivers/net/wireless/ath5k_regdom.c
rename to drivers/net/wireless/ath5k/ath5k_regdom.c
drivers/net/wireless/ath5k/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/ath5k_regdom.h
author
#1 lore raw

PATCH 2/3 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 bb9a4a146644d5b50ae0ab8c3fc57304064c57c2
tree 2123b9ba385bc2506d6e0bbf9e1539aad85467f5
parent 83e027e3714be11155c100a8e4ea7c0eb2a14f0a
author Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:33:13 +0200 committer Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:33:13 +0200

 drivers/net/wireless/ath5k/ath5k.h          |  221 ++--
 drivers/net/wireless/ath5k/ath5k_hw.c       | 1306 ---------------------
 drivers/net/wireless/ath5k/ath5k_hw.h       | 1513 ------------------------
 drivers/net/wireless/ath5k/ath5k_initvals.c | 1121 ++++++++++++++++++
 drivers/net/wireless/ath5k/ath5k_phy.c      | 1704 +++++++++++++++++++++++++++
 5 files changed, 2948 insertions(+), 2917 deletions(-)
drivers/net/wireless/ath5k/ath5k.h +103 -118
index a6f7995..b069f45 100644
@@ -28,6 +28,7 @@
 /* Uncomment this for debuging (warning that it results in TOO much output) */
 /*#define AR5K_DEBUG	1 */
 
+#include <linux/io.h>
 #include <linux/types.h>
 #include <net/mac80211.h>
 
@@ -125,42 +126,6 @@ enum ath5k_radio {
 /*
  * Common silicon revision/version values
  */
-enum ath5k_srev_type {
-	AR5K_VERSION_VER,
-	AR5K_VERSION_REV,
-	AR5K_VERSION_RAD,
-	AR5K_VERSION_DEV
-};
-
-struct ath5k_srev_name {
-	const char		*sr_name;
-	enum ath5k_srev_type	sr_type;
-	u_int			sr_val;
-};
-
-#define AR5K_SREV_NAME	{						\
-	{ "5210",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5210 },	\
-	{ "5311",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5311 },	\
-	{ "5311a",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5311A },\
-	{ "5311b",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5311B },\
-	{ "5211",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5211 },	\
-	{ "5212",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5212 },	\
-	{ "5213",	AR5K_VERSION_VER,	AR5K_SREV_VER_AR5213 },	\
-	{ "xxxx",	AR5K_VERSION_VER,	AR5K_SREV_UNKNOWN },	\
-	{ "5110",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5110 },	\
-	{ "5111",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5111 },	\
-	{ "2111",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2111 },	\
-	{ "5112",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5112 },	\
-	{ "5112a",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_5112A },	\
-	{ "2112",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2112 },	\
-	{ "2112a",	AR5K_VERSION_RAD,	AR5K_SREV_RAD_2112A },	\
-	{ "xxxx",	AR5K_VERSION_RAD,	AR5K_SREV_UNKNOWN },	\
-	{ "2413",	AR5K_VERSION_DEV,	PCI_DEVICE_ID_ATHEROS_AR2413 },\
-	{ "5413",	AR5K_VERSION_DEV,	PCI_DEVICE_ID_ATHEROS_AR5413 },\
-	{ "5424",	AR5K_VERSION_DEV,	PCI_DEVICE_ID_ATHEROS_AR5424 },\
-	{ "xxxx",	AR5K_VERSION_DEV,	AR5K_SREV_UNKNOWN }	\
-}
-
 #define AR5K_SREV_UNKNOWN	0xffff
 
 #define AR5K_SREV_VER_AR5210	0x00
@@ -182,7 +147,6 @@ struct ath5k_srev_name {
 #define AR5K_SREV_RAD_2112A	0x45
 #define AR5K_SREV_RAD_UNSUPP	0x50
 
-
 /* IEEE defs */
 
 #define IEEE80211_MAX_LEN       2500
@@ -745,12 +709,6 @@ struct ath5k_rate_table {
 } while (0)
 
 
-struct ath5k_node_stats {
-	u32	ns_avgbrssi;	/* average beacon rssi */
-	u32	ns_avgrssi;	/* average data rssi */
-	u32	ns_avgtxrssi;	/* average tx rssi */
-};
-
 enum ath5k_ant_setting {
 	AR5K_ANT_VARIABLE	= 0,	/* variable by programming */
 	AR5K_ANT_FIXED_A	= 1,	/* fixed to 11a frequencies */
@@ -1004,101 +962,128 @@ struct ath_hw {
 /*
  * Prototypes
  */
+
+/* General Functions */
+extern int ath5k_hw_register_timeout(struct ath_hw *hal, u32 reg, u32 flag, u32 val, bool is_set);
 /* Attach/Detach Functions */
-struct ath_hw *ath5k_hw_attach(u16 device, u8 macversion, void *sc, void __iomem *sh);
-const struct ath5k_rate_table *ath5k_hw_get_rate_table(struct ath_hw *hal, unsigned int mode);
-void ath5k_hw_detach(struct ath_hw *hal);
+extern struct ath_hw *ath5k_hw_attach(u16 device, u8 mac_version, void *sc, void __iomem *sh);
+extern const struct ath5k_rate_table *ath5k_hw_get_rate_table(struct ath_hw *hal, unsigned int mode);
+extern void ath5k_hw_detach(struct ath_hw *hal);
 /* Reset Functions */
-int ath5k_hw_reset(struct ath_hw *hal, enum ieee80211_if_types op_mode, struct ieee80211_channel *channel, bool change_channel);
+extern int ath5k_hw_reset(struct ath_hw *hal, enum ieee80211_if_types op_mode, struct ieee80211_channel *channel, bool change_channel);
 /* Power management functions */
-int ath5k_hw_set_power(struct ath_hw *hal, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration);
-enum ath5k_power_mode ath5k_hw_get_power_mode(struct ath_hw *hal);
+extern int ath5k_hw_set_power(struct ath_hw *hal, enum ath5k_power_mode mode, bool set_chip, u16 sleep_duration);
 /* DMA Related Functions */
-void ath5k_hw_start_rx(struct ath_hw *hal);
-int ath5k_hw_stop_rx_dma(struct ath_hw *hal);
-u32 ath5k_hw_get_rx_buf(struct ath_hw *hal);
-void ath5k_hw_put_rx_buf(struct ath_hw *hal, u32 phys_addr);
-int ath5k_hw_tx_start(struct ath_hw *hal, unsigned int queue);
-bool ath5k_hw_stop_tx_dma(struct ath_hw *hal, unsigned int queue);
-u32 ath5k_hw_get_tx_buf(struct ath_hw *hal, unsigned int queue);
-int ath5k_hw_put_tx_buf(struct ath_hw *hal, unsigned int queue, u32 phys_addr);
-bool ath5k_hw_update_tx_triglevel(struct ath_hw *hal, bool increase);
+extern void ath5k_hw_start_rx(struct ath_hw *hal);
+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 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);
 /* Interrupt handling */
-bool ath5k_hw_is_intr_pending(struct ath_hw *hal);
-int ath5k_hw_get_isr(struct ath_hw *hal, enum ath5k_int *interrupt_mask);
-enum ath5k_int ath5k_hw_set_intr(struct ath_hw *hal, enum ath5k_int new_mask);
-void ath5k_hw_radar_alert(struct ath_hw *hal, bool enable);
+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);
+extern enum ath5k_int ath5k_hw_set_intr(struct ath_hw *hal, enum ath5k_int new_mask);
 /* EEPROM access functions */
-int ath5k_hw_set_regdomain(struct ath_hw *hal, u16 regdomain);
+extern int ath5k_hw_set_regdomain(struct ath_hw *hal, u16 regdomain);
 /* Protocol Control Unit Functions */
-void ath5k_hw_set_opmode(struct ath_hw *hal);
+extern void ath5k_hw_set_opmode(struct ath_hw *hal);
 /* BSSID Functions */
-void ath5k_hw_get_lladdr(struct ath_hw *hal, u8 *mac);
-bool ath5k_hw_set_lladdr(struct ath_hw *hal, const u8 *mac);
-void ath5k_hw_set_associd(struct ath_hw *hal, const u8 *bssid, u16 assoc_id);
-bool ath5k_hw_set_bssid_mask(struct ath_hw *hal, const u8 *mask);
+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 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);
 /* Receive start/stop functions */
-void ath5k_hw_start_rx_pcu(struct ath_hw *hal);
-void ath5k_hw_stop_pcu_recv(struct ath_hw *hal);
+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 */
-void ath5k_hw_set_mcast_filter(struct ath_hw *hal, u32 filter0, u32 filter1);
-bool ath5k_hw_set_mcast_filterindex(struct ath_hw *hal, u32 index);
-bool ath5k_hw_clear_mcast_filter_idx(struct ath_hw *hal, u32 index);
-u32 ath5k_hw_get_rx_filter(struct ath_hw *hal);
-void ath5k_hw_set_rx_filter(struct ath_hw *hal, u32 filter);
+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 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 */
-u32 ath5k_hw_get_tsf32(struct ath_hw *hal);
-u64 ath5k_hw_get_tsf64(struct ath_hw *hal);
-void ath5k_hw_reset_tsf(struct ath_hw *hal);
-void ath5k_hw_init_beacon(struct ath_hw *hal, u32 next_beacon, u32 interval);
-void ath5k_hw_set_beacon_timers(struct ath_hw *hal, const struct ath5k_beacon_state *state);
-void ath5k_hw_reset_beacon(struct ath_hw *hal);
-bool ath5k_hw_wait_for_beacon(struct ath_hw *hal, unsigned long phys_addr);
-void ath5k_hw_update_mib_counters(struct ath_hw *hal, struct ath5k_mib_stats *statistics);
+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 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 void ath5k_hw_update_mib_counters(struct ath_hw *hal, struct ath5k_mib_stats *statistics);
 /* ACK/CTS Timeouts */
-bool ath5k_hw_set_ack_timeout(struct ath_hw *hal, unsigned int timeout);
-unsigned int ath5k_hw_get_ack_timeout(struct ath_hw *hal);
-bool ath5k_hw_set_cts_timeout(struct ath_hw *hal, unsigned int timeout);
-unsigned int ath5k_hw_get_cts_timeout(struct ath_hw *hal);
+extern bool 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 unsigned int ath5k_hw_get_cts_timeout(struct ath_hw *hal);
 /* Key table (WEP) functions */
-int ath5k_hw_reset_key(struct ath_hw *hal, u16 entry);
-int ath5k_hw_is_key_valid(struct ath_hw *hal, u16 entry);
-int ath5k_hw_set_key(struct ath_hw *hal, u16 entry, const struct ieee80211_key_conf *key, const u8 *mac);
-int ath5k_hw_set_key_lladdr(struct ath_hw *hal, u16 entry, const u8 *mac);
+extern int ath5k_hw_reset_key(struct ath_hw *hal, u16 entry);
+extern int ath5k_hw_is_key_valid(struct ath_hw *hal, u16 entry);
+extern int ath5k_hw_set_key(struct ath_hw *hal, u16 entry, const struct ieee80211_key_conf *key, const u8 *mac);
+extern int ath5k_hw_set_key_lladdr(struct ath_hw *hal, u16 entry, const u8 *mac);
 /* Queue Control Unit, DFS Control Unit Functions */
-int ath5k_hw_setup_tx_queue(struct ath_hw *hal, enum ath5k_tx_queue queue_type, struct ath5k_txq_info *queue_info);
-int ath5k_hw_setup_tx_queueprops(struct ath_hw *hal, int queue, const struct ath5k_txq_info *queue_info);
-int ath5k_hw_get_tx_queueprops(struct ath_hw *hal, int queue, struct ath5k_txq_info *queue_info);
-void ath5k_hw_release_tx_queue(struct ath_hw *hal, unsigned int queue);
-int ath5k_hw_reset_tx_queue(struct ath_hw *hal, unsigned int queue);
-u32 ath5k_hw_num_tx_pending(struct ath_hw *hal, unsigned int queue);
-bool ath5k_hw_set_slot_time(struct ath_hw *hal, unsigned int slot_time);
-unsigned int ath5k_hw_get_slot_time(struct ath_hw *hal);
+extern int ath5k_hw_setup_tx_queue(struct ath_hw *hal, enum ath5k_tx_queue queue_type, struct ath5k_txq_info *queue_info);
+extern int ath5k_hw_setup_tx_queueprops(struct ath_hw *hal, int queue, const struct ath5k_txq_info *queue_info);
+extern int ath5k_hw_get_tx_queueprops(struct ath_hw *hal, int queue, struct ath5k_txq_info *queue_info);
+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 unsigned int ath5k_hw_get_slot_time(struct ath_hw *hal);
 /* Hardware Descriptor Functions */
-/* RX Descriptor */
-int ath5k_hw_setup_rx_desc(struct ath_hw *hal, struct ath_desc *desc, u32 size, unsigned int flags);
+extern int ath5k_hw_setup_rx_desc(struct ath_hw *hal, struct ath_desc *desc, u32 size, unsigned int flags);
 /* GPIO Functions */
-void ath5k_hw_set_ledstate(struct ath_hw *hal, unsigned int state);
-int ath5k_hw_set_gpio_output(struct ath_hw *hal, u32 gpio);
-int ath5k_hw_set_gpio_input(struct ath_hw *hal, u32 gpio);
-u32 ath5k_hw_get_gpio(struct ath_hw *hal, u32 gpio);
-int ath5k_hw_set_gpio(struct ath_hw *hal, u32 gpio, u32 val);
-void ath5k_hw_set_gpio_intr(struct ath_hw *hal, unsigned int gpio, u32 interrupt_level);
+extern void ath5k_hw_set_ledstate(struct ath_hw *hal, unsigned int state);
+extern int ath5k_hw_set_gpio_output(struct ath_hw *hal, u32 gpio);
+extern int ath5k_hw_set_gpio_input(struct ath_hw *hal, u32 gpio);
+extern u32 ath5k_hw_get_gpio(struct ath_hw *hal, u32 gpio);
+extern int ath5k_hw_set_gpio(struct ath_hw *hal, u32 gpio, u32 val);
+extern void ath5k_hw_set_gpio_intr(struct ath_hw *hal, unsigned int gpio, u32 interrupt_level);
 /* Regulatory Domain/Channels Setup */
-bool ath5k_channel_ok(struct ath_hw *hal, u16 freq, unsigned int flags);
-u16 ath5k_get_regdomain(struct ath_hw *hal);
-/* PHY/RF access functions */
-int ath5k_hw_phy_calibrate(struct ath_hw *hal, struct ieee80211_channel *channel);
-bool ath5k_hw_phy_disable(struct ath_hw *hal);
-void ath5k_hw_set_def_antenna(struct ath_hw *hal, unsigned int ant);
-unsigned int ath5k_hw_get_def_antenna(struct ath_hw *hal);
-enum ath5k_rfgain ath5k_hw_get_rf_gain(struct ath_hw *hal);
+extern u16 ath5k_get_regdomain(struct ath_hw *hal);
 /* Misc functions */
-int ath5k_hw_set_txpower_limit(struct ath_hw *hal, unsigned int power);
-void ath5k_hw_dump_state(struct ath_hw *hal);
-int ath5k_hw_get_capability(struct ath_hw *hal, enum ath5k_capability_type cap_type, u32 capability, u32 *result);
+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 */
+extern int ath5k_hw_write_initvals(struct ath_hw *hal, u8 mode, bool change_channel);
+/* Initialize RF */
+extern int ath5k_hw_rfregs(struct ath_hw *hal, struct ieee80211_channel *channel, unsigned int mode);
+extern int ath5k_hw_rfgain(struct ath_hw *hal, unsigned int freq);
+extern enum ath5k_rfgain ath5k_hw_get_rf_gain(struct ath_hw *hal);
+extern int ath5k_hw_set_rfgain_opt(struct ath_hw *hal);
+
+
+/* PHY/RF channel functions */
+extern bool ath5k_channel_ok(struct ath_hw *hal, u16 freq, unsigned int flags);
+extern int ath5k_hw_channel(struct ath_hw *hal, struct ieee80211_channel *channel);
+/* PHY calibration */
+extern int ath5k_hw_phy_calibrate(struct ath_hw *hal, struct ieee80211_channel *channel);
+extern int ath5k_hw_phy_disable(struct ath_hw *hal);
+/* Misc PHY functions */
+extern u16 ath5k_hw_radio_revision(struct ath_hw *hal, unsigned int chan);
+extern void ath5k_hw_set_def_antenna(struct ath_hw *hal, unsigned int ant);
+extern unsigned int ath5k_hw_get_def_antenna(struct ath_hw *hal);
+/* TX power setup */
+extern int ath5k_hw_txpower(struct ath_hw *hal, struct ieee80211_channel *channel, unsigned int txpower);
+extern int ath5k_hw_set_txpower_limit(struct ath_hw *hal, unsigned int power);
+
+
+static inline u32 ath5k_hw_reg_read(struct ath_hw *hal, u16 reg)
+{
+	return ioread32(hal->ah_sh + reg);
+}
+
+static inline void ath5k_hw_reg_write(struct ath_hw *hal, u32 val, u16 reg)
+{
+	iowrite32(val, hal->ah_sh + reg);
+}
+
 #endif
drivers/net/wireless/ath5k/ath5k_hw.c +8 -1298

1,392 lines not on this page · raw message

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

1,337 lines not on this page · raw message

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

1,121 lines not on this page · raw message

drivers/net/wireless/ath5k/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/3 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 beb56ba7270e1bf4e2f5a5e69195b082b2a14f29
tree 4232ba30c9392ed8c10c85e1b567502fb0b3780a
parent bb9a4a146644d5b50ae0ab8c3fc57304064c57c2
author Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:35:08 +0200 committer Jiri Slaby <[email protected]> Mon, 24 Sep 2007 20:35:08 +0200

 drivers/net/wireless/ath5k/ath5k.h      |   27 ++---
 drivers/net/wireless/ath5k/ath5k_base.c |    2 
 drivers/net/wireless/ath5k/ath5k_hw.c   |  169 ++++++++++++++-----------------
 3 files changed, 91 insertions(+), 107 deletions(-)
drivers/net/wireless/ath5k/ath5k.h +12 -15
index b069f45..69e2efe 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/ath5k_base.c +1 -1
index fead9a7..665f775 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/ath5k_hw.c +78 -91

476 lines not on this page · raw message

#3 lore raw

Re: [PATCH 3/3 try 3] Net: ath5k, use int as retval

Quoted 5 lines · Jiri Slaby

ath5k, use int as retval

Changes-licensed-under: ISC

Cc Luis R. Rodriguez <[email protected]>

Same comment applies here for the #if 0. Specifically here:

@@ -4360,38 +4344,41 @@ yes:

       return 0;

}

-bool
-ath5k_hw_query_pspoll_support(struct ath_hw *hal) +#if 0
+static bool ath5k_hw_query_pspoll_support(struct ath_hw *hal)

 {
       AR5K_TRACE;
+
       if (hal->ah_version == AR5K_AR5210)

- return(true);
+ return true;

       return false;

}
+#endif

Luis

maintainer
#5 lore raw
In reply to Jiri Slaby
Quoted 4 lines · Jiri Slaby

ath5k, make its own directory

rename from drivers/net/wireless/ath5k_regdom.c rename to drivers/net/wireless/ath5k/ath5k_regdom.c

imho you should get rid of the ath5k_ prefixes now.

johannes

author
#6 lore raw
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Jiri Slaby

ath5k, make its own directory

rename from drivers/net/wireless/ath5k_regdom.c rename to drivers/net/wireless/ath5k/ath5k_regdom.c

imho you should get rid of the ath5k_ prefixes now.

It's OK to me, but this is how bcm, prism and zd do it :). If nobody minds, I will get rid of the prefix.

#7 lore raw
Quoted 11 lines · Jiri Slaby
Quoted 7 lines · Johannes Berg
Quoted 4 lines · Jiri Slaby

ath5k, make its own directory

rename from drivers/net/wireless/ath5k_regdom.c rename to drivers/net/wireless/ath5k/ath5k_regdom.c

imho you should get rid of the ath5k_ prefixes now.

It's OK to me, but this is how bcm, prism and zd do it :). If nobody minds, I will get rid of the prefix.

This would be great :-)

Luis

#8 lore raw

2007/9/24, Luis R. Rodriguez <[email protected]>:

Quoted 5 lines · Jiri Slaby
Quoted 4 lines · Johannes Berg
Quoted 3 lines · Jiri Slaby
Quoted 1 line

ath5k, make its own directory

Quoted 8 lines
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

rename from drivers/net/wireless/ath5k_regdom.c rename to drivers/net/wireless/ath5k/ath5k_regdom.c

imho you should get rid of the ath5k_ prefixes now.

It's OK to me, but this is how bcm, prism and zd do it :). If nobody minds, I will get rid of the prefix.

O.K. by me too ;-)

Signature · 3 lines
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick