Net: ath5k, split hw into hw, phy and initvals
Subsystems (3)
PATCH 1/5 Net: ath5k, split hw into hw, phy and initvals
ath5k, split hw into hw, phy and initvals
Separate the hw code into logical pieces hw, phy and initvals for better readability and maintainability.
---
commit f65aa1c7d680d1bcde1ae20749eeda6d3ec02652
tree d7bb663be32d81a32431d9d0e0c775ddb67bf6cf
parent 49fa12761f1fef6f0e6bf7d8ef7e599c5eef6871
author Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:23:29 +0200 committer Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:23:29 +0200
drivers/net/wireless/Makefile | 3 drivers/net/wireless/ath5k.h | 221 ++-- drivers/net/wireless/ath5k_hw.c | 1306 ------------------------ drivers/net/wireless/ath5k_hw.h | 1513 ---------------------------- drivers/net/wireless/ath5k_hw_inivals.c | 1090 ++++++++++++++++++++ drivers/net/wireless/ath5k_hw_phy.c | 1674 +++++++++++++++++++++++++++++++ 6 files changed, 2889 insertions(+), 2918 deletions(-)
drivers/net/wireless/Makefile +2 -1
@@ -109,4 +109,5 @@ $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE $(call if_changed_rule,cc_o_c) obj-$(CONFIG_ATH5K) += ath5k.o -ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.o
drivers/net/wireless/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,331 lines not on this page · raw message
drivers/net/wireless/ath5k_hw_inivals.c new file +1090 -0
1,090 lines not on this page · raw message
drivers/net/wireless/ath5k_hw_phy.c new file +1674 -0
1,674 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.
PATCH 2/5 Net: ath5k, switch to ioread/iowrite
ath5k, switch to ioread/iowrite
Do not use readl/writel, since iomap retval is platform dependent and needn't be virtual address awaited by readl/writel.
---
commit 64b9d0578668fe8c7a43eadace673bc3e57fc22b
tree 4990ed95e4112d79830d306ab6ae7afb2235f190
parent f65aa1c7d680d1bcde1ae20749eeda6d3ec02652
author Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:06:28 +0200 committer Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:24:50 +0200
drivers/net/wireless/ath5k.h | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath5k.h +2 -2
@@ -1018,12 +1018,12 @@ 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 readl (hal->ah_sh + reg); +return ioread32 (hal->ah_sh + reg); }static inline void ath5k_hw_reg_write (struct ath_hw *hal,u32 val,u16 reg) { -writel (val, hal->ah_sh + reg); +iowrite32 (val, hal->ah_sh + reg); }#endif
PATCH 3/5 Net: ath5k, use int as retval
In reply to Jiri Slabyath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
---
commit ceeaf6b9aac9daaa41ec38fbba3d2c1972af4470
tree 44cd0736147325e35c32274eb53bd543fb1510a9
parent 64b9d0578668fe8c7a43eadace673bc3e57fc22b
author Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:10:36 +0200 committer Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:24:57 +0200
drivers/net/wireless/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.h +12 -15
@@ -919,10 +919,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);
@@ -930,19 +930,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 */
@@ -950,14 +950,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);
@@ -971,7 +971,7 @@ extern int ath5k_hw_get_tx_queueprops(struct ath_hw *hal, int queue, struct ath5extern 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);
@@ -987,9 +987,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
@@ -577,7 +577,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
PATCH 4/5 Net: ath5k, license is GPLv2
In reply to Jiri Slabyath5k, license is GPLv2
The files are available only under GPLv2 since now.
---
commit 330c2ab9a53ddce27003218bd546034e8eeeff17
tree b24cecd991fbe3046d5c5269c61e0090427e4fd3
parent ceeaf6b9aac9daaa41ec38fbba3d2c1972af4470
author Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:27:51 +0200 committer Jiri Slaby <[email protected]> Tue, 28 Aug 2007 16:27:51 +0200
drivers/net/wireless/ath5k.h | 12 +----------- drivers/net/wireless/ath5k_base.c | 22 +++------------------- drivers/net/wireless/ath5k_base.h | 33 +-------------------------------- drivers/net/wireless/ath5k_hw.c | 13 +------------ drivers/net/wireless/ath5k_hw.h | 12 +----------- drivers/net/wireless/ath5k_reg.h | 31 +------------------------------ drivers/net/wireless/ath5k_regdom.c | 4 +--- drivers/net/wireless/ath5k_regdom.h | 4 +--- 8 files changed, 10 insertions(+), 121 deletions(-)
drivers/net/wireless/ath5k.h +1 -11
@@ -2,17 +2,7 @@* Copyright (c) 2004-2007 Reyk Floeter <[email protected]> * Copyright (c) 2006-2007 Nick Kossifidis <[email protected]> * -* Permission to use, copy, modify, and 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. +* This file is released under GPLv2 */ #ifndef _ATH5K_H
drivers/net/wireless/ath5k_base.c +3 -19
@@ -4,25 +4,9 @@* Copyright (c) 2007 Jiri Slaby <[email protected]> * All rights reserved. * -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer, -* without modification. -* 2. Redistributions in binary form must reproduce at minimum a disclaimer -* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any -* redistribution must be conditioned upon including a substantially -* similar Disclaimer requirement for further binary redistribution. -* 3. Neither the names of the above-listed copyright holders nor the names -* of any contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* Alternatively, this software may be distributed under the terms of the -* GNU General Public License ("GPL") version 2 as published by the Free -* Software Foundation. -* +* This file is released under GPLv2 */ +#define ATH_PCI_VERSION "0.9.5.0-BSD"#include <linux/version.h>
@@ -2530,5 +2514,5 @@ module_exit(exit_ath_pci);MODULE_AUTHOR ("Jiri Slaby" );MODULE_DESCRIPTION ("Support for Atheros 802.11 wireless LAN cards." );MODULE_SUPPORTED_DEVICE ("Atheros WLAN cards" ); -MODULE_LICENSE ("Dual BSD/GPL" ); +MODULE_LICENSE ("GPL v2" );MODULE_VERSION (ATH_PCI_VERSION " (EXPERIMENTAL)" );
drivers/net/wireless/ath5k_base.h +1 -32
@@ -2,38 +2,7 @@* Copyright (c) 2002-2007 Sam Leffler, Errno Consulting * All rights reserved. * -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer, -* without modification. -* 2. Redistributions in binary form must reproduce at minimum a disclaimer -* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any -* redistribution must be conditioned upon including a substantially -* similar Disclaimer requirement for further binary redistribution. -* 3. Neither the names of the above-listed copyright holders nor the names -* of any contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* Alternatively, this software may be distributed under the terms of the -* GNU General Public License ("GPL") version 2 as published by the Free -* Software Foundation. -* -* NO WARRANTY -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY -* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, -* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -* THE POSSIBILITY OF SUCH DAMAGES. -* -* $FreeBSD: src/sys/dev/ath/if_athvar.h,v 1.20 2005/01/24 20:31:24 sam Exp $ +* This file is released under GPLv2 */ /*
drivers/net/wireless/ath5k_hw.c +1 -12
@@ -3,18 +3,7 @@* Copyright (c) 2006-2007 Nick Kossifidis <[email protected]> * Copyright (c) 2007 Jiri Slaby <[email protected]> * -* Permission to use, copy, modify, and 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. -* +* This file is released under GPLv2 */ /*
drivers/net/wireless/ath5k_hw.h +1 -11
@@ -2,17 +2,7 @@* Copyright (c) 2004-2007 Reyk Floeter <[email protected]> * Copyright (c) 2006-2007 Nick Kossifidis <[email protected]> * -* Permission to use, copy, modify, and 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. +* This file is released under GPLv2 */ #include <linux/delay.h>
drivers/net/wireless/ath5k_reg.h +1 -30
@@ -2,36 +2,7 @@* Copyright (c) 2007 Nick Kossifidis <[email protected]> * All rights reserved. * -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions -* are met: -* 1. Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer, -* without modification. -* 2. Redistributions in binary form must reproduce at minimum a disclaimer -* similar to the "NO WARRANTY" disclaimer below ("Disclaimer") and any -* redistribution must be conditioned upon including a substantially -* similar Disclaimer requirement for further binary redistribution. -* 3. Neither the names of the above-listed copyright holders nor the names -* of any contributors may be used to endorse or promote products derived -* from this software without specific prior written permission. -* -* Alternatively, this software may be distributed under the terms of the -* GNU General Public License ("GPL") version 2 as published by the Free -* Software Foundation. -* -* NO WARRANTY -* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -* LIMITED TO, THE IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTIBILITY -* AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL -* THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, -* OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER -* IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF -* THE POSSIBILITY OF SUCH DAMAGES. +* This file is released under GPLv2 */ /*
drivers/net/wireless/ath5k_regdom.c +1 -3
@@ -1,9 +1,7 @@/* * Copyright (c) 2004, 2005 Reyk Floeter <[email protected]> * -* Permission to use, copy, modify, and 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. +* This file is released under GPLv2 */ /*
drivers/net/wireless/ath5k_regdom.h +1 -3
@@ -1,9 +1,7 @@/* * Copyright (c) 2004, 2005 Reyk Floeter <[email protected]> * -* Permission to use, copy, modify, and 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. +* This file is released under GPLv2 */ #ifndef _IEEE80211_REGDOMAIN_H_
PATCH 5/5 Net: ath5k, kconfig changes
In reply to Jiri Slabyath5k, kconfig changes
- build 5120, 5111 and 5112 optionally
- alter Kconfig text
---
commit 0902114e92b19bc080780f21f98807688244fc8f
tree d7b4a039e4d14ae73faf1b33907c38825d198461
parent 330c2ab9a53ddce27003218bd546034e8eeeff17
author Jiri Slaby <[email protected]> Tue, 28 Aug 2007 17:39:44 +0200 committer Jiri Slaby <[email protected]> Tue, 28 Aug 2007 17:39:44 +0200
drivers/net/wireless/Kconfig | 30 +++++++++++++++++++-------- drivers/net/wireless/ath5k_hw_inivals.c | 35 ++++++++++++++++++++++++++++--- drivers/net/wireless/ath5k_hw_phy.c | 24 +++++++++++++++++++++ 3 files changed, 77 insertions(+), 12 deletions(-)
drivers/net/wireless/Kconfig +21 -9
@@ -856,18 +856,30 @@ config IWL3945 will be called iwl3945.ko. config ATH5K - tristate "Atheros 5xxx wireless cards support" - depends on MAC80211 - depends on PCI - default m + tristate "Atheros 5xxx PCI/Cardbus wireless cards" + depends on PCI && MAC80211 && WLAN_80211 && EXPERIMENTAL ---help--- - This module adds support for atheros 5xxx (e.g. 5212) wireless - cards. If you have this card in your PC, select this to be build. + Say Y here if you intend to attach an Atheros 5xxx + series Cardbus or PCI wireless Ethernet networking card to + your computer. This driver uses mac80211 stack. - This driver uses the kernel's mac80211 subsystem. + To compile this driver as a module, choose M here: the module will be + called ath5k. If unsure, say M. - If you choose to build a module, it'll be called ath5k. Say M if - unsure. +config ATH5K_AR5210 + bool "Support AR5210" + depends on ATH5K + default y + +config ATH5K_AR5211 + bool "Support AR5211" + depends on ATH5K + default y + +config ATH5K_AR5212 + bool "Support AR5212" + depends on ATH5K + default y source "drivers/net/wireless/hostap/Kconfig" source "drivers/net/wireless/bcm43xx/Kconfig"
drivers/net/wireless/ath5k_hw_inivals.c +32 -3
@@ -38,6 +38,7 @@ struct ath5k_ini_mode {u32 mode_value[5 ]; }; +#ifdef CONFIG_ATH5K_AR5210 /* Initial register settings for AR5210 */ static const struct ath5k_ini ar5210_ini[] = { /* PCU and MAC registers */
@@ -249,7 +250,9 @@ static const struct ath5k_ini ar5210_ini[] = { { AR5K_PHY(52), 0x00000014 }, { AR5K_PHY_ACT, AR5K_PHY_ACT_ENABLE }, }; +#endif +#ifdef CONFIG_ATH5K_AR5211 /* Initial register settings for AR5211 */ static const struct ath5k_ini ar5211_ini[] = { { AR5K_RXDP, 0x00000000 },
@@ -448,7 +451,9 @@ static const struct ath5k_ini_mode ar5211_ini_mode[] = { {AR5K_RF_BUFFER_CONTROL_4 , { 0x00000010, 0x00000014, 0x00000010, 0x00000010, 0x00000010 } }, }; +#endif +#ifdef CONFIG_ATH5K_AR5212 /* Initial register settings for AR5212 */ static const struct ath5k_ini ar5212_ini[] = { { AR5K_RXDP, 0x00000000 },
@@ -842,12 +847,14 @@ static const struct ath5k_ini_mode ar5212_rf5112_ini_mode[] = { {AR5K_PHY_GAIN_2GHZ , { 0x642c0140, 0x642c0140, 0x6442c160, 0x6442c160, 0x6442c160 } }, }; +#endif /* * Initial BaseBand Gain settings for RF5111/5112 (only AR5210 comes with * RF5110 so initial BB Gain settings are included in AR5K_AR5210_INI) */ +#if defined(CONFIG_ATH5K_AR5211 ) || defined (CONFIG_ATH5K_AR5212 )/* RF5111 Initial BaseBand Gain settings */ static const struct ath5k_ini rf5111_ini_bbgain[] = { { AR5K_BB_GAIN(0), 0x00000000 },
@@ -915,7 +922,9 @@ static const struct ath5k_ini rf5111_ini_bbgain[] = { { AR5K_BB_GAIN(62), 0x00000002 }, { AR5K_BB_GAIN(63), 0x00000016 }, }; +#endif +#ifdef CONFIG_ATH5K_AR5212 /* RF 5112 Initial BaseBand Gain settings */ static const struct ath5k_ini rf5112_ini_bbgain[] = { { AR5K_BB_GAIN(0), 0x00000000 },
@@ -983,7 +992,10 @@ static const struct ath5k_ini rf5112_ini_bbgain[] = { { AR5K_BB_GAIN(62), 0x00000010 }, { AR5K_BB_GAIN(63), 0x0000001a }, }; +#endif +#if defined(CONFIG_ATH5K_AR5210) || defined(CONFIG_ATH5K_AR5211) \ + || defined(CONFIG_ATH5K_AR5212) /* * Write initial register dump */
@@ -1014,7 +1026,12 @@ static void ath5k_hw_ini_registers(struct ath_hw *hal, unsigned int size, } } } +#endif +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 ) +/* +* Write initial mode-specific register dump +*/ static void ath5k_hw_ini_mode_registers (struct ath_hw *hal,unsigned int size,const struct ath5k_ini_mode *ini_mode,u8 mode)
@@ -1028,6 +1045,7 @@ static void ath5k_hw_ini_mode_registers(struct ath_hw *hal, } } +#endif int ath5k_hw_write_initvals (struct ath_hw *hal,u8 mode,bool change_channel) {
@@ -1035,6 +1053,7 @@ int ath5k_hw_write_initvals(struct ath_hw *hal, u8 mode, bool change_channel)* Write initial mode-specific settings */ /*For 5212*/ +#ifdef CONFIG_ATH5K_AR5212 if (hal->ah_version ==AR5K_AR5212 ) {ath5k_hw_ini_mode_registers (hal,ARRAY_SIZE (ar5212_ini_mode), ar5212_ini_mode, mode);
@@ -1047,16 +1066,19 @@ int ath5k_hw_write_initvals(struct ath_hw *hal, u8 mode, bool change_channel)ARRAY_SIZE (ar5212_rf5112_ini_mode), ar5212_rf5112_ini_mode, mode); } +#endif +#ifdef CONFIG_ATH5K_AR5211 /*For 5211*/ if (hal->ah_version ==AR5K_AR5211 )ath5k_hw_ini_mode_registers (hal,ARRAY_SIZE (ar5211_ini_mode), ar5211_ini_mode, mode); +#endif /* For 5210 mode settings check out ath5k_hw_reset_tx_queue */ /* * Write initial settings common for all modes */ -/*For 5212*/ +#ifdef CONFIG_ATH5K_AR5212 if (hal->ah_version ==AR5K_AR5212 ) {ath5k_hw_ini_registers (hal,ARRAY_SIZE (ar5212_ini), ar5212_ini, change_channel);
@@ -1075,16 +1097,23 @@ int ath5k_hw_write_initvals(struct ath_hw *hal, u8 mode, bool change_channel)ARRAY_SIZE (rf5111_ini_bbgain), rf5111_ini_bbgain, change_channel); } - }else if (hal->ah_version ==AR5K_AR5211 ) { + } +#endif +#ifdef CONFIG_ATH5K_AR5211 +if (hal->ah_version ==AR5K_AR5211 ) {ath5k_hw_ini_registers (hal,ARRAY_SIZE (ar5211_ini), ar5211_ini, change_channel);/* AR5211 only comes with 5111 */ ath5k_hw_ini_registers (hal,ARRAY_SIZE (rf5111_ini_bbgain), rf5111_ini_bbgain, change_channel); - }else if (hal->ah_version ==AR5K_AR5210 ) { + } +#endif +#ifdef CONFIG_ATH5K_AR5210 +if (hal->ah_version ==AR5K_AR5210 ) {ath5k_hw_ini_registers (hal,ARRAY_SIZE (ar5210_ini), ar5210_ini, change_channel); } +#endif return 0 ; }
drivers/net/wireless/ath5k_hw_phy.c +24 -0
@@ -35,6 +35,7 @@ struct ath5k_gain_opt {const struct ath5k_gain_opt_step go_step[AR5K_GAIN_STEP_COUNT ]; }; +#if defined(CONFIG_ATH5K_AR5211) || defined(CONFIG_ATH5K_AR5212) /* RF5111 mode-specific init registers */ static const struct ath5k_ini_rf rfregs_5111[] = { { 0, 0x989c,
@@ -214,8 +215,10 @@ static const struct ath5k_gain_opt rfgain_opt_5111 = { { { 2, 1, 1, 0 }, -6 } } }; +#endif /* RF5112 mode-specific init registers */ +#ifdef CONFIG_ATH5K_AR5212 static const struct ath5k_ini_rf rfregs_5112[] = { { 1, 0x98d4, /* mode a/XR mode aTurbo mode b mode g mode gTurbo */
@@ -529,6 +532,7 @@ static const struct ath5k_gain_opt rfgain_opt_5112 = { { { 0, 1, 0, 1, 1, 0, 1 }, -16 }, } }; +#endif /* * Used to modify RF Banks before writing them to AR5K_RF_BUFFER
@@ -661,12 +665,16 @@ static s32 ath5k_hw_rfregs_gain_adjust(struct ath_hw *hal)int ret =0 ;switch (hal->ah_radio) { +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 )case AR5K_RF5111 : go = &rfgain_opt_5111;break ; +#endif +#if defined(CONFIG_ATH5K_AR5212 )case AR5K_RF5112 : go = &rfgain_opt_5112;break ; +#endif default :return 0 ; }
@@ -715,6 +723,7 @@ done:return ret; } +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 )/* * Read EEPROM Calibration data, modify RF Banks and Initialize RF5111 */
@@ -815,7 +824,9 @@ static int ath5k_hw_rf5111_rfregs(struct ath_hw *hal, return 0; } +#endif +#ifdef CONFIG_ATH5K_AR5212 /* * Read EEPROM Calibration data, modify RF Banks and Initialize RF5112 */
@@ -910,6 +921,7 @@ static int ath5k_hw_rf5112_rfregs(struct ath_hw *hal, return 0; } +#endif /* * Initialize RF
@@ -921,10 +933,13 @@ int ath5k_hw_rfregs(struct ath_hw *hal, struct ieee80211_channel *channel,int ret;switch (hal->ah_radio) { +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 )case AR5K_RF5111 : hal->ah_rf_banks_size =sizeof (rfregs_5111); func = ath5k_hw_rf5111_rfregs;break ; +#endif +#ifdef CONFIG_ATH5K_AR5212 case AR5K_RF5112 :if (hal->ah_radio_5ghz_revision >=AR5K_SREV_RAD_5112A ) hal->ah_rf_banks_size =sizeof (rfregs_5112a);
@@ -932,6 +947,7 @@ int ath5k_hw_rfregs(struct ath_hw *hal, struct ieee80211_channel *channel, hal->ah_rf_banks_size =sizeof (rfregs_5112); func = ath5k_hw_rf5112_rfregs;break ; +#endif default :return -EINVAL ; }
@@ -958,14 +974,18 @@ int ath5k_hw_rfgain(struct ath_hw *hal, unsigned int freq)unsigned int i, size;switch (hal->ah_radio) { +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 )case AR5K_RF5111 : ath5k_rfg = rfgain_5111; size =ARRAY_SIZE (rfgain_5111);break ; +#endif +#ifdef CONFIG_ATH5K_AR5212 case AR5K_RF5112 : ath5k_rfg = rfgain_5112; size =ARRAY_SIZE (rfgain_5112);break ; +#endif default :return -EINVAL ; }
@@ -1031,6 +1051,7 @@ int ath5k_hw_set_rfgain_opt(struct ath_hw *hal) {/* Initialize the gain optimization values */ switch (hal->ah_radio) { +#if defined(CONFIG_ATH5K_AR5211 ) || defined(CONFIG_ATH5K_AR5212 )case AR5K_RF5111 : hal->ah_gain.g_step_idx = rfgain_opt_5111.go_default; hal->ah_gain.g_step =
@@ -1039,6 +1060,8 @@ int ath5k_hw_set_rfgain_opt(struct ath_hw *hal) hal->ah_gain.g_high =35 ; hal->ah_gain.g_active =1 ;break ; +#endif +#ifdef CONFIG_ATH5K_AR5212 case AR5K_RF5112 : hal->ah_gain.g_step_idx = rfgain_opt_5112.go_default; hal->ah_gain.g_step =
@@ -1047,6 +1070,7 @@ int ath5k_hw_set_rfgain_opt(struct ath_hw *hal) hal->ah_gain.g_high =85 ; hal->ah_gain.g_active =1 ;break ; +#endif default :return -EINVAL ; }
Johannes Berg
maintainerOn Tue, 2007-08-28 at 11:58 -0400, Jiri Slaby wrote:
[...]
There really is no need to CC netdev, those on linux-wireless don't need to get it twice (if they're also on netdev) and those on netdev aren't too concerned about wireless-dev (and if they are really need to sign up to linux-wireless)
johannes
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 4 lines · Jiri Slaby
obj-$(CONFIG_ATH5K) += ath5k.o
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.o
Btw, this should be ath5k-y += ath5k_base.o ath5k_hw.o ath5k_regdom.o \
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 3 lines · Jiri Slaby
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.o
And while I'm at nitpicking :)
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Jiri SlabyQuoted 3 lines · Jiri Slaby
ath5k, license is GPLv2
The files are available only under GPLv2 since now.
Is this really a good idea? Most of the reverse-engineering was done by the OpenBSD folks, and it would certainly be helpful to work together with them on new hardware revisions, etc..
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to Jiri SlabyQuoted 4 lines · Jiri Slaby
drivers/net/wireless/Kconfig +4
-0+config ATH5K_AR5210 + bool "Support AR5210" + depends on ATH5K + default y
drivers/net/wireless/Kconfig config IWL3945 · line 882
Quoted 10 lines
drivers/net/wireless/Kconfig +10
-0+ +config ATH5K_AR5211 + bool "Support AR5211" + depends on ATH5K + default y + +config ATH5K_AR5212 + bool "Support AR5212" + depends on ATH5K + default y
Please don't add more default statements.
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Johannes Berg
maintainerQuoted 10 lines · Christoph Hellwig
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 3 lines · Jiri Slaby
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.oAnd while I'm at nitpicking :)
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
While we're at names... I personally much prefer a new directory ath5k and then ath5k/hw.c etc. but it seems I'm pretty alone in that. But here we already have at least four files now.
johannes
Quoted 7 lines · Johannes Berg
Quoted 6 lines · Christoph Hellwig
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 3 lines · Jiri Slaby
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.oAnd while I'm at nitpicking :)
Quoted 7 lines
Quoted 3 lines
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
While we're at names... I personally much prefer a new directory ath5k and then
ath5k/hw.cetc. but it seems I'm pretty alone in that. But here we already have at least four files now.
I agree with you. If a wireless driver takes more than one .c and one .h file, it belongs in its own directory, and the file names stripped of any driver prefix. Not only are the file names simpler, but Makefile and Kconfig in wireless benefits.
Larry
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
Quoted 3 lines · Jiri Slaby
ath5k, license is GPLv2
The files are available only under GPLv2 since now.
Is this really a good idea? Most of the reverse-engineering was done by the OpenBSD folks, and it would certainly be helpful to work together with them on new hardware revisions, etc..
Technically the best we can do is to leave the license as dual licensed, but keep in that technically that means nothing and is just for show, the GPL is what would apply as its derivative work and is the most restrictive license. This applies to any other driver in the kernel right now with a dual license tag.
Luis
Quoted 12 lines · Larry Finger
Quoted 11 lines · Johannes Berg
Quoted 9 lines · Christoph Hellwig
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 3 lines · Jiri Slaby
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.oAnd while I'm at nitpicking :)
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
Quoted 7 lines
Quoted 3 lines
While we're at names... I personally much prefer a new directory ath5k and then
ath5k/hw.cetc. but it seems I'm pretty alone in that. But here we already have at least four files now.I agree with you. If a wireless driver takes more than one .c and one .h file, it belongs in its own directory, and the file names stripped of any driver prefix. Not only are the file names simpler, but
MakefileandKconfigin wireless benefits.
NACK, I don't agree with this patch. The ath5k_regdom.* files will be gone soon anyway and don't see the reason to split the files even more. Now iwlwifi... -- that could is own directory IMHO :)
Luis
Johannes Berg
maintainerRe: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Jiri SlabyQuoted 1 line · Jiri Slaby
The files are available only under GPLv2 since now.
Since the BSD people are already getting upset about (for various reasons among which seem to be a clear non-understanding) I'd suggest changing it to:
+ * Parts of this file were originally licenced under the BSD licence:
+ *
Quoted 11 lines
* Permission to use, copy, modify, and 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.
+ *
+ * Further changes to this file since the moment this notice was extended
+ * are now distributed under the terms of the GPL version two as published
+ * by the Free Software Foundation <yaddaya>
johannes
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 7 lines · Johannes Berg
Quoted 1 line · Jiri Slaby
The files are available only under GPLv2 since now.
Since the BSD people are already getting upset about (for various reasons among which seem to be a clear non-understanding) I'd suggest changing it to:
yes, please. Can somebody do it, I'm away from my box.
Quoted 21 lines
+ * Parts of this file were originally licenced under the BSD licence:
+ *Quoted 5 lines
* Permission to use, copy, modify, and 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 ALLWARRANTIES
Quoted 6 lines
* 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.+ *
+ * Further changes to this file since the moment this notice was extended
+ * are now distributed under the terms of the GPL version two as published
+ * by the Free Software Foundation <yaddaya>johannes
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 31 lines · Jiri Slaby
Quoted 7 lines · Johannes Berg
Quoted 1 line · Jiri Slaby
The files are available only under GPLv2 since now.
Since the BSD people are already getting upset about (for various reasons among which seem to be a clear non-understanding) I'd suggest changing it to:
yes, please. Can somebody do it, I'm away from my box.
Quoted 20 lines
+ * Parts of this file were originally licenced under the BSD licence:
+ *Quoted 5 lines
* Permission to use, copy, modify, and 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 ALLWARRANTIES
Quoted 6 lines
* 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.+ *
+ * Further changes to this file since the moment this notice was extended
+ * are now distributed under the terms of the GPL version two as published
+ * by the Free Software Foundation <yaddaya>johannes
How about asking for changes to be dual-licenced too ?
Xav
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Christoph HellwigQuoted 8 lines · Christoph Hellwig
Quoted 3 lines · Jiri Slaby
ath5k, license is GPLv2
The files are available only under GPLv2 since now.
Is this really a good idea? Most of the reverse-engineering was done by the OpenBSD folks, and it would certainly be helpful to work together with them on new hardware revisions, etc..
The heck with "good idea" - it's unclear to me if Jiri is even *allowed*
to remove the BSD/other license. Jiri can release *his* code as GPLv2
only, but I suspect the files as a whole really should be dual BSD/GPLv2, due to the numerous other stakeholders in those files.
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 4 lines · On 8/29/07, [email protected] <[email protected]> wrote:
The heck with "good idea" - it's unclear to me if Jiri is even *allowed*
to remove the BSD/other license. Jiri can release *his* code as GPLv2
only, but I suspect the files as a whole really should be dual BSD/GPLv2, due to the numerous other stakeholders in those files.
This mess has been occurring in the kernel for years. The DRM graphics drivers are used in both BSD and Linux. It is quite easy to contribute something to this code via LKML and think you are doing it under the GPL. Doesn't a patch against the kernel have to be GPL? When these patches get pulled back into BSD and distributed with it, did BSD get infected with the GPL? AFAIK this has never been legally sorted out.
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 10 lines
Quoted 3 lines
to remove the BSD/other license. Jiri can release *his* code as GPLv2
only, but I suspect the files as a whole really should be dual BSD/GPLv2, due to the numerous other stakeholders in those files.This mess has been occurring in the kernel for years. The DRM graphics drivers are used in both BSD and Linux. It is quite easy to contribute something to this code via LKML and think you are doing it under the GPL. Doesn't a patch against the kernel have to be GPL? When these patches get pulled back into BSD and distributed with it, did BSD get infected with the GPL? AFAIK this has never been legally sorted out.
I'm not aware anyone has felt it needed "sorting out". Its not exactly complicated.
BSD non advertising is compatible with GPL
The GPL says:
"when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, "
The BSD license doesn't conflict with that
The GPL (and copyright law also say)
"If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to ..."
All a bit irrelevant anyway as Ath5K code (not the .h file) say:
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
So Jiri is choosing to distribute it under the GPL, and with his changes GPL only.
So whats the problem ?
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 31 lines · Alan Cox
Quoted 10 lines
Quoted 3 lines
to remove the BSD/other license. Jiri can release *his* code as GPLv2
only, but I suspect the files as a whole really should be dual BSD/GPLv2, due to the numerous other stakeholders in those files.This mess has been occurring in the kernel for years. The DRM graphics drivers are used in both BSD and Linux. It is quite easy to contribute something to this code via LKML and think you are doing it under the GPL. Doesn't a patch against the kernel have to be GPL? When these patches get pulled back into BSD and distributed with it, did BSD get infected with the GPL? AFAIK this has never been legally sorted out.
I'm not aware anyone has felt it needed "sorting out". Its not exactly complicated.
BSD non advertising is compatible with GPL
The GPL says:
"when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, "The BSD license doesn't conflict with that
The GPL (and copyright law also say)
"If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to ..."
All a bit irrelevant anyway as Ath5K code (not the .h file) say:
Quoted 8 lines
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.So Jiri is choosing to distribute it under the GPL, and with his changes GPL only.
So whats the problem ?
BSD code can definitely be brought into a GPL project as you describe. The problem is the other direction.
Aren't patches made against the kernel GPL'd if the author doesn't explicitly grant them more liberal BSD license in addition?
The problem then comes in taking the patches that were only made available against GPL code and reshipping them under the BSD license without the author explicitly agreeing to this.
What if a patch spans both code that is pure GPL and code imported from BSD, how do you license it?
Signature · 2 lines
Jon Smirl [email protected]
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
Quoted 2 lines · On Wednesday 29 August 2007 21:33:43 Jon Smirl wrote:
What if a patch spans both code that is pure GPL and code imported from BSD, how do you license it?
I think it's a valid assumption, if we say that the author of the patch read the license header of a file and agreed with it. So the patch is licensed to whatever the fileheader says. And if there's none, it's licensed with the COPYING terms.
If a patch author likes some other license conditions, he must explicitely add them with the patch to the file, saying that this and that part have these and those conditions. Of course they must be compatible with the original license.
Signature · 1 line
Greetings Michael.
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Jon SmirlQuoted 2 lines
Aren't patches made against the kernel GPL'd if the author doesn't explicitly grant them more liberal BSD license in addition?
That would be the normal assumption.
Quoted 6 lines
The problem then comes in taking the patches that were only made available against GPL code and reshipping them under the BSD license without the author explicitly agreeing to this.
What if a patch spans both code that is pure GPL and code imported from BSD, how do you license it?
See the acpi codebase for a worked example.
Alan
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to Christoph Hellwig2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 18 lines · Jiri Slaby
Quoted 4 lines
drivers/net/wireless/Kconfig +4
-0+config ATH5K_AR5210 + bool "Support AR5210" + depends on ATH5K + default ydrivers/net/wireless/Kconfig config IWL3945 · line 882
Quoted 10 lines
drivers/net/wireless/Kconfig +10
-0+ +config ATH5K_AR5211 + bool "Support AR5211" + depends on ATH5K + default y + +config ATH5K_AR5212 + bool "Support AR5212" + depends on ATH5K + default yPlease don't add more default statements.
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
It saves big chunks of code (not only initial register settings arrays) and we'll extend it's use more inside ath5k_hw.c Trust me this is a very useful step, eg. check out descriptor processing / setup or PHY functions (calibrate/channel set etc). For example AR5210 mac chip only comes with RF5110 phy chip so we can get rid of RF5111/RF5112 code, AR5211 comes with RF5111 so we can get rid of RF5110 and RF5112 code and AR5212 comes with RF5111 or RF5112 so we get rid of RF5110. This thing also saves lots of checks during runtime (some of them happen verry frequently, eg. durring descriptor processing). Also most people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :P
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 11 lines · Jiri Slaby
drivers/net/wireless/Makefile $(obj)/iwl-base-4965.o: $(src)/iwl-base.c FORCE · line 113
Quoted 3 lines
drivers/net/wireless/Makefile +2
-1-ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o +ath5k-objs = ath5k_base.o ath5k_hw.o ath5k_regdom.o \ + ath5k_hw_phy.o ath5k_hw_inivals.oAnd while I'm at nitpicking :)
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
If you check out the code you'll see i'm using the same convention inside them, ath5k_hw* files contain hw related functions (ath5k_hw_<name>) while driver code has ath5k_<name>. Also ath5k_init is misleading, file acually includes initial register settings for various chips and the functions to apply them on hw, not the initialization/attach/wakeup etc routines (that can be found in ath5k_hw.c), that's why it's inivals, i couldn't find a more appropriate name.
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Michael BueschQuoted 4 lines · Michael Buesch
Quoted 2 lines · On Wednesday 29 August 2007 21:33:43 Jon Smirl wrote:
What if a patch spans both code that is pure GPL and code imported from BSD, how do you license it?
Quoted 9 lines
I think it's a valid assumption, if we say that the author of the patch read the license header of a file and agreed with it. So the patch is licensed to whatever the fileheader says. And if there's none, it's licensed with the COPYING terms.
If a patch author likes some other license conditions, he must explicitely add them with the patch to the file, saying that this and that part have these and those conditions. Of course they must be compatible with the original license.
I didn't track this thread from the beginning, so maybe I repeat somebody's ideas (probably like above), but IMHO: do we have to be so selfish/pedantic? Can't we sometimes 'donate' a little bit to our 'older' bsd cousins or half-brothers? I think, it could be like this:
- if our changes are minor and authors of these changes don't mind the file could stay BSD licensed only; plus we ask BSD to let it be dual licensed (but no big hassle);
- otherwise, we should always distinctly mark all GPL parts.
Regards,
Jarek P.
PS: there is probably some mess with gmail addresses in this thread.
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
On Thu, Aug 30, 2007 at 10:26:52AM +0200, Jarek Poplawski wrote:
...
Quoted 1 line
PS: there is probably some mess with gmail addresses in this thread.
...or maybe it's OK... Sorry.
Jarek P.
Johannes Berg
maintainerRe: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Xavier BestelQuoted 1 line · Xavier Bestel
How about asking for changes to be dual-licenced too ?
In theory, that could work, but in practice relying on functions that the Linux kernel offers in GPLv2-only headers etc. will make the result GPLv2 anyway, and disentangling it would be a nightmare.
johannes
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to Nick KossifidisQuoted 11 lines · Nick Kossifidis
It saves big chunks of code (not only initial register settings arrays) and we'll extend it's use more inside
ath5k_hw.cTrust me this is a very useful step, eg. check out descriptor processing / setup or PHY functions (calibrate/channel set etc). For example AR5210 mac chip only comes with RF5110 phy chip so we can get rid of RF5111/RF5112 code, AR5211 comes with RF5111 so we can get rid of RF5110 and RF5112 code and AR5212 comes with RF5111 or RF5112 so we get rid of RF5110. This thing also saves lots of checks during runtime (some of them happen verry frequently, eg. durring descriptor processing). Also most people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :P
If you're doing these checks in a hotpath something is badly wrong with your architecture.
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to Nick KossifidisQuoted 8 lines · Nick Kossifidis
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :P
FWIW, I'd bet dollars to donuts that distros will enable them all together.
Is saving code space the only reason to turn these off? How much space do you save?
Is there some way you can isolate and/or limit the number of ifdef blocks further? If so, we might consider a version of this patch that depends on EMBEDDED or somesuch...?
John
Signature · 2 lines
John W. Linville [email protected]
Quoted 10 lines · Nick Kossifidis
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 3 lines
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
If you check out the code you'll see i'm using the same convention inside them, ath5k_hw* files contain hw related functions (ath5k_hw_<name>) while driver code has ath5k_<name>. Also
ath5k_initis misleading, file acually includes initial register settings for
I have to agree w/ Christoph -- the extra "_hw" in the names is just a bit unwieldy.
John
P.S. "ath5k_initvals.c" seems acceptable to me.
Signature · 2 lines
John W. Linville [email protected]
Re: [PATCH 3/5] Net: ath5k, use int as retval
In reply to Jiri SlabyQuoted 4 lines · Jiri Slaby
ath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
Since I didn't apply 1/5, this one didn't apply either. It seems fine overall, so if you rediff I'll be happy to apply.
John
Signature · 2 lines
John W. Linville [email protected]
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Jon SmirlIs it actually necessary to change the license? With the dual-license, you can keep a single code-base for both BSD and Linux platforms, which seems terribly important to me. It'd be awful to lose that. It would be a maintenance nightmare for BSD. Is it even possible--in real life, I mean--to accept GPLed patches into a BSD project? Nightmare, I tell you!
Re: [PATCH 4/5] Net: ath5k, license is GPLv2
In reply to Alan CoxQuoted 8 lines · Johannes Berg
Quoted 1 line · Xavier Bestel
How about asking for changes to be dual-licenced too ?
In theory, that could work, but in practice relying on functions that the Linux kernel offers in GPLv2-only headers etc. will make the result GPLv2 anyway, and disentangling it would be a nightmare.
Why?
Very good point, but, in my opinion, it should be still resonable for both sides: it simply means such changes are mostly unusable for the other side, but nobody is going to waste time for marking all these places, or care about suing if accidentally the changes, after some adaptation, are usable for the other side. Unless you think or know that "#include xyz" or "print_linux_way()" should add more than these (maybe unusable) words or lines only?
Jarek P.
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to John W. Linville2007/8/30, John W. Linville <[email protected]>:
Quoted 13 lines · Nick Kossifidis
Quoted 8 lines
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :PFWIW, I'd bet dollars to donuts that distros will enable them all together.
Quoted 8 lines
Is saving code space the only reason to turn these off? How much space do you save?
Is there some way you can isolate and/or limit the number of ifdef blocks further? If so, we might consider a version of this patch that depends on EMBEDDED or somesuch...?
John
O.K. as a first step i'll limit 5210 code only then, just an option like "support older 5210 chipsets" which is going to be off by default instead of 3 options. It's not just saving space, it's also saving some runtime checks. It's not really a gain in performance though, most checks are done during initialization and dfs setup, i just thought it would be usefull to save as much cpu as possible.
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to John W. LinvilleQuoted 6 lines · John W. Linville
Quoted 4 lines · Nick Kossifidis
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Quoted 6 lines
Quoted 3 lines
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :PFWIW, I'd bet dollars to donuts that distros will enable them all together.
I would certainly _hope_ that distros enable everything -that is in the kernel- that they can get their hands on, otherwise when you stick a card in, it doesn't just work.
Dan
Quoted 8 lines
Is saving code space the only reason to turn these off? How much space do you save?
Is there some way you can isolate and/or limit the number of ifdef blocks further? If so, we might consider a version of this patch that depends on EMBEDDED or somesuch...?
John
Re: [PATCH 5/5] Net: ath5k, kconfig changes
Quoted 8 lines · Dan Williams
Quoted 7 lines · John W. Linville
Quoted 6 lines · Nick Kossifidis
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :P
Quoted 6 lines
Quoted 2 lines
FWIW, I'd bet dollars to donuts that distros will enable them all together.
I would certainly _hope_ that distros enable everything -that is in the kernel- that they can get their hands on, otherwise when you stick a card in, it doesn't just work.
Distros definitely -do not- do this. Plenty of ancient ISA drivers are disabled at build time, for example, in many distros.
Jeff
Re: [PATCH 5/5] Net: ath5k, kconfig changes
Quoted 12 lines · Jeff Garzik
Quoted 11 lines · Dan Williams
Quoted 9 lines · John W. Linville
Quoted 6 lines · Nick Kossifidis
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :PFWIW, I'd bet dollars to donuts that distros will enable them all together.
Quoted 6 lines
Quoted 3 lines
I would certainly _hope_ that distros enable everything -that is in the kernel- that they can get their hands on, otherwise when you stick a card in, it doesn't just work.
Distros definitely -do not- do this. Plenty of ancient ISA drivers are disabled at build time, for example, in many distros.
Ok, so let me qualify to "within reason". All 802.11-compliant wireless cards would fall within the "within reason" IMHO, but, for example, older non 802.11 wireless cards (early Aironet products for example) probably don't. ISA clearly does not for mainstream distros.
Dan
2007/8/30, John W. Linville <[email protected]>:
Quoted 12 lines · Nick Kossifidis
Quoted 10 lines
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 3 lines
ath5k_hw_phy.o should probably be ath5k_phy.o by conventions used by most drivers and ath5k_hw_inivals.o mights aswell be something like ath5k_init.o
If you check out the code you'll see i'm using the same convention inside them, ath5k_hw* files contain hw related functions (ath5k_hw_<name>) while driver code has ath5k_<name>. Also
ath5k_initis misleading, file acually includes initial register settings for
Quoted 6 lines
I have to agree w/ Christoph -- the extra "
_hw" in the names is just a bit unwieldy.John
P.S. "ath5k_initvals.c" seems acceptable to me.
ACK, i'll remove _hw ;-)
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Re: [PATCH 5/5] Net: ath5k, kconfig changes
In reply to Nick Kossifidis2007/8/31, Nick Kossifidis <[email protected]>:
Quoted 21 lines
2007/8/30, John W. Linville <[email protected]>:
Quoted 20 lines · Nick Kossifidis
Quoted 8 lines
2007/8/28, Christoph Hellwig <[email protected]>:
Quoted 2 lines
Also this whole patch seems rather pointless. It saves only very little and turns the driver into a complete ifdef maze.
Also most
people will use 5212 code only, 5211 cards are on some old laptops and 5210, well i couldn't even find a 5210 for actual testing :PFWIW, I'd bet dollars to donuts that distros will enable them all together.
Is saving code space the only reason to turn these off? How much space do you save?
Is there some way you can isolate and/or limit the number of ifdef blocks further? If so, we might consider a version of this patch that depends on EMBEDDED or somesuch...?
Quoted 9 lines
Quoted 1 line
John
O.K. as a first step i'll limit 5210 code only then, just an option like "support older 5210 chipsets" which is going to be off by default instead of 3 options. It's not just saving space, it's also saving some runtime checks. It's not really a gain in performance though, most checks are done during initialization and dfs setup, i just thought it would be usefull to save as much cpu as possible.
Well after some thought i removed them all, there is no real gain from this in most cases (that ppl will use newer 5212 chips and combatibles).
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Re: [PATCH 3/5] Net: ath5k, use int as retval
In reply to John W. LinvilleJohn W. Linville napsal(a):
Quoted 8 lines · Jiri Slaby
Quoted 4 lines
ath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
Since I didn't apply 1/5, this one didn't apply either. It seems fine overall, so if you rediff I'll be happy to apply.
Ok, I'll do it, thanks,
Signature · 2 lines
http://www.fi.muni.cz/~xslaby/ Jiri Slaby faculty of informatics, masaryk university, brno, cz
Re: [PATCH 3/5] Net: ath5k, use int as retval
2007/9/1, Jiri Slaby <[email protected]>:
Quoted 11 lines
John W. Linville napsal(a):
Quoted 8 lines · Jiri Slaby
Quoted 4 lines
ath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
Since I didn't apply 1/5, this one didn't apply either. It seems fine overall, so if you rediff I'll be happy to apply.
Ok, I'll do it, thanks,
Can somebody commit my resent changes from madwifi-svn (cleanups, kconfig, remove_hw_ from filenames etc) ? I don't have git repository ;-(
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick
Re: [PATCH 3/5] Net: ath5k, use int as retval
Nick Kossifidis napsal(a):
Quoted 7 lines
2007/9/1, Jiri Slaby <[email protected]>:
Quoted 6 lines
John W. Linville napsal(a):
Quoted 5 lines · Jiri Slaby
Quoted 4 lines
ath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
Quoted 7 lines
Quoted 3 lines
Quoted 2 lines
Since I didn't apply 1/5, this one didn't apply either. It seems fine overall, so if you rediff I'll be happy to apply.
Ok, I'll do it, thanks,
Can somebody commit my resent changes from madwifi-svn (cleanups, kconfig,
remove_hw_from filenames etc) ? I don't have git repository ;-(
Resent to where? Or what do you mean?
thanks,
Signature · 2 lines
http://www.fi.muni.cz/~xslaby/ Jiri Slaby faculty of informatics, masaryk university, brno, cz
Re: [PATCH 3/5] Net: ath5k, use int as retval
2007/9/3, Jiri Slaby <[email protected]>:
Quoted 10 lines
Nick Kossifidis napsal(a):
Quoted 9 lines
2007/9/1, Jiri Slaby <[email protected]>:
Quoted 8 lines
John W. Linville napsal(a):
Quoted 7 lines · Jiri Slaby
Quoted 4 lines
ath5k, use int as retval
Convert some functions to return int and proper negative return value on error as we are used to.
Since I didn't apply 1/5, this one didn't apply either. It seems fine overall, so if you rediff I'll be happy to apply.
Quoted 8 lines
Quoted 5 lines
Quoted 1 line
Ok, I'll do it, thanks,
Can somebody commit my resent changes from madwifi-svn (cleanups, kconfig,
remove_hw_from filenames etc) ? I don't have git repository ;-(Resent to where? Or what do you mean?
I mean commit changes from current madwifi-svn's ath5k branch on the list to be included on wireless-dev too. Have you sent r2697 and later ? I can't work against current wireless-dev because my laptop doesn't even boot with it (there is a discussion on lkml about it they changed something on 2.6.23).
Signature · 3 lines
GPG ID: 0xD21DB2DB As you read this post global entropy rises. Have Fun ;-) Nick