Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Dan Williams
On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:
 On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
  2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
 
   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.

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

 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

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Jeff Garzik

Dan Williams wrote:

On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:

On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:

2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:

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.


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



-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Dan Williams
On Fri, 2007-08-31 at 09:30 -0400, Jeff Garzik wrote:
 Dan Williams wrote:
  On Thu, 2007-08-30 at 08:36 -0400, John W. Linville wrote:
  On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
  2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
  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.
  
  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


-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-31 Thread Nick Kossifidis
2007/8/31, Nick Kossifidis [EMAIL PROTECTED]:
 2007/8/30, John W. Linville [EMAIL PROTECTED]:
  On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
   2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
 
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

 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).



-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-30 Thread Christoph Hellwig
On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
 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

If you're doing these checks in a hotpath something is badly wrong with
your architecture.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-30 Thread John W. Linville
On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
 2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:

  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
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-30 Thread Nick Kossifidis
2007/8/30, John W. Linville [EMAIL PROTECTED]:
 On Thu, Aug 30, 2007 at 04:38:09AM +0300, Nick Kossifidis wrote:
  2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:

   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

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.

-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-29 Thread Nick Kossifidis
2007/8/28, Christoph Hellwig [EMAIL PROTECTED]:
 On Tue, Aug 28, 2007 at 12:01:30PM -0400, Jiri Slaby wrote:
  +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

 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.

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

-- 
GPG ID: 0xD21DB2DB
As you read this post global entropy rises. Have Fun ;-)
Nick
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/5] Net: ath5k, kconfig changes

2007-08-28 Thread Jiri Slaby
ath5k, kconfig changes

- build 5120, 5111 and 5112 optionally
- alter Kconfig text

Signed-off-by: Jiri Slaby [EMAIL PROTECTED]

---
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(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
index 00b4fcd..a4608f9 100644
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -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
diff --git a/drivers/net/wireless/ath5k_hw_inivals.c 
b/drivers/net/wireless/ath5k_hw_inivals.c
index 062e03d..0531ad3 100644
--- a/drivers/net/wireless/ath5k_hw_inivals.c
+++ b/drivers/net/wireless/ath5k_hw_inivals.c
@@ -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), 0x0014 },
{ 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,0x },
@@ -448,7 +451,9 @@ static const struct ath5k_ini_mode ar5211_ini_mode[] = {
{ AR5K_RF_BUFFER_CONTROL_4,
{ 0x0010, 0x0014, 0x0010, 0x0010, 0x0010 } 
},
 };
+#endif
 
+#ifdef CONFIG_ATH5K_AR5212
 /* Initial register settings for AR5212 */
 static const struct ath5k_ini ar5212_ini[] = {
{ AR5K_RXDP,0x },
@@ -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), 0x },
@@ -915,7 +922,9 @@ static const struct ath5k_ini rf5111_ini_bbgain[] = {
{ AR5K_BB_GAIN(62), 0x0002 },
{ AR5K_BB_GAIN(63), 0x0016 },
 };
+#endif
 
+#ifdef CONFIG_ATH5K_AR5212
 /* RF 5112 Initial BaseBand Gain settings */
 static const struct ath5k_ini rf5112_ini_bbgain[] = {
{ AR5K_BB_GAIN(0), 0x },
@@ -983,7 +992,10 @@ static const struct ath5k_ini rf5112_ini_bbgain[] = {
{ AR5K_BB_GAIN(62), 0x0010 },
{ AR5K_BB_GAIN(63), 0x001a },
 };
+#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 

Re: [PATCH 5/5] Net: ath5k, kconfig changes

2007-08-28 Thread Christoph Hellwig
On Tue, Aug 28, 2007 at 12:01:30PM -0400, Jiri Slaby wrote:
 +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

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.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html