[PATCH] zd1201 fixes

2005-09-02 Thread Linux Kernel Mailing List
tree e3519e48dc40bf5dbda5159f49cbaa67fade8212
parent 695b5bc3ecfc7da0a29360a6c2ee0849ffdb300a
author Al Viro [EMAIL PROTECTED] Tue, 26 Apr 2005 18:43:05 +0100
committer Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:23:04 -0400

[PATCH] zd1201 fixes

In netdev-2.6 we need to update zd1201.c since we don't have
driver/net/wireless/ieee802_11.h anymore.

Signed-off-by: Al Viro [EMAIL PROTECTED]

 drivers/usb/net/Makefile |2 --
 drivers/usb/net/zd1201.c |   16 
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/usb/net/Makefile b/drivers/usb/net/Makefile
--- a/drivers/usb/net/Makefile
+++ b/drivers/usb/net/Makefile
@@ -8,5 +8,3 @@ obj-$(CONFIG_USB_PEGASUS)   += pegasus.o
 obj-$(CONFIG_USB_RTL8150)  += rtl8150.o
 obj-$(CONFIG_USB_USBNET)   += usbnet.o
 obj-$(CONFIG_USB_ZD1201)   += zd1201.o
-
-CFLAGS_zd1201.o = -Idrivers/net/wireless/
diff --git a/drivers/usb/net/zd1201.c b/drivers/usb/net/zd1201.c
--- a/drivers/usb/net/zd1201.c
+++ b/drivers/usb/net/zd1201.c
@@ -21,7 +21,7 @@
 #include linux/string.h
 #include linux/if_arp.h
 #include linux/firmware.h
-#include ieee802_11.h
+#include net/ieee80211.h
 #include zd1201.h
 
 static struct usb_device_id zd1201_table[] = {
@@ -337,25 +337,25 @@ static void zd1201_usbrx(struct urb *urb
goto resubmit;
}

-   if ((seq  IEEE802_11_SCTL_FRAG) ||
-   (fc  IEEE802_11_FCTL_MOREFRAGS)) {
+   if ((seq  IEEE80211_SCTL_FRAG) ||
+   (fc  IEEE80211_FCTL_MOREFRAGS)) {
struct zd1201_frag *frag = NULL;
char *ptr;
 
if (datalen14)
goto resubmit;
-   if ((seq  IEEE802_11_SCTL_FRAG) == 0) {
+   if ((seq  IEEE80211_SCTL_FRAG) == 0) {
frag = kmalloc(sizeof(struct zd1201_frag*),
GFP_ATOMIC);
if (!frag)
goto resubmit;
-   skb = dev_alloc_skb(IEEE802_11_DATA_LEN +14+2);
+   skb = dev_alloc_skb(IEEE80211_DATA_LEN +14+2);
if (!skb) {
kfree(frag);
goto resubmit;
}
frag-skb = skb;
-   frag-seq = seq  IEEE802_11_SCTL_SEQ;
+   frag-seq = seq  IEEE80211_SCTL_SEQ;
skb_reserve(skb, 2);
memcpy(skb_put(skb, 12), data[datalen-14], 12);
memcpy(skb_put(skb, 2), data[6], 2);
@@ -364,7 +364,7 @@ static void zd1201_usbrx(struct urb *urb
goto resubmit;
}
hlist_for_each_entry(frag, node, zd-fraglist, fnode)
-   if(frag-seq == (seqIEEE802_11_SCTL_SEQ))
+   if(frag-seq == (seqIEEE80211_SCTL_SEQ))
break;
if (!frag)
goto resubmit;
@@ -372,7 +372,7 @@ static void zd1201_usbrx(struct urb *urb
ptr = skb_put(skb, len);
if (ptr)
memcpy(ptr, data+8, len);
-   if (fc  IEEE802_11_FCTL_MOREFRAGS)
+   if (fc  IEEE80211_FCTL_MOREFRAGS)
goto resubmit;
hlist_del_init(frag-fnode);
kfree(frag);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100: interface-up carrier state fix

2005-09-02 Thread Linux Kernel Mailing List
tree 8f31ce7cd3da75ad255c1bedc2a16dee75dc21af
parent 53788015c736b9957448aebd7b7c286da217ee51
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:07:01 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:07:01 -0400

ipw2100: interface-up carrier state fix

From: Imre Deak [EMAIL PROTECTED]

I had a problem where doing an open after a close left the device
unusable. netif_carrier_on should be called whenever we go to the
associated state, but this is not so in case of a close-open sequence.

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

 drivers/net/wireless/ipw2100.c |4 +++-
 1 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5685,8 +5685,10 @@ static int ipw2100_open(struct net_devic
IPW_DEBUG_INFO(dev-open\n);
 
spin_lock_irqsave(priv-low_lock, flags);
-   if (priv-status  STATUS_ASSOCIATED)
+   if (priv-status  STATUS_ASSOCIATED) {
+   netif_carrier_on(dev);
netif_start_queue(dev);
+   }
spin_unlock_irqrestore(priv-low_lock, flags);
 
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: remove pci.h #include's

2005-09-02 Thread Linux Kernel Mailing List
tree 7173a182677332e31d4b2461ec18eaa1c4d7fc10
parent 245ac8738b0b840552d56b842e70e750d65911cc
author Adrian Bunk [EMAIL PROTECTED] Fri, 03 Jun 2005 18:28:19 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:12:35 -0400

[PATCH] ieee80211: remove pci.h #include's

I was wondering why editing pci.h triggered the rebuild of three files
under net/, and as far as I can see, there's no reason for these three
files to #include pci.h .

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 net/ieee80211/ieee80211_module.c |1 -
 net/ieee80211/ieee80211_rx.c |1 -
 net/ieee80211/ieee80211_tx.c |1 -
 3 files changed, 3 deletions(-)

diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -40,7 +40,6 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/netdevice.h
-#include linux/pci.h
 #include linux/proc_fs.h
 #include linux/skbuff.h
 #include linux/slab.h
diff --git a/net/ieee80211/ieee80211_rx.c b/net/ieee80211/ieee80211_rx.c
--- a/net/ieee80211/ieee80211_rx.c
+++ b/net/ieee80211/ieee80211_rx.c
@@ -23,7 +23,6 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/netdevice.h
-#include linux/pci.h
 #include linux/proc_fs.h
 #include linux/skbuff.h
 #include linux/slab.h
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -33,7 +33,6 @@
 #include linux/kernel.h
 #include linux/module.h
 #include linux/netdevice.h
-#include linux/pci.h
 #include linux/proc_fs.h
 #include linux/skbuff.h
 #include linux/slab.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] fix IEEE80211_CRYPT_* selects

2005-09-02 Thread Linux Kernel Mailing List
tree d7b03713a116d26518ec2ede12799a70f38e3417
parent e157249d948bf0c5da10ce8610e2b4b36d0a3c4c
author Adrian Bunk [EMAIL PROTECTED] Sat, 07 May 2005 00:54:49 +0200
committer Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:26:44 -0400

[PATCH] fix IEEE80211_CRYPT_* selects

Some of the options didn't obey the most important rule of select

  If you select something, you have to ensure that the dependencies
  of what you do select are fulfilled.

resulting in the following compile error:

--  snip  --

..
  LD  .tmp_vmlinux1
crypto/built-in.o(.init.text+0x31b): In function `aes_init':
: undefined reference to `crypto_register_alg'
crypto/built-in.o(.init.text+0x326): In function `michael_mic_init':
: undefined reference to `crypto_register_alg'
crypto/built-in.o(.exit.text+0x6): In function `aes_fini':
: undefined reference to `crypto_unregister_alg'
crypto/built-in.o(.exit.text+0x16): In function `michael_mic_exit':
: undefined reference to `crypto_unregister_alg'
net/built-in.o(.text+0x5ba52): In function `ieee80211_ccmp_init':
: undefined reference to `crypto_alloc_tfm'
net/built-in.o(.text+0x5ba94): In function `ieee80211_ccmp_init':
: undefined reference to `crypto_free_tfm'
net/built-in.o(.text+0x5bab7): In function `ieee80211_ccmp_deinit':
: undefined reference to `crypto_free_tfm'
net/built-in.o(.text+0x5c5c2): In function `ieee80211_tkip_init':
: undefined reference to `crypto_alloc_tfm'
net/built-in.o(.text+0x5c5d5): In function `ieee80211_tkip_init':
: undefined reference to `crypto_alloc_tfm'
net/built-in.o(.text+0x5c623): In function `ieee80211_tkip_init':
: undefined reference to `crypto_free_tfm'
net/built-in.o(.text+0x5c62a): In function `ieee80211_tkip_init':
: undefined reference to `crypto_free_tfm'
net/built-in.o(.text+0x5c65e): In function `ieee80211_tkip_deinit':
: undefined reference to `crypto_free_tfm'
net/built-in.o(.text+0x5c665): In function `ieee80211_tkip_deinit':
: undefined reference to `crypto_free_tfm'
make: *** [.tmp_vmlinux1] Error 1

--  snip  --

This patch adds the missing selects of CRYPTO (similar to how
IEEE80211_CRYPT_WEP already does it).

Yes, you could argue whether CRYPTO should be select'ed by the CRYPTO_*
options, but with the current CRYPTO* dependencies this patch is
required.

 net/ieee80211/Kconfig |2 ++
 1 files changed, 2 insertions(+)

diff --git a/net/ieee80211/Kconfig b/net/ieee80211/Kconfig
--- a/net/ieee80211/Kconfig
+++ b/net/ieee80211/Kconfig
@@ -44,6 +44,7 @@ config IEEE80211_CRYPT_WEP
 config IEEE80211_CRYPT_CCMP
tristate IEEE 802.11i CCMP support
depends on IEEE80211
+   select CRYPTO
select CRYPTO_AES
---help---
Include software based cipher suites in support of IEEE 802.11i 
@@ -56,6 +57,7 @@ config IEEE80211_CRYPT_CCMP
 config IEEE80211_CRYPT_TKIP
tristate IEEE 802.11i TKIP encryption
depends on IEEE80211
+   select CRYPTO
select CRYPTO_MICHAEL_MIC
---help---
Include software based cipher suites in support of IEEE 802.11i 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Simplify setup_mm_for_reboot()

2005-09-02 Thread Linux Kernel Mailing List
tree 01d0fa7bfa325cbbeec6ea484378355a18269444
parent 08f4ffb3eb4ff23daf9c61bcd523940d43c2270c
author Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:51:59 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:51:59 +0100

[ARM] Simplify setup_mm_for_reboot()

No point checking what CPU architecture level we have each time
within the loop, so precompute the base PMD flags outside the
loop.

Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/mm/mm-armv.c |   18 +-
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -577,23 +577,23 @@ static void __init create_mapping(struct
  */
 void setup_mm_for_reboot(char mode)
 {
-   unsigned long pmdval;
+   unsigned long base_pmdval;
pgd_t *pgd;
-   pmd_t *pmd;
int i;
-   int cpu_arch = cpu_architecture();
 
if (current-mm  current-mm-pgd)
pgd = current-mm-pgd;
else
pgd = init_mm.pgd;
 
-   for (i = 0; i  FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++) {
-   pmdval = (i  PGDIR_SHIFT) |
-PMD_SECT_AP_WRITE | PMD_SECT_AP_READ |
-PMD_TYPE_SECT;
-   if (cpu_arch = CPU_ARCH_ARMv5TEJ)
-   pmdval |= PMD_BIT4;
+   base_pmdval = PMD_SECT_AP_WRITE | PMD_SECT_AP_READ | PMD_TYPE_SECT;
+   if (cpu_architecture() = CPU_ARCH_ARMv5TEJ)
+   base_pmdval |= PMD_BIT4;
+
+   for (i = 0; i  FIRST_USER_PGD_NR + USER_PTRS_PER_PGD; i++, pgd++) {
+   unsigned long pmdval = (i  PGDIR_SHIFT) | base_pmdval;
+   pmd_t *pmd;
+
pmd = pmd_off(pgd, i  PGDIR_SHIFT);
pmd[0] = __pmd(pmdval);
pmd[1] = __pmd(pmdval + (1  (PGDIR_SHIFT - 1)));
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: Fix frame control pver mask

2005-09-02 Thread Linux Kernel Mailing List
tree 36dfbae39ee8d3becd87afba8e5c0dbf3da702dc
parent bf79451ec5862510b402c112c039698e68d0c250
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:45 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:09:03 -0400

[PATCH] ieee80211: Fix frame control pver mask

IEEE 802.11 frame control has two bits reserved for protocol
version. IEEE80211_FCTL_VERS was not used anywhere, but I would assume
it was supposed to be a mask for the protocol field and as such, it
should be 0x0003, not 0x0002. This matches with WLAN_FC_PVER
definition in hostap.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 include/net/ieee80211.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -104,7 +104,7 @@ struct eapol {
 #defineMAX_FRAG_THRESHOLD 2346U
 
 /* Frame control field constants */
-#define IEEE80211_FCTL_VERS0x0002
+#define IEEE80211_FCTL_VERS0x0003
 #define IEEE80211_FCTL_FTYPE   0x000c
 #define IEEE80211_FCTL_STYPE   0x00f0
 #define IEEE80211_FCTL_TODS0x0100
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net/ieee80211/ieee80211_tx.c: swapped memset arguments

2005-09-02 Thread Linux Kernel Mailing List
tree a240d10b44bfe328afc86e914b469ce48e0d7d73
parent b453872c35cfcbdbf5a794737817f7d4e7b1b579
author Adrian Bunk [EMAIL PROTECTED] Tue, 12 Apr 2005 06:52:15 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 16 May 2005 07:21:19 -0400

[PATCH] net/ieee80211/ieee80211_tx.c: swapped memset arguments

Fix swapped memset() arguments in net/ieee80211/ieee80211_tx.c found by
Maciej Soltysiak.

Patch by Jesper Juhl.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 net/ieee80211/ieee80211_tx.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -223,7 +223,7 @@ struct ieee80211_txb *ieee80211_alloc_tx
if (!txb)
return NULL;
 
-   memset(txb, sizeof(struct ieee80211_txb), 0);
+   memset(txb, 0, sizeof(struct ieee80211_txb));
txb-nr_frags = nr_frags;
txb-frag_size = txb_size;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ieee80211: trim trailing whitespace

2005-09-02 Thread Linux Kernel Mailing List
tree b075497ae0dd6783d50d218c5c2d13ca9ef49bc6
parent b7721ff96fa15459c7c5de59323bedd61f1bcbd7
author Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 21:05:43 -0400
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 21:05:43 -0400

ieee80211: trim trailing whitespace

 net/ieee80211/Kconfig  |   26 +-
 net/ieee80211/Makefile |2 +-
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/net/ieee80211/Kconfig b/net/ieee80211/Kconfig
--- a/net/ieee80211/Kconfig
+++ b/net/ieee80211/Kconfig
@@ -2,19 +2,19 @@ config IEEE80211
tristate Generic IEEE 802.11 Networking Stack
select NET_RADIO
---help---
-   This option enables the hardware independent IEEE 802.11 
+   This option enables the hardware independent IEEE 802.11
networking stack.
 
 config IEEE80211_DEBUG
bool Enable full debugging output
depends on IEEE80211
---help---
- This option will enable debug tracing output for the 
- ieee80211 network stack.  
+ This option will enable debug tracing output for the
+ ieee80211 network stack.
 
- This will result in the kernel module being ~70k larger.  You 
- can control which debug output is sent to the kernel log by 
- setting the value in 
+ This will result in the kernel module being ~70k larger.  You
+ can control which debug output is sent to the kernel log by
+ setting the value in
 
  /proc/net/ieee80211/debug_level
 
@@ -22,10 +22,10 @@ config IEEE80211_DEBUG
 
  % echo 0x0FFO  /proc/net/ieee80211/debug_level
 
- For a list of values you can assign to debug_level, you 
+ For a list of values you can assign to debug_level, you
  can look at the bit mask values in net/ieee80211.h
 
- If you are not trying to debug or develop the ieee80211 
+ If you are not trying to debug or develop the ieee80211
  subsystem, you most likely want to say N here.
 
 config IEEE80211_CRYPT_WEP
@@ -35,7 +35,7 @@ config IEEE80211_CRYPT_WEP
select CRYPTO_ARC4
select CRC32
---help---
-   Include software based cipher suites in support of IEEE 
+   Include software based cipher suites in support of IEEE
802.11's WEP.  This is needed for WEP as well as 802.1x.
 
This can be compiled as a modules and it will be called
@@ -47,8 +47,8 @@ config IEEE80211_CRYPT_CCMP
select CRYPTO
select CRYPTO_AES
---help---
-   Include software based cipher suites in support of IEEE 802.11i 
-   (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with CCMP enabled 
+   Include software based cipher suites in support of IEEE 802.11i
+   (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with CCMP enabled
networks.
 
This can be compiled as a modules and it will be called
@@ -60,8 +60,8 @@ config IEEE80211_CRYPT_TKIP
select CRYPTO
select CRYPTO_MICHAEL_MIC
---help---
-   Include software based cipher suites in support of IEEE 802.11i 
-   (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled 
+   Include software based cipher suites in support of IEEE 802.11i
+   (aka TGi, WPA, WPA2, WPA-PSK, etc.) for use with TKIP enabled
networks.
 
This can be compiled as a modules and it will be called
diff --git a/net/ieee80211/Makefile b/net/ieee80211/Makefile
--- a/net/ieee80211/Makefile
+++ b/net/ieee80211/Makefile
@@ -1,4 +1,4 @@
-obj-$(CONFIG_IEEE80211) += ieee80211.o 
+obj-$(CONFIG_IEEE80211) += ieee80211.o
 obj-$(CONFIG_IEEE80211) += ieee80211_crypt.o
 obj-$(CONFIG_IEEE80211_CRYPT_WEP) += ieee80211_crypt_wep.o
 obj-$(CONFIG_IEEE80211_CRYPT_CCMP) += ieee80211_crypt_ccmp.o
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ieee80211: Puts debug macros together and makes escape_essid not inlined.

2005-09-02 Thread Linux Kernel Mailing List
tree bbe79e548146565c0119f36b4e71599b63c6af4f
parent b2382b363df828f25e35ed8b70a3da33b29b2a64
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:00:53 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:00:53 -0400

ieee80211: Puts debug macros together and makes escape_essid not inlined.

Signed-off-by: Jiri Benc [EMAIL PROTECTED]
Signed-off-by: Jirka Bohac [EMAIL PROTECTED]

 include/net/ieee80211.h  |   37 -
 net/ieee80211/ieee80211_module.c |   26 ++
 2 files changed, 38 insertions(+), 25 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -167,8 +167,19 @@ do { if (ieee80211_debug_level  (level)
 #define IEEE80211_DEBUG(level, fmt, args...) do {} while (0)
 #endif /* CONFIG_IEEE80211_DEBUG */
 
+
+/* debug macros not dependent on CONFIG_IEEE80211_DEBUG */
+
+#define MAC_FMT %02x:%02x:%02x:%02x:%02x:%02x
+#define MAC_ARG(x) 
((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
+
+/* escape_essid() is intended to be used in debug (and possibly error)
+ * messages. It should never be used for passing essid to user space. */
+const char *escape_essid(const char *essid, u8 essid_len);
+
+
 /*
- * To use the debug system;
+ * To use the debug system:
  *
  * If you are defining a new debug classification, simply add it to the #define
  * list here in the form of:
@@ -622,8 +633,6 @@ enum ieee80211_state {
 
 #define DEFAULT_MAX_SCAN_AGE (15 * HZ)
 #define DEFAULT_FTS 2346
-#define MAC_FMT %02x:%02x:%02x:%02x:%02x:%02x
-#define MAC_ARG(x) 
((u8*)(x))[0],((u8*)(x))[1],((u8*)(x))[2],((u8*)(x))[3],((u8*)(x))[4],((u8*)(x))[5]
 
 
 #define CFG_IEEE80211_RESERVE_FCS (10)
@@ -827,27 +836,5 @@ extern inline int ieee80211_get_scans(st
return ieee-scans;
 }
 
-static inline const char *escape_essid(const char *essid, u8 essid_len) {
-   static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
-   const char *s = essid;
-   char *d = escaped;
-
-   if (ieee80211_is_empty_essid(essid, essid_len)) {
-   memcpy(escaped, hidden, sizeof(hidden));
-   return escaped;
-   }
 
-   essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
-   while (essid_len--) {
-   if (*s == '\0') {
-   *d++ = '\\';
-   *d++ = '0';
-   s++;
-   } else {
-   *d++ = *s++;
-   }
-   }
-   *d = '\0';
-   return escaped;
-}
 #endif /* IEEE80211_H */
diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -269,5 +269,31 @@ module_exit(ieee80211_exit);
 module_init(ieee80211_init);
 #endif
 
+
+const char *escape_essid(const char *essid, u8 essid_len) {
+   static char escaped[IW_ESSID_MAX_SIZE * 2 + 1];
+   const char *s = essid;
+   char *d = escaped;
+
+   if (ieee80211_is_empty_essid(essid, essid_len)) {
+   memcpy(escaped, hidden, sizeof(hidden));
+   return escaped;
+   }
+
+   essid_len = min(essid_len, (u8)IW_ESSID_MAX_SIZE);
+   while (essid_len--) {
+   if (*s == '\0') {
+   *d++ = '\\';
+   *d++ = '0';
+   s++;
+   } else {
+   *d++ = *s++;
+   }
+   }
+   *d = '\0';
+   return escaped;
+}
+
 EXPORT_SYMBOL(alloc_ieee80211);
 EXPORT_SYMBOL(free_ieee80211);
+EXPORT_SYMBOL(escape_essid);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] Convert open-coded __pmd_populate to use inline function

2005-09-02 Thread Linux Kernel Mailing List
tree 4aefef161593bc013a0d848a0be05610eaea0d69
parent 569d2c34dcf259b07977835492aa8813d1168230
author Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:45:18 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:45:18 +0100

[ARM] Convert open-coded __pmd_populate to use inline function

Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/mm/mm-armv.c |6 +-
 1 files changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/arm/mm/mm-armv.c b/arch/arm/mm/mm-armv.c
--- a/arch/arm/mm/mm-armv.c
+++ b/arch/arm/mm/mm-armv.c
@@ -295,14 +295,10 @@ alloc_init_page(unsigned long virt, unsi
pte_t *ptep;
 
if (pmd_none(*pmdp)) {
-   unsigned long pmdval;
ptep = alloc_bootmem_low_pages(2 * PTRS_PER_PTE *
   sizeof(pte_t));
 
-   pmdval = __pa(ptep) | prot_l1;
-   pmdp[0] = __pmd(pmdval);
-   pmdp[1] = __pmd(pmdval + 256 * sizeof(pte_t));
-   flush_pmd_entry(pmdp);
+   __pmd_populate(pmdp, __pa(ptep) | prot_l1);
}
ptep = pte_offset_kernel(pmdp, virt);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 2862/1: VST aka CONFIG_NO_IDLE_HZ support for PXA2xx

2005-09-02 Thread Linux Kernel Mailing List
tree d3d740367c93594860087531124213379e7345e4
parent 68d9102f76de7a923fb81c8b6de4764f8f50ed17
author Nicolas Pitre [EMAIL PROTECTED] Thu, 01 Sep 2005 12:48:40 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 12:48:40 +0100

[ARM] 2862/1: VST aka CONFIG_NO_IDLE_HZ support for PXA2xx

Patch from Nicolas Pitre

Signed-off-by: Nicolas Pitre [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/Kconfig |4 +--
 arch/arm/mach-pxa/time.c |   51 +++
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -365,8 +365,8 @@ config NO_IDLE_HZ
 
  Please note that dynamic tick may affect the accuracy of
  timekeeping on some platforms depending on the implementation.
- Currently at least OMAP platform is known to have accurate
- timekeeping with dynamic tick.
+ Currently at least OMAP and PXA2xx platforms are known to have
+ accurate timekeeping with dynamic tick.
 
 config ARCH_DISCONTIGMEM_ENABLE
bool
diff --git a/arch/arm/mach-pxa/time.c b/arch/arm/mach-pxa/time.c
--- a/arch/arm/mach-pxa/time.c
+++ b/arch/arm/mach-pxa/time.c
@@ -70,6 +70,11 @@ static unsigned long pxa_gettimeoffset (
return usec;
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+static unsigned long initial_match;
+static int match_posponed;
+#endif
+
 static irqreturn_t
 pxa_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
@@ -77,6 +82,13 @@ pxa_timer_interrupt(int irq, void *dev_i
 
write_seqlock(xtime_lock);
 
+#ifdef CONFIG_NO_IDLE_HZ
+   if (match_posponed) {
+   match_posponed = 0;
+   OSMR0 = initial_match;
+   }
+#endif
+
/* Loop until we get ahead of the free running timer.
 * This ensures an exact clock tick count and time accuracy.
 * IRQs are disabled inside the loop to ensure coherence between
@@ -126,6 +138,42 @@ static void __init pxa_timer_init(void)
OSCR = 0;   /* initialize free-running timer, force first 
match */
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+static int pxa_dyn_tick_enable_disable(void)
+{
+   /* nothing to do */
+   return 0;
+}
+
+static void pxa_dyn_tick_reprogram(unsigned long ticks)
+{
+   if (ticks  1) {
+   initial_match = OSMR0;
+   OSMR0 = initial_match + ticks * LATCH;
+   match_posponed = 1;
+   }
+}
+
+static irqreturn_t
+pxa_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+   if (match_posponed) {
+   match_posponed = 0;
+   OSMR0 = initial_match;
+   if ( (signed long)(initial_match - OSCR) = 8 )
+   return pxa_timer_interrupt(irq, dev_id, regs);
+   }
+   return IRQ_NONE;
+}
+
+static struct dyn_tick_timer pxa_dyn_tick = {
+   .enable = pxa_dyn_tick_enable_disable,
+   .disable= pxa_dyn_tick_enable_disable,
+   .reprogram  = pxa_dyn_tick_reprogram,
+   .handler= pxa_dyn_tick_handler,
+};
+#endif
+
 #ifdef CONFIG_PM
 static unsigned long osmr[4], oier;
 
@@ -161,4 +209,7 @@ struct sys_timer pxa_timer = {
.suspend= pxa_timer_suspend,
.resume = pxa_timer_resume,
.offset = pxa_gettimeoffset,
+#ifdef CONFIG_NO_IDLE_HZ
+   .dyn_tick   = pxa_dyn_tick,
+#endif
 };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100: minor cleanups

2005-09-02 Thread Linux Kernel Mailing List
tree 8bbd4c06bcbcb94083b6424dcd592f7245833e89
parent 797b4f7652a4dcf06bdf6a8c870991acdf56c03d
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:04:43 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:04:43 -0400

ipw2100: minor cleanups

From: Adrian Bunk [EMAIL PROTECTED]

This patch contains the following possible cleanups:
- make needlessly global code static
- remove the unused IPW_DEBUG_ENABLED

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |  136 +
 drivers/net/wireless/ipw2100.h |   28 
 2 files changed, 86 insertions(+), 78 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -207,7 +207,20 @@ MODULE_PARM_DESC(channel, channel);
 MODULE_PARM_DESC(associate, auto associate when scanning (default on));
 MODULE_PARM_DESC(disable, manually disable the radio (default 0 [radio on]));
 
-u32 ipw2100_debug_level = IPW_DL_NONE;
+static u32 ipw2100_debug_level = IPW_DL_NONE;
+
+#ifdef CONFIG_IPW_DEBUG
+#define IPW_DEBUG(level, message...) \
+do { \
+   if (ipw2100_debug_level  (level)) { \
+   printk(KERN_DEBUG ipw2100: %c %s , \
+   in_interrupt() ? 'I' : 'U',  __FUNCTION__); \
+   printk(message); \
+   } \
+} while (0)
+#else
+#define IPW_DEBUG(level, message...) do {} while (0)
+#endif /* CONFIG_IPW_DEBUG */
 
 #ifdef CONFIG_IPW_DEBUG
 static const char *command_types[] = {
@@ -295,6 +308,22 @@ static void ipw2100_queues_initialize(st
 static void ipw2100_queues_free(struct ipw2100_priv *priv);
 static int ipw2100_queues_allocate(struct ipw2100_priv *priv);
 
+static int ipw2100_fw_download(struct ipw2100_priv *priv,
+  struct ipw2100_fw *fw);
+static int ipw2100_get_firmware(struct ipw2100_priv *priv,
+   struct ipw2100_fw *fw);
+static int ipw2100_get_fwversion(struct ipw2100_priv *priv, char *buf,
+size_t max);
+static int ipw2100_get_ucodeversion(struct ipw2100_priv *priv, char *buf,
+   size_t max);
+static void ipw2100_release_firmware(struct ipw2100_priv *priv,
+struct ipw2100_fw *fw);
+static int ipw2100_ucode_download(struct ipw2100_priv *priv,
+ struct ipw2100_fw *fw);
+static void ipw2100_wx_event_work(struct ipw2100_priv *priv);
+static struct iw_statistics *ipw2100_wx_wireless_stats(struct net_device * 
dev);
+static struct iw_handler_def ipw2100_wx_handler_def;
+
 
 static inline void read_register(struct net_device *dev, u32 reg, u32 *val)
 {
@@ -473,8 +502,8 @@ static inline int ipw2100_hw_is_adapter_
 == IPW_DATA_DOA_DEBUG_VALUE));
 }
 
-int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
-   void *val, u32 *len)
+static int ipw2100_get_ordinal(struct ipw2100_priv *priv, u32 ord,
+  void *val, u32 *len)
 {
struct ipw2100_ordinals *ordinals = priv-ordinals;
u32 addr;
@@ -1586,7 +1615,7 @@ fail_up:
return err;
 }
 
-int ipw2100_set_scan_options(struct ipw2100_priv *priv)
+static int ipw2100_set_scan_options(struct ipw2100_priv *priv)
 {
struct host_command cmd = {
.host_command = SET_SCAN_OPTIONS,
@@ -1618,7 +1647,7 @@ int ipw2100_set_scan_options(struct ipw2
return err;
 }
 
-int ipw2100_start_scan(struct ipw2100_priv *priv)
+static int ipw2100_start_scan(struct ipw2100_priv *priv)
 {
struct host_command cmd = {
.host_command = BROADCAST_SCAN,
@@ -1833,7 +1862,7 @@ static void ipw2100_down(struct ipw2100_
netif_stop_queue(priv-net_dev);
 }
 
-void ipw2100_reset_adapter(struct ipw2100_priv *priv)
+static void ipw2100_reset_adapter(struct ipw2100_priv *priv)
 {
unsigned long flags;
union iwreq_data wrqu = {
@@ -1963,8 +1992,8 @@ static void isr_indicate_associated(stru
 }
 
 
-int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
- int length, int batch_mode)
+static int ipw2100_set_essid(struct ipw2100_priv *priv, char *essid,
+int length, int batch_mode)
 {
int ssid_len = min(length, IW_ESSID_MAX_SIZE);
struct host_command cmd = {
@@ -2095,7 +2124,7 @@ static void isr_indicate_scanning(struct
priv-status |= STATUS_SCANNING;
 }
 
-const struct ipw2100_status_indicator status_handlers[] = {
+static const struct ipw2100_status_indicator status_handlers[] = {
IPW2100_HANDLER(IPW_STATE_INITIALIZED, 0),
IPW2100_HANDLER(IPW_STATE_COUNTRY_FOUND, 0),
IPW2100_HANDLER(IPW_STATE_ASSOCIATED, isr_indicate_associated),
@@ -2163,7 +2192,7 @@ static void isr_rx_complete_command(
 }
 
 #ifdef CONFIG_IPW_DEBUG
-const char *frame_types[] = {

ieee80211: use endian-aware types

2005-09-02 Thread Linux Kernel Mailing List
tree 021fc2d3afa5889e45593aef433a4051633d6abf
parent 95d5185d1ab6875b86a639310919dc48a716c7be
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:15:10 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:15:10 -0400

ieee80211: use endian-aware types

From: Michael Wu [EMAIL PROTECTED]

This patch:
- fixes misc. whitespace/comments
- replaces u16 with __le16/__be16 where appropriate

Signed-off-by: Michael Wu [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 include/net/ieee80211.h |   46 ++
 1 files changed, 22 insertions(+), 24 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -47,22 +47,22 @@
 #define IEEE80211_FRAME_LEN(IEEE80211_DATA_LEN + IEEE80211_HLEN)
 
 struct ieee80211_hdr {
-   u16 frame_ctl;
-   u16 duration_id;
+   __le16 frame_ctl;
+   __le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
-   u16 seq_ctl;
+   __le16 seq_ctl;
u8 addr4[ETH_ALEN];
 } __attribute__ ((packed));
 
 struct ieee80211_hdr_3addr {
-   u16 frame_ctl;
-   u16 duration_id;
+   __le16 frame_ctl;
+   __le16 duration_id;
u8 addr1[ETH_ALEN];
u8 addr2[ETH_ALEN];
u8 addr3[ETH_ALEN];
-   u16 seq_ctl;
+   __le16 seq_ctl;
 } __attribute__ ((packed));
 
 enum eap_type {
@@ -88,10 +88,10 @@ static inline const char *eap_get_type(i
 
 struct eapol {
u8 snap[6];
-   u16 ethertype;
+   __be16 ethertype;
u8 version;
u8 type;
-   u16 length;
+   __be16 length;
 } __attribute__ ((packed));
 
 #define IEEE80211_1ADDR_LEN 10
@@ -235,9 +235,9 @@ const char *escape_essid(const char *ess
 #include linux/if_arp.h /* ARPHRD_ETHER */
 
 #ifndef WIRELESS_SPY
-#define WIRELESS_SPY   // enable iwspy support
+#define WIRELESS_SPY   /* enable iwspy support */
 #endif
-#include net/iw_handler.h// new driver API
+#include net/iw_handler.h/* new driver API */
 
 #ifndef ETH_P_PAE
 #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
@@ -588,9 +588,9 @@ struct ieee80211_info_element {
 
 struct ieee80211_authentication {
struct ieee80211_hdr_3addr header;
-   u16 algorithm;
-   u16 transaction;
-   u16 status;
+   __le16 algorithm;
+   __le16 transaction;
+   __le16 status;
struct ieee80211_info_element info_element;
 } __attribute__ ((packed));
 
@@ -598,23 +598,23 @@ struct ieee80211_authentication {
 struct ieee80211_probe_response {
struct ieee80211_hdr_3addr header;
u32 time_stamp[2];
-   u16 beacon_interval;
-   u16 capability;
+   __le16 beacon_interval;
+   __le16 capability;
struct ieee80211_info_element info_element;
 } __attribute__ ((packed));
 
 struct ieee80211_assoc_request_frame {
-   u16 capability;
-   u16 listen_interval;
+   __le16 capability;
+   __le16 listen_interval;
u8 current_ap[ETH_ALEN];
struct ieee80211_info_element info_element;
 } __attribute__ ((packed));
 
 struct ieee80211_assoc_response_frame {
struct ieee80211_hdr_3addr header;
-   u16 capability;
-   u16 status;
-   u16 aid;
+   __le16 capability;
+   __le16 status;
+   __le16 aid;
struct ieee80211_info_element info_element; /* supported rates */
 } __attribute__ ((packed));
 
@@ -629,7 +629,7 @@ struct ieee80211_txb {
 };
 
 
-/* SWEEP TABLE ENTRIES NUMBER*/
+/* SWEEP TABLE ENTRIES NUMBER */
 #define MAX_SWEEP_TAB_ENTRIES42
 #define MAX_SWEEP_TAB_ENTRIES_PER_PACKET  7
 /* MAX_RATES_LENGTH needs to be 12.  The spec says 8, and many APs
@@ -857,8 +857,6 @@ extern struct net_device *alloc_ieee8021
 extern int ieee80211_set_encryption(struct ieee80211_device *ieee);
 
 /* ieee80211_tx.c */
-
-
 extern int ieee80211_xmit(struct sk_buff *skb,
  struct net_device *dev);
 extern void ieee80211_txb_free(struct ieee80211_txb *);
@@ -871,7 +869,7 @@ extern void ieee80211_rx_mgt(struct ieee
 struct ieee80211_hdr *header,
 struct ieee80211_rx_stats *stats);
 
-/* iee80211_wx.c */
+/* ieee80211_wx.c */
 extern int ieee80211_wx_get_scan(struct ieee80211_device *ieee,
 struct iw_request_info *info,
 union iwreq_data *wrqu, char *key);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[ARM] 2864/1: VST aka CONFIG_NO_IDLE_HZ support for SA11x0

2005-09-02 Thread Linux Kernel Mailing List
tree aa16ba481ff295b1cf7d0bafa503078bc54249a2
parent 20e912680842504ab4633deaa644c2b855ad3d44
author Nicolas Pitre [EMAIL PROTECTED] Thu, 01 Sep 2005 12:48:48 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 12:48:48 +0100

[ARM] 2864/1: VST aka CONFIG_NO_IDLE_HZ support for SA11x0

Patch from Nicolas Pitre

Signed-off-by: Nicolas Pitre [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/Kconfig|4 +--
 arch/arm/mach-sa1100/time.c |   51 
 2 files changed, 53 insertions(+), 2 deletions(-)

diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
--- a/arch/arm/Kconfig
+++ b/arch/arm/Kconfig
@@ -365,8 +365,8 @@ config NO_IDLE_HZ
 
  Please note that dynamic tick may affect the accuracy of
  timekeeping on some platforms depending on the implementation.
- Currently at least OMAP and PXA2xx platforms are known to have
- accurate timekeeping with dynamic tick.
+ Currently at least OMAP, PXA2xx and SA11x0 platforms are known
+ to have accurate timekeeping with dynamic tick.
 
 config ARCH_DISCONTIGMEM_ENABLE
bool
diff --git a/arch/arm/mach-sa1100/time.c b/arch/arm/mach-sa1100/time.c
--- a/arch/arm/mach-sa1100/time.c
+++ b/arch/arm/mach-sa1100/time.c
@@ -70,6 +70,11 @@ static unsigned long sa1100_gettimeoffse
return usec;
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+static unsigned long initial_match;
+static int match_posponed;
+#endif
+
 static irqreturn_t
 sa1100_timer_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
@@ -77,6 +82,13 @@ sa1100_timer_interrupt(int irq, void *de
 
write_seqlock(xtime_lock);
 
+#ifdef CONFIG_NO_IDLE_HZ
+   if (match_posponed) {
+   match_posponed = 0;
+   OSMR0 = initial_match;
+   }
+#endif
+
/*
 * Loop until we get ahead of the free running timer.
 * This ensures an exact clock tick count and time accuracy.
@@ -119,6 +131,42 @@ static void __init sa1100_timer_init(voi
OSCR = 0;   /* initialize free-running timer, force first 
match */
 }
 
+#ifdef CONFIG_NO_IDLE_HZ
+static int sa1100_dyn_tick_enable_disable(void)
+{
+   /* nothing to do */
+   return 0;
+}
+
+static void sa1100_dyn_tick_reprogram(unsigned long ticks)
+{
+   if (ticks  1) {
+   initial_match = OSMR0;
+   OSMR0 = initial_match + ticks * LATCH;
+   match_posponed = 1;
+   }
+}
+
+static irqreturn_t
+sa1100_dyn_tick_handler(int irq, void *dev_id, struct pt_regs *regs)
+{
+   if (match_posponed) {
+   match_posponed = 0;
+   OSMR0 = initial_match;
+   if ((signed long)(initial_match - OSCR) = 0)
+   return sa1100_timer_interrupt(irq, dev_id, regs);
+   }
+   return IRQ_NONE;
+}
+
+static struct dyn_tick_timer sa1100_dyn_tick = {
+   .enable = sa1100_dyn_tick_enable_disable,
+   .disable= sa1100_dyn_tick_enable_disable,
+   .reprogram  = sa1100_dyn_tick_reprogram,
+   .handler= sa1100_dyn_tick_handler,
+};
+#endif
+
 #ifdef CONFIG_PM
 unsigned long osmr[4], oier;
 
@@ -155,4 +203,7 @@ struct sys_timer sa1100_timer = {
.suspend= sa1100_timer_suspend,
.resume = sa1100_timer_resume,
.offset = sa1100_gettimeoffset,
+#ifdef CONFIG_NO_IDLE_HZ
+   .dyn_tick   = sa1100_dyn_tick,
+#endif
 };
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100: Fix incorrectly named config option.

2005-09-02 Thread Linux Kernel Mailing List
tree 8a86bf1e50bf971f2515faeaa9320e17548a4810
parent c4aee8c21ff5d8d6f9a27112468f5e840d5ced1b
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:05:45 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:05:45 -0400

ipw2100: Fix incorrectly named config option.

Signed-off-by: Jiri Benc [EMAIL PROTECTED]
Signed-off-by: Jirka Bohac [EMAIL PROTECTED]

 drivers/net/wireless/Kconfig |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -164,7 +164,7 @@ config IPW2100
   say M here and read file:Documentation/modules.txt.  The module
   will be called ipw2100.ko.

-config IPW2100_PROMISC
+config IPW2100_MONITOR
 bool Enable promiscuous mode
 depends on IPW2100
 ---help---
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: fix recursive ipw2200 dependencies

2005-09-02 Thread Linux Kernel Mailing List
tree f5f76662cc575cbe0247ab3841b34bcc5586f147
parent 7c9d4c70b20e165eb11d8aed2b6374377d17f43a
author Adrian Bunk [EMAIL PROTECTED] Fri, 03 Jun 2005 18:29:20 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:12:35 -0400

[PATCH] ieee80211: fix recursive ipw2200 dependencies

This results in recursive dependencies:
- IPW2200 depends on NET_RADIO
- IPW2200 selects IEEE80211
- IEEE80211 selects NET_RADIO

This patch fixes the IPW2200 dependencies in a way that they are similar
to the IPW2100 dependencies.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 drivers/net/wireless/Kconfig |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
--- a/drivers/net/wireless/Kconfig
+++ b/drivers/net/wireless/Kconfig
@@ -192,9 +192,8 @@ config IPW_DEBUG
 
 config IPW2200
tristate Intel PRO/Wireless 2200BG and 2915ABG Network Connection
-   depends on NET_RADIO  PCI
+   depends on IEEE80211  PCI
select FW_LOADER
-   select IEEE80211
---help---
   A driver for the Intel PRO/Wireless 2200BG and 2915ABG Network
  Connection adapters. 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] wireless-device-attr-fixes-2

2005-09-02 Thread Linux Kernel Mailing List
tree 21dfeb0daf6354cec40e71ee6a5865e28593e9c1
parent edfc43f2ec542c17c479d8ec7e4b0cee7b20f578
author Andrew Morton [EMAIL PROTECTED] Tue, 21 Jun 2005 04:30:36 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:37:30 -0400

[PATCH] wireless-device-attr-fixes-2

More fixes for greg depredations.

Also nuke lots of pointless typecasts.

All this new wireless code adds near-infinite amounts of trailing whitespace.

Cc: Jeff Garzik [EMAIL PROTECTED]
Cc: Greg KH [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 drivers/net/wireless/ipw2200.c |  122 ++---
 1 files changed, 68 insertions(+), 54 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -642,8 +642,8 @@ static ssize_t show_debug_level(struct d
 {
return sprintf(buf, 0x%08X\n, ipw_debug_level);
 }
-static ssize_t store_debug_level(struct device_driver *d, const char *buf, 
-size_t count)
+static ssize_t store_debug_level(struct device_driver *d,
+   const char *buf, size_t count)
 {
char *p = (char *)buf;
u32 val;
@@ -667,23 +667,26 @@ static ssize_t store_debug_level(struct 
 static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO, 
   show_debug_level, store_debug_level);
 
-static ssize_t show_status(struct device *d, char *buf)
+static ssize_t show_status(struct device *d,
+   struct device_attribute *attr, char *buf)
 {
-   struct ipw_priv *p = (struct ipw_priv *)d-driver_data;
+   struct ipw_priv *p = d-driver_data;
return sprintf(buf, 0x%08x\n, (int)p-status);
 }
 static DEVICE_ATTR(status, S_IRUGO, show_status, NULL);
 
-static ssize_t show_cfg(struct device *d, char *buf)
+static ssize_t show_cfg(struct device *d, struct device_attribute *attr,
+   char *buf)
 {
-   struct ipw_priv *p = (struct ipw_priv *)d-driver_data;
+   struct ipw_priv *p = d-driver_data;
return sprintf(buf, 0x%08x\n, (int)p-config);
 }
 static DEVICE_ATTR(cfg, S_IRUGO, show_cfg, NULL);
 
-static ssize_t show_nic_type(struct device *d, char *buf)
+static ssize_t show_nic_type(struct device *d,
+   struct device_attribute *attr, char *buf)
 {
-   struct ipw_priv *p = (struct ipw_priv *)d-driver_data;
+   struct ipw_priv *p = d-driver_data;
u8 type = p-eeprom[EEPROM_NIC_TYPE];
 
switch (type) {
@@ -703,8 +706,8 @@ static ssize_t show_nic_type(struct devi
 }
 static DEVICE_ATTR(nic_type, S_IRUGO, show_nic_type, NULL);
 
-static ssize_t dump_error_log(struct device *d, const char *buf,
- size_t count)
+static ssize_t dump_error_log(struct device *d,
+   struct device_attribute *attr, const char *buf, size_t count)
 {
char *p = (char *)buf;
 
@@ -715,8 +718,8 @@ static ssize_t dump_error_log(struct dev
 }
 static DEVICE_ATTR(dump_errors, S_IWUSR, NULL, dump_error_log);
 
-static ssize_t dump_event_log(struct device *d, const char *buf,
- size_t count)
+static ssize_t dump_event_log(struct device *d,
+   struct device_attribute *attr, const char *buf, size_t count)
 {
char *p = (char *)buf;
 
@@ -727,10 +730,11 @@ static ssize_t dump_event_log(struct dev
 }
 static DEVICE_ATTR(dump_events, S_IWUSR, NULL, dump_event_log);
 
-static ssize_t show_ucode_version(struct device *d, char *buf)
+static ssize_t show_ucode_version(struct device *d,
+   struct device_attribute *attr, char *buf)
 {
u32 len = sizeof(u32), tmp = 0;
-   struct ipw_priv *p = (struct ipw_priv*)d-driver_data;
+   struct ipw_priv *p = d-driver_data;
 
if(ipw_get_ordinal(p, IPW_ORD_STAT_UCODE_VERSION, tmp, len))
return 0;
@@ -739,10 +743,11 @@ static ssize_t show_ucode_version(struct
 }
 static DEVICE_ATTR(ucode_version, S_IWUSR|S_IRUGO, show_ucode_version, NULL);
 
-static ssize_t show_rtc(struct device *d, char *buf)
+static ssize_t show_rtc(struct device *d, struct device_attribute *attr,
+   char *buf)
 {
u32 len = sizeof(u32), tmp = 0;
-   struct ipw_priv *p = (struct ipw_priv*)d-driver_data;
+   struct ipw_priv *p = d-driver_data;
 
if(ipw_get_ordinal(p, IPW_ORD_STAT_RTC, tmp, len))
return 0;
@@ -755,35 +760,38 @@ static DEVICE_ATTR(rtc, S_IWUSR|S_IRUGO,
  * Add a device attribute to view/control the delay between eeprom
  * operations.
  */
-static ssize_t show_eeprom_delay(struct device *d, char *buf)
+static ssize_t show_eeprom_delay(struct device *d,
+   struct device_attribute *attr, char *buf)
 {
int n = ((struct ipw_priv*)d-driver_data)-eeprom_delay;
return sprintf(buf, %i\n, n);
 }
-static ssize_t store_eeprom_delay(struct device *d, const char *buf, 
-

ipw2200: minor cleanups

2005-09-02 Thread Linux Kernel Mailing List
tree 404fb9ba1a837bc9661bbbf45c3734adf3ef957a
parent 771abed990d8642f289f733dc0fa8a395ab31ca1
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:09:39 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:09:39 -0400

ipw2200: minor cleanups

This removes one trap for a programmer, few unused macros, and one
unused struct.

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 drivers/net/wireless/ipw2200.c |2 +-
 drivers/net/wireless/ipw2200.h |   10 +-
 2 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -4485,7 +4485,7 @@ static void ipw_debug_config(struct ipw_
IPW_DEBUG_INFO(RATE MASK: 0x%08X\n, priv-rates_mask);
 }
 #else
-#define ipw_debug_config(x) do {} while (0);
+#define ipw_debug_config(x) do {} while (0)
 #endif
 
 static inline void ipw_set_fixed_rate(struct ipw_priv *priv,
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -73,8 +73,6 @@ enum connection_manager_assoc_states
 };
 
 
-#define IPW_NORMAL   0
-#define IPW_NOWAIT   0
 #define IPW_WAIT (10)
 #define IPW_QUIET(11)
 #define IPW_ROAMING  (12)
@@ -180,7 +178,7 @@ enum connection_manager_assoc_states
 
 /* even if MAC WEP set (allows pre-encrypt) */
 #define DCT_FLAG_NO_WEP  0x20
-#define IPW_
+
 /* overwrite TSF field */
 #define DCT_FLAG_TSF_REQD  0x40
 
@@ -513,12 +511,6 @@ struct notif_authenticate {
u16 status;
 } __attribute__ ((packed));
 
-struct temperature
-{
-   s32 measured;
-   s32 active;
-} __attribute__ ((packed));
-
 struct notif_calibration {
u8 data[104];
 } __attribute__ ((packed));
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100: remove custom debug-print macros

2005-09-02 Thread Linux Kernel Mailing List
tree 8f948ed3592fe9e4f726955f4d1e217af00622a7
parent 19f7f74297e7f88f60c183acb105a5488dd189b6
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:03:27 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:03:27 -0400

ipw2100: remove custom debug-print macros

From: Pavel Machek [EMAIL PROTECTED]

ipw2100 uses custom debug prints that are sometimes longer and always
harder to read than normal printk. They also introduced some bugs where
prefix is printed twice.

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |   90 -
 1 files changed, 45 insertions(+), 45 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -484,7 +484,7 @@ int ipw2100_get_ordinal(struct ipw2100_p
u32 total_length;
 
if (ordinals-table1_addr == 0) {
-   IPW_DEBUG_WARNING(DRV_NAME : attempt to use fw ordinals 
+   printk(KERN_WARNING DRV_NAME : attempt to use fw ordinals 
   before they have been loaded.\n);
return -EINVAL;
}
@@ -493,7 +493,7 @@ int ipw2100_get_ordinal(struct ipw2100_p
if (*len  IPW_ORD_TAB_1_ENTRY_SIZE) {
*len = IPW_ORD_TAB_1_ENTRY_SIZE;
 
-   IPW_DEBUG_WARNING(DRV_NAME
+   printk(KERN_WARNING DRV_NAME
   : ordinal buffer length too small, need %zd\n,
   IPW_ORD_TAB_1_ENTRY_SIZE);
 
@@ -546,7 +546,7 @@ int ipw2100_get_ordinal(struct ipw2100_p
return 0;
}
 
-   IPW_DEBUG_WARNING(DRV_NAME : ordinal %d neither in table 1 nor 
+   printk(KERN_WARNING DRV_NAME : ordinal %d neither in table 1 nor 
   in table 2\n, ord);
 
return -EINVAL;
@@ -761,7 +761,7 @@ static int ipw2100_hw_send_command(struc
}
 
if (priv-fatal_error) {
-   IPW_DEBUG_WARNING(%s: firmware fatal error\n,
+   printk(KERN_WARNING DRV_NAME : %s: firmware fatal error\n,
   priv-net_dev-name);
return -EIO;
}
@@ -999,7 +999,7 @@ static int ipw2100_download_firmware(str
/* load microcode */
err = ipw2100_ucode_download(priv, ipw2100_firmware);
if (err) {
-   IPW_DEBUG_ERROR(%s: Error loading microcode: %d\n,
+   printk(KERN_ERR DRV_NAME : %s: Error loading microcode: %d\n,
   priv-net_dev-name, err);
goto fail;
}
@@ -1012,7 +1012,7 @@ static int ipw2100_download_firmware(str
/* s/w reset and clock stabilization (again!!!) */
err = sw_reset_and_clock(priv);
if (err) {
-   IPW_DEBUG_ERROR(%s: sw_reset_and_clock failed: %d\n,
+   printk(KERN_ERR DRV_NAME : %s: sw_reset_and_clock failed: 
%d\n,
   priv-net_dev-name, err);
goto fail;
}
@@ -1206,7 +1206,7 @@ static int ipw2100_start_adapter(struct 
 * fw  dino ucode
 */
if (ipw2100_download_firmware(priv)) {
-   IPW_DEBUG_ERROR(%s: Failed to power on the adapter.\n,
+   printk(KERN_ERR DRV_NAME : %s: Failed to power on the 
adapter.\n,
   priv-net_dev-name);
return -EIO;
}
@@ -1266,7 +1266,7 @@ static int ipw2100_start_adapter(struct 
 i ? SUCCESS : FAILED);
 
if (!i) {
-   IPW_DEBUG_WARNING(%s: Firmware did not initialize.\n,
+   printk(KERN_WARNING DRV_NAME : %s: Firmware did not 
initialize.\n,
   priv-net_dev-name);
return -EIO;
}
@@ -1462,7 +1462,7 @@ static int ipw2100_hw_stop_adapter(struc
 
err = ipw2100_hw_phy_off(priv);
if (err)
-   IPW_DEBUG_WARNING(Error disabling radio %d\n, err);
+   printk(KERN_WARNING DRV_NAME : Error disabling radio 
%d\n, err);
 
/*
 * If in D0-standby mode going directly to D3 may cause a
@@ -1488,7 +1488,7 @@ static int ipw2100_hw_stop_adapter(struc
 
err = ipw2100_hw_send_command(priv, cmd);
if (err)
-   IPW_DEBUG_WARNING(
+   printk(KERN_WARNING DRV_NAME : 
   %s: Power down command failed: Error %d\n,
   priv-net_dev-name, err);
else {
@@ -1529,7 +1529,7 @@ static int ipw2100_hw_stop_adapter(struc
}
 
if (i == 0)
-   IPW_DEBUG_WARNING(DRV_NAME
+   printk(KERN_WARNING DRV_NAME
   : %s: Could now power down adapter.\n,
   priv-net_dev-name);
 
@@ -1569,13 +1569,13 @@ static int ipw2100_disable_adapter(struc

ieee80211: convert defines to enums

2005-09-02 Thread Linux Kernel Mailing List
tree 4e127ad70ce5de9a33d81c875e665c229e66000d
parent f13baae43e97e84d3f06080908db75a017c62165
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:13:04 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:13:04 -0400

ieee80211: convert defines to enums

From: Gertjan van Wingerde [EMAIL PROTECTED]

Attached patch cleans up the long lists of #defines for status codes,
reason codes, and information elements.

Signed-off-by: Gertjan van Wingerde [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 include/net/ieee80211.h |  168 
 1 files changed, 87 insertions(+), 81 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -290,63 +290,67 @@ struct ieee80211_snap_hdr {
 #define WLAN_CAPABILITY_OSSS_OFDM (113)
 
 /* Status codes */
-#define WLAN_STATUS_SUCCESS 0
-#define WLAN_STATUS_UNSPECIFIED_FAILURE 1
-#define WLAN_STATUS_CAPS_UNSUPPORTED 10
-#define WLAN_STATUS_REASSOC_NO_ASSOC 11
-#define WLAN_STATUS_ASSOC_DENIED_UNSPEC 12
-#define WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG 13
-#define WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION 14
-#define WLAN_STATUS_CHALLENGE_FAIL 15
-#define WLAN_STATUS_AUTH_TIMEOUT 16
-#define WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA 17
-#define WLAN_STATUS_ASSOC_DENIED_RATES 18
-/* 802.11b */
-#define WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE 19
-#define WLAN_STATUS_ASSOC_DENIED_NOPBCC 20
-#define WLAN_STATUS_ASSOC_DENIED_NOAGILITY 21
-/* 802.11h */
-#define WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM 22
-#define WLAN_STATUS_ASSOC_REJECTED_BAD_POWER 23
-#define WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN 24
-/* 802.11g */
-#define WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME 25
-#define WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM 26
-/* 802.11i */
-#define WLAN_STATUS_INVALID_IE 40
-#define WLAN_STATUS_INVALID_GROUP_CIPHER 41
-#define WLAN_STATUS_INVALID_PAIRWISE_CIPHER 42
-#define WLAN_STATUS_INVALID_AKMP 43
-#define WLAN_STATUS_UNSUPP_RSN_VERSION 44
-#define WLAN_STATUS_INVALID_RSN_IE_CAP 45
-#define WLAN_STATUS_CIPHER_SUITE_REJECTED 46
+enum ieee80211_statuscode {
+   WLAN_STATUS_SUCCESS = 0,
+   WLAN_STATUS_UNSPECIFIED_FAILURE = 1,
+   WLAN_STATUS_CAPS_UNSUPPORTED = 10,
+   WLAN_STATUS_REASSOC_NO_ASSOC = 11,
+   WLAN_STATUS_ASSOC_DENIED_UNSPEC = 12,
+   WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG = 13,
+   WLAN_STATUS_UNKNOWN_AUTH_TRANSACTION = 14,
+   WLAN_STATUS_CHALLENGE_FAIL = 15,
+   WLAN_STATUS_AUTH_TIMEOUT = 16,
+   WLAN_STATUS_AP_UNABLE_TO_HANDLE_NEW_STA = 17,
+   WLAN_STATUS_ASSOC_DENIED_RATES = 18,
+   /* 802.11b */
+   WLAN_STATUS_ASSOC_DENIED_NOSHORTPREAMBLE = 19,
+   WLAN_STATUS_ASSOC_DENIED_NOPBCC = 20,
+   WLAN_STATUS_ASSOC_DENIED_NOAGILITY = 21,
+   /* 802.11h */
+   WLAN_STATUS_ASSOC_DENIED_NOSPECTRUM = 22,
+   WLAN_STATUS_ASSOC_REJECTED_BAD_POWER = 23,
+   WLAN_STATUS_ASSOC_REJECTED_BAD_SUPP_CHAN = 24,
+   /* 802.11g */
+   WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
+   WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
+   /* 802.11i */
+   WLAN_STATUS_INVALID_IE = 40,
+   WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
+   WLAN_STATUS_INVALID_PAIRWISE_CIPHER = 42,
+   WLAN_STATUS_INVALID_AKMP = 43,
+   WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
+   WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
+   WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
+};
 
 /* Reason codes */
-#define WLAN_REASON_UNSPECIFIED 1
-#define WLAN_REASON_PREV_AUTH_NOT_VALID 2
-#define WLAN_REASON_DEAUTH_LEAVING 3
-#define WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY 4
-#define WLAN_REASON_DISASSOC_AP_BUSY 5
-#define WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA 6
-#define WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA 7
-#define WLAN_REASON_DISASSOC_STA_HAS_LEFT 8
-#define WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH 9
-/* 802.11h */
-#define WLAN_REASON_DISASSOC_BAD_POWER 10
-#define WLAN_REASON_DISASSOC_BAD_SUPP_CHAN 11
-/* 802.11i */
-#define WLAN_REASON_INVALID_IE 13
-#define WLAN_REASON_MIC_FAILURE 14
-#define WLAN_REASON_4WAY_HANDSHAKE_TIMEOUT 15
-#define WLAN_REASON_GROUP_KEY_HANDSHAKE_TIMEOUT 16
-#define WLAN_REASON_IE_DIFFERENT 17
-#define WLAN_REASON_INVALID_GROUP_CIPHER 18
-#define WLAN_REASON_INVALID_PAIRWISE_CIPHER 19
-#define WLAN_REASON_INVALID_AKMP 20
-#define WLAN_REASON_UNSUPP_RSN_VERSION 21
-#define WLAN_REASON_INVALID_RSN_IE_CAP 22
-#define WLAN_REASON_IEEE8021X_FAILED 23
-#define WLAN_REASON_CIPHER_SUITE_REJECTED 24
+enum ieee80211_reasoncode {
+   WLAN_REASON_UNSPECIFIED = 1,
+   WLAN_REASON_PREV_AUTH_NOT_VALID = 2,
+   WLAN_REASON_DEAUTH_LEAVING = 3,
+   WLAN_REASON_DISASSOC_DUE_TO_INACTIVITY = 4,
+   WLAN_REASON_DISASSOC_AP_BUSY = 5,
+   WLAN_REASON_CLASS2_FRAME_FROM_NONAUTH_STA = 6,
+   WLAN_REASON_CLASS3_FRAME_FROM_NONASSOC_STA = 7,
+   WLAN_REASON_DISASSOC_STA_HAS_LEFT = 8,
+   WLAN_REASON_STA_REQ_ASSOC_WITHOUT_AUTH = 9,
+   /* 802.11h */
+   

[PATCH] drivers/net/wireless/ipw2100: Use the DMA_32BIT_MASK constant

2005-09-02 Thread Linux Kernel Mailing List
tree e1c925bb8c981f4051f78432ed4d330018fa760e
parent 070d01651296d3c87bca94f3b1313447e9e06c2f
author Tobias Klauser [EMAIL PROTECTED] Tue, 21 Jun 2005 04:28:40 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:25:10 -0400

[PATCH] drivers/net/wireless/ipw2100: Use the DMA_32BIT_MASK constant

Use the DMA_32BIT_MASK constant from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistent_dma_mask() instead of custom macros.

This patch includes dma-mapping.h explicitly because it caused errors on some
architectures otherwise.  See
http://marc.theaimsgroup.com/?t=10800199301r=1w=2 for details

Signed-off-by: Tobias Klauser [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |7 ++-
 1 files changed, 2 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -146,6 +146,7 @@ that only one external action is invoked
 #include linux/netdevice.h
 #include linux/ethtool.h
 #include linux/pci.h
+#include linux/dma-mapping.h
 #include linux/proc_fs.h
 #include linux/skbuff.h
 #include asm/uaccess.h
@@ -6423,10 +6424,6 @@ static struct net_device *ipw2100_alloc_
return dev;
 }
 
-
-
-#define PCI_DMA_32BIT   0xULL
-
 static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
const struct pci_device_id *ent)
 {
@@ -6480,7 +6477,7 @@ static int ipw2100_pci_init_one(struct p
pci_set_master(pci_dev);
pci_set_drvdata(pci_dev, priv);
 
-   err = pci_set_dma_mask(pci_dev, PCI_DMA_32BIT);
+   err = pci_set_dma_mask(pci_dev, DMA_32BIT_MASK);
if (err) {
printk(KERN_WARNING DRV_NAME
   Error calling pci_set_dma_mask.\n);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] drivers/net/wireless/ipw2200: Use the DMA_32BIT_MASK constant

2005-09-02 Thread Linux Kernel Mailing List
tree 84ee98bf0e580b5e552933053df9410fb1b6de76
parent 05743d165be9f0293b4ff67f4e1cf3724eb13e1f
author Tobias Klauser [EMAIL PROTECTED] Tue, 21 Jun 2005 04:28:41 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:25:10 -0400

[PATCH] drivers/net/wireless/ipw2200: Use the DMA_32BIT_MASK constant

Use the DMA_32BIT_MASK constant from dma-mapping.h when calling
pci_set_dma_mask() or pci_set_consistent_dma_mask() instead of custom macros.

This patch includes dma-mapping.h explicitly because it caused errors on some
architectures otherwise.  See
http://marc.theaimsgroup.com/?t=10800199301r=1w=2 for details

Signed-off-by: Tobias Klauser [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 drivers/net/wireless/ipw2200.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -6979,10 +6979,9 @@ static int ipw_pci_probe(struct pci_dev 
 
pci_set_master(pdev);
 
-#define PCI_DMA_32BIT 0xULL
-   err = pci_set_dma_mask(pdev, PCI_DMA_32BIT);
+   err = pci_set_dma_mask(pdev, DMA_32BIT_MASK);
if (!err) 
-   err = pci_set_consistent_dma_mask(pdev, PCI_DMA_32BIT);
+   err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK);
if (err) {
printk(KERN_WARNING DRV_NAME : No suitable DMA available.\n);
goto out_pci_disable_device;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: fix ipw 64bit compilation warnings

2005-09-02 Thread Linux Kernel Mailing List
tree 8d3d17298dcd9acca396ca783f64c5922d253677
parent e19b813e0c9c5995423dc95b01379c89f188ae70
author Jiri Benc [EMAIL PROTECTED] Tue, 07 Jun 2005 14:58:41 +0200
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:13:59 -0400

[PATCH] ieee80211: fix ipw 64bit compilation warnings

On Mon, 06 Jun 2005 14:29:52 +0800, Zhu Yi wrote:
 (%zd, sizeof()) should be better.

Thanks. This is a corrected version of the patch.

This patch fixes warnings when compiling ipw2100 and ipw2200 on x86_64.

Signed-off-by: Jiri Benc [EMAIL PROTECTED]
Signed-off-by: Jirka Bohac [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |   24 +++
 drivers/net/wireless/ipw2200.c |   42 -
 2 files changed, 33 insertions(+), 33 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -493,7 +493,7 @@ int ipw2100_get_ordinal(struct ipw2100_p
*len = IPW_ORD_TAB_1_ENTRY_SIZE;
 
IPW_DEBUG_WARNING(DRV_NAME
-  : ordinal buffer length too small, need %d\n,
+  : ordinal buffer length too small, need %zd\n,
   IPW_ORD_TAB_1_ENTRY_SIZE);
 
return -EINVAL;
@@ -2302,7 +2302,7 @@ static inline void ipw2100_corruption_de
 #endif
 
IPW_DEBUG_INFO(DRV_NAME : PCI latency error detected at 
-  0x%04X.\n, i * sizeof(struct ipw2100_status));
+  0x%04zX.\n, i * sizeof(struct ipw2100_status));
 
 #ifdef ACPI_CSTATE_LIMIT_DEFINED
IPW_DEBUG_INFO(DRV_NAME : Disabling C3 transitions.\n);
@@ -2398,7 +2398,7 @@ static inline void isr_rx(struct ipw2100
/* Make a copy of the frame so we can dump it to the logs if
 * ieee80211_rx fails */
memcpy(packet_data, packet-skb-data,
-  min(status-frame_size, IPW_RX_NIC_BUFFER_LENGTH));
+  min_t(u32, status-frame_size, IPW_RX_NIC_BUFFER_LENGTH));
 #endif
 
if (!ieee80211_rx(priv-ieee, packet-skb, stats)) {
@@ -2730,21 +2730,21 @@ static inline int __ipw2100_tx_process(s
{
int i = txq-oldest;
IPW_DEBUG_TX(
-   TX%d V=%p P=%p T=%p L=%d\n, i,
+   TX%d V=%p P=%04X T=%04X L=%d\n, i,
txq-drv[i],
-   (void*)txq-nic + i * sizeof(struct ipw2100_bd),
-   (void*)txq-drv[i].host_addr,
+   (u32)(txq-nic + i * sizeof(struct ipw2100_bd)),
+   txq-drv[i].host_addr,
txq-drv[i].buf_length);
 
if (packet-type == DATA) {
i = (i + 1) % txq-entries;
 
IPW_DEBUG_TX(
-   TX%d V=%p P=%p T=%p L=%d\n, i,
+   TX%d V=%p P=%04X T=%04X L=%d\n, i,
txq-drv[i],
-   (void*)txq-nic + i *
-   sizeof(struct ipw2100_bd),
-   (void*)txq-drv[i].host_addr,
+   (u32)(txq-nic + i *
+   sizeof(struct ipw2100_bd)),
+   (u32)txq-drv[i].host_addr,
txq-drv[i].buf_length);
}
}
@@ -4212,7 +4212,7 @@ static void bd_queue_initialize(
 {
IPW_DEBUG_INFO(enter\n);
 
-   IPW_DEBUG_INFO(initializing bd queue at virt=%p, phys=%08x\n, q-drv, 
q-nic);
+   IPW_DEBUG_INFO(initializing bd queue at virt=%p, phys=%08x\n, q-drv, 
(u32)q-nic);
 
write_register(priv-net_dev, base, q-nic);
write_register(priv-net_dev, size, q-entries);
@@ -8431,7 +8431,7 @@ int ipw2100_get_firmware(struct ipw2100_
   priv-net_dev-name, fw_name);
return rc;
}
-   IPW_DEBUG_INFO(firmware data %p size %d\n, fw-fw_entry-data,
+   IPW_DEBUG_INFO(firmware data %p size %zd\n, fw-fw_entry-data,
   fw-fw_entry-size);
 
ipw2100_mod_firmware_load(fw);
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -241,8 +241,8 @@ static void _ipw_write_reg8(struct ipw_p
IPW_DEBUG_IO( reg = 0x%8X : value = 0x%8X\n, reg, value);
_ipw_write32(priv, CX2_INDIRECT_ADDR, reg  CX2_INDIRECT_ADDR_MASK);
_ipw_write8(priv, CX2_INDIRECT_DATA, value);
-   IPW_DEBUG_IO( reg = 0x%8X : value = 0x%8X\n, 
-(unsigned)(priv-hw_base + CX2_INDIRECT_DATA),
+   IPW_DEBUG_IO( reg = 0x%8lX : value = 0x%8X\n, 
+(unsigned long)(priv-hw_base + CX2_INDIRECT_DATA),
 value);
 }
 
@@ -508,7 +508,7 @@ static int ipw_get_ordinal(struct ipw_pr
  

[ARM] 2865/2: fix fadvise64_64 syscall argument passing

2005-09-02 Thread Linux Kernel Mailing List
tree 635711b71ef8aca704638b01bb2f58902b93d04a
parent 147056fb84150966d736fe21fa01d5e0f08e0980
author Nicolas Pitre [EMAIL PROTECTED] Thu, 01 Sep 2005 12:37:13 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 12:37:13 +0100

[ARM] 2865/2: fix fadvise64_64 syscall argument passing

Patch from Nicolas Pitre

The prototype for sys_fadvise64_64() is:
long sys_fadvise64_64(int fd, loff_t offset, loff_t len, int advice)
The argument list is therefore as follows on legacy ABI:
fd: type int (r0)
offset: type long long (r1-r2)
len: type long long (r3-sp[0])
advice: type int (sp[4])
With EABI this becomes:
fd: type int (r0)
offset: type long long (r2-r3)
len: type long long (sp[0]-sp[4])
advice: type int (sp[8])
Not only do we have ABI differences here, but the EABI version requires
one additional word on the syscall stack.
To avoid the ABI mismatch and the extra stack space required with EABI
this syscall is now defined with a different argument ordering
on ARM as follows:
long sys_arm_fadvise64_64(int fd, int advice, loff_t offset, loff_t len)
This gives us the following ABI independent argument distribution:
fd: type int (r0)
advice: type int (r1)
offset: type long long (r2-r3)
len: type long long (sp[0]-sp[4])
Now, since the syscall entry code takes care of 5 registers only by
default including the store of r4 to the stack, we need a wrapper to
store r5 to the stack as well.  Because that wrapper was missing and was
always required this means that sys_fadvise64_64 never worked on ARM and
therefore we can safely reuse its syscall number for our new
sys_arm_fadvise64_64 interface.

Signed-off-by: Nicolas Pitre [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/kernel/calls.S|2 +-
 arch/arm/kernel/entry-common.S |4 
 arch/arm/kernel/sys_arm.c  |   10 ++
 include/asm-arm/unistd.h   |2 +-
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/arch/arm/kernel/calls.S b/arch/arm/kernel/calls.S
--- a/arch/arm/kernel/calls.S
+++ b/arch/arm/kernel/calls.S
@@ -284,7 +284,7 @@ __syscall_start:
.long   sys_fstatfs64
.long   sys_tgkill
.long   sys_utimes
-/* 270 */  .long   sys_fadvise64_64
+/* 270 */  .long   sys_arm_fadvise64_64_wrapper
.long   sys_pciconfig_iobase
.long   sys_pciconfig_read
.long   sys_pciconfig_write
diff --git a/arch/arm/kernel/entry-common.S b/arch/arm/kernel/entry-common.S
--- a/arch/arm/kernel/entry-common.S
+++ b/arch/arm/kernel/entry-common.S
@@ -265,6 +265,10 @@ sys_futex_wrapper:
str r5, [sp, #4]@ push sixth arg
b   sys_futex
 
+sys_arm_fadvise64_64_wrapper:
+   str r5, [sp, #4]@ push r5 to stack
+   b   sys_arm_fadvise64_64
+
 /*
  * Note: off_4k (r5) is always units of 4K.  If we can't do the requested
  * offset, we return EINVAL.
diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
--- a/arch/arm/kernel/sys_arm.c
+++ b/arch/arm/kernel/sys_arm.c
@@ -311,3 +311,13 @@ long execve(const char *filename, char *
return ret;
 }
 EXPORT_SYMBOL(execve);
+
+/*
+ * Since loff_t is a 64 bit type we avoid a lot of ABI hastle
+ * with a different argument ordering.
+ */
+asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
+loff_t offset, loff_t len)
+{
+   return sys_fadvise64_64(fd, offset, len, advice);
+}
diff --git a/include/asm-arm/unistd.h b/include/asm-arm/unistd.h
--- a/include/asm-arm/unistd.h
+++ b/include/asm-arm/unistd.h
@@ -295,7 +295,7 @@
 #define __NR_fstatfs64 (__NR_SYSCALL_BASE+267)
 #define __NR_tgkill(__NR_SYSCALL_BASE+268)
 #define __NR_utimes(__NR_SYSCALL_BASE+269)
-#define __NR_fadvise64_64  (__NR_SYSCALL_BASE+270)
+#define __NR_arm_fadvise64_64  (__NR_SYSCALL_BASE+270)
 #define __NR_pciconfig_iobase  (__NR_SYSCALL_BASE+271)
 #define __NR_pciconfig_read(__NR_SYSCALL_BASE+272)
 #define __NR_pciconfig_write   (__NR_SYSCALL_BASE+273)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211_module.c::store_debug_level() cleanup

2005-09-02 Thread Linux Kernel Mailing List
tree 5c6d8a4a44acccb6f9685b8d601d4b24357fb130
parent ff0e0ea2f5d36fa90fc2c57fd019102b0a0cfabf
author Al Viro [EMAIL PROTECTED] Sun, 03 Apr 2005 09:15:52 +0100
committer Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:15:13 -0400

[PATCH] ieee80211_module.c::store_debug_level() cleanup

* trivial __user annotations
* store_debug_level() sanitized a bit
Signed-off-by: Al Viro [EMAIL PROTECTED]

 net/ieee80211/ieee80211_module.c |   16 +++-
 1 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/net/ieee80211/ieee80211_module.c b/net/ieee80211/ieee80211_module.c
--- a/net/ieee80211/ieee80211_module.c
+++ b/net/ieee80211/ieee80211_module.c
@@ -194,17 +194,23 @@ static int show_debug_level(char *page, 
return snprintf(page, count, 0x%08X\n, ieee80211_debug_level);
 }
 
-static int store_debug_level(struct file *file, const char *buffer,
+static int store_debug_level(struct file *file, const char __user *buffer,
 unsigned long count, void *data)
 {
char buf[] = 0x;
-   unsigned long len = min(sizeof(buf) - 1, (u32)count);
char *p = (char *)buf;
unsigned long val;
 
-   if (copy_from_user(buf, buffer, len))
+   if (count  sizeof(buf) - 1)
+   count = sizeof(buf) - 1;
+
+   if (copy_from_user(buf, buffer, count))
return count;
-   buf[len] = 0;
+   buf[count] = 0;
+   /*
+* what a FPOS...  What, sscanf(buf, %i, val) would be too
+* scary?
+*/
if (p[1] == 'x' || p[1] == 'X' || p[0] == 'x' || p[0] == 'X') {
p++;
if (p[0] == 'x' || p[0] == 'X')
@@ -218,7 +224,7 @@ static int store_debug_level(struct file
else
ieee80211_debug_level = val;
 
-   return strnlen(buf, count);
+   return strlen(buf);
 }
 
 static int __init ieee80211_init(void)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: Fix debug comments ipw-ieee80211

2005-09-02 Thread Linux Kernel Mailing List
tree 2bf0b83759860617d7d2b73a04a0e61fd2e0851a
parent 51e828b6a123912f27afc512377ad3e2ab40d2eb
author Jouni Malinen [EMAIL PROTECTED] Mon, 29 Aug 2005 00:51:34 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 29 Aug 2005 03:23:07 -0400

[PATCH] ieee80211: Fix debug comments ipw-ieee80211

Debug variables and procfs dir should be ieee80211, not ipw.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 include/net/ieee80211.h |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -158,11 +158,11 @@ const char *escape_essid(const char *ess
  *
  * To add your debug level to the list of levels seen when you perform
  *
- * % cat /proc/net/ipw/debug_level
+ * % cat /proc/net/ieee80211/debug_level
  *
- * you simply need to add your entry to the ipw_debug_levels array.
+ * you simply need to add your entry to the ieee80211_debug_level array.
  *
- * If you do not see debug_level in /proc/net/ipw then you do not have
+ * If you do not see debug_level in /proc/net/ieee80211 then you do not have
  * CONFIG_IEEE80211_DEBUG defined in your kernel configuration
  *
  */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[wireless] ipw2100: fix build after applying SuSE cleanups

2005-09-02 Thread Linux Kernel Mailing List
tree 287fe022d75e287aeff6d115316b93e6308ae28d
parent 286d974797705ae7ceedc84ef98bdeee3646
author Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:53:55 -0400
committer Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:53:55 -0400

[wireless] ipw2100: fix build after applying SuSE cleanups

s/ieee80211_header_data/ieee80211_hdr_3addr/

 drivers/net/wireless/ipw2100.h |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -885,7 +885,7 @@ struct ipw2100_priv {
 
 
 
-#define IPW_HEADER_802_11_SIZE  sizeof(struct ieee80211_header_data)
+#define IPW_HEADER_802_11_SIZE  sizeof(struct ieee80211_hdr_3addr)
 #define IPW_MAX_80211_PAYLOAD_SIZE  2304U
 #define IPW_MAX_802_11_PAYLOAD_LENGTH  2312
 #define IPW_MAX_ACCEPTABLE_TX_FRAME_LENGTH 1536
@@ -900,7 +900,7 @@ struct ipw2100_priv {
IPW_802_11_FCS_LENGTH)
 
 #define IPW_802_11_PAYLOAD_OFFSET \
-(sizeof(struct ieee80211_header_data) + \
+(sizeof(struct ieee80211_hdr_3addr) + \
  sizeof(struct ieee80211_snap_hdr))
 
 struct ipw2100_rx {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ipw2100 old gcc fix

2005-09-02 Thread Linux Kernel Mailing List
tree 57adf80a6e63d189da1edb32be3fff186f76bc7f
parent 8724a118031a4eb62174b3e12745e4d35d4b03fe
author Andrew Morton [EMAIL PROTECTED] Tue, 21 Jun 2005 04:30:36 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:28:35 -0400

[PATCH] ipw2100 old gcc fix

drivers/net/wireless/ipw2100.c: In function `ipw2100_set_key_index':
drivers/net/wireless/ipw2100.c:5326: array index in non-array initializer
drivers/net/wireless/ipw2100.c:5326: (near initialization for `cmd')
drivers/net/wireless/ipw2100.c:5326: warning: missing braces around initializer
drivers/net/wireless/ipw2100.c:5326: warning: (near initialization for 
`cmd.host_command_parameters')

Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5305,7 +5305,7 @@ static int ipw2100_set_key_index(struct 
.host_command = WEP_KEY_INDEX,
.host_command_sequence = 0,
.host_command_length = 4,
-   .host_command_parameters[0] = idx,
+   .host_command_parameters = { idx },
};
int err;
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


wireless: fix ipw warning; add is_broadcast_ether_addr() to linux/etherdevice.h

2005-09-02 Thread Linux Kernel Mailing List
tree 3ccd9be1df9cff30863e47d32f631b9c43da5783
parent 2179a59db18ddf8eb3fd0133a3bee57f1c2b5b06
author Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 09:46:35 -0400
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 09:46:35 -0400

wireless: fix ipw warning; add is_broadcast_ether_addr() to linux/etherdevice.h

 drivers/net/wireless/ipw2200.c |2 +-
 include/linux/etherdevice.h|6 ++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1170,7 +1170,7 @@ static int ipw_send_cmd(struct ipw_priv 
HOST_COMPLETE_TIMEOUT);
if (rc == 0) {
IPW_DEBUG_INFO(Command completion failed out after %dms.\n,
-  HOST_COMPLETE_TIMEOUT / (HZ / 1000));
+  jiffies_to_msecs(HOST_COMPLETE_TIMEOUT));
priv-status = ~STATUS_HCMD_ACTIVE;
return -EIO;
}
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -68,6 +68,12 @@ static inline int is_multicast_ether_add
return ((addr[0] != 0xff)  (0x01  addr[0]));
 }
 
+static inline int is_broadcast_ether_addr(const u8 *addr)
+{
+return ((addr[0] == 0xff)  (addr[1] == 0xff)  (addr[2] == 0xff)  
 
+   (addr[3] == 0xff)  (addr[4] == 0xff)  (addr[5] == 0xff));
+}
+
 /**
  * is_valid_ether_addr - Determine if the given Ethernet address is valid
  * @addr: Pointer to a six-byte array containing the Ethernet address
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: Capability field is called ESS, not BSS

2005-09-02 Thread Linux Kernel Mailing List
tree af2e7e7695e3dc46b8db9d0770dcbab3e58849b5
parent 4c0e176dd5e4c44dd60f398518f75eedbe1a65f3
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 10:59:59 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 08:28:17 -0400

[PATCH] ieee80211: Capability field is called ESS, not BSS

IEEE 802.11 has a capability field flag called ESS, but ieee80211 had
renamed this to BSS for some reason. hostap has been using
WLAN_CAPABILITY_ESS and since that matches with the standard, lets use
it as the name for this define. Add WLAN_CAPABILITY_BSS as a backwards
compatibility name for the same bit since ieee80211 and ipw2200 are
using this and there are versions outside kernel tree that expect to
find this define name.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/ipw2200.c |2 +-
 include/net/ieee80211.h|3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -4190,7 +4190,7 @@ static int ipw_best_network(
/* Verify that this network's capability is compatible with the
 * current mode (AdHoc or Infrastructure) */
if ((priv-ieee-iw_mode == IW_MODE_INFRA 
-!(network-capability  WLAN_CAPABILITY_BSS)) ||
+!(network-capability  WLAN_CAPABILITY_ESS)) ||
(priv-ieee-iw_mode == IW_MODE_ADHOC 
 !(network-capability  WLAN_CAPABILITY_IBSS))) {
IPW_DEBUG_ASSOC(Network '%s ( MAC_FMT )' excluded due to 
diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -264,7 +264,8 @@ struct ieee80211_snap_hdr {
 
 #define WLAN_AUTH_CHALLENGE_LEN 128
 
-#define WLAN_CAPABILITY_BSS (10)
+#define WLAN_CAPABILITY_ESS (10)
+#define WLAN_CAPABILITY_BSS WLAN_CAPABILITY_ESS
 #define WLAN_CAPABILITY_IBSS (11)
 #define WLAN_CAPABILITY_CF_POLLABLE (12)
 #define WLAN_CAPABILITY_CF_POLL_REQUEST (13)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ieee80211: Remove WIRELESS_EXT 17 support

2005-09-02 Thread Linux Kernel Mailing List
tree 0800fc7d25f9b74d4f0fd16fd852a7ad44424bea
parent 099c5bb169e9816a7761336f668b63010762807b
author Jouni Malinen [EMAIL PROTECTED] Mon, 29 Aug 2005 00:51:32 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 29 Aug 2005 03:23:06 -0400

[PATCH] ieee80211: Remove WIRELESS_EXT  17 support

No need to maintain support for WIRELESS_EXT  17 since this kernel
tree is already using WIRELESS_EXT 18.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 include/net/ieee80211.h |9 -
 1 files changed, 9 deletions(-)

diff --git a/include/net/ieee80211.h b/include/net/ieee80211.h
--- a/include/net/ieee80211.h
+++ b/include/net/ieee80211.h
@@ -24,15 +24,6 @@
 #include linux/kernel.h   /* ARRAY_SIZE */
 #include linux/wireless.h
 
-#if WIRELESS_EXT  17
-#define IW_QUAL_QUAL_INVALID   0x10
-#define IW_QUAL_LEVEL_INVALID  0x20
-#define IW_QUAL_NOISE_INVALID  0x40
-#define IW_QUAL_QUAL_UPDATED   0x1
-#define IW_QUAL_LEVEL_UPDATED  0x2
-#define IW_QUAL_NOISE_UPDATED  0x4
-#endif
-
 #define IEEE80211_DATA_LEN 2304
 /* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
6.2.1.1.2.
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] ipw2100: kill dead macros

2005-09-02 Thread Linux Kernel Mailing List
tree 8dde1717c6748c73b3287104662c238d43b57450
parent 4663663f1d91aa0b84526841e47f401598bfa2f4
author Pavel Machek [EMAIL PROTECTED] Tue, 21 Jun 2005 04:28:43 -0700
committer Jeff Garzik [EMAIL PROTECTED] Tue, 28 Jun 2005 07:26:30 -0400

[PATCH] ipw2100: kill dead macros

There are several never used macros in ipw2100.  This removes them.

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |1 
 drivers/net/wireless/ipw2100.h |   49 -
 2 files changed, 50 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1116,7 +1116,6 @@ static inline int rf_kill_active(struct 
 {
 #define MAX_RF_KILL_CHECKS 5
 #define RF_KILL_CHECK_DELAY 40
-#define RF_KILL_CHECK_THRESHOLD 3
 
unsigned short value = 0;
u32 reg = 0;
diff --git a/drivers/net/wireless/ipw2100.h b/drivers/net/wireless/ipw2100.h
--- a/drivers/net/wireless/ipw2100.h
+++ b/drivers/net/wireless/ipw2100.h
@@ -143,15 +143,6 @@ enum { IPW_DEBUG_ENABLED = 0 };
 #define IPW_DEBUG_STATE(f, a...) IPW_DEBUG(IPW_DL_STATE | IPW_DL_ASSOC | 
IPW_DL_INFO, f, ## a)
 #define IPW_DEBUG_ASSOC(f, a...) IPW_DEBUG(IPW_DL_ASSOC | IPW_DL_INFO, f, ## a)
 
-
-#define VERIFY(f) \
-{ \
-  int status = 0; \
-  status = f; \
-  if(status) \
- return status; \
-}
-
 enum {
IPW_HW_STATE_DISABLED = 1,
IPW_HW_STATE_ENABLED = 0
@@ -186,8 +177,6 @@ struct bd_status {
} info;
 } __attribute__ ((packed));
 
-#defineIPW_BUFDESC_LAST_FRAG 0
-
 struct ipw2100_bd {
u32 host_addr;
u32 buf_length;
@@ -624,9 +613,6 @@ struct ipw2100_priv {
struct semaphore adapter_sem;
 
wait_queue_head_t wait_command_queue;
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,10)
-   u32 pm_state[PM_STATE_SIZE];
-#endif
 };
 
 
@@ -728,41 +714,6 @@ struct ipw2100_priv {
 #define IPW_MEM_HOST_SHARED_TX_QUEUE_WRITE_INDEX \
 (IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND)
 
-
-#if 0
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_BASE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x00)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_BD_SIZE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x04)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_BASE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x08)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_BD_SIZE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0c)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_BASE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x10)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_BD_SIZE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x14)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_BASE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x18)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_BD_SIZE  
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x1c)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_READ_INDEX   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x80)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_READ_INDEX   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x84)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_READ_INDEX   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x88)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_READ_INDEX   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x8c)
-
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_BASE(QueueNum) \
-(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + (QueueNum3))
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_BD_SIZE(QueueNum) \
-(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0004+(QueueNum3))
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_READ_INDEX(QueueNum) \
-(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x0080+(QueueNum2))
-
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_0_WRITE_INDEX \
-(IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x00)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_1_WRITE_INDEX \
-(IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x04)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_2_WRITE_INDEX \
-(IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x08)
-#define IPW_MEM_HOST_SHARED_TX_QUEUE_3_WRITE_INDEX \
-(IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x0c)
-#define IPW_MEM_HOST_SHARED_SLAVE_MODE_INT_REGISTER \
-(IPW_MEM_SRAM_HOST_INTERRUPT_AREA_LOWER_BOUND + 0x78)
-
-#endif
-
 #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_1   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x180)
 #define IPW_MEM_HOST_SHARED_ORDINALS_TABLE_2   
(IPW_MEM_SRAM_HOST_SHARED_LOWER_BOUND + 0x184)
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[SERIAL] mwave is no longer broken

2005-09-02 Thread Linux Kernel Mailing List
tree 21cd9b7db02a67d6420068b95aa394b504e10eff
parent 5981d644209c38029df7f91eb8c61bc5952f182b
author Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:25:45 +0100
committer Russell King [EMAIL PROTECTED] Thu, 01 Sep 2005 14:25:45 +0100

[SERIAL] mwave is no longer broken

Signed-off-by: Russell King [EMAIL PROTECTED]

 drivers/char/Kconfig |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -896,8 +896,8 @@ source drivers/char/pcmcia/Kconfig
 
 config MWAVE
tristate ACP Modem (Mwave) support
-   depends on X86  BROKEN
-   select SERIAL_8250 # PLEASE DO NOT DO THIS - move this driver to 
drivers/serial
+   depends on X86
+   select SERIAL_8250
---help---
  The ACP modem (Mwave) for Linux is a WinModem. It is composed of a
  kernel driver and a user level application. Together these components
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ipw2100: remove strange symbol prefixes

2005-09-02 Thread Linux Kernel Mailing List
tree bda720299a5212d3da8d23017fbf54c92c0bd527
parent e88187eedc0a9223914b23b063342db8bcc31f9c
author Jiri Benc [EMAIL PROTECTED] Fri, 26 Aug 2005 04:02:10 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:02:10 -0400

ipw2100: remove strange symbol prefixes

From: Pavel Machek [EMAIL PROTECTED]

ipw2100 uses strange X__ prefixes even for symbols already prefixed
by ipw2100. Fixed.

Signed-off-by: Pavel Machek [EMAIL PROTECTED]
Signed-off-by: Jiri Benc [EMAIL PROTECTED]

 drivers/net/wireless/ipw2100.c |   26 +-
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -106,7 +106,7 @@ that protects the following:
 
   tx_pend_list : Holds used Tx buffers waiting to go into the TBD ring
 TAIL modified ipw2100_tx()
-HEAD modified by X__ipw2100_tx_send_data()
+HEAD modified by ipw2100_tx_send_data()
 
   msg_free_list : Holds pre-allocated Msg (Command) buffers
 TAIL modified in __ipw2100_tx_process()
@@ -114,7 +114,7 @@ that protects the following:
 
   msg_pend_list : Holds used Msg buffers waiting to go into the TBD ring
 TAIL modified in ipw2100_hw_send_command()
-HEAD modified in X__ipw2100_tx_send_commands()
+HEAD modified in ipw2100_tx_send_commands()
 
   The flow of data on the TX side is as follows:
 
@@ -287,8 +287,8 @@ static const char *command_types[] = {
 
 
 /* Pre-decl until we get the code solid and then we can clean it up */
-static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv);
-static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv);
+static void ipw2100_tx_send_commands(struct ipw2100_priv *priv);
+static void ipw2100_tx_send_data(struct ipw2100_priv *priv);
 static int ipw2100_adapter_setup(struct ipw2100_priv *priv);
 
 static void ipw2100_queues_initialize(struct ipw2100_priv *priv);
@@ -736,8 +736,8 @@ static int ipw2100_hw_send_command(struc
list_add_tail(element, priv-msg_pend_list);
INC_STAT(priv-msg_pend_stat);
 
-   X__ipw2100_tx_send_commands(priv);
-   X__ipw2100_tx_send_data(priv);
+   ipw2100_tx_send_commands(priv);
+   ipw2100_tx_send_data(priv);
 
spin_unlock_irqrestore(priv-low_lock, flags);
 
@@ -2837,14 +2837,14 @@ static inline void __ipw2100_tx_complete
while (__ipw2100_tx_process(priv)  i  200) i++;
 
if (i == 200) {
-   IPW_DEBUG_WARNING(
+   printk(KERN_WARNING DRV_NAME : 
   %s: Driver is running slow (%d iters).\n,
   priv-net_dev-name, i);
}
 }
 
 
-static void X__ipw2100_tx_send_commands(struct ipw2100_priv *priv)
+static void ipw2100_tx_send_commands(struct ipw2100_priv *priv)
 {
struct list_head *element;
struct ipw2100_tx_packet *packet;
@@ -2912,10 +2912,10 @@ static void X__ipw2100_tx_send_commands(
 
 
 /*
- * X__ipw2100_tx_send_data
+ * ipw2100_tx_send_data
  *
  */
-static void X__ipw2100_tx_send_data(struct ipw2100_priv *priv)
+static void ipw2100_tx_send_data(struct ipw2100_priv *priv)
 {
struct list_head *element;
struct ipw2100_tx_packet *packet;
@@ -3130,8 +3130,8 @@ static void ipw2100_irq_tasklet(struct i
   IPW2100_INTA_TX_TRANSFER);
 
__ipw2100_tx_complete(priv);
-   X__ipw2100_tx_send_commands(priv);
-   X__ipw2100_tx_send_data(priv);
+   ipw2100_tx_send_commands(priv);
+   ipw2100_tx_send_data(priv);
}
 
if (inta  IPW2100_INTA_TX_COMPLETE) {
@@ -3282,7 +3282,7 @@ static int ipw2100_tx(struct ieee80211_t
list_add_tail(element, priv-tx_pend_list);
INC_STAT(priv-tx_pend_stat);
 
-   X__ipw2100_tx_send_data(priv);
+   ipw2100_tx_send_data(priv);
 
spin_unlock_irqrestore(priv-low_lock, flags);
return 0;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] net/ieee80211/: make two functions static

2005-09-02 Thread Linux Kernel Mailing List
tree c55f18c62d814fafe291e55019ec95221bdcf8eb
parent 3dcefbc9d6bd8b5ff0fc4bdbe3df938be5460f79
author Adrian Bunk [EMAIL PROTECTED] Fri, 06 May 2005 23:32:39 +0200
committer Jeff Garzik [EMAIL PROTECTED] Sat, 28 May 2005 06:26:43 -0400

[PATCH] net/ieee80211/: make two functions static

This patch makes two needlessly global functions static.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]

 net/ieee80211/ieee80211_crypt_ccmp.c |4 ++--
 net/ieee80211/ieee80211_tx.c |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/ieee80211/ieee80211_crypt_ccmp.c 
b/net/ieee80211/ieee80211_crypt_ccmp.c
--- a/net/ieee80211/ieee80211_crypt_ccmp.c
+++ b/net/ieee80211/ieee80211_crypt_ccmp.c
@@ -59,8 +59,8 @@ struct ieee80211_ccmp_data {
u8 rx_b0[AES_BLOCK_LEN], rx_b[AES_BLOCK_LEN], rx_a[AES_BLOCK_LEN];
 };
 
-void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm,
-const u8 pt[16], u8 ct[16])
+static void ieee80211_ccmp_aes_encrypt(struct crypto_tfm *tfm,
+  const u8 pt[16], u8 ct[16])
 {
struct scatterlist src, dst;
 
diff --git a/net/ieee80211/ieee80211_tx.c b/net/ieee80211/ieee80211_tx.c
--- a/net/ieee80211/ieee80211_tx.c
+++ b/net/ieee80211/ieee80211_tx.c
@@ -212,8 +212,8 @@ void ieee80211_txb_free(struct ieee80211
kfree(txb);
 }
 
-struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
- int gfp_mask)
+static struct ieee80211_txb *ieee80211_alloc_txb(int nr_frags, int txb_size,
+int gfp_mask)
 {
struct ieee80211_txb *txb;
int i;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 38caa068662b2a661939a7e34e66eed83ccbbf3b
parent 47e362cf6942de8b3a227929bf8bab578d92ad49
author Adrian Bunk [EMAIL PROTECTED] Sun, 31 Jul 2005 02:49:56 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:22 -0400

[PATCH] hostap update

EXPORT_SYMTAB does nothing. There's no need to define something if it
doesn't have any effect.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap.c |4 
 1 files changed, 4 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap.c 
b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c
+++ b/drivers/net/wireless/hostap/hostap.c
@@ -12,10 +12,6 @@
  * more details.
  */
 
-#ifndef EXPORT_SYMTAB
-#define EXPORT_SYMTAB
-#endif
-
 #include linux/config.h
 #include linux/version.h
 #include linux/module.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 0039836752d1ae1a3d3aab8b514e9159573fd146
parent 0ef79ee22cf5c1b177184c18b6525889bcc6681f
author Dave Hansen [EMAIL PROTECTED] Sun, 31 Jul 2005 02:49:58 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:22 -0400

[PATCH] hostap update

Create sysfs device files for hostap

I was writing some scripts to automatically build kismet source lines,
and I noticed that hostap devices don't have device files, unlike my
prism54 and ipw2200 cards:

$ ls -l /sys/class/net/eth0/device
/sys/class/net/eth0/device - 
../../../devices/pci:00/:00:1e.0/:02:01.0
$ ls -l /sys/class/net/wifi0
ls: /sys/class/net/wifi0/device: No such file or directory
$ ls -l /sys/class/net/wlan0
ls: /sys/class/net/wlan0/device: No such file or directory

The following (quite small) patch makes sure that both the wlan and wifi
net devices have that pointer to the bus device.

This way, I can do things like

for i in /sys/class/net/*; do
if ! [ -e $i/device/drive ]; then
continue;
fi;
driver=$(basename $(readlink $i/device/driver))
case $driver in
hostap*)
echo -- hostap,$i,$i-$driver
break;
ipw2?00)
echo -- $driver,$i,$i-$driver
break;
prism54)
echo prism54g,$i
esac
done

Which should generate a working set of source lines for kismet no matter
what order I plug the cards in.

It might also be handy to have a link between the two net devices, but
that's a patch for another day.

That patch is against 2.6.13-rc1-mm1.

-- Dave

Signed-off-by: Dave Hansen [EMAIL PROTECTED]
Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap.c |1 +
 drivers/net/wireless/hostap/hostap_cs.c  |3 ++-
 drivers/net/wireless/hostap/hostap_hw.c  |4 +++-
 drivers/net/wireless/hostap/hostap_pci.c |3 ++-
 drivers/net/wireless/hostap/hostap_plx.c |3 ++-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap.c 
b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c
+++ b/drivers/net/wireless/hostap/hostap.c
@@ -137,6 +137,7 @@ struct net_device * hostap_add_interface
if (strchr(dev-name, '%'))
ret = dev_alloc_name(dev, dev-name);
 
+   SET_NETDEV_DEV(dev, mdev-class_dev.dev);
if (ret = 0)
ret = register_netdevice(dev);
 
diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -725,7 +725,8 @@ static int prism2_config(dev_link_t *lin
}
 
/* Need to allocate net_device before requesting IRQ handler */
-   dev = prism2_init_local_data(prism2_pccard_funcs, 0);
+   dev = prism2_init_local_data(prism2_pccard_funcs, 0,
+handle_to_dev(link-handle));
if (dev == NULL)
goto failed;
link-priv = dev;
diff --git a/drivers/net/wireless/hostap/hostap_hw.c 
b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3268,7 +3268,8 @@ static void prism2_clear_set_tim_queue(l
 
 
 static struct net_device *
-prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx)
+prism2_init_local_data(struct prism2_helper_functions *funcs, int card_idx,
+  struct device *sdev)
 {
struct net_device *dev;
struct hostap_interface *iface;
@@ -3439,6 +3440,7 @@ while (0)
 
rtnl_lock();
ret = dev_alloc_name(dev, wifi%d);
+   SET_NETDEV_DEV(dev, sdev);
if (ret = 0)
ret = register_netdevice(dev);
rtnl_unlock();
diff --git a/drivers/net/wireless/hostap/hostap_pci.c 
b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -308,7 +308,8 @@ static int prism2_pci_probe(struct pci_d
pci_set_master(pdev);
 #endif /* PRISM2_BUS_MASTER */
 
-   dev = prism2_init_local_data(prism2_pci_funcs, cards_found);
+   dev = prism2_init_local_data(prism2_pci_funcs, cards_found,
+pdev-dev);
if (dev == NULL)
goto fail;
iface = netdev_priv(dev);
diff --git a/drivers/net/wireless/hostap/hostap_plx.c 
b/drivers/net/wireless/hostap/hostap_plx.c
--- a/drivers/net/wireless/hostap/hostap_plx.c
+++ b/drivers/net/wireless/hostap/hostap_plx.c
@@ -522,7 +522,8 @@ static int prism2_plx_probe(struct pci_d
 * not present; but are there really such cards in use(?) */

[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree d1fd0e8f8de80e0728dfd46f7ae130e9a6999439
parent 1fad810473423bbf0626fab2fbeb27a4663fa2d5
author Jar [EMAIL PROTECTED] Sun, 31 Jul 2005 02:49:57 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:22 -0400

[PATCH] hostap update

hostap_cs: Remove irq_list, irq_mask and pcmcia/version.h

Remove irq_list, irq_mask and pcmcia/version.h as suggested in
http://kernel.org/pub/linux/utils/kernel/pcmcia/pcmcia.html

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_cs.c |   14 +-
 1 files changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -34,12 +34,6 @@ MODULE_SUPPORTED_DEVICE(Intersil Prism2
 MODULE_LICENSE(GPL);
 
 
-static int irq_mask = 0xdeb8;
-module_param(irq_mask, int, 0444);
-
-static int irq_list[4] = { -1 };
-module_param_array(irq_list, int, NULL, 0444);
-
 static int ignore_cis_vcc;
 module_param(ignore_cis_vcc, int, 0444);
 MODULE_PARM_DESC(ignore_cis_vcc, Ignore broken CIS VCC entry);
@@ -742,14 +736,8 @@ static int prism2_config(dev_link_t *lin
 * irq structure is initialized.
 */
if (link-conf.Attributes  CONF_ENABLE_IRQ) {
-   int i;
link-irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT;
-   link-irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
-   if (irq_list[0] == -1)
-   link-irq.IRQInfo2 = irq_mask;
-   else
-   for (i = 0; i  4; i++)
-   link-irq.IRQInfo2 |= 1  irq_list[i];
+   link-irq.IRQInfo1 = IRQ_LEVEL_ID;
link-irq.Handler = prism2_interrupt;
link-irq.Instance = dev;
CS_CHECK(RequestIRQ,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree fe2fa88ebe7d39538e6d4789d29db0e5a58b50b3
parent f06ac319c05c6822f878f201ae80e54fbbe8be8c
author Jouni Malinen [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:01 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:22 -0400

[PATCH] hostap update

Added support for setting channel mask for scan requests
('iwpriv wlan0 scan_channels 0x00ff' masks scans to use channels 1-8).

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_common.h |1 +
 drivers/net/wireless/hostap/hostap_hw.c |1 +
 drivers/net/wireless/hostap/hostap_ioctl.c  |   18 --
 drivers/net/wireless/hostap/hostap_wlan.h   |3 ++-
 4 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_common.h 
b/drivers/net/wireless/hostap/hostap_common.h
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -423,6 +423,7 @@ enum {
PRISM2_PARAM_PRIVACY_INVOKED = 37,
PRISM2_PARAM_TKIP_COUNTERMEASURES = 38,
PRISM2_PARAM_DROP_UNENCRYPTED = 39,
+   PRISM2_PARAM_SCAN_CHANNEL_MASK = 40,
 };
 
 enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1,
diff --git a/drivers/net/wireless/hostap/hostap_hw.c 
b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -3374,6 +3374,7 @@ prism2_init_local_data(struct prism2_hel
   * cnfDbmAdjust, if available */
local-auth_algs = PRISM2_AUTH_OPEN | PRISM2_AUTH_SHARED_KEY;
local-sram_type = -1;
+   local-scan_channel_mask = 0x;
 #if defined(PRISM2_PCI)  defined(PRISM2_BUS_MASTER)
local-bus_master_threshold_rx = GET_INT_PARM(bus_master_threshold_rx,
  card_idx);
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c 
b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1664,7 +1664,8 @@ static int prism2_request_hostscan(struc
local = iface-local;
 
memset(scan_req, 0, sizeof(scan_req));
-   scan_req.channel_list = __constant_cpu_to_le16(local-channel_mask);
+   scan_req.channel_list = cpu_to_le16(local-channel_mask 
+   local-scan_channel_mask);
scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
if (ssid) {
if (ssid_len  32)
@@ -1693,7 +1694,8 @@ static int prism2_request_scan(struct ne
local = iface-local;
 
memset(scan_req, 0, sizeof(scan_req));
-   scan_req.channel_list = __constant_cpu_to_le16(local-channel_mask);
+   scan_req.channel_list = cpu_to_le16(local-channel_mask 
+   local-scan_channel_mask);
scan_req.txrate = __constant_cpu_to_le16(HFA384X_RATES_1MBPS);
 
/* FIX:
@@ -2338,6 +2340,10 @@ static const struct iw_priv_args prism2_
  IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, drop_unencrypte },
{ PRISM2_PARAM_DROP_UNENCRYPTED,
  0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, getdrop_unencry },
+   { PRISM2_PARAM_SCAN_CHANNEL_MASK,
+ IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0, scan_channels },
+   { PRISM2_PARAM_SCAN_CHANNEL_MASK,
+ 0, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, getscan_channel },
 };
 
 
@@ -2699,6 +2705,10 @@ static int prism2_ioctl_priv_prism2_para
local-drop_unencrypted = value;
break;
 
+   case PRISM2_PARAM_SCAN_CHANNEL_MASK:
+   local-scan_channel_mask = value;
+   break;
+
default:
printk(KERN_DEBUG %s: prism2_param: unknown param %d\n,
   dev-name, param);
@@ -2890,6 +2900,10 @@ static int prism2_ioctl_priv_get_prism2_
*param = local-drop_unencrypted;
break;
 
+   case PRISM2_PARAM_SCAN_CHANNEL_MASK:
+   *param = local-scan_channel_mask;
+   break;
+
default:
printk(KERN_DEBUG %s: get_prism2_param: unknown param %d\n,
   dev-name, *param);
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h 
b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -680,7 +680,8 @@ struct local_info {
char essid[MAX_SSID_LEN + 1];
char name[MAX_NAME_LEN + 1];
int name_set;
-   u16 channel_mask;
+   u16 channel_mask; /* mask of allowed channels */
+   u16 scan_channel_mask; /* mask of channels to be scanned */
struct comm_tallies_sums comm_tallies;
struct net_device_stats stats;
struct proc_dir_entry *proc;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of 

[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 64206e16c44242428b9eeb48b21109d478de6782
parent 72ca9c61cddb82a8596cee8141656d50aba42be5
author Jouni Malinen [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:02 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:23 -0400

[PATCH] hostap update

Cleaned up scan result processing by converting struct
hfa384x_scan_result into struct hfa384x_hostscan_result. This removes
special cases from result processing since the results are only used
in one, hostscan, format.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_info.c  |   24 ++---
 drivers/net/wireless/hostap/hostap_ioctl.c |   77 +++--
 drivers/net/wireless/hostap/hostap_proc.c  |   50 ++
 drivers/net/wireless/hostap/hostap_wlan.h  |4 -
 4 files changed, 64 insertions(+), 91 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_info.c 
b/drivers/net/wireless/hostap/hostap_info.c
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -160,7 +160,7 @@ static void prism2_host_roaming(local_in
 {
struct hfa384x_join_request req;
struct net_device *dev = local-dev;
-   struct hfa384x_scan_result *selected, *entry;
+   struct hfa384x_hostscan_result *selected, *entry;
int i;
unsigned long flags;
 
@@ -244,9 +244,10 @@ static void prism2_info_scanresults(loca
int left)
 {
u16 *pos;
-   int new_count;
+   int new_count, i;
unsigned long flags;
-   struct hfa384x_scan_result *results, *prev;
+   struct hfa384x_scan_result *res;
+   struct hfa384x_hostscan_result *results, *prev;
 
if (left  4) {
printk(KERN_DEBUG %s: invalid scanresult info frame 
@@ -260,11 +261,18 @@ static void prism2_info_scanresults(loca
left -= 4;
 
new_count = left / sizeof(struct hfa384x_scan_result);
-   results = kmalloc(new_count * sizeof(struct hfa384x_scan_result),
+   results = kmalloc(new_count * sizeof(struct hfa384x_hostscan_result),
  GFP_ATOMIC);
if (results == NULL)
return;
-   memcpy(results, pos, new_count * sizeof(struct hfa384x_scan_result));
+
+   /* Convert to hostscan result format. */
+   res = (struct hfa384x_scan_result *) pos;
+   for (i = 0; i  new_count; i++) {
+   memcpy(results[i], res[i],
+  sizeof(struct hfa384x_scan_result));
+   results[i].atim = 0;
+   }
 
spin_lock_irqsave(local-lock, flags);
local-last_scan_type = PRISM2_SCAN;
@@ -335,9 +343,9 @@ static void prism2_info_hostscanresults(
 
spin_lock_irqsave(local-lock, flags);
local-last_scan_type = PRISM2_HOSTSCAN;
-   prev = local-last_hostscan_results;
-   local-last_hostscan_results = results;
-   local-last_hostscan_results_count = new_count;
+   prev = local-last_scan_results;
+   local-last_scan_results = results;
+   local-last_scan_results_count = new_count;
spin_unlock_irqrestore(local-lock, flags);
kfree(prev);
 
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c 
b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -663,7 +663,7 @@ static int hostap_join_ap(struct net_dev
struct hfa384x_join_request req;
unsigned long flags;
int i;
-   struct hfa384x_scan_result *entry;
+   struct hfa384x_hostscan_result *entry;
 
iface = netdev_priv(dev);
local = iface-local;
@@ -1795,10 +1795,8 @@ static int prism2_ioctl_siwscan(struct n
 
 #ifndef PRISM2_NO_STATION_MODES
 static char * __prism2_translate_scan(local_info_t *local,
- struct hfa384x_scan_result *scan,
- struct hfa384x_hostscan_result *hscan,
- int hostscan,
- struct hostap_bss_info *bss, u8 *bssid,
+ struct hfa384x_hostscan_result *scan,
+ struct hostap_bss_info *bss,
  char *current_ev, char *end_buf)
 {
int i, chan;
@@ -1806,17 +1804,18 @@ static char * __prism2_translate_scan(lo
char *current_val;
u16 capabilities;
u8 *pos;
-   u8 *ssid;
+   u8 *ssid, *bssid;
size_t ssid_len;
char *buf;
 
if (bss) {
ssid = bss-ssid;
ssid_len = bss-ssid_len;
+   bssid = bss-bssid;
} else {
-   ssid = hostscan ? hscan-ssid : scan-ssid;
-   ssid_len = le16_to_cpu(hostscan ? hscan-ssid_len :
-  scan-ssid_len);
+   ssid = scan-ssid;
+   ssid_len = 

[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 13c08758ef220b91a94299909d29252497313fc9
parent 2e4fd068e7e25e654a454ed4a425f239c0f6407a
author Jouni Malinen [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:03 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:23 -0400

[PATCH] hostap update

Firmware seems to be getting into odd state in host_roaming mode 2
when hostscan is used without join command, so try to fix this by
re-joining the current AP. This does not actually trigger a new
association if the current AP is still in the scan results.

This makes background scans (iwlist wlan0 scan) not to break data
connection when in host_roaming 2 mode, e.g., when using wpa_supplicant.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_info.c |   13 +
 1 files changed, 13 insertions(+)

diff --git a/drivers/net/wireless/hostap/hostap_info.c 
b/drivers/net/wireless/hostap/hostap_info.c
--- a/drivers/net/wireless/hostap/hostap_info.c
+++ b/drivers/net/wireless/hostap/hostap_info.c
@@ -453,6 +453,19 @@ static void handle_info_queue_scanresult
 {
if (local-host_roaming == 1  local-iw_mode == IW_MODE_INFRA)
prism2_host_roaming(local);
+
+   if (local-host_roaming == 2  local-iw_mode == IW_MODE_INFRA 
+   memcmp(local-preferred_ap, \x00\x00\x00\x00\x00\x00,
+  ETH_ALEN) != 0) {
+   /*
+* Firmware seems to be getting into odd state in host_roaming
+* mode 2 when hostscan is used without join command, so try
+* to fix this by re-joining the current AP. This does not
+* actually trigger a new association if the current AP is
+* still in the scan results.
+*/
+   prism2_host_roaming(local);
+   }
 }
 
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 2e720a490a9cb47d3c1a9b929955e0fdba1889f5
parent 0c629a69fd8ec7b67566cfc052a9b1c4b927805a
author Brandon Enochs [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:04 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:23 -0400

[PATCH] hostap update

line 129 of hostap_80211_rx.c should read:

   LWNG_SETVAL(mactime, 2, 0, 4, rx_stats-mac_time);

not:
   LWNG_SETVAL(mactime, 2, 0, 0, rx_stats-mac_time);

The length field is incorrect.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_80211_rx.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c 
b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -123,7 +123,7 @@ int prism2_rx_80211(struct net_device *d
 hdr-f.did = LWNG_CAP_DID_BASE | (i  12); \
 hdr-f.status = s; hdr-f.len = l; hdr-f.data = d
LWNG_SETVAL(hosttime, 1, 0, 4, jiffies);
-   LWNG_SETVAL(mactime, 2, 0, 0, rx_stats-mac_time);
+   LWNG_SETVAL(mactime, 2, 0, 4, rx_stats-mac_time);
LWNG_SETVAL(channel, 3, 1 /* no value */, 4, 0);
LWNG_SETVAL(rssi, 4, 1 /* no value */, 4, 0);
LWNG_SETVAL(sq, 5, 1 /* no value */, 4, 0);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree e61b3a7b99c1078faed0dc0594b1df8c09caa9b2
parent 3e1d393240880e3d7ae580c46f1ba265643fcd15
author Pavel Roskin [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:05 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:23 -0400

[PATCH] hostap update

Warning fix for 64-bit platforms

Hello!

The patch fixes following warning seen on 64-bit platforms (in my case -
x86_64, gcc-4.0):

In file included from /usr/local/src/hostap/driver/modules/hostap_cs.c:203:
/usr/local/src/hostap/driver/modules/hostap_hw.c: In function 
?prism2_transmit_cb?:
/usr/local/src/hostap/driver/modules/hostap_hw.c:1674: warning: cast from 
pointer to integer of different size
/usr/local/src/hostap/driver/modules/hostap_hw.c: In function ?prism2_transmit?:
/usr/local/src/hostap/driver/modules/hostap_hw.c:1758: warning: cast to pointer 
from integer of different size

prism2_transmit_cb uses a (void *) argument to get an integer.   A
simple fix would be to use double cast from pointer to long and then to
int (and vice versa when int is passed as a pointer).  But I prefer a
slightly longer patch.

I believe that whenever an argument can hold both a pointer and an
integer, it should be declared long.  long can hold both pointers and
integers (except win64, but we are not coding for Windows), it can be
cast to both of them and it's never assumed to be a valid pointer, which
could be useful for some automatic code checkers.

Signed-off-by: Pavel Roskin [EMAIL PROTECTED]
Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_hw.c   |   18 +-
 drivers/net/wireless/hostap/hostap_wlan.h |4 ++--
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_hw.c 
b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -507,7 +507,7 @@ static int hfa384x_cmd(struct net_device
  * @cmd: Prism2 command code (HFA384X_CMD_CODE_*)
  * @param0: value for Param0 register
  * @callback: command completion callback function (%NULL = no callback)
- * @context: data pointer to be given to callback function
+ * @context: context data to be given to the callback function
  *
  * Issue given command (possibly after waiting in command queue) and use
  * callback function to indicate command completion. This can be called both
@@ -517,9 +517,9 @@ static int hfa384x_cmd(struct net_device
  */
 static int hfa384x_cmd_callback(struct net_device *dev, u16 cmd, u16 param0,
void (*callback)(struct net_device *dev,
-void *context, u16 resp0,
+long context, u16 resp0,
 u16 status),
-   void *context)
+   long context)
 {
struct hostap_interface *iface;
local_info_t *local;
@@ -1710,7 +1710,7 @@ static int prism2_get_txfid_idx(local_in
 
 
 /* Called only from hardware IRQ */
-static void prism2_transmit_cb(struct net_device *dev, void *context,
+static void prism2_transmit_cb(struct net_device *dev, long context,
   u16 resp0, u16 res)
 {
struct hostap_interface *iface;
@@ -1805,7 +1805,7 @@ static int prism2_transmit(struct net_de
dev,
HFA384X_CMDCODE_TRANSMIT | HFA384X_CMD_TX_RECLAIM,
local-txfid[idx],
-   prism2_transmit_cb, (void *) idx);
+   prism2_transmit_cb, (long) idx);
 
if (res) {
struct net_device_stats *stats;
@@ -1951,7 +1951,7 @@ static int prism2_tx_80211(struct sk_buf
/* Any RX packet seems to break something with TX bus
 * mastering; enable command is enough to fix this.. */
if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_ENABLE, 0,
-prism2_tx_cb, (void *) buf_len)) {
+prism2_tx_cb, (long) buf_len)) {
printk(KERN_DEBUG %s: TX: enable port0 failed\n,
   dev-name);
}
@@ -2697,7 +2697,7 @@ static void prism2_infdrop(struct net_de
 * get out of this state by inquiring CommTallies. */
if (!last_inquire || time_after(jiffies, last_inquire + HZ)) {
hfa384x_cmd_callback(dev, HFA384X_CMDCODE_INQUIRE,
-HFA384X_INFO_COMMTALLIES, NULL, NULL);
+HFA384X_INFO_COMMTALLIES, NULL, 0);
last_inquire = jiffies;
}
 }
@@ -3055,7 +3055,7 @@ static void hostap_passive_scan(unsigned
 
if (hfa384x_cmd_callback(dev, HFA384X_CMDCODE_TEST |
 (HFA384X_TEST_CHANGE_CHANNEL  8),
-channel, NULL, NULL))
+

[wireless hostap] trim trailing whitespace

2005-09-02 Thread Linux Kernel Mailing List
tree 3cec275b2d612891abfa43e1529dbd484bfd1990
parent 4fa969cfb2a6406fcffd0d1ec5f33ebf3fea9053
author Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 21:08:32 -0400
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 21:08:32 -0400

[wireless hostap] trim trailing whitespace

 drivers/net/wireless/hostap/hostap_ap.c|   10 +-
 drivers/net/wireless/hostap/hostap_cs.c|4 ++--
 drivers/net/wireless/hostap/hostap_ioctl.c |2 +-
 3 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_ap.c 
b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -489,7 +489,7 @@ static void ap_control_kickall(struct ap
 {
struct list_head *ptr, *n;
struct sta_info *sta;
-  
+
spin_lock_bh(ap-sta_table_lock);
for (ptr = ap-sta_list.next, n = ptr-next; ptr != ap-sta_list;
 ptr = n, n = ptr-next) {
@@ -1573,7 +1573,7 @@ static void handle_assoc(local_info_t *l
u++; left--;
ileft = *u;
u++; left--;
-   
+
if (ileft  left || ileft == 0 ||
ileft  WLAN_SUPP_RATES_MAX) {
txt = SUPP_RATES len error;
@@ -2047,7 +2047,7 @@ static void handle_beacon(local_info_t *
u++; left--;
ileft = *u;
u++; left--;
-   
+
if (ileft  left || ileft == 0 || ileft  8) {
PDEBUG(DEBUG_AP,  - SUPP_RATES len error\n);
return;
@@ -2064,7 +2064,7 @@ static void handle_beacon(local_info_t *
u++; left--;
ileft = *u;
u++; left--;
-   
+
if (ileft  left || ileft != 1) {
PDEBUG(DEBUG_AP,  - DS_PARAMS len error\n);
return;
@@ -2839,7 +2839,7 @@ void hostap_handle_sta_tx_exc(local_info
 
sta-tx_since_last_failure = 0;
sta-tx_consecutive_exc++;
-
+
if (sta-tx_consecutive_exc = WLAN_RATE_DECREASE_THRESHOLD 
sta-tx_rate_idx  0  meta-rate = sta-tx_rate) {
/* use next lower rate */
diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -644,13 +644,13 @@ static int prism2_config(dev_link_t *lin
link-conf.ConfigIndex = cfg-index;
PDEBUG(DEBUG_EXTRA, Checking CFTABLE_ENTRY 0x%02X 
   (default 0x%02X)\n, cfg-index, dflt.index);
-   
+
/* Does this card need audio output? */
if (cfg-flags  CISTPL_CFTABLE_AUDIO) {
link-conf.Attributes |= CONF_ENABLE_SPKR;
link-conf.Status = CCSR_AUDIO_ENA;
}
-   
+
/* Use power settings for Vcc and Vpp if present */
/*  Note that the CIS values need to be rescaled */
if (cfg-vcc.present  (1  CISTPL_POWER_VNOM)) {
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c 
b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -335,7 +335,7 @@ static int hostap_set_rate(struct net_de
   hostap_set_word(dev, HFA384X_RID_CNFSUPPORTEDRATES,
   local-tx_rate_control) ||
   local-func-reset_port(dev));
-   
+
if (ret) {
printk(KERN_WARNING %s: TXRateControl/cnfSupportedRates 
   setting to 0x%x failed\n,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap update

2005-09-02 Thread Linux Kernel Mailing List
tree 57d78b3fd950bfa2c6991e14090ee9bee98f51f4
parent b15eff2632be3fcea68e01ba7f12e26a731e3157
author Jouni Malinen [EMAIL PROTECTED] Sun, 31 Jul 2005 02:50:06 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 02:17:23 -0400

[PATCH] hostap update

Fixed beacon frame when moving from monitor mode to master mode
(workaround for firmware bug that left IBSS IE in the Beacon
frames). This is using the same workaround that was previously used
when moving from adhoc mode to master mode.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_ioctl.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c 
b/drivers/net/wireless/hostap/hostap_ioctl.c
--- a/drivers/net/wireless/hostap/hostap_ioctl.c
+++ b/drivers/net/wireless/hostap/hostap_ioctl.c
@@ -1182,7 +1182,8 @@ static int prism2_ioctl_siwmode(struct n
if (local-iw_mode == IW_MODE_MONITOR)
hostap_monitor_mode_disable(local);
 
-   if (local-iw_mode == IW_MODE_ADHOC  *mode == IW_MODE_MASTER) {
+   if ((local-iw_mode == IW_MODE_ADHOC ||
+local-iw_mode == IW_MODE_MONITOR)  *mode == IW_MODE_MASTER) {
/* There seems to be a firmware bug in at least STA f/w v1.5.6
 * that leaves beacon frames to use IBSS type when moving from
 * IBSS to Host AP mode. Doing double Port0 reset seems to be
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap: Start using net/ieee80211.h

2005-09-02 Thread Linux Kernel Mailing List
tree 9565c6fdaa7745669ec11087e259544cc6b31d2f
parent f3b10e1636dec053f4874d593e3de5d46da48a5f
author Jouni Malinen [EMAIL PROTECTED] Sun, 31 Jul 2005 10:43:19 -0700
committer Jeff Garzik [EMAIL PROTECTED] Sun, 31 Jul 2005 08:28:02 -0400

[PATCH] hostap: Start using net/ieee80211.h

Preparations for starting to use net/ieee80211 instead of private
IEEE 802.11 implementation. Include net/ieee80211.h and
net/ieee80211_crypt.h into files that will be needed these in the
future. Remove duplicate definitions from hostap_common.h and
rename WLAN_FC_GET_{TYPE,STYPE} macros for now sinc net/ieee80211.h
is using incompatible definitions. This will be resolved in the
future by updating Host AP to use the versions that do not shift
type/stype.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap.c|   10 +--
 drivers/net/wireless/hostap/hostap_80211_rx.c   |   12 +--
 drivers/net/wireless/hostap/hostap_80211_tx.c   |   12 +--
 drivers/net/wireless/hostap/hostap_ap.c |   24 +++
 drivers/net/wireless/hostap/hostap_common.h |   73 ++--
 drivers/net/wireless/hostap/hostap_crypt_ccmp.c |4 -
 drivers/net/wireless/hostap/hostap_hw.c |   13 ++--
 7 files changed, 46 insertions(+), 102 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap.c 
b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c
+++ b/drivers/net/wireless/hostap/hostap.c
@@ -26,6 +26,8 @@
 #include linux/rtnetlink.h
 #include linux/wireless.h
 #include net/iw_handler.h
+#include net/ieee80211.h
+#include net/ieee80211_crypt.h
 #include asm/uaccess.h
 
 #include hostap_wlan.h
@@ -596,7 +598,7 @@ void hostap_dump_rx_header(const char *n
fc = __le16_to_cpu(rx-frame_control);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x 
   data_len=%d%s%s\n,
-  fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc),
+  fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
   __le16_to_cpu(rx-duration_id), __le16_to_cpu(rx-seq_ctrl),
   __le16_to_cpu(rx-data_len),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
@@ -625,7 +627,7 @@ void hostap_dump_tx_header(const char *n
fc = __le16_to_cpu(tx-frame_control);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x 
   data_len=%d%s%s\n,
-  fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc),
+  fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
   __le16_to_cpu(tx-duration_id), __le16_to_cpu(tx-seq_ctrl),
   __le16_to_cpu(tx-data_len),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
@@ -668,13 +670,13 @@ int hostap_80211_get_hdrlen(u16 fc)
 {
int hdrlen = 24;
 
-   switch (WLAN_FC_GET_TYPE(fc)) {
+   switch (HOSTAP_FC_GET_TYPE(fc)) {
case WLAN_FC_TYPE_DATA:
if ((fc  WLAN_FC_FROMDS)  (fc  WLAN_FC_TODS))
hdrlen = 30; /* Addr4 */
break;
case WLAN_FC_TYPE_CTRL:
-   switch (WLAN_FC_GET_STYPE(fc)) {
+   switch (HOSTAP_FC_GET_STYPE(fc)) {
case WLAN_FC_STYPE_CTS:
case WLAN_FC_STYPE_ACK:
hdrlen = 10;
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c 
b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -21,7 +21,7 @@ void hostap_dump_rx_80211(const char *na
 
fc = le16_to_cpu(hdr-frame_control);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d)%s%s,
-  fc, WLAN_FC_GET_TYPE(fc), WLAN_FC_GET_STYPE(fc),
+  fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
   fc  WLAN_FC_FROMDS ?  [FromDS] : );
 
@@ -224,7 +224,7 @@ prism2_frag_cache_get(local_info_t *loca
 
sc = le16_to_cpu(hdr-seq_ctrl);
frag = WLAN_GET_SEQ_FRAG(sc);
-   seq = WLAN_GET_SEQ_SEQ(sc);
+   seq = WLAN_GET_SEQ_SEQ(sc)  4;
 
if (frag == 0) {
/* Reserve enough space to fit maximum frame length */
@@ -274,7 +274,7 @@ static int prism2_frag_cache_invalidate(
struct prism2_frag_entry *entry;
 
sc = le16_to_cpu(hdr-seq_ctrl);
-   seq = WLAN_GET_SEQ_SEQ(sc);
+   seq = WLAN_GET_SEQ_SEQ(sc)  4;
 
entry = prism2_frag_cache_find(local, seq, -1, hdr-addr2, hdr-addr1);
 
@@ -719,8 +719,8 @@ void hostap_80211_rx(struct net_device *
goto rx_dropped;
 
fc = le16_to_cpu(hdr-frame_control);
-   type = WLAN_FC_GET_TYPE(fc);
-   stype = WLAN_FC_GET_STYPE(fc);
+   type = HOSTAP_FC_GET_TYPE(fc);
+   stype = HOSTAP_FC_GET_STYPE(fc);
sc = le16_to_cpu(hdr-seq_ctrl);
frag = WLAN_GET_SEQ_FRAG(sc);
hdrlen = hostap_80211_get_hdrlen(fc);
@@ -896,7 +896,7 @@ void 

[PATCH] hostap: Fix skb-cb use for TX meta data

2005-09-02 Thread Linux Kernel Mailing List
tree 916d3c4c880c64ba13edc4f890fa3b021be4ded8
parent 1e4adbdb3f0348dcf4fce92f1acc7c8386982c17
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:39 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:06:26 -0400

[PATCH] hostap: Fix skb-cb use for TX meta data

Old AP mode code for power saving was using skb-cb for couple of
flags before the more generic 802.11 TX code started using the same
buffer for struct hostap_skb_tx_data. This resulted in the power save
code corrupting the magic value in beginning of the buffer and TX code
dropping the power saved packets because of this for the case where
STAs send PS-Poll frames with PwrMgmt flag set.

This patch modifies the power save code to use the same struct
hostap_skb_tx_data as rest of the TX path in order to avoid corrupting
the data in skb-cb.

In addition, this patch reorders fields in the structure and makes
them use smaller types in order to make the structure fit in skb-cb
on 64-bit hosts.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_80211_tx.c |6 +++--
 drivers/net/wireless/hostap/hostap_ap.c   |   30 +-
 drivers/net/wireless/hostap/hostap_ap.h   |9 ---
 drivers/net/wireless/hostap/hostap_wlan.h |   17 +-
 4 files changed, 30 insertions(+), 32 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c 
b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -226,7 +226,8 @@ int hostap_data_start_xmit(struct sk_buf
meta = (struct hostap_skb_tx_data *) skb-cb;
memset(meta, 0, sizeof(*meta));
meta-magic = HOSTAP_SKB_TX_DATA_MAGIC;
-   meta-wds = use_wds;
+   if (use_wds)
+   meta-flags |= HOSTAP_TX_FLAGS_WDS;
meta-ethertype = ethertype;
meta-iface = iface;
 
@@ -410,7 +411,8 @@ int hostap_master_start_xmit(struct sk_b
case AP_TX_CONTINUE_NOT_AUTHORIZED:
if (local-ieee_802_1x 
HOSTAP_FC_GET_TYPE(fc) == WLAN_FC_TYPE_DATA 
-   meta-ethertype != ETH_P_PAE  !meta-wds) {
+   meta-ethertype != ETH_P_PAE 
+   !(meta-flags  HOSTAP_TX_FLAGS_WDS)) {
printk(KERN_DEBUG %s: dropped frame to unauthorized 
   port (IEEE 802.1X): ethertype=0x%04x\n,
   dev-name, meta-ethertype);
diff --git a/drivers/net/wireless/hostap/hostap_ap.c 
b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -1840,6 +1840,8 @@ static void ap_handle_dropped_data(local
 static void pspoll_send_buffered(local_info_t *local, struct sta_info *sta,
 struct sk_buff *skb)
 {
+   struct hostap_skb_tx_data *meta;
+
if (!(sta-flags  WLAN_STA_PS)) {
/* Station has moved to non-PS mode, so send all buffered
 * frames using normal device queue. */
@@ -1849,11 +1851,11 @@ static void pspoll_send_buffered(local_i
 
/* add a flag for hostap_handle_sta_tx() to know that this skb should
 * be passed through even though STA is using PS */
-   memcpy(skb-cb, AP_SKB_CB_MAGIC, AP_SKB_CB_MAGIC_LEN);
-   skb-cb[AP_SKB_CB_MAGIC_LEN] = AP_SKB_CB_BUFFERED_FRAME;
+   meta = (struct hostap_skb_tx_data *) skb-cb;
+   meta-flags |= HOSTAP_TX_FLAGS_BUFFERED_FRAME;
if (!skb_queue_empty(sta-tx_buf)) {
/* indicate to STA that more frames follow */
-   skb-cb[AP_SKB_CB_MAGIC_LEN] |= AP_SKB_CB_ADD_MOREDATA;
+   meta-flags |= HOSTAP_TX_FLAGS_ADD_MOREDATA;
}
dev_queue_xmit(skb);
 }
@@ -2707,7 +2709,8 @@ ap_tx_ret hostap_handle_sta_tx(local_inf
atomic_inc(sta-users);
spin_unlock(local-ap-sta_table_lock);
 
-   if (local-iw_mode == IW_MODE_MASTER  sta == NULL  !meta-wds 
+   if (local-iw_mode == IW_MODE_MASTER  sta == NULL 
+   !(meta-flags  HOSTAP_TX_FLAGS_WDS) 
meta-iface-type != HOSTAP_INTERFACE_MASTER 
meta-iface-type != HOSTAP_INTERFACE_AP) {
 #if 0
@@ -2743,18 +2746,15 @@ ap_tx_ret hostap_handle_sta_tx(local_inf
if (!(sta-flags  WLAN_STA_PS))
goto out;
 
-   if (memcmp(skb-cb, AP_SKB_CB_MAGIC, AP_SKB_CB_MAGIC_LEN) == 0) {
-   if (skb-cb[AP_SKB_CB_MAGIC_LEN]  AP_SKB_CB_ADD_MOREDATA) {
-   /* indicate to STA that more frames follow */
-   hdr-frame_control |=
-   __constant_cpu_to_le16(WLAN_FC_MOREDATA);
-   }
+   if (meta-flags  HOSTAP_TX_FLAGS_ADD_MOREDATA) {
+   /* indicate to STA that more frames follow */
+   hdr-frame_control |= 

[PATCH] hostap: Remove experimental PCI bus master/DMA code

2005-09-02 Thread Linux Kernel Mailing List
tree 03036e8bd28fd97296b1938e28cbb3723dff61a2
parent 5bee720fd7fa5ed4eade96058acd3a684da30932
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:40 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:06:27 -0400

[PATCH] hostap: Remove experimental PCI bus master/DMA code

PCI version of Prism2.5/3 has undocumented DMA support for TX/RX data,
but this seems to have some hardware bugs that prevent it from being
used properly for TX. RX side could possibly be made to work reliably.

Even though DMA support would be very useful for saving host CPU (from
about 40% to 5-10% when operating at maximum throughput), it seems to
be best to just remove this code finally. The implementation has
always been commented out by default and has received very limited
testing. The code may have already been broken number of times and I
don't have much interested in trying to verify whether it works or
not. Getting this out makes it easier to maintain the driver and
allows some cleanups that have been partly postponed because of this
experimental bus master/DMA code.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_common.h |4 
 drivers/net/wireless/hostap/hostap_config.h |   31 
 drivers/net/wireless/hostap/hostap_hw.c |  211 +---
 drivers/net/wireless/hostap/hostap_ioctl.c  |   24 ---
 drivers/net/wireless/hostap/hostap_pci.c|4 
 drivers/net/wireless/hostap/hostap_wlan.h   |   12 -
 6 files changed, 13 insertions(+), 273 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_common.h 
b/drivers/net/wireless/hostap/hostap_common.h
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -343,8 +343,8 @@ enum {
PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16,
PRISM2_PARAM_HOST_ENCRYPT = 17,
PRISM2_PARAM_HOST_DECRYPT = 18,
-   PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19,
-   PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20,
+   /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19, REMOVED 2005-08-14 */
+   /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20, REMOVED 2005-08-14 */
PRISM2_PARAM_HOST_ROAMING = 21,
PRISM2_PARAM_BCRX_STA_KEY = 22,
PRISM2_PARAM_IEEE_802_1X = 23,
diff --git a/drivers/net/wireless/hostap/hostap_config.h 
b/drivers/net/wireless/hostap/hostap_config.h
--- a/drivers/net/wireless/hostap/hostap_config.h
+++ b/drivers/net/wireless/hostap/hostap_config.h
@@ -13,37 +13,6 @@
 /* Maximum number of events handler per one interrupt */
 #define PRISM2_MAX_INTERRUPT_EVENTS 20
 
-/* Use PCI bus master to copy data to/from BAP (only available for
- * hostap_pci.o).
- *
- * Note! This is extremely experimental. PCI bus master is not supported by
- * Intersil and it seems to have some problems at least on TX path (see below).
- * The driver code for implementing bus master support is based on guessing
- * and experimenting suitable control bits and these might not be correct.
- * This code is included because using bus master makes a huge difference in
- * host CPU load (something like 40% host CPU usage to 5-10% when sending or
- * receiving at maximum throughput).
- *
- * Note2! Station firmware version 1.3.5 and primary firmware version 1.0.7
- * have some fixes for PCI corruption and these (or newer) versions are
- * recommended especially when using bus mastering.
- *
- * NOTE: PCI bus mastering code has not been updated for long time and it is
- * not likely to compile and it will _not_ work as is. Only enable this if you
- * are prepared to first fix the implementation..
- */
-/* #define PRISM2_BUS_MASTER */
-
-#ifdef PRISM2_BUS_MASTER
-
-/* PCI bus master implementation seems to be broken in current
- * hardware/firmware versions. Enable this to use enable command to fix
- * something before starting bus master operation on TX path. This will add
- * some latency and an extra interrupt to each TX packet. */
-#define PRISM2_ENABLE_BEFORE_TX_BUS_MASTER
-
-#endif /* PRISM2_BUS_MASTER */
-
 /* Include code for downloading firmware images into volatile RAM. */
 #define PRISM2_DOWNLOAD_SUPPORT
 
diff --git a/drivers/net/wireless/hostap/hostap_hw.c 
b/drivers/net/wireless/hostap/hostap_hw.c
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -83,18 +83,6 @@ static int dtim_period[MAX_PARM_DEVICES]
 module_param_array(dtim_period, int, NULL, 0444);
 MODULE_PARM_DESC(dtim_period, DTIM period);
 
-#if defined(PRISM2_PCI)  defined(PRISM2_BUS_MASTER)
-static int bus_master_threshold_rx[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-module_param_array(bus_master_threshold_rx, int, NULL, 0444);
-MODULE_PARM_DESC(bus_master_threshold_rx, Packet length threshold for using 
-PCI bus master on RX);
-
-static int bus_master_threshold_tx[MAX_PARM_DEVICES] = { 100, DEF_INTS };
-module_param_array(bus_master_threshold_tx, int, NULL, 0444);

[PATCH] hostap: Remove extra defines

2005-09-02 Thread Linux Kernel Mailing List
tree badaa7f340e6ed65ecbb70837a8fbdb004f2d202
parent 67e0e473fb54e7657f6604236e42ef07fd7a2768
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:42 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:07:30 -0400

[PATCH] hostap: Remove extra defines

Remove unused defines that are already available from generic kernel
header files.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_common.h |8 
 drivers/net/wireless/hostap/hostap_wlan.h   |7 ---
 2 files changed, 15 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_common.h 
b/drivers/net/wireless/hostap/hostap_common.h
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -7,14 +7,6 @@
 #define MACSTR %02x:%02x:%02x:%02x:%02x:%02x
 
 
-#ifndef ETH_P_PAE
-#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
-#endif /* ETH_P_PAE */
-
-#define ETH_P_PREAUTH 0x88C7 /* IEEE 802.11i pre-authentication */
-
-
-
 /* IEEE 802.11 defines */
 
 #define WLAN_FC_PVER (BIT(1) | BIT(0))
diff --git a/drivers/net/wireless/hostap/hostap_wlan.h 
b/drivers/net/wireless/hostap/hostap_wlan.h
--- a/drivers/net/wireless/hostap/hostap_wlan.h
+++ b/drivers/net/wireless/hostap/hostap_wlan.h
@@ -18,13 +18,6 @@
  * prism2_send_mgmt() sends these with dev_queue_xmit() to prism2_tx(). */
 #define ETH_P_HOSTAP ETH_P_CONTROL
 
-#ifndef ARPHRD_IEEE80211
-#define ARPHRD_IEEE80211 801
-#endif
-#ifndef ARPHRD_IEEE80211_PRISM
-#define ARPHRD_IEEE80211_PRISM 802
-#endif
-
 /* ARPHRD_IEEE80211_PRISM uses a bloated version of Prism2 RX frame header
  * (from linux-wlan-ng) */
 struct linux_wlan_ng_val {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap: Replace hostap_ieee80211_hdr with ieee80211_hdr

2005-09-02 Thread Linux Kernel Mailing List
tree 4362f671ba43b48b73ac5378a1cb0954b407f09e
parent 3ec0f4857df4c3dd0d0455ce5b2470b4be77fc77
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:43 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:07:30 -0400

[PATCH] hostap: Replace hostap_ieee80211_hdr with ieee80211_hdr

Replace hostap-specific struct hostap_ieee80211_hdr with struct
ieee80211_hdr from net/ieee80211.h.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_80211.h|   11 --
 drivers/net/wireless/hostap/hostap_80211_rx.c |   60 +++
 drivers/net/wireless/hostap/hostap_80211_tx.c |   36 -
 drivers/net/wireless/hostap/hostap_ap.c   |   99 --
 drivers/net/wireless/hostap/hostap_ap.h   |9 --
 drivers/net/wireless/hostap/hostap_hw.c   |2 
 6 files changed, 98 insertions(+), 119 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_80211.h 
b/drivers/net/wireless/hostap/hostap_80211.h
--- a/drivers/net/wireless/hostap/hostap_80211.h
+++ b/drivers/net/wireless/hostap/hostap_80211.h
@@ -1,17 +1,6 @@
 #ifndef HOSTAP_80211_H
 #define HOSTAP_80211_H
 
-struct hostap_ieee80211_hdr {
-   u16 frame_control;
-   u16 duration_id;
-   u8 addr1[6];
-   u8 addr2[6];
-   u8 addr3[6];
-   u16 seq_ctrl;
-   u8 addr4[6];
-} __attribute__ ((packed));
-
-
 struct hostap_ieee80211_mgmt {
u16 frame_control;
u16 duration;
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c 
b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -6,10 +6,10 @@
 void hostap_dump_rx_80211(const char *name, struct sk_buff *skb,
  struct hostap_80211_rx_status *rx_stats)
 {
-   struct hostap_ieee80211_hdr *hdr;
+   struct ieee80211_hdr *hdr;
u16 fc;
 
-   hdr = (struct hostap_ieee80211_hdr *) skb-data;
+   hdr = (struct ieee80211_hdr *) skb-data;
 
printk(KERN_DEBUG %s: RX signal=%d noise=%d rate=%d len=%d 
   jiffies=%ld\n,
@@ -19,7 +19,7 @@ void hostap_dump_rx_80211(const char *na
if (skb-len  2)
return;
 
-   fc = le16_to_cpu(hdr-frame_control);
+   fc = le16_to_cpu(hdr-frame_ctl);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d)%s%s,
   fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
@@ -31,7 +31,7 @@ void hostap_dump_rx_80211(const char *na
}
 
printk( dur=0x%04x seq=0x%04x\n, le16_to_cpu(hdr-duration_id),
-  le16_to_cpu(hdr-seq_ctrl));
+  le16_to_cpu(hdr-seq_ctl));
 
printk(KERN_DEBUGA1= MACSTR  A2= MACSTR  A3= MACSTR,
   MAC2STR(hdr-addr1), MAC2STR(hdr-addr2), MAC2STR(hdr-addr3));
@@ -51,7 +51,7 @@ int prism2_rx_80211(struct net_device *d
int hdrlen, phdrlen, head_need, tail_need;
u16 fc;
int prism_header, ret;
-   struct hostap_ieee80211_hdr *hdr;
+   struct ieee80211_hdr *hdr;
 
iface = netdev_priv(dev);
local = iface-local;
@@ -70,8 +70,8 @@ int prism2_rx_80211(struct net_device *d
phdrlen = 0;
}
 
-   hdr = (struct hostap_ieee80211_hdr *) skb-data;
-   fc = le16_to_cpu(hdr-frame_control);
+   hdr = (struct ieee80211_hdr *) skb-data;
+   fc = le16_to_cpu(hdr-frame_ctl);
 
if (type == PRISM2_RX_MGMT  (fc  WLAN_FC_PVER)) {
printk(KERN_DEBUG %s: dropped management frame with header 
@@ -215,21 +215,21 @@ prism2_frag_cache_find(local_info_t *loc
 
 /* Called only as a tasklet (software IRQ) */
 static struct sk_buff *
-prism2_frag_cache_get(local_info_t *local, struct hostap_ieee80211_hdr *hdr)
+prism2_frag_cache_get(local_info_t *local, struct ieee80211_hdr *hdr)
 {
struct sk_buff *skb = NULL;
u16 sc;
unsigned int frag, seq;
struct prism2_frag_entry *entry;
 
-   sc = le16_to_cpu(hdr-seq_ctrl);
+   sc = le16_to_cpu(hdr-seq_ctl);
frag = WLAN_GET_SEQ_FRAG(sc);
seq = WLAN_GET_SEQ_SEQ(sc)  4;
 
if (frag == 0) {
/* Reserve enough space to fit maximum frame length */
skb = dev_alloc_skb(local-dev-mtu +
-   sizeof(struct hostap_ieee80211_hdr) +
+   sizeof(struct ieee80211_hdr) +
8 /* LLC */ +
2 /* alignment */ +
8 /* WEP */ + ETH_ALEN /* WDS */);
@@ -267,13 +267,13 @@ prism2_frag_cache_get(local_info_t *loca
 
 /* Called only as a tasklet (software IRQ) */
 static int prism2_frag_cache_invalidate(local_info_t *local,
-   struct hostap_ieee80211_hdr *hdr)
+   struct ieee80211_hdr *hdr)
 {

[PATCH] hostap: Use ieee80211 WLAN_FC_GET_{TYPE,STYPE}

2005-09-02 Thread Linux Kernel Mailing List
tree 1848ffbf700ccd4e38c70e218f91dd2a7eadf018
parent c0f72ca8e4f1b459b5582c1c8dcaf7e53151f069
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 09:08:44 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 07:07:30 -0400

[PATCH] hostap: Use ieee80211 WLAN_FC_GET_{TYPE,STYPE}

Replace temporary HOSTAP_FC_GET_{TYPE,STYPE} macros with the ieee80211
version of WLAN_FC_GET_{TYPE,STYPE}.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap.c  |   23 ++--
 drivers/net/wireless/hostap/hostap.h  |2 
 drivers/net/wireless/hostap/hostap_80211_rx.c |   46 +
 drivers/net/wireless/hostap/hostap_80211_tx.c |   14 +--
 drivers/net/wireless/hostap/hostap_ap.c   |  120 +-
 drivers/net/wireless/hostap/hostap_common.h   |   43 -
 drivers/net/wireless/hostap/hostap_hw.c   |   10 +-
 drivers/net/wireless/hostap/hostap_ioctl.c|8 -
 8 files changed, 114 insertions(+), 152 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap.c 
b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c
+++ b/drivers/net/wireless/hostap/hostap.c
@@ -594,7 +594,7 @@ void hostap_dump_rx_header(const char *n
fc = __le16_to_cpu(rx-frame_control);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x 
   data_len=%d%s%s\n,
-  fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
+  fc, WLAN_FC_GET_TYPE(fc)  2, WLAN_FC_GET_STYPE(fc)  4,
   __le16_to_cpu(rx-duration_id), __le16_to_cpu(rx-seq_ctrl),
   __le16_to_cpu(rx-data_len),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
@@ -623,7 +623,7 @@ void hostap_dump_tx_header(const char *n
fc = __le16_to_cpu(tx-frame_control);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d) dur=0x%04x seq=0x%04x 
   data_len=%d%s%s\n,
-  fc, HOSTAP_FC_GET_TYPE(fc), HOSTAP_FC_GET_STYPE(fc),
+  fc, WLAN_FC_GET_TYPE(fc)  2, WLAN_FC_GET_STYPE(fc)  4,
   __le16_to_cpu(tx-duration_id), __le16_to_cpu(tx-seq_ctrl),
   __le16_to_cpu(tx-data_len),
   fc  WLAN_FC_TODS ?  [ToDS] : ,
@@ -666,15 +666,15 @@ int hostap_80211_get_hdrlen(u16 fc)
 {
int hdrlen = 24;
 
-   switch (HOSTAP_FC_GET_TYPE(fc)) {
-   case WLAN_FC_TYPE_DATA:
+   switch (WLAN_FC_GET_TYPE(fc)) {
+   case IEEE80211_FTYPE_DATA:
if ((fc  WLAN_FC_FROMDS)  (fc  WLAN_FC_TODS))
hdrlen = 30; /* Addr4 */
break;
-   case WLAN_FC_TYPE_CTRL:
-   switch (HOSTAP_FC_GET_STYPE(fc)) {
-   case WLAN_FC_STYPE_CTS:
-   case WLAN_FC_STYPE_ACK:
+   case IEEE80211_FTYPE_CTL:
+   switch (WLAN_FC_GET_STYPE(fc)) {
+   case IEEE80211_STYPE_CTS:
+   case IEEE80211_STYPE_ACK:
hdrlen = 10;
break;
default:
@@ -1093,7 +1093,7 @@ int prism2_update_comms_qual(struct net_
 }
 
 
-int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u8 stype,
+int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
 u8 *body, size_t bodylen)
 {
struct sk_buff *skb;
@@ -1108,8 +1108,7 @@ int prism2_sta_send_mgmt(local_info_t *l
mgmt = (struct hostap_ieee80211_mgmt *)
skb_put(skb, IEEE80211_MGMT_HDR_LEN);
memset(mgmt, 0, IEEE80211_MGMT_HDR_LEN);
-   mgmt-frame_control =
-   cpu_to_le16((WLAN_FC_TYPE_MGMT  2) | (stype  4));
+   mgmt-frame_control = cpu_to_le16(IEEE80211_FTYPE_MGMT | stype);
memcpy(mgmt-da, dst, ETH_ALEN);
memcpy(mgmt-sa, dev-dev_addr, ETH_ALEN);
memcpy(mgmt-bssid, dst, ETH_ALEN);
@@ -1140,7 +1139,7 @@ int prism2_sta_deauth(local_info_t *loca
return 0;
 
reason = cpu_to_le16(reason);
-   ret = prism2_sta_send_mgmt(local, local-bssid, WLAN_FC_STYPE_DEAUTH,
+   ret = prism2_sta_send_mgmt(local, local-bssid, IEEE80211_STYPE_DEAUTH,
   (u8 *) reason, 2);
memset(wrqu.ap_addr.sa_data, 0, ETH_ALEN);
wireless_send_event(local-dev, SIOCGIWAP, wrqu, NULL);
diff --git a/drivers/net/wireless/hostap/hostap.h 
b/drivers/net/wireless/hostap/hostap.h
--- a/drivers/net/wireless/hostap/hostap.h
+++ b/drivers/net/wireless/hostap/hostap.h
@@ -37,7 +37,7 @@ struct net_device * hostap_add_interface
 void hostap_remove_interface(struct net_device *dev, int rtnl_locked,
 int remove_from_list);
 int prism2_update_comms_qual(struct net_device *dev);
-int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u8 stype,
+int prism2_sta_send_mgmt(local_info_t *local, u8 *dst, u16 stype,
 u8 *body, size_t bodylen);
 int prism2_sta_deauth(local_info_t *local, u16 reason);
 
diff --git 

[PATCH] hostap: Replace WLAN_FC_ defines with ieee80211 ones

2005-09-02 Thread Linux Kernel Mailing List
tree db5e024ea15f6d78f373074d6d32a726db736633
parent e313087e42da177df00652d03be9afccf25f9545
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 11:00:01 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 08:29:20 -0400

[PATCH] hostap: Replace WLAN_FC_ defines with ieee80211 ones

Replace remaining WLAN_FC_* defines with the ones used in ieee80211
header file. This completes the move from hostap version of frame
control field processing to ieee80211 version.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap.c  |   10 ++--
 drivers/net/wireless/hostap/hostap_80211_rx.c |   61 ++
 drivers/net/wireless/hostap/hostap_80211_tx.c |   20 
 drivers/net/wireless/hostap/hostap_ap.c   |   24 +-
 drivers/net/wireless/hostap/hostap_common.h   |   10 
 drivers/net/wireless/hostap/hostap_hw.c   |7 +-
 6 files changed, 65 insertions(+), 67 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap.c 
b/drivers/net/wireless/hostap/hostap.c
--- a/drivers/net/wireless/hostap/hostap.c
+++ b/drivers/net/wireless/hostap/hostap.c
@@ -597,8 +597,8 @@ void hostap_dump_rx_header(const char *n
   fc, WLAN_FC_GET_TYPE(fc)  2, WLAN_FC_GET_STYPE(fc)  4,
   __le16_to_cpu(rx-duration_id), __le16_to_cpu(rx-seq_ctrl),
   __le16_to_cpu(rx-data_len),
-  fc  WLAN_FC_TODS ?  [ToDS] : ,
-  fc  WLAN_FC_FROMDS ?  [FromDS] : );
+  fc  IEEE80211_FCTL_TODS ?  [ToDS] : ,
+  fc  IEEE80211_FCTL_FROMDS ?  [FromDS] : );
 
printk(KERN_DEBUGA1= MACSTR  A2= MACSTR  A3= MACSTR  A4=
   MACSTR \n,
@@ -626,8 +626,8 @@ void hostap_dump_tx_header(const char *n
   fc, WLAN_FC_GET_TYPE(fc)  2, WLAN_FC_GET_STYPE(fc)  4,
   __le16_to_cpu(tx-duration_id), __le16_to_cpu(tx-seq_ctrl),
   __le16_to_cpu(tx-data_len),
-  fc  WLAN_FC_TODS ?  [ToDS] : ,
-  fc  WLAN_FC_FROMDS ?  [FromDS] : );
+  fc  IEEE80211_FCTL_TODS ?  [ToDS] : ,
+  fc  IEEE80211_FCTL_FROMDS ?  [FromDS] : );
 
printk(KERN_DEBUGA1= MACSTR  A2= MACSTR  A3= MACSTR  A4=
   MACSTR \n,
@@ -668,7 +668,7 @@ int hostap_80211_get_hdrlen(u16 fc)
 
switch (WLAN_FC_GET_TYPE(fc)) {
case IEEE80211_FTYPE_DATA:
-   if ((fc  WLAN_FC_FROMDS)  (fc  WLAN_FC_TODS))
+   if ((fc  IEEE80211_FCTL_FROMDS)  (fc  IEEE80211_FCTL_TODS))
hdrlen = 30; /* Addr4 */
break;
case IEEE80211_FTYPE_CTL:
diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c 
b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -22,8 +22,8 @@ void hostap_dump_rx_80211(const char *na
fc = le16_to_cpu(hdr-frame_ctl);
printk(KERN_DEBUGFC=0x%04x (type=%d:%d)%s%s,
   fc, WLAN_FC_GET_TYPE(fc)  2, WLAN_FC_GET_STYPE(fc)  4,
-  fc  WLAN_FC_TODS ?  [ToDS] : ,
-  fc  WLAN_FC_FROMDS ?  [FromDS] : );
+  fc  IEEE80211_FCTL_TODS ?  [ToDS] : ,
+  fc  IEEE80211_FCTL_FROMDS ?  [FromDS] : );
 
if (skb-len  IEEE80211_DATA_HDR3_LEN) {
printk(\n);
@@ -73,9 +73,9 @@ int prism2_rx_80211(struct net_device *d
hdr = (struct ieee80211_hdr *) skb-data;
fc = le16_to_cpu(hdr-frame_ctl);
 
-   if (type == PRISM2_RX_MGMT  (fc  WLAN_FC_PVER)) {
+   if (type == PRISM2_RX_MGMT  (fc  IEEE80211_FCTL_VERS)) {
printk(KERN_DEBUG %s: dropped management frame with header 
-  version %d\n, dev-name, fc  WLAN_FC_PVER);
+  version %d\n, dev-name, fc  IEEE80211_FCTL_VERS);
dev_kfree_skb_any(skb);
return 0;
}
@@ -525,9 +525,9 @@ hostap_rx_frame_wds(local_info_t *local,
 {
/* FIX: is this really supposed to accept WDS frames only in Master
 * mode? What about Repeater or Managed with WDS frames? */
-   if ((fc  (WLAN_FC_TODS | WLAN_FC_FROMDS)) !=
-   (WLAN_FC_TODS | WLAN_FC_FROMDS) 
-   (local-iw_mode != IW_MODE_MASTER || !(fc  WLAN_FC_TODS)))
+   if ((fc  (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS)) !=
+   (IEEE80211_FCTL_TODS | IEEE80211_FCTL_FROMDS) 
+   (local-iw_mode != IW_MODE_MASTER || !(fc  IEEE80211_FCTL_TODS)))
return 0; /* not a WDS frame */
 
/* Possible WDS frame: either IEEE 802.11 compliant (if FromDS)
@@ -539,14 +539,15 @@ hostap_rx_frame_wds(local_info_t *local,
/* RA (or BSSID) is not ours - drop */
PDEBUG(DEBUG_EXTRA, %s: received WDS frame with 
   not own or broadcast %s= MACSTR \n,
-  local-dev-name, fc  WLAN_FC_FROMDS ? RA : BSSID,
+  

[PATCH] hostap: Capability field is called ESS, not BSS

2005-09-02 Thread Linux Kernel Mailing List
tree 769236258d9c2045af6bad59f50997dbbd7aca58
parent eff349b136be49b0569bfdc225b49e28ce66ed22
author Jouni Malinen [EMAIL PROTECTED] Mon, 15 Aug 2005 11:00:00 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 15 Aug 2005 08:29:20 -0400

[PATCH] hostap: Capability field is called ESS, not BSS

Remove backwards compatibility define for WLAN_CAPABILITY_ESS now that
net/ieee80211.h defines this.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_common.h |3 ---
 1 files changed, 3 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_common.h 
b/drivers/net/wireless/hostap/hostap_common.h
--- a/drivers/net/wireless/hostap/hostap_common.h
+++ b/drivers/net/wireless/hostap/hostap_common.h
@@ -19,9 +19,6 @@
 #define WLAN_FC_ISWEP BIT(14)
 #define WLAN_FC_ORDER BIT(15)
 
-#define WLAN_CAPABILITY_ESS WLAN_CAPABILITY_BSS
-
-
 /* Information Element IDs */
 #define WLAN_EID_SSID 0
 #define WLAN_EID_SUPP_RATES 1
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


hostap: s/IEEE80211_FCTL_WEP/IEEE80211_FCTL_PROTECTED/ to fix build

2005-09-02 Thread Linux Kernel Mailing List
tree efb3ea5fc390e7cefdaadb535dc166319ac6f69d
parent b4bf343093e81e33d75bede45896eda52cd5f2b4
author Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:59:10 -0400
committer Jeff Garzik [EMAIL PROTECTED] Fri, 26 Aug 2005 04:59:10 -0400

hostap: s/IEEE80211_FCTL_WEP/IEEE80211_FCTL_PROTECTED/ to fix build

 drivers/net/wireless/hostap/hostap_80211_rx.c |   14 +++---
 drivers/net/wireless/hostap/hostap_80211_tx.c |2 +-
 drivers/net/wireless/hostap/hostap_ap.c   |2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_80211_rx.c 
b/drivers/net/wireless/hostap/hostap_80211_rx.c
--- a/drivers/net/wireless/hostap/hostap_80211_rx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_rx.c
@@ -773,7 +773,7 @@ void hostap_80211_rx(struct net_device *
  crypt-ops-decrypt_mpdu == NULL))
crypt = NULL;
 
-   if (!crypt  (fc  IEEE80211_FCTL_WEP)) {
+   if (!crypt  (fc  IEEE80211_FCTL_PROTECTED)) {
 #if 0
/* This seems to be triggered by some (multicast?)
 * frames from other than current BSS, so just drop the
@@ -791,7 +791,7 @@ void hostap_80211_rx(struct net_device *
if (type != IEEE80211_FTYPE_DATA) {
if (type == IEEE80211_FTYPE_MGMT 
stype == IEEE80211_STYPE_AUTH 
-   fc  IEEE80211_FCTL_WEP  local-host_decrypt 
+   fc  IEEE80211_FCTL_PROTECTED  local-host_decrypt 
(keyidx = hostap_rx_frame_decrypt(local, skb, crypt))  0)
{
printk(KERN_DEBUG %s: failed to decrypt mgmt::auth 
@@ -886,14 +886,14 @@ void hostap_80211_rx(struct net_device *
 
/* skb: hdr + (possibly fragmented, possibly encrypted) payload */
 
-   if (local-host_decrypt  (fc  IEEE80211_FCTL_WEP) 
+   if (local-host_decrypt  (fc  IEEE80211_FCTL_PROTECTED) 
(keyidx = hostap_rx_frame_decrypt(local, skb, crypt))  0)
goto rx_dropped;
hdr = (struct ieee80211_hdr *) skb-data;
 
/* skb: hdr + (possibly fragmented) plaintext payload */
 
-   if (local-host_decrypt  (fc  IEEE80211_FCTL_WEP) 
+   if (local-host_decrypt  (fc  IEEE80211_FCTL_PROTECTED) 
(frag != 0 || (fc  IEEE80211_FCTL_MOREFRAGS))) {
int flen;
struct sk_buff *frag_skb =
@@ -948,12 +948,12 @@ void hostap_80211_rx(struct net_device *
/* skb: hdr + (possible reassembled) full MSDU payload; possibly still
 * encrypted/authenticated */
 
-   if (local-host_decrypt  (fc  IEEE80211_FCTL_WEP) 
+   if (local-host_decrypt  (fc  IEEE80211_FCTL_PROTECTED) 
hostap_rx_frame_decrypt_msdu(local, skb, keyidx, crypt))
goto rx_dropped;
 
hdr = (struct ieee80211_hdr *) skb-data;
-   if (crypt  !(fc  IEEE80211_FCTL_WEP)  !local-open_wep) {
+   if (crypt  !(fc  IEEE80211_FCTL_PROTECTED)  !local-open_wep) {
if (local-ieee_802_1x 
hostap_is_eapol_frame(local, skb)) {
/* pass unencrypted EAPOL frames even if encryption is
@@ -968,7 +968,7 @@ void hostap_80211_rx(struct net_device *
}
}
 
-   if (local-drop_unencrypted  !(fc  IEEE80211_FCTL_WEP) 
+   if (local-drop_unencrypted  !(fc  IEEE80211_FCTL_PROTECTED) 
!hostap_is_eapol_frame(local, skb)) {
if (net_ratelimit()) {
printk(KERN_DEBUG %s: dropped unencrypted RX data 
diff --git a/drivers/net/wireless/hostap/hostap_80211_tx.c 
b/drivers/net/wireless/hostap/hostap_80211_tx.c
--- a/drivers/net/wireless/hostap/hostap_80211_tx.c
+++ b/drivers/net/wireless/hostap/hostap_80211_tx.c
@@ -466,7 +466,7 @@ int hostap_master_start_xmit(struct sk_b
else if ((tx.crypt || local-crypt[local-tx_keyidx])  !no_encrypt) {
/* Add ISWEP flag both for firmware and host based encryption
 */
-   fc |= IEEE80211_FCTL_WEP;
+   fc |= IEEE80211_FCTL_PROTECTED;
hdr-frame_ctl = cpu_to_le16(fc);
} else if (local-drop_unencrypted 
   WLAN_FC_GET_TYPE(fc) == IEEE80211_FTYPE_DATA 
diff --git a/drivers/net/wireless/hostap/hostap_ap.c 
b/drivers/net/wireless/hostap/hostap_ap.c
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -1436,7 +1436,7 @@ static void handle_authen(local_info_t *
challenge == NULL ||
memcmp(sta-u.sta.challenge, challenge,
   WLAN_AUTH_CHALLENGE_LEN) != 0 ||
-   !(fc  IEEE80211_FCTL_WEP)) {
+   !(fc  IEEE80211_FCTL_PROTECTED)) {
txt = challenge response incorrect;
resp = WLAN_STATUS_CHALLENGE_FAIL;

[PATCH] more-u32-vs-pm_message_t-fixes-6

2005-09-02 Thread Linux Kernel Mailing List
tree 96dfb10f6ed608a0af775871e007669e4a691ac8
parent ea6bfb0adf1361c2039adac3fcaca27f91d7c2c7
author Andrew Morton [EMAIL PROTECTED] Wed, 13 Jul 2005 14:33:46 -0700
committer Jeff Garzik [EMAIL PROTECTED] Fri, 19 Aug 2005 11:00:01 -0400

[PATCH] more-u32-vs-pm_message_t-fixes-6

Cc: Pavel Machek [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_pci.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_pci.c 
b/drivers/net/wireless/hostap/hostap_pci.c
--- a/drivers/net/wireless/hostap/hostap_pci.c
+++ b/drivers/net/wireless/hostap/hostap_pci.c
@@ -405,7 +405,7 @@ static void prism2_pci_remove(struct pci
 
 
 #ifdef CONFIG_PM
-static int prism2_pci_suspend(struct pci_dev *pdev, u32 state)
+static int prism2_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
struct net_device *dev = pci_get_drvdata(pdev);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap: Fix null pointer dereference in prism2_pccard_card_present()

2005-09-02 Thread Linux Kernel Mailing List
tree 100c6e7d12bea013586d540b3d8ca27c451af049
parent 6c5b90d2c84d557baed56e71729504b467ff3e5b
author Kalle Valo [EMAIL PROTECTED] Sun, 28 Aug 2005 22:46:57 +0300
committer Jeff Garzik [EMAIL PROTECTED] Mon, 29 Aug 2005 03:25:02 -0400

[PATCH] hostap: Fix null pointer dereference in prism2_pccard_card_present()

With my Buffalo WLI-CF-S11G PC Card kernel oopses every time in
prism2_interrupt() when I try load the hostap module. local-hw_priv is null
during the first call to prism2_interrupt(). It feels like
interrupts are enabled too early, or something.

This patch fixes the symptom, but not the cause.

Signed-off-by: Kalle Valo [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_cs.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -212,7 +212,7 @@ static int prism2_event(event_t event, i
 static int prism2_pccard_card_present(local_info_t *local)
 {
struct hostap_cs_priv *hw_priv = local-hw_priv;
-   if (hw_priv-link != NULL 
+   if (hw_priv != NULL  hw_priv-link != NULL 
((hw_priv-link-state  (DEV_PRESENT | DEV_CONFIG)) ==
 (DEV_PRESENT | DEV_CONFIG)))
return 1;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap: Fix null pointer dereference in prism2_pccard_card_present()

2005-09-02 Thread Linux Kernel Mailing List
tree 3582ea805d0153b42979bdc8315c68607db928b6
parent a8eef8a22232e64be76410100c52038b21bda7ed
author Jouni Malinen [EMAIL PROTECTED] Mon, 29 Aug 2005 07:53:32 -0700
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:48:39 -0400

[PATCH] hostap: Fix null pointer dereference in prism2_pccard_card_present()

local-hw_priv was initialized only after the interrupt handler was
registered. This could trigger a NULL pointer dereference in
prism2_pccard_card_present() that assumed that local-hw_priv is always
set (and it should have been). Fix this by setting local-hw_priv before
registering the interrupt handler.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_cs.c |   14 +++---
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -772,6 +772,13 @@ static int prism2_config(dev_link_t *lin
goto failed;
link-priv = dev;
 
+   iface = netdev_priv(dev);
+   local = iface-local;
+   local-hw_priv = hw_priv;
+   hw_priv-link = link;
+   strcpy(hw_priv-node.dev_name, dev-name);
+   link-dev = hw_priv-node;
+
/*
 * Allocate an interrupt line.  Note that this does not assign a
 * handler to the interrupt, unless the 'Handler' member of the
@@ -817,13 +824,6 @@ static int prism2_config(dev_link_t *lin
link-state |= DEV_CONFIG;
link-state = ~DEV_CONFIG_PENDING;
 
-   iface = netdev_priv(dev);
-   local = iface-local;
-   local-hw_priv = hw_priv;
-   hw_priv-link = link;
-   strcpy(hw_priv-node.dev_name, dev-name);
-   link-dev = hw_priv-node;
-
local-shutdown = 0;
 
sandisk_enable_wireless(dev);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] hostap: Update version

2005-09-02 Thread Linux Kernel Mailing List
tree 56f80ba621279be1dbcc414cbd4aea938efe05bc
parent fd67b0641118031a65d370f65bd80eef1982b45a
author Jouni Malinen [EMAIL PROTECTED] Mon, 29 Aug 2005 00:51:35 -0700
committer Jeff Garzik [EMAIL PROTECTED] Mon, 29 Aug 2005 03:25:02 -0400

[PATCH] hostap: Update version

Version 0.4.4 of Host AP driver was released, so let's sync the version
number in netdev-2.6 tree.

Signed-off-by: Jouni Malinen [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/wireless/hostap/hostap_config.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/hostap/hostap_config.h 
b/drivers/net/wireless/hostap/hostap_config.h
--- a/drivers/net/wireless/hostap/hostap_config.h
+++ b/drivers/net/wireless/hostap/hostap_config.h
@@ -1,7 +1,7 @@
 #ifndef HOSTAP_CONFIG_H
 #define HOSTAP_CONFIG_H
 
-#define PRISM2_VERSION 0.4.1-kernel
+#define PRISM2_VERSION 0.4.4-kernel
 
 /* In the previous versions of Host AP driver, support for user space version
  * of IEEE 802.11 management (hostapd) used to be disabled in the default
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Cleanup error and debug messages

2005-09-02 Thread Linux Kernel Mailing List
tree 299cc2a18fea9eb046a32e6f7ec3a2db13f16ad4
parent afc7097f45bdfddc2a0d375ef4a2c38b6e09c339
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:28:57 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:37:56 -0400

[PATCH] iseries_veth: Cleanup error and debug messages

Currently the iseries_veth driver prints the file name and line number in its
error messages. This isn't very useful for most users, so just print
iseries_veth: message instead.

 - convert uses of veth_printk() to veth_debug()/veth_error()/veth_info()
 - make terminology consistent, ie. always refer to LPAR not lpar
 - be consistent about printing return codes as %d not %x
 - make format strings fit in 80 columns

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   98 +++--
 1 files changed, 51 insertions(+), 47 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -79,6 +79,8 @@
 #include asm/iommu.h
 #include asm/vio.h
 
+#undef DEBUG
+
 #include iseries_veth.h
 
 MODULE_AUTHOR(Kyle Lucke [EMAIL PROTECTED]);
@@ -176,11 +178,18 @@ static void veth_timed_ack(unsigned long
  * Utility functions
  */
 
-#define veth_printk(prio, fmt, args...) \
-   printk(prio %s:  fmt, __FILE__, ## args)
+#define veth_info(fmt, args...) \
+   printk(KERN_INFO iseries_veth:  fmt, ## args)
 
 #define veth_error(fmt, args...) \
-   printk(KERN_ERR (%s:%3.3d) ERROR:  fmt, __FILE__, __LINE__ , ## args)
+   printk(KERN_ERR iseries_veth: Error:  fmt, ## args)
+
+#ifdef DEBUG
+#define veth_debug(fmt, args...) \
+   printk(KERN_DEBUG iseries_veth:  fmt, ## args)
+#else
+#define veth_debug(fmt, args...) do {} while (0)
+#endif
 
 static inline void veth_stack_push(struct veth_lpar_connection *cnx,
   struct veth_msg *msg)
@@ -278,7 +287,7 @@ static void veth_take_cap(struct veth_lp
  HvLpEvent_Type_VirtualLan);
 
if (cnx-state  VETH_STATE_GOTCAPS) {
-   veth_error(Received a second capabilities from lpar %d\n,
+   veth_error(Received a second capabilities from LPAR %d.\n,
   cnx-remote_lp);
event-base_event.xRc = HvLpEvent_Rc_BufferNotAvailable;
HvCallEvent_ackLpEvent((struct HvLpEvent *) event);
@@ -297,7 +306,7 @@ static void veth_take_cap_ack(struct vet
 
spin_lock_irqsave(cnx-lock, flags);
if (cnx-state  VETH_STATE_GOTCAPACK) {
-   veth_error(Received a second capabilities ack from lpar %d\n,
+   veth_error(Received a second capabilities ack from LPAR %d.\n,
   cnx-remote_lp);
} else {
memcpy(cnx-cap_ack_event, event,
@@ -314,8 +323,7 @@ static void veth_take_monitor_ack(struct
unsigned long flags;
 
spin_lock_irqsave(cnx-lock, flags);
-   veth_printk(KERN_DEBUG, Monitor ack returned for lpar %d\n,
-   cnx-remote_lp);
+   veth_debug(cnx %d: lost connection.\n, cnx-remote_lp);
cnx-state |= VETH_STATE_RESET;
veth_kick_statemachine(cnx);
spin_unlock_irqrestore(cnx-lock, flags);
@@ -336,8 +344,8 @@ static void veth_handle_ack(struct VethL
veth_take_monitor_ack(cnx, event);
break;
default:
-   veth_error(Unknown ack type %d from lpar %d\n,
-  event-base_event.xSubtype, rlp);
+   veth_error(Unknown ack type %d from LPAR %d.\n,
+   event-base_event.xSubtype, rlp);
};
 }
 
@@ -373,8 +381,8 @@ static void veth_handle_int(struct VethL
veth_receive(cnx, event);
break;
default:
-   veth_error(Unknown interrupt type %d from lpar %d\n,
-  event-base_event.xSubtype, rlp);
+   veth_error(Unknown interrupt type %d from LPAR %d.\n,
+   event-base_event.xSubtype, rlp);
};
 }
 
@@ -400,8 +408,8 @@ static int veth_process_caps(struct veth
 || (remote_caps-ack_threshold  VETH_MAX_ACKS_PER_MSG)
 || (remote_caps-ack_threshold == 0)
 || (cnx-ack_timeout == 0) ) {
-   veth_error(Received incompatible capabilities from lpar %d\n,
-  cnx-remote_lp);
+   veth_error(Received incompatible capabilities from LPAR %d.\n,
+   cnx-remote_lp);
return HvLpEvent_Rc_InvalidSubtypeData;
}
 
@@ -418,8 +426,8 @@ static int veth_process_caps(struct veth
cnx-num_ack_events += num;
 
if (cnx-num_ack_events  num_acks_needed) {
-   veth_error(Couldn't allocate enough ack events for 
lpar %d\n,
-   

[PATCH] iseries_veth: Remove a FIXME WRT deletion of the ack_timer

2005-09-02 Thread Linux Kernel Mailing List
tree 868c89f3f74f3771a336bca4c9abcbc75e61105c
parent 61a3c6966158dfd9b1279c10ea8eeb3bc7acdef4
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:28:59 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:37:56 -0400

[PATCH] iseries_veth: Remove a FIXME WRT deletion of the ack_timer

The iseries_veth driver has a timer which we use to send acks. When the
connection is reset or stopped we need to delete the timer.

Currently we only call del_timer() when resetting a connection, which means
the timer might run again while the connection is being re-setup. As it turns
out that's ok, because the flags the timer consults have been reset.

It's cleaner though to call del_timer_sync() once we've dropped the lock,
although the timer may still run between us dropping the lock and calling
del_timer_sync(), but as above that's ok.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   21 +
 1 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -450,13 +450,15 @@ static void veth_statemachine(void *p)
if (cnx-state  VETH_STATE_RESET) {
int i;
 
-   del_timer(cnx-ack_timer);
-
if (cnx-state  VETH_STATE_OPEN)
HvCallEvent_closeLpEventPath(cnx-remote_lp,
 HvLpEvent_Type_VirtualLan);
 
-   /* reset ack data */
+   /*
+* Reset ack data. This prevents the ack_timer actually
+* doing anything, even if it runs one more time when
+* we drop the lock below.
+*/
memset(cnx-pending_acks, 0xff, sizeof (cnx-pending_acks));
cnx-num_pending_acks = 0;
 
@@ -469,9 +471,16 @@ static void veth_statemachine(void *p)
if (cnx-msgs)
for (i = 0; i  VETH_NUMBUFFERS; ++i)
veth_recycle_msg(cnx, cnx-msgs + i);
+
+   /* Drop the lock so we can do stuff that might sleep or
+* take other locks. */
spin_unlock_irq(cnx-lock);
+
+   del_timer_sync(cnx-ack_timer);
veth_flush_pending(cnx);
+
spin_lock_irq(cnx-lock);
+
if (cnx-state  VETH_STATE_RESET)
goto restart;
}
@@ -658,13 +667,9 @@ static void veth_stop_connection(u8 rlp)
veth_kick_statemachine(cnx);
spin_unlock_irq(cnx-lock);
 
+   /* Wait for the state machine to run. */
flush_scheduled_work();
 
-   /* FIXME: not sure if this is necessary - will already have
-* been deleted by the state machine, just want to make sure
-* its not running any more */
-   del_timer_sync(cnx-ack_timer);
-
if (cnx-num_events  0)
mf_deallocate_lp_events(cnx-remote_lp,
  HvLpEvent_Type_VirtualLan,
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Fix broken promiscuous handling

2005-09-02 Thread Linux Kernel Mailing List
tree 1ada6ec6cd236f98371c32fc02c30c97546f84d9
parent 58c5900bdaffbf76afd7ad5e053410cb95eb3169
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:02 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:37:57 -0400

[PATCH] iseries_veth: Fix broken promiscuous handling

Due to a logic bug, once promiscuous mode is enabled in the iseries_veth
driver it is never disabled.

The driver keeps two flags, promiscuous and all_mcast which have exactly the
same effect. This is because we only ever receive packets destined for us,
or multicast packets. So consolidate them into one promiscuous flag for
simplicity.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   16 +---
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -159,7 +159,6 @@ struct veth_port {
 
rwlock_t mcast_gate;
int promiscuous;
-   int all_mcast;
int num_mcast;
u64 mcast_addr[VETH_MAX_MCAST];
 };
@@ -756,17 +755,15 @@ static void veth_set_multicast_list(stru
 
write_lock_irqsave(port-mcast_gate, flags);
 
-   if (dev-flags  IFF_PROMISC) { /* set promiscuous mode */
-   printk(KERN_INFO %s: Promiscuous mode enabled.\n,
-  dev-name);
+   if ((dev-flags  IFF_PROMISC) || (dev-flags  IFF_ALLMULTI) ||
+   (dev-mc_count  VETH_MAX_MCAST)) {
port-promiscuous = 1;
-   } else if ( (dev-flags  IFF_ALLMULTI)
-   || (dev-mc_count  VETH_MAX_MCAST) ) {
-   port-all_mcast = 1;
} else {
struct dev_mc_list *dmi = dev-mc_list;
int i;
 
+   port-promiscuous = 0;
+
/* Update table */
port-num_mcast = 0;
 
@@ -1145,12 +1142,9 @@ static inline int veth_frame_wanted(stru
if ( (mac_addr == port-mac_addr) || (mac_addr == 0x) )
return 1;
 
-   if (! (((char *) mac_addr)[0]  0x01))
-   return 0;
-
read_lock_irqsave(port-mcast_gate, flags);
 
-   if (port-promiscuous || port-all_mcast) {
+   if (port-promiscuous) {
wanted = 1;
goto out;
}
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Replace lock-protected atomic with an ordinary variable

2005-09-02 Thread Linux Kernel Mailing List
tree ee9e8d2e5457a2bb06d301b528203fca2c4db18e
parent d7893ddd1b2110a54a5b1773a405748172ba1fe5
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:06 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:39:43 -0400

[PATCH] iseries_veth: Replace lock-protected atomic with an ordinary variable

The iseries_veth driver uses atomic ops to manipulate the in_use field of
one of its per-connection structures. However all references to the
flag occur while the connection's lock is held, so the atomic ops aren't
necessary.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   13 +++--
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -117,7 +117,7 @@ struct veth_msg {
struct veth_msg *next;
struct VethFramesData data;
int token;
-   unsigned long in_use;
+   int in_use;
struct sk_buff *skb;
struct device *dev;
 };
@@ -957,6 +957,8 @@ static int veth_transmit_to_one(struct s
goto drop;
}
 
+   msg-in_use = 1;
+
dma_length = skb-len;
dma_address = dma_map_single(port-dev, skb-data,
 dma_length, DMA_TO_DEVICE);
@@ -971,7 +973,6 @@ static int veth_transmit_to_one(struct s
msg-data.addr[0] = dma_address;
msg-data.len[0] = dma_length;
msg-data.eofmask = 1  VETH_EOF_SHIFT;
-   set_bit(0, (msg-in_use));
rc = veth_signaldata(cnx, VethEventTypeFrames, msg-token, msg-data);
 
if (rc != HvLpEvent_Rc_Good)
@@ -981,10 +982,8 @@ static int veth_transmit_to_one(struct s
return 0;
 
  recycle_and_drop:
+   /* we free the skb below, so tell veth_recycle_msg() not to. */
msg-skb = NULL;
-   /* need to set in use to make veth_recycle_msg in case this
-* was a mapping failure */
-   set_bit(0, msg-in_use);
veth_recycle_msg(cnx, msg);
  drop:
port-stats.tx_errors++;
@@ -1066,12 +1065,14 @@ static int veth_start_xmit(struct sk_buf
return 0;
 }
 
+/* You must hold the connection's lock when you call this function. */
 static void veth_recycle_msg(struct veth_lpar_connection *cnx,
 struct veth_msg *msg)
 {
u32 dma_address, dma_length;
 
-   if (test_and_clear_bit(0, msg-in_use)) {
+   if (msg-in_use) {
+   msg-in_use = 0;
dma_address = msg-data.addr[0];
dma_length = msg-data.len[0];
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Only call dma_unmap_single() if dma_map_single() succeeded

2005-09-02 Thread Linux Kernel Mailing List
tree f3d0133df8c9a46135148e34b0a553849153c04f
parent b08bd5c0a3110f143faeef9cd057d9d8ff2f0714
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:07 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:39:43 -0400

[PATCH] iseries_veth: Only call dma_unmap_single() if dma_map_single() succeeded

The iseries_veth driver unconditionally calls dma_unmap_single() even
when the corresponding dma_map_single() may have failed.

Rework the code a bit to keep the return value from dma_unmap_single()
around, and then check if it's a dma_mapping_error() before we do
the dma_unmap_single().

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   17 -
 1 files changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -931,7 +931,6 @@ static int veth_transmit_to_one(struct s
struct veth_lpar_connection *cnx = veth_cnx[rlp];
struct veth_port *port = (struct veth_port *) dev-priv;
HvLpEvent_Rc rc;
-   u32 dma_address, dma_length;
struct veth_msg *msg = NULL;
int err = 0;
unsigned long flags;
@@ -959,20 +958,19 @@ static int veth_transmit_to_one(struct s
 
msg-in_use = 1;
 
-   dma_length = skb-len;
-   dma_address = dma_map_single(port-dev, skb-data,
-dma_length, DMA_TO_DEVICE);
+   msg-data.addr[0] = dma_map_single(port-dev, skb-data,
+   skb-len, DMA_TO_DEVICE);
 
-   if (dma_mapping_error(dma_address))
+   if (dma_mapping_error(msg-data.addr[0]))
goto recycle_and_drop;
 
/* Is it really necessary to check the length and address
 * fields of the first entry here? */
msg-skb = skb;
msg-dev = port-dev;
-   msg-data.addr[0] = dma_address;
-   msg-data.len[0] = dma_length;
+   msg-data.len[0] = skb-len;
msg-data.eofmask = 1  VETH_EOF_SHIFT;
+
rc = veth_signaldata(cnx, VethEventTypeFrames, msg-token, msg-data);
 
if (rc != HvLpEvent_Rc_Good)
@@ -1076,8 +1074,9 @@ static void veth_recycle_msg(struct veth
dma_address = msg-data.addr[0];
dma_length = msg-data.len[0];
 
-   dma_unmap_single(msg-dev, dma_address, dma_length,
-DMA_TO_DEVICE);
+   if (!dma_mapping_error(dma_address))
+   dma_unmap_single(msg-dev, dma_address, dma_length,
+   DMA_TO_DEVICE);
 
if (msg-skb) {
dev_kfree_skb_any(msg-skb);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Make init_connection() destroy_connection() symmetrical

2005-09-02 Thread Linux Kernel Mailing List
tree 0591903d946969283238116291b2755b1cfa86d2
parent cbf9074cc30ca0eee19c9bd7304faf9f1beb1e76
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:08 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:39:43 -0400

[PATCH] iseries_veth: Make init_connection()  destroy_connection() symmetrical

This patch makes veth_init_connection() and veth_destroy_connection()
symmetrical in that they allocate/deallocate the same data.

Currently if there's an error while initialising connections (ie. ENOMEM)
we call veth_module_cleanup(), however this will oops because we call
driver_unregister() before we've called driver_register(). I've never seen
this actually happen though.

So instead we explicitly call veth_destroy_connection() for each connection,
any that have been set up will be deallocated.

We also fix a potential leak if vio_register_driver() fails.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   35 ++-
 1 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -683,6 +683,14 @@ static void veth_stop_connection(u8 rlp)
 
/* Wait for the state machine to run. */
flush_scheduled_work();
+}
+
+static void veth_destroy_connection(u8 rlp)
+{
+   struct veth_lpar_connection *cnx = veth_cnx[rlp];
+
+   if (! cnx)
+   return;
 
if (cnx-num_events  0)
mf_deallocate_lp_events(cnx-remote_lp,
@@ -694,14 +702,6 @@ static void veth_stop_connection(u8 rlp)
  HvLpEvent_Type_VirtualLan,
  cnx-num_ack_events,
  NULL, NULL);
-}
-
-static void veth_destroy_connection(u8 rlp)
-{
-   struct veth_lpar_connection *cnx = veth_cnx[rlp];
-
-   if (! cnx)
-   return;
 
kfree(cnx-msgs);
kfree(cnx);
@@ -1441,15 +1441,24 @@ int __init veth_module_init(void)
 
for (i = 0; i  HVMAXARCHITECTEDLPS; ++i) {
rc = veth_init_connection(i);
-   if (rc != 0) {
-   veth_module_cleanup();
-   return rc;
-   }
+   if (rc != 0)
+   goto error;
}
 
HvLpEvent_registerHandler(HvLpEvent_Type_VirtualLan,
  veth_handle_event);
 
-   return vio_register_driver(veth_driver);
+   rc = vio_register_driver(veth_driver);
+   if (rc != 0)
+   goto error;
+
+   return 0;
+
+error:
+   for (i = 0; i  HVMAXARCHITECTEDLPS; ++i) {
+   veth_destroy_connection(i);
+   }
+
+   return rc;
 }
 module_init(veth_module_init);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Use kobjects to track lifecycle of connection structs

2005-09-02 Thread Linux Kernel Mailing List
tree 84f22d680065e39d11be61ecd992d6b8597704dd
parent ec60beebed497691c97d674c1facac5ca3d7a4b3
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:09 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:39:43 -0400

[PATCH] iseries_veth: Use kobjects to track lifecycle of connection structs

The iseries_veth driver can attach to multiple vlans, which correspond to
multiple net devices. However there is only 1 connection between each LPAR,
so the connection structure may be shared by multiple net devices.

This makes module removal messy, because we can't deallocate the connections
until we know there are no net devices still using them. The solution is to
use ref counts on the connections, so we can delete them (actually stop) as
soon as the ref count hits zero.

This patch fixes (part of) a bug we were seeing with IPv6 sending probes to
a dead LPAR, which would then hang us forever due to leftover skbs.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |  121 ++---
 1 files changed, 83 insertions(+), 38 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -129,6 +129,7 @@ struct veth_lpar_connection {
int num_events;
struct VethCapData local_caps;
 
+   struct kobject kobject;
struct timer_list ack_timer;
 
spinlock_t lock;
@@ -171,6 +172,11 @@ static void veth_recycle_msg(struct veth
 static void veth_flush_pending(struct veth_lpar_connection *cnx);
 static void veth_receive(struct veth_lpar_connection *, struct VethLpEvent *);
 static void veth_timed_ack(unsigned long connectionPtr);
+static void veth_release_connection(struct kobject *kobject);
+
+static struct kobj_type veth_lpar_connection_ktype = {
+   .release= veth_release_connection
+};
 
 /*
  * Utility functions
@@ -611,7 +617,7 @@ static int veth_init_connection(u8 rlp)
 {
struct veth_lpar_connection *cnx;
struct veth_msg *msgs;
-   int i;
+   int i, rc;
 
if ( (rlp == this_lp)
 || ! HvLpConfig_doLpsCommunicateOnVirtualLan(this_lp, rlp) )
@@ -632,6 +638,14 @@ static int veth_init_connection(u8 rlp)
 
veth_cnx[rlp] = cnx;
 
+   /* This gets us 1 reference, which is held on behalf of the driver
+* infrastructure. It's released at module unload. */
+   kobject_init(cnx-kobject);
+   cnx-kobject.ktype = veth_lpar_connection_ktype;
+   rc = kobject_set_name(cnx-kobject, cnx%.2d, rlp);
+   if (rc != 0)
+   return rc;
+
msgs = kmalloc(VETH_NUMBUFFERS * sizeof(struct veth_msg), GFP_KERNEL);
if (! msgs) {
veth_error(Can't allocate buffers for LPAR %d.\n, rlp);
@@ -660,11 +674,9 @@ static int veth_init_connection(u8 rlp)
return 0;
 }
 
-static void veth_stop_connection(u8 rlp)
+static void veth_stop_connection(struct veth_lpar_connection *cnx)
 {
-   struct veth_lpar_connection *cnx = veth_cnx[rlp];
-
-   if (! cnx)
+   if (!cnx)
return;
 
spin_lock_irq(cnx-lock);
@@ -685,11 +697,9 @@ static void veth_stop_connection(u8 rlp)
flush_scheduled_work();
 }
 
-static void veth_destroy_connection(u8 rlp)
+static void veth_destroy_connection(struct veth_lpar_connection *cnx)
 {
-   struct veth_lpar_connection *cnx = veth_cnx[rlp];
-
-   if (! cnx)
+   if (!cnx)
return;
 
if (cnx-num_events  0)
@@ -704,8 +714,16 @@ static void veth_destroy_connection(u8 r
  NULL, NULL);
 
kfree(cnx-msgs);
+   veth_cnx[cnx-remote_lp] = NULL;
kfree(cnx);
-   veth_cnx[rlp] = NULL;
+}
+
+static void veth_release_connection(struct kobject *kobj)
+{
+   struct veth_lpar_connection *cnx;
+   cnx = container_of(kobj, struct veth_lpar_connection, kobject);
+   veth_stop_connection(cnx);
+   veth_destroy_connection(cnx);
 }
 
 /*
@@ -1349,15 +1367,31 @@ static void veth_timed_ack(unsigned long
 
 static int veth_remove(struct vio_dev *vdev)
 {
-   int i = vdev-unit_address;
+   struct veth_lpar_connection *cnx;
struct net_device *dev;
+   struct veth_port *port;
+   int i;
 
-   dev = veth_dev[i];
-   if (dev != NULL) {
-   veth_dev[i] = NULL;
-   unregister_netdev(dev);
-   free_netdev(dev);
+   dev = veth_dev[vdev-unit_address];
+
+   if (! dev)
+   return 0;
+
+   port = netdev_priv(dev);
+
+   for (i = 0; i  HVMAXARCHITECTEDLPS; i++) {
+   cnx = veth_cnx[i];
+
+   if (cnx  (port-lpar_map  (1  i))) {
+   /* Drop our reference to connections on our VLAN */
+   kobject_put(cnx-kobject);
+   }
}
+
+   veth_dev[vdev-unit_address] = NULL;
+  

[PATCH] iseries_veth: Remove TX timeout code

2005-09-02 Thread Linux Kernel Mailing List
tree 20154b85d4a5f62d74890b1b5b8568c16475f853
parent f0c129caa34b4bb0944bbb758b56c3d85b105557
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:12 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:39:43 -0400

[PATCH] iseries_veth: Remove TX timeout code

The iseries_veth driver uses the generic TX timeout watchdog, however a better
solution is in the works, so remove this code.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   48 -
 1 files changed, 48 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -830,49 +830,6 @@ static struct ethtool_ops ops = {
.get_link = veth_get_link,
 };
 
-static void veth_tx_timeout(struct net_device *dev)
-{
-   struct veth_port *port = (struct veth_port *)dev-priv;
-   struct net_device_stats *stats = port-stats;
-   unsigned long flags;
-   int i;
-
-   stats-tx_errors++;
-
-   spin_lock_irqsave(port-pending_gate, flags);
-
-   if (!port-pending_lpmask) {
-   spin_unlock_irqrestore(port-pending_gate, flags);
-   return;
-   }
-
-   printk(KERN_WARNING %s: Tx timeout!  Resetting lp connections: %08x\n,
-  dev-name, port-pending_lpmask);
-
-   for (i = 0; i  HVMAXARCHITECTEDLPS; i++) {
-   struct veth_lpar_connection *cnx = veth_cnx[i];
-
-   if (! (port-pending_lpmask  (1i)))
-   continue;
-
-   /* If we're pending on it, we must be connected to it,
-* so we should certainly have a structure for it. */
-   BUG_ON(! cnx);
-
-   /* Theoretically we could be kicking a connection
-* which doesn't deserve it, but in practice if we've
-* had a Tx timeout, the pending_lpmask will have
-* exactly one bit set - the connection causing the
-* problem. */
-   spin_lock(cnx-lock);
-   cnx-state |= VETH_STATE_RESET;
-   veth_kick_statemachine(cnx);
-   spin_unlock(cnx-lock);
-   }
-
-   spin_unlock_irqrestore(port-pending_gate, flags);
-}
-
 static struct net_device * __init veth_probe_one(int vlan, struct device *vdev)
 {
struct net_device *dev;
@@ -921,9 +878,6 @@ static struct net_device * __init veth_p
dev-set_multicast_list = veth_set_multicast_list;
SET_ETHTOOL_OPS(dev, ops);
 
-   dev-watchdog_timeo = 2 * (VETH_ACKTIMEOUT * HZ / 100);
-   dev-tx_timeout = veth_tx_timeout;
-
SET_NETDEV_DEV(dev, vdev);
 
rc = register_netdev(dev);
@@ -1058,8 +1012,6 @@ static int veth_start_xmit(struct sk_buf
 
lpmask = veth_transmit_to_many(skb, lpmask, dev);
 
-   dev-trans_start = jiffies;
-
if (! lpmask) {
dev_kfree_skb(skb);
} else {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Fix bogus counting of TX errors

2005-09-02 Thread Linux Kernel Mailing List
tree e0adc928ffa6735e228c6fd2867381f8442875e7
parent e0808494ff44d5cedcaf286bb8a93d08e8d9af49
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:19 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:42:45 -0400

[PATCH] iseries_veth: Fix bogus counting of TX errors

There's a number of problems with the way iseries_veth counts TX errors.

Firstly it counts conditions which aren't really errors as TX errors. This
includes if we don't have a connection struct for the other LPAR, or if the
other LPAR is currently down (or just doesn't want to talk to us). Neither
of these should count as TX errors.

Secondly, it counts one TX error for each LPAR that fails to accept the packet.
This can lead to TX error counts higher than the total number of packets sent
through the interface. This is confusing for users.

This patch fixes that behaviour. The non-error conditions are no longer
counted, and we introduce a new and I think saner meaning to the TX counts.

If a packet is successfully transmitted to any LPAR then it is transmitted
and tx_packets is incremented by 1.

If there is an error transmitting a packet to any LPAR then that is counted
as one error, ie. tx_errors is incremented by 1.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   47 ++---
 1 files changed, 19 insertions(+), 28 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -938,31 +938,25 @@ static int veth_transmit_to_one(struct s
struct veth_port *port = (struct veth_port *) dev-priv;
HvLpEvent_Rc rc;
struct veth_msg *msg = NULL;
-   int err = 0;
unsigned long flags;
 
-   if (! cnx) {
-   port-stats.tx_errors++;
-   dev_kfree_skb(skb);
+   if (! cnx)
return 0;
-   }
 
spin_lock_irqsave(cnx-lock, flags);
 
if (! (cnx-state  VETH_STATE_READY))
-   goto drop;
+   goto no_error;
 
-   if ((skb-len - 14)  VETH_MAX_MTU)
+   if ((skb-len - ETH_HLEN)  VETH_MAX_MTU)
goto drop;
 
msg = veth_stack_pop(cnx);
-
-   if (! msg) {
-   err = 1;
+   if (! msg)
goto drop;
-   }
 
msg-in_use = 1;
+   msg-skb = skb_get(skb);
 
msg-data.addr[0] = dma_map_single(port-dev, skb-data,
skb-len, DMA_TO_DEVICE);
@@ -970,9 +964,6 @@ static int veth_transmit_to_one(struct s
if (dma_mapping_error(msg-data.addr[0]))
goto recycle_and_drop;
 
-   /* Is it really necessary to check the length and address
-* fields of the first entry here? */
-   msg-skb = skb;
msg-dev = port-dev;
msg-data.len[0] = skb-len;
msg-data.eofmask = 1  VETH_EOF_SHIFT;
@@ -992,43 +983,43 @@ static int veth_transmit_to_one(struct s
if (veth_stack_is_empty(cnx))
veth_stop_queues(cnx);
 
+ no_error:
spin_unlock_irqrestore(cnx-lock, flags);
return 0;
 
  recycle_and_drop:
-   /* we free the skb below, so tell veth_recycle_msg() not to. */
-   msg-skb = NULL;
veth_recycle_msg(cnx, msg);
  drop:
-   port-stats.tx_errors++;
-   dev_kfree_skb(skb);
spin_unlock_irqrestore(cnx-lock, flags);
-   return err;
+   return 1;
 }
 
-static HvLpIndexMap veth_transmit_to_many(struct sk_buff *skb,
+static void veth_transmit_to_many(struct sk_buff *skb,
  HvLpIndexMap lpmask,
  struct net_device *dev)
 {
struct veth_port *port = (struct veth_port *) dev-priv;
-   int i;
-   int rc;
+   int i, success, error;
+
+   success = error = 0;
 
for (i = 0; i  HVMAXARCHITECTEDLPS; i++) {
if ((lpmask  (1  i)) == 0)
continue;
 
-   rc = veth_transmit_to_one(skb_get(skb), i, dev);
-   if (! rc)
-   lpmask = ~(1i);
+   if (veth_transmit_to_one(skb, i, dev))
+   error = 1;
+   else
+   success = 1;
}
 
-   if (! lpmask) {
+   if (error)
+   port-stats.tx_errors++;
+
+   if (success) {
port-stats.tx_packets++;
port-stats.tx_bytes += skb-len;
}
-
-   return lpmask;
 }
 
 static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Add sysfs support for connection structs

2005-09-02 Thread Linux Kernel Mailing List
tree 461d70f89c14cfc4586729ad082c92cee3306f4e
parent db5e8718eac0b8166d6fd05b1ed7f8114c243988
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:20 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:42:46 -0400

[PATCH] iseries_veth: Add sysfs support for connection structs

To aid in field debugging, add sysfs support for iseries_veth's connection
structures. At the moment this is all read-only, however we could think about
adding write support for some attributes in future.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   94 +++--
 1 files changed, 90 insertions(+), 4 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -182,10 +182,6 @@ static void veth_release_connection(stru
 static void veth_timed_ack(unsigned long ptr);
 static void veth_timed_reset(unsigned long ptr);
 
-static struct kobj_type veth_lpar_connection_ktype = {
-   .release= veth_release_connection
-};
-
 /*
  * Utility functions
  */
@@ -280,6 +276,81 @@ static int veth_allocate_events(HvLpInde
 }
 
 /*
+ * sysfs support
+ */
+
+struct veth_cnx_attribute {
+   struct attribute attr;
+   ssize_t (*show)(struct veth_lpar_connection *, char *buf);
+   ssize_t (*store)(struct veth_lpar_connection *, const char *buf);
+};
+
+static ssize_t veth_cnx_attribute_show(struct kobject *kobj,
+   struct attribute *attr, char *buf)
+{
+   struct veth_cnx_attribute *cnx_attr;
+   struct veth_lpar_connection *cnx;
+
+   cnx_attr = container_of(attr, struct veth_cnx_attribute, attr);
+   cnx = container_of(kobj, struct veth_lpar_connection, kobject);
+
+   if (!cnx_attr-show)
+   return -EIO;
+
+   return cnx_attr-show(cnx, buf);
+}
+
+#define CUSTOM_CNX_ATTR(_name, _format, _expression)   \
+static ssize_t _name##_show(struct veth_lpar_connection *cnx, char *buf)\
+{  \
+   return sprintf(buf, _format, _expression);  \
+}  \
+struct veth_cnx_attribute veth_cnx_attr_##_name = __ATTR_RO(_name)
+
+#define SIMPLE_CNX_ATTR(_name) \
+   CUSTOM_CNX_ATTR(_name, %lu\n, (unsigned long)cnx-_name)
+
+SIMPLE_CNX_ATTR(outstanding_tx);
+SIMPLE_CNX_ATTR(remote_lp);
+SIMPLE_CNX_ATTR(num_events);
+SIMPLE_CNX_ATTR(src_inst);
+SIMPLE_CNX_ATTR(dst_inst);
+SIMPLE_CNX_ATTR(num_pending_acks);
+SIMPLE_CNX_ATTR(num_ack_events);
+CUSTOM_CNX_ATTR(ack_timeout, %d\n, jiffies_to_msecs(cnx-ack_timeout));
+CUSTOM_CNX_ATTR(reset_timeout, %d\n, jiffies_to_msecs(cnx-reset_timeout));
+CUSTOM_CNX_ATTR(state, 0x%.4lX\n, cnx-state);
+CUSTOM_CNX_ATTR(last_contact, %d\n, cnx-last_contact ?
+   jiffies_to_msecs(jiffies - cnx-last_contact) : 0);
+
+#define GET_CNX_ATTR(_name)(veth_cnx_attr_##_name.attr)
+
+static struct attribute *veth_cnx_default_attrs[] = {
+   GET_CNX_ATTR(outstanding_tx),
+   GET_CNX_ATTR(remote_lp),
+   GET_CNX_ATTR(num_events),
+   GET_CNX_ATTR(reset_timeout),
+   GET_CNX_ATTR(last_contact),
+   GET_CNX_ATTR(state),
+   GET_CNX_ATTR(src_inst),
+   GET_CNX_ATTR(dst_inst),
+   GET_CNX_ATTR(num_pending_acks),
+   GET_CNX_ATTR(num_ack_events),
+   GET_CNX_ATTR(ack_timeout),
+   NULL
+};
+
+static struct sysfs_ops veth_cnx_sysfs_ops = {
+   .show = veth_cnx_attribute_show
+};
+
+static struct kobj_type veth_lpar_connection_ktype = {
+   .release= veth_release_connection,
+   .sysfs_ops  = veth_cnx_sysfs_ops,
+   .default_attrs  = veth_cnx_default_attrs
+};
+
+/*
  * LPAR connection code
  */
 
@@ -1493,6 +1564,8 @@ void __exit veth_module_cleanup(void)
if (!cnx)
continue;
 
+   /* Remove the connection from sysfs */
+   kobject_del(cnx-kobject);
/* Drop the driver's reference to the connection */
kobject_put(cnx-kobject);
}
@@ -1523,6 +1596,19 @@ int __init veth_module_init(void)
if (rc != 0)
goto error;
 
+   for (i = 0; i  HVMAXARCHITECTEDLPS; ++i) {
+   struct kobject *kobj;
+
+   if (!veth_cnx[i])
+   continue;
+
+   kobj = veth_cnx[i]-kobject;
+   kobj-parent = veth_driver.driver.kobj;
+   /* If the add failes, complain but otherwise continue */
+   if (0 != kobject_add(kobj))
+   veth_error(cnx %d: Failed adding to sysfs.\n, i);
+   }
+
return 0;
 
 error:
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

[PATCH] iseries_veth: Incorporate iseries_veth.h in iseries_veth.c

2005-09-02 Thread Linux Kernel Mailing List
tree a409815ba4897bc06e60a45044a4bb45001c4521
parent 07a5c1727d6bf5c917034fe4006acf726cb158bf
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:25 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:43:42 -0400

[PATCH] iseries_veth: Incorporate iseries_veth.h in iseries_veth.c

iseries_veth.h is only used by iseries_veth.c, so merge the former into
the latter.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.h |   46 -
 drivers/net/iseries_veth.c |   42 +++--
 2 files changed, 40 insertions(+), 48 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -81,12 +81,50 @@
 
 #undef DEBUG
 
-#include iseries_veth.h
-
 MODULE_AUTHOR(Kyle Lucke [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(iSeries Virtual ethernet driver);
 MODULE_LICENSE(GPL);
 
+#define VethEventTypeCap   (0)
+#define VethEventTypeFrames(1)
+#define VethEventTypeMonitor   (2)
+#define VethEventTypeFramesAck (3)
+
+#define VETH_MAX_ACKS_PER_MSG  (20)
+#define VETH_MAX_FRAMES_PER_MSG(6)
+
+struct VethFramesData {
+   u32 addr[VETH_MAX_FRAMES_PER_MSG];
+   u16 len[VETH_MAX_FRAMES_PER_MSG];
+   u32 eofmask;
+};
+#define VETH_EOF_SHIFT (32-VETH_MAX_FRAMES_PER_MSG)
+
+struct VethFramesAckData {
+   u16 token[VETH_MAX_ACKS_PER_MSG];
+};
+
+struct VethCapData {
+   u8 caps_version;
+   u8 rsvd1;
+   u16 num_buffers;
+   u16 ack_threshold;
+   u16 rsvd2;
+   u32 ack_timeout;
+   u32 rsvd3;
+   u64 rsvd4[3];
+};
+
+struct VethLpEvent {
+   struct HvLpEvent base_event;
+   union {
+   struct VethCapData caps_data;
+   struct VethFramesData frames_data;
+   struct VethFramesAckData frames_ack_data;
+   } u;
+
+};
+
 #define VETH_NUMBUFFERS(120)
 #define VETH_ACKTIMEOUT(100) /* microseconds */
 #define VETH_MAX_MCAST (12)
diff --git a/drivers/net/iseries_veth.h b/drivers/net/iseries_veth.h
deleted file mode 100644
--- a/drivers/net/iseries_veth.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* File veth.h created by Kyle A. Lucke on Mon Aug  7 2000. */
-
-#ifndef _ISERIES_VETH_H
-#define _ISERIES_VETH_H
-
-#define VethEventTypeCap   (0)
-#define VethEventTypeFrames(1)
-#define VethEventTypeMonitor   (2)
-#define VethEventTypeFramesAck (3)
-
-#define VETH_MAX_ACKS_PER_MSG  (20)
-#define VETH_MAX_FRAMES_PER_MSG(6)
-
-struct VethFramesData {
-   u32 addr[VETH_MAX_FRAMES_PER_MSG];
-   u16 len[VETH_MAX_FRAMES_PER_MSG];
-   u32 eofmask;
-};
-#define VETH_EOF_SHIFT (32-VETH_MAX_FRAMES_PER_MSG)
-
-struct VethFramesAckData {
-   u16 token[VETH_MAX_ACKS_PER_MSG];
-};
-
-struct VethCapData {
-   u8 caps_version;
-   u8 rsvd1;
-   u16 num_buffers;
-   u16 ack_threshold;
-   u16 rsvd2;
-   u32 ack_timeout;
-   u32 rsvd3;
-   u64 rsvd4[3];
-};
-
-struct VethLpEvent {
-   struct HvLpEvent base_event;
-   union {
-   struct VethCapData caps_data;
-   struct VethFramesData frames_data;
-   struct VethFramesAckData frames_ack_data;
-   } u;
-
-};
-
-#endif /* _ISERIES_VETH_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Remove studly caps from iseries_veth.c

2005-09-02 Thread Linux Kernel Mailing List
tree 9bdf374b21bfa92a5fd22e6f9367017b54575054
parent 642d1a4c36b9002a45ea6498bda5d1e911eeb933
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:27 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:43:42 -0400

[PATCH] iseries_veth: Remove studly caps from iseries_veth.c

Having merged iseries_veth.h, let's remove some of the studly caps that came
with it.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   74 ++---
 1 files changed, 37 insertions(+), 37 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -85,26 +85,26 @@ MODULE_AUTHOR(Kyle Lucke [EMAIL PROTECTED]
 MODULE_DESCRIPTION(iSeries Virtual ethernet driver);
 MODULE_LICENSE(GPL);
 
-#define VethEventTypeCap   (0)
-#define VethEventTypeFrames(1)
-#define VethEventTypeMonitor   (2)
-#define VethEventTypeFramesAck (3)
+#define VETH_EVENT_CAP (0)
+#define VETH_EVENT_FRAMES  (1)
+#define VETH_EVENT_MONITOR (2)
+#define VETH_EVENT_FRAMES_ACK  (3)
 
 #define VETH_MAX_ACKS_PER_MSG  (20)
 #define VETH_MAX_FRAMES_PER_MSG(6)
 
-struct VethFramesData {
+struct veth_frames_data {
u32 addr[VETH_MAX_FRAMES_PER_MSG];
u16 len[VETH_MAX_FRAMES_PER_MSG];
u32 eofmask;
 };
 #define VETH_EOF_SHIFT (32-VETH_MAX_FRAMES_PER_MSG)
 
-struct VethFramesAckData {
+struct veth_frames_ack_data {
u16 token[VETH_MAX_ACKS_PER_MSG];
 };
 
-struct VethCapData {
+struct veth_cap_data {
u8 caps_version;
u8 rsvd1;
u16 num_buffers;
@@ -115,12 +115,12 @@ struct VethCapData {
u64 rsvd4[3];
 };
 
-struct VethLpEvent {
+struct veth_lpevent {
struct HvLpEvent base_event;
union {
-   struct VethCapData caps_data;
-   struct VethFramesData frames_data;
-   struct VethFramesAckData frames_ack_data;
+   struct veth_cap_data caps_data;
+   struct veth_frames_data frames_data;
+   struct veth_frames_ack_data frames_ack_data;
} u;
 
 };
@@ -153,7 +153,7 @@ struct VethLpEvent {
 
 struct veth_msg {
struct veth_msg *next;
-   struct VethFramesData data;
+   struct veth_frames_data data;
int token;
int in_use;
struct sk_buff *skb;
@@ -165,7 +165,7 @@ struct veth_lpar_connection {
struct work_struct statemachine_wq;
struct veth_msg *msgs;
int num_events;
-   struct VethCapData local_caps;
+   struct veth_cap_data local_caps;
 
struct kobject kobject;
struct timer_list ack_timer;
@@ -179,12 +179,12 @@ struct veth_lpar_connection {
unsigned long state;
HvLpInstanceId src_inst;
HvLpInstanceId dst_inst;
-   struct VethLpEvent cap_event, cap_ack_event;
+   struct veth_lpevent cap_event, cap_ack_event;
u16 pending_acks[VETH_MAX_ACKS_PER_MSG];
u32 num_pending_acks;
 
int num_ack_events;
-   struct VethCapData remote_caps;
+   struct veth_cap_data remote_caps;
u32 ack_timeout;
 
struct veth_msg *msg_stack_head;
@@ -217,7 +217,7 @@ static int veth_start_xmit(struct sk_buf
 static void veth_recycle_msg(struct veth_lpar_connection *, struct veth_msg *);
 static void veth_wake_queues(struct veth_lpar_connection *cnx);
 static void veth_stop_queues(struct veth_lpar_connection *cnx);
-static void veth_receive(struct veth_lpar_connection *, struct VethLpEvent *);
+static void veth_receive(struct veth_lpar_connection *, struct veth_lpevent *);
 static void veth_release_connection(struct kobject *kobject);
 static void veth_timed_ack(unsigned long ptr);
 static void veth_timed_reset(unsigned long ptr);
@@ -308,7 +308,7 @@ static int veth_allocate_events(HvLpInde
struct veth_allocation vc = { COMPLETION_INITIALIZER(vc.c), 0 };
 
mf_allocate_lp_events(rlp, HvLpEvent_Type_VirtualLan,
-   sizeof(struct VethLpEvent), number,
+   sizeof(struct veth_lpevent), number,
veth_complete_allocation, vc);
wait_for_completion(vc.c);
 
@@ -456,7 +456,7 @@ static inline void veth_kick_statemachin
 }
 
 static void veth_take_cap(struct veth_lpar_connection *cnx,
- struct VethLpEvent *event)
+ struct veth_lpevent *event)
 {
unsigned long flags;
 
@@ -481,7 +481,7 @@ static void veth_take_cap(struct veth_lp
 }
 
 static void veth_take_cap_ack(struct veth_lpar_connection *cnx,
- struct VethLpEvent *event)
+ struct veth_lpevent *event)
 {
unsigned long flags;
 
@@ -499,7 +499,7 @@ static void veth_take_cap_ack(struct vet
 }
 
 static void veth_take_monitor_ack(struct veth_lpar_connection *cnx,
- 

[PATCH] iseries_veth: Add sysfs support for port structs

2005-09-02 Thread Linux Kernel Mailing List
tree 06a57b62a3129cf4f63a237119c1f97ec891e7df
parent 76812d81238cda5c5c4060da27517a08287620fc
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:21 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:42:46 -0400

[PATCH] iseries_veth: Add sysfs support for port structs

Also to aid debugging, add sysfs support for iseries_veth's port structures.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   67 +
 1 files changed, 67 insertions(+)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -167,6 +167,8 @@ struct veth_port {
int promiscuous;
int num_mcast;
u64 mcast_addr[VETH_MAX_MCAST];
+
+   struct kobject kobject;
 };
 
 static HvLpIndex this_lp;
@@ -350,6 +352,62 @@ static struct kobj_type veth_lpar_connec
.default_attrs  = veth_cnx_default_attrs
 };
 
+struct veth_port_attribute {
+   struct attribute attr;
+   ssize_t (*show)(struct veth_port *, char *buf);
+   ssize_t (*store)(struct veth_port *, const char *buf);
+};
+
+static ssize_t veth_port_attribute_show(struct kobject *kobj,
+   struct attribute *attr, char *buf)
+{
+   struct veth_port_attribute *port_attr;
+   struct veth_port *port;
+
+   port_attr = container_of(attr, struct veth_port_attribute, attr);
+   port = container_of(kobj, struct veth_port, kobject);
+
+   if (!port_attr-show)
+   return -EIO;
+
+   return port_attr-show(port, buf);
+}
+
+#define CUSTOM_PORT_ATTR(_name, _format, _expression)  \
+static ssize_t _name##_show(struct veth_port *port, char *buf) \
+{  \
+   return sprintf(buf, _format, _expression);  \
+}  \
+struct veth_port_attribute veth_port_attr_##_name = __ATTR_RO(_name)
+
+#define SIMPLE_PORT_ATTR(_name)\
+   CUSTOM_PORT_ATTR(_name, %lu\n, (unsigned long)port-_name)
+
+SIMPLE_PORT_ATTR(promiscuous);
+SIMPLE_PORT_ATTR(num_mcast);
+CUSTOM_PORT_ATTR(lpar_map, 0x%X\n, port-lpar_map);
+CUSTOM_PORT_ATTR(stopped_map, 0x%X\n, port-stopped_map);
+CUSTOM_PORT_ATTR(mac_addr, 0x%lX\n, port-mac_addr);
+
+#define GET_PORT_ATTR(_name)   (veth_port_attr_##_name.attr)
+static struct attribute *veth_port_default_attrs[] = {
+   GET_PORT_ATTR(mac_addr),
+   GET_PORT_ATTR(lpar_map),
+   GET_PORT_ATTR(stopped_map),
+   GET_PORT_ATTR(promiscuous),
+   GET_PORT_ATTR(num_mcast),
+   NULL
+};
+
+static struct sysfs_ops veth_port_sysfs_ops = {
+   .show = veth_port_attribute_show
+};
+
+static struct kobj_type veth_port_ktype = {
+   .sysfs_ops  = veth_port_sysfs_ops,
+   .default_attrs  = veth_port_default_attrs
+};
+
 /*
  * LPAR connection code
  */
@@ -992,6 +1050,13 @@ static struct net_device * __init veth_p
return NULL;
}
 
+   kobject_init(port-kobject);
+   port-kobject.parent = dev-class_dev.kobj;
+   port-kobject.ktype  = veth_port_ktype;
+   kobject_set_name(port-kobject, veth_port);
+   if (0 != kobject_add(port-kobject))
+   veth_error(Failed adding port for %s to sysfs.\n, dev-name);
+
veth_info(%s attached to iSeries vlan %d (LPAR map = 0x%.4X)\n,
dev-name, vlan, port-lpar_map);
 
@@ -1486,6 +1551,8 @@ static int veth_remove(struct vio_dev *v
}
 
veth_dev[vdev-unit_address] = NULL;
+   kobject_del(port-kobject);
+   kobject_put(port-kobject);
unregister_netdev(dev);
free_netdev(dev);
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Be consistent about driver name, increment version

2005-09-02 Thread Linux Kernel Mailing List
tree 75fdfcc259b9a62796766219df10799cd9ad342d
parent 59f17aebabef709a32a8fc09b4cd3507f32dea01
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:29 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:43:42 -0400

[PATCH] iseries_veth: Be consistent about driver name, increment version

The iseries_veth driver tells sysfs that it's called 'iseries_veth', but if
you ask it via ethtool it thinks it's called 'veth'. I think this comes from
2.4 when the driver was called 'veth', but it's definitely called
'iseries_veth' now, so fix it.

To make sure we don't do it again define DRV_NAME and use it everywhere.

While we're at it, change the version number to 2.0, to reflect the changes
made in this patch series.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |   16 ++--
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -125,6 +125,9 @@ struct veth_lpevent {
 
 };
 
+#define DRV_NAME   iseries_veth
+#define DRV_VERSION2.0
+
 #define VETH_NUMBUFFERS(120)
 #define VETH_ACKTIMEOUT(100) /* microseconds */
 #define VETH_MAX_MCAST (12)
@@ -227,14 +230,14 @@ static void veth_timed_reset(unsigned lo
  */
 
 #define veth_info(fmt, args...) \
-   printk(KERN_INFO iseries_veth:  fmt, ## args)
+   printk(KERN_INFO DRV_NAME :  fmt, ## args)
 
 #define veth_error(fmt, args...) \
-   printk(KERN_ERR iseries_veth: Error:  fmt, ## args)
+   printk(KERN_ERR DRV_NAME : Error:  fmt, ## args)
 
 #ifdef DEBUG
 #define veth_debug(fmt, args...) \
-   printk(KERN_DEBUG iseries_veth:  fmt, ## args)
+   printk(KERN_DEBUG DRV_NAME :  fmt, ## args)
 #else
 #define veth_debug(fmt, args...) do {} while (0)
 #endif
@@ -997,9 +1000,10 @@ static void veth_set_multicast_list(stru
 
 static void veth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo 
*info)
 {
-   strncpy(info-driver, veth, sizeof(info-driver) - 1);
+   strncpy(info-driver, DRV_NAME, sizeof(info-driver) - 1);
info-driver[sizeof(info-driver) - 1] = '\0';
-   strncpy(info-version, 1.0, sizeof(info-version) - 1);
+   strncpy(info-version, DRV_VERSION, sizeof(info-version) - 1);
+   info-version[sizeof(info-version) - 1] = '\0';
 }
 
 static int veth_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
@@ -1642,7 +1646,7 @@ static struct vio_device_id veth_device_
 MODULE_DEVICE_TABLE(vio, veth_device_table);
 
 static struct vio_driver veth_driver = {
-   .name = iseries_veth,
+   .name = DRV_NAME,
.id_table = veth_device_table,
.probe = veth_probe,
.remove = veth_remove
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] iseries_veth: Simplify full-queue handling

2005-09-02 Thread Linux Kernel Mailing List
tree e2d90bb9d07454266ebc9fe36901aa97305c15e0
parent 24562ffa8bdf3a111278a8b93ab92837b9ec9113
author Michael Ellerman [EMAIL PROTECTED] Thu, 01 Sep 2005 11:29:18 +1000
committer Jeff Garzik [EMAIL PROTECTED] Thu, 01 Sep 2005 06:42:45 -0400

[PATCH] iseries_veth: Simplify full-queue handling

The iseries_veth driver often has multiple netdevices sending packets over
a single connection to another LPAR. If the bandwidth to the other LPAR is
exceeded, all the netdevices must have their queues stopped.

The current code achieves this by queueing one incoming skb on the
per-netdevice port structure. When the connection is able to send more packets
we iterate through the port structs and flush any packet that is queued,
as well as restarting the associated netdevice's queue.

This arrangement makes less sense now that we have per-connection TX timers,
rather than the per-netdevice generic TX timer.

The new code simply detects when one of the connections is full, and stops
the queue of all associated netdevices. Then when a packet is acked on that
connection (ie. there is space again) all the queues are woken up.

Signed-off-by: Michael Ellerman [EMAIL PROTECTED]
Signed-off-by: Jeff Garzik [EMAIL PROTECTED]

 drivers/net/iseries_veth.c |  108 ++---
 1 files changed, 64 insertions(+), 44 deletions(-)

diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -158,10 +158,11 @@ struct veth_port {
u64 mac_addr;
HvLpIndexMap lpar_map;
 
-   spinlock_t pending_gate;
-   struct sk_buff *pending_skb;
-   HvLpIndexMap pending_lpmask;
+   /* queue_lock protects the stopped_map and dev's queue. */
+   spinlock_t queue_lock;
+   HvLpIndexMap stopped_map;
 
+   /* mcast_gate protects promiscuous, num_mcast  mcast_addr. */
rwlock_t mcast_gate;
int promiscuous;
int num_mcast;
@@ -174,7 +175,8 @@ static struct net_device *veth_dev[HVMAX
 
 static int veth_start_xmit(struct sk_buff *skb, struct net_device *dev);
 static void veth_recycle_msg(struct veth_lpar_connection *, struct veth_msg *);
-static void veth_flush_pending(struct veth_lpar_connection *cnx);
+static void veth_wake_queues(struct veth_lpar_connection *cnx);
+static void veth_stop_queues(struct veth_lpar_connection *cnx);
 static void veth_receive(struct veth_lpar_connection *, struct VethLpEvent *);
 static void veth_release_connection(struct kobject *kobject);
 static void veth_timed_ack(unsigned long ptr);
@@ -221,6 +223,12 @@ static inline struct veth_msg *veth_stac
return msg;
 }
 
+/* You must hold the connection's lock when you call this function. */
+static inline int veth_stack_is_empty(struct veth_lpar_connection *cnx)
+{
+   return cnx-msg_stack_head == NULL;
+}
+
 static inline HvLpEvent_Rc
 veth_signalevent(struct veth_lpar_connection *cnx, u16 subtype,
 HvLpEvent_AckInd ackind, HvLpEvent_AckType acktype,
@@ -391,12 +399,12 @@ static void veth_handle_int(struct VethL
}
}
 
-   if (acked  0)
+   if (acked  0) {
cnx-last_contact = jiffies;
+   veth_wake_queues(cnx);
+   }
 
spin_unlock_irqrestore(cnx-lock, flags);
-
-   veth_flush_pending(cnx);
break;
case VethEventTypeFrames:
veth_receive(cnx, event);
@@ -492,7 +500,9 @@ static void veth_statemachine(void *p)
for (i = 0; i  VETH_NUMBUFFERS; ++i)
veth_recycle_msg(cnx, cnx-msgs + i);
}
+
cnx-outstanding_tx = 0;
+   veth_wake_queues(cnx);
 
/* Drop the lock so we can do stuff that might sleep or
 * take other locks. */
@@ -501,8 +511,6 @@ static void veth_statemachine(void *p)
del_timer_sync(cnx-ack_timer);
del_timer_sync(cnx-reset_timer);
 
-   veth_flush_pending(cnx);
-
spin_lock_irq(cnx-lock);
 
if (cnx-state  VETH_STATE_RESET)
@@ -869,8 +877,9 @@ static struct net_device * __init veth_p
 
port = (struct veth_port *) dev-priv;
 
-   spin_lock_init(port-pending_gate);
+   spin_lock_init(port-queue_lock);
rwlock_init(port-mcast_gate);
+   port-stopped_map = 0;
 
for (i = 0; i  HVMAXARCHITECTEDLPS; i++) {
HvLpVirtualLanIndexMap map;
@@ -980,6 +989,9 @@ static int veth_transmit_to_one(struct s
cnx-last_contact = jiffies;
cnx-outstanding_tx++;
 
+   if (veth_stack_is_empty(cnx))
+   veth_stop_queues(cnx);
+
spin_unlock_irqrestore(cnx-lock, flags);
return 0;
 
@@ -1023,7 +1035,6 @@ static int veth_start_xmit(struct sk_buf
 {
unsigned char *frame = skb-data;
struct veth_port *port = (struct 

[IA64] Rationalise Region Definitions

2005-09-02 Thread Linux Kernel Mailing List
tree 9f5b0288c3101344acd22f7e901fe909a8f98df6
parent 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf
author Peter Chubb [EMAIL PROTECTED] Wed, 17 Aug 2005 09:54:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 05:35:41 -0700

[IA64] Rationalise Region Definitions

Currently, region numbers are defined in several files, with several 
names.  For example, we have REGION_KERNEL in asm/page.h and 
RGN_KERNEL in pgtable.h 
 
We also have address definitions that should depend on the 
RGN_XXX macros, but are currently just long constants. 
 
The following patch reorganises all the definitions so that they have 
the same form (RGN_XXX), are in one place, and that addresses that 
depend on RGN_XXX are derived from them. 

(This is a necessary but not sufficient patch to allow UML-like 
operation on IA64). 

Thanks to David Mosberger for catching the change I missed in mmu_context.h.
 
Signed-off-by: Peter Chubb [EMAIL PROTECTED] 
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/kernel/sys_ia64.c|2 +-
 arch/ia64/mm/hugetlbpage.c |8 
 include/asm-ia64/io.h  |2 +-
 include/asm-ia64/mmu_context.h |7 ++-
 include/asm-ia64/page.h|   27 ++-
 include/asm-ia64/pgtable.h |   13 +
 include/asm-ia64/system.h  |5 +++--
 7 files changed, 38 insertions(+), 26 deletions(-)

diff --git a/arch/ia64/kernel/sys_ia64.c b/arch/ia64/kernel/sys_ia64.c
--- a/arch/ia64/kernel/sys_ia64.c
+++ b/arch/ia64/kernel/sys_ia64.c
@@ -35,7 +35,7 @@ arch_get_unmapped_area (struct file *fil
return -ENOMEM;
 
 #ifdef CONFIG_HUGETLB_PAGE
-   if (REGION_NUMBER(addr) == REGION_HPAGE)
+   if (REGION_NUMBER(addr) == RGN_HPAGE)
addr = 0;
 #endif
if (!addr)
diff --git a/arch/ia64/mm/hugetlbpage.c b/arch/ia64/mm/hugetlbpage.c
--- a/arch/ia64/mm/hugetlbpage.c
+++ b/arch/ia64/mm/hugetlbpage.c
@@ -76,7 +76,7 @@ int is_aligned_hugepage_range(unsigned l
return -EINVAL;
if (addr  ~HPAGE_MASK)
return -EINVAL;
-   if (REGION_NUMBER(addr) != REGION_HPAGE)
+   if (REGION_NUMBER(addr) != RGN_HPAGE)
return -EINVAL;
 
return 0;
@@ -87,7 +87,7 @@ struct page *follow_huge_addr(struct mm_
struct page *page;
pte_t *ptep;
 
-   if (REGION_NUMBER(addr) != REGION_HPAGE)
+   if (REGION_NUMBER(addr) != RGN_HPAGE)
return ERR_PTR(-EINVAL);
 
ptep = huge_pte_offset(mm, addr);
@@ -142,8 +142,8 @@ unsigned long hugetlb_get_unmapped_area(
return -ENOMEM;
if (len  ~HPAGE_MASK)
return -EINVAL;
-   /* This code assumes that REGION_HPAGE != 0. */
-   if ((REGION_NUMBER(addr) != REGION_HPAGE) || (addr  (HPAGE_SIZE - 1)))
+   /* This code assumes that RGN_HPAGE != 0. */
+   if ((REGION_NUMBER(addr) != RGN_HPAGE) || (addr  (HPAGE_SIZE - 1)))
addr = HPAGE_REGION_BASE;
else
addr = ALIGN(addr, HPAGE_SIZE);
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -23,7 +23,7 @@
 #define __SLOW_DOWN_IO do { } while (0)
 #define SLOW_DOWN_IO   do { } while (0)
 
-#define __IA64_UNCACHED_OFFSET 0xc000UL/* region 6 */
+#define __IA64_UNCACHED_OFFSET RGN_BASE(RGN_UNCACHED)
 
 /*
  * The legacy I/O space defined by the ia64 architecture supports only 65536 
ports, but
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h
--- a/include/asm-ia64/mmu_context.h
+++ b/include/asm-ia64/mmu_context.h
@@ -19,6 +19,7 @@
 
 #define ia64_rid(ctx,addr) (((ctx)  3) | (addr  61))
 
+# include asm/page.h
 # ifndef __ASSEMBLY__
 
 #include linux/compiler.h
@@ -110,7 +111,7 @@ reload_context (mm_context_t context)
unsigned long rid_incr = 0;
unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
 
-   old_rr4 = ia64_get_rr(0x8000UL);
+   old_rr4 = ia64_get_rr(RGN_BASE(RGN_HPAGE));
rid = context  3; /* make space for encoding the region number */
rid_incr = 1  8;
 
@@ -122,6 +123,10 @@ reload_context (mm_context_t context)
rr4 = rr0 + 4*rid_incr;
 #ifdef  CONFIG_HUGETLB_PAGE
rr4 = (rr4  (~(0xfcUL))) | (old_rr4  0xfc);
+
+#  if RGN_HPAGE != 4
+#error reload_context assumes RGN_HPAGE is 4
+#  endif
 #endif
 
ia64_set_rr(0xUL, rr0);
diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -13,6 +13,19 @@
 #include asm/types.h
 
 /*
+ * The top three bits of an IA64 address are its Region Number.
+ * Different regions are assigned to different purposes.
+ */
+#define RGN_SHIFT  (61)
+#define RGN_BASE(r)  (__IA64_UL_CONST(r)RGN_SHIFT)
+
+#define KHIGH -1   /* high three bits of Kernel virtual address */
+#define RGN_KERNEL 7   /* Identity mapped region */
+#define RGN_UNCACHED

[IA64-SGI] altix: cosmetic rename of SGI_PCIBR_ERROR

2005-09-02 Thread Linux Kernel Mailing List
tree b1bbba93f06088b2f1e35bafced3d3bcff69f995
parent 674c6479b7bdc78528ea83dd43897e3161558b8b
author Mark Maule [EMAIL PROTECTED] Thu, 04 Aug 2005 04:06:00 -0700
committer Tony Luck [EMAIL PROTECTED] Fri, 12 Aug 2005 05:36:00 -0700

[IA64-SGI] altix: cosmetic rename of SGI_PCIBR_ERROR

Cosmetic altix patch to rename SGI_PCIBR_ERROR to something more generic and
remove a duplicate #define.

Signed-off-by: Mark Maule [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/pci/pcibr/pcibr_provider.c |2 +-
 include/asm-ia64/sn/intr.h  |3 +--
 2 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -115,7 +115,7 @@ pcibr_bus_fixup(struct pcibus_bussoft *p
/*
 * register the bridge's error interrupt handler
 */
-   if (request_irq(SGI_PCIBR_ERROR, (void *)pcibr_error_intr_handler,
+   if (request_irq(SGI_PCIASIC_ERROR, (void *)pcibr_error_intr_handler,
SA_SHIRQ, PCIBR error, (void *)(soft))) {
printk(KERN_WARNING
   pcibr cannot allocate interrupt for error handler\n);
diff --git a/include/asm-ia64/sn/intr.h b/include/asm-ia64/sn/intr.h
--- a/include/asm-ia64/sn/intr.h
+++ b/include/asm-ia64/sn/intr.h
@@ -12,13 +12,12 @@
 #include linux/rcupdate.h
 
 #define SGI_UART_VECTOR(0xe9)
-#define SGI_PCIBR_ERROR(0x33)
 
 /* Reserved IRQs : Note, not to exceed IA64_SN2_FIRST_DEVICE_VECTOR */
 #define SGI_XPC_ACTIVATE(0x30)
 #define SGI_II_ERROR(0x31)
 #define SGI_XBOW_ERROR  (0x32)
-#define SGI_PCIBR_ERROR (0x33)
+#define SGI_PCIASIC_ERROR   (0x33)
 #define SGI_ACPI_SCI_INT(0x34)
 #define SGI_TIOCA_ERROR (0x35)
 #define SGI_TIO_ERROR   (0x36)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] abstract force_interrupt() mechanism

2005-09-02 Thread Linux Kernel Mailing List
tree eedca515f820a1310937a629d8f95fc0833235e9
parent 89963d16dc50a5d91ed09914a1232d59e6461fd6
author Mark Maule [EMAIL PROTECTED] Thu, 04 Aug 2005 04:06:00 -0700
committer Tony Luck [EMAIL PROTECTED] Fri, 12 Aug 2005 05:36:39 -0700

[IA64-SGI] abstract force_interrupt() mechanism

Altix patch to abstract the force_interrupt() mechanism away from the
pcibr provider.

Signed-off-by: Mark Maule [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/irq.c  |   50 -
 arch/ia64/sn/pci/pcibr/pcibr_provider.c|4 ++
 arch/ia64/sn/pci/tioca_provider.c  |1 
 include/asm-ia64/sn/pcibus_provider_defs.h |1 
 include/asm-ia64/sn/pda.h  |1 
 5 files changed, 34 insertions(+), 23 deletions(-)

diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -317,6 +317,16 @@ void sn_irq_unfixup(struct pci_dev *pci_
pci_dev_put(pci_dev);
 }
 
+static inline void
+sn_call_force_intr_provider(struct sn_irq_info *sn_irq_info)
+{
+   struct sn_pcibus_provider *pci_provider;
+
+   pci_provider = sn_pci_provider[sn_irq_info-irq_bridge_type];
+   if (pci_provider  pci_provider-force_interrupt)
+   (*pci_provider-force_interrupt)(sn_irq_info);
+}
+
 static void force_interrupt(int irq)
 {
struct sn_irq_info *sn_irq_info;
@@ -325,11 +335,9 @@ static void force_interrupt(int irq)
return;
 
rcu_read_lock();
-   list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list) {
-   if (IS_PCI_BRIDGE_ASIC(sn_irq_info-irq_bridge_type) 
-   (sn_irq_info-irq_bridge != NULL))
-   pcibr_force_interrupt(sn_irq_info);
-   }
+   list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[irq], list)
+   sn_call_force_intr_provider(sn_irq_info);
+
rcu_read_unlock();
 }
 
@@ -351,6 +359,14 @@ static void sn_check_intr(int irq, struc
struct pcidev_info *pcidev_info;
struct pcibus_info *pcibus_info;
 
+   /*
+* Bridge types attached to TIO (anything but PIC) do not need this WAR
+* since they do not target Shub II interrupt registers.  If that
+* ever changes, this check needs to accomodate.
+*/
+   if (sn_irq_info-irq_bridge_type != PCIIO_ASIC_TYPE_PIC)
+   return;
+
pcidev_info = (struct pcidev_info *)sn_irq_info-irq_pciioinfo;
if (!pcidev_info)
return;
@@ -377,16 +393,12 @@ static void sn_check_intr(int irq, struc
break;
}
if (!test_bit(irr_bit, irr_reg)) {
-   if (!test_bit(irq, pda-sn_soft_irr)) {
-   if (!test_bit(irq, pda-sn_in_service_ivecs)) {
-   regval = 0xff;
-   if (sn_irq_info-irq_int_bit  regval 
-   sn_irq_info-irq_last_intr) {
-   regval =
-   ~(sn_irq_info-
- irq_int_bit  regval);
-   pcibr_force_interrupt(sn_irq_info);
-   }
+   if (!test_bit(irq, pda-sn_in_service_ivecs)) {
+   regval = 0xff;
+   if (sn_irq_info-irq_int_bit  regval 
+   sn_irq_info-irq_last_intr) {
+   regval = ~(sn_irq_info-irq_int_bit  regval);
+   sn_call_force_intr_provider(sn_irq_info);
}
}
}
@@ -404,13 +416,7 @@ void sn_lb_int_war_check(void)
rcu_read_lock();
for (i = pda-sn_first_irq; i = pda-sn_last_irq; i++) {
list_for_each_entry_rcu(sn_irq_info, sn_irq_lh[i], list) {
-   /*
-* Only call for PCI bridges that are fully
-* initialized.
-*/
-   if (IS_PCI_BRIDGE_ASIC(sn_irq_info-irq_bridge_type) 
-   (sn_irq_info-irq_bridge != NULL))
-   sn_check_intr(i, sn_irq_info);
+   sn_check_intr(i, sn_irq_info);
}
}
rcu_read_unlock();
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -178,6 +178,9 @@ void pcibr_force_interrupt(struct sn_irq
struct pcibus_info *pcibus_info;
int bit = sn_irq_info-irq_int_bit;
 
+   if (! sn_irq_info-irq_bridge)
+   return;
+
pcidev_info = (struct pcidev_info *)sn_irq_info-irq_pciioinfo;
if (pcidev_info) {
pcibus_info =
@@ -222,6 +225,7 @@ struct sn_pcibus_provider pcibr_provider

[IA64] clean up sn2 region definitions

2005-09-02 Thread Linux Kernel Mailing List
tree 138e13ac97b8af1f52f7fa798bc8f29851b9e176
parent 0a41e2501160587eb8f66cef3bdf1c6f2cb86997
author Greg Edwards [EMAIL PROTECTED] Mon, 22 Aug 2005 23:57:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 05:37:26 -0700

[IA64] clean up sn2 region definitions

Clean up some duplicate region definitions in sn2 code.

Signed-off-by: Greg Edwards [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/page.h |4 ++--
 include/asm-ia64/sn/addrs.h |   33 -
 2 files changed, 14 insertions(+), 23 deletions(-)

diff --git a/include/asm-ia64/page.h b/include/asm-ia64/page.h
--- a/include/asm-ia64/page.h
+++ b/include/asm-ia64/page.h
@@ -17,9 +17,9 @@
  * Different regions are assigned to different purposes.
  */
 #define RGN_SHIFT  (61)
-#define RGN_BASE(r)  (__IA64_UL_CONST(r)RGN_SHIFT)
+#define RGN_BASE(r)(__IA64_UL_CONST(r)RGN_SHIFT)
+#define RGN_BITS   (RGN_BASE(-1))
 
-#define KHIGH -1   /* high three bits of Kernel virtual address */
 #define RGN_KERNEL 7   /* Identity mapped region */
 #define RGN_UNCACHED6  /* Identity mapped I/O region */
 #define RGN_GATE   5   /* Gate page, Kernel text, etc */
diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -65,7 +65,6 @@
 
 #define NASID_MASK  ((u64)NASID_BITMASK  NASID_SHIFT)
 #define AS_MASK((u64)AS_BITMASK  AS_SHIFT)
-#define REGION_BITS0xe000UL
 
 
 /*
@@ -79,38 +78,30 @@
 #define AS_CAC_SPACE   (AS_CAC_VAL  AS_SHIFT)
 
 
-/*
- * Base addresses for various address ranges.
- */
-#define CACHED 0xe000UL
-#define UNCACHED0xc000UL
-#define UNCACHED_PHYS   0x8000UL
-
-
 /* 
  * Virtual Mode Local  Global MMR space.  
  */
 #define SH1_LOCAL_MMR_OFFSET   0x80UL
 #define SH2_LOCAL_MMR_OFFSET   0x02UL
 #define LOCAL_MMR_OFFSET   (is_shub2() ? SH2_LOCAL_MMR_OFFSET : 
SH1_LOCAL_MMR_OFFSET)
-#define LOCAL_MMR_SPACE(UNCACHED | LOCAL_MMR_OFFSET)
-#define LOCAL_PHYS_MMR_SPACE   (UNCACHED_PHYS | LOCAL_MMR_OFFSET)
+#define LOCAL_MMR_SPACE(__IA64_UNCACHED_OFFSET | 
LOCAL_MMR_OFFSET)
+#define LOCAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | LOCAL_MMR_OFFSET)
 
 #define SH1_GLOBAL_MMR_OFFSET  0x08UL
 #define SH2_GLOBAL_MMR_OFFSET  0x03UL
 #define GLOBAL_MMR_OFFSET  (is_shub2() ? SH2_GLOBAL_MMR_OFFSET : 
SH1_GLOBAL_MMR_OFFSET)
-#define GLOBAL_MMR_SPACE   (UNCACHED | GLOBAL_MMR_OFFSET)
+#define GLOBAL_MMR_SPACE   (__IA64_UNCACHED_OFFSET | GLOBAL_MMR_OFFSET)
 
 /*
  * Physical mode addresses
  */
-#define GLOBAL_PHYS_MMR_SPACE  (UNCACHED_PHYS | GLOBAL_MMR_OFFSET)
+#define GLOBAL_PHYS_MMR_SPACE  (RGN_BASE(RGN_HPAGE) | GLOBAL_MMR_OFFSET)
 
 
 /*
  * Clear region  AS bits.
  */
-#define TO_PHYS_MASK   (~(REGION_BITS | AS_MASK))
+#define TO_PHYS_MASK   (~(RGN_BITS | AS_MASK))
 
 
 /*
@@ -134,10 +125,10 @@
 /*
  * general address defines
  */
-#define CAC_BASE   (CACHED   | AS_CAC_SPACE)
-#define AMO_BASE   (UNCACHED | AS_AMO_SPACE)
-#define AMO_PHYS_BASE  (UNCACHED_PHYS | AS_AMO_SPACE)
-#define GET_BASE   (CACHED   | AS_GET_SPACE)
+#define CAC_BASE   (PAGE_OFFSET | AS_CAC_SPACE)
+#define AMO_BASE   (__IA64_UNCACHED_OFFSET | AS_AMO_SPACE)
+#define AMO_PHYS_BASE  (RGN_BASE(RGN_HPAGE) | AS_AMO_SPACE)
+#define GET_BASE   (PAGE_OFFSET | AS_GET_SPACE)
 
 /*
  * Convert Memory addresses between various addressing modes.
@@ -164,8 +155,8 @@
 /*
  * Macros to test for address type.
  */
-#define IS_AMO_ADDRESS(x)  (((u64)(x)  (REGION_BITS | AS_MASK)) == 
AMO_BASE)
-#define IS_AMO_PHYS_ADDRESS(x) (((u64)(x)  (REGION_BITS | AS_MASK)) == 
AMO_PHYS_BASE)
+#define IS_AMO_ADDRESS(x)  (((u64)(x)  (RGN_BITS | AS_MASK)) == AMO_BASE)
+#define IS_AMO_PHYS_ADDRESS(x) (((u64)(x)  (RGN_BITS | AS_MASK)) == 
AMO_PHYS_BASE)
 
 
 /*
@@ -180,7 +171,7 @@
 #define TIO_SWIN_BASE(n, w)(TIO_IO_BASE(n) + \
((u64) (w)  TIO_SWIN_SIZE_BITS))
 #define NODE_IO_BASE(n)(GLOBAL_MMR_SPACE | 
NASID_SPACE(n))
-#define TIO_IO_BASE(n)  (UNCACHED | NASID_SPACE(n))
+#define TIO_IO_BASE(n)  (__IA64_UNCACHED_OFFSET | 
NASID_SPACE(n))
 #define BWIN_SIZE  (1UL  BWIN_SIZE_BITS)
 #define NODE_BWIN_BASE0(n) (NODE_IO_BASE(n) + BWIN_SIZE)
 #define NODE_BWIN_BASE(n, w)   (NODE_BWIN_BASE0(n) + ((u64) (w)  
BWIN_SIZE_BITS))
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] add support for TIO huge-window

2005-09-02 Thread Linux Kernel Mailing List
tree 538fb3307b1f16928dde68c6f6ff5565be3a2efb
parent 735e60f4c67823a3e01655c990296e2e56574885
author Mark Maule [EMAIL PROTECTED] Thu, 04 Aug 2005 04:06:00 -0700
committer Tony Luck [EMAIL PROTECTED] Fri, 12 Aug 2005 05:37:13 -0700

[IA64-SGI] add support for TIO huge-window

Altix patch to add TIO huge-window address support to sn_dma_flush().

Update copyright in affected files.

Signed-off-by: Mark Maule [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/include/tio.h  |6 +++
 arch/ia64/sn/include/xtalk/hubdev.h |5 ++-
 arch/ia64/sn/pci/pcibr/pcibr_dma.c  |   55 +---
 include/asm-ia64/sn/addrs.h |5 +--
 4 files changed, 45 insertions(+), 26 deletions(-)

diff --git a/arch/ia64/sn/include/tio.h b/arch/ia64/sn/include/tio.h
--- a/arch/ia64/sn/include/tio.h
+++ b/arch/ia64/sn/include/tio.h
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  */
 
 #ifndef _ASM_IA64_SN_TIO_H
@@ -26,6 +26,10 @@
 #define TIO_ITTE_VALID_MASK0x1
 #define TIO_ITTE_VALID_SHIFT   16
 
+#define TIO_ITTE_WIDGET(itte) \
+   (((itte)  TIO_ITTE_WIDGET_SHIFT)  TIO_ITTE_WIDGET_MASK)
+#define TIO_ITTE_VALID(itte) \
+   (((itte)  TIO_ITTE_VALID_SHIFT)  TIO_ITTE_VALID_MASK)
 
 #define TIO_ITTE_PUT(nasid, bigwin, widget, addr, valid) \
 REMOTE_HUB_S((nasid), TIO_ITTE(bigwin), \
diff --git a/arch/ia64/sn/include/xtalk/hubdev.h 
b/arch/ia64/sn/include/xtalk/hubdev.h
--- a/arch/ia64/sn/include/xtalk/hubdev.h
+++ b/arch/ia64/sn/include/xtalk/hubdev.h
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights 
reserved.
+ * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights 
reserved.
  */
 #ifndef _ASM_IA64_SN_XTALK_HUBDEV_H
 #define _ASM_IA64_SN_XTALK_HUBDEV_H
@@ -16,6 +16,9 @@
 #define IIO_ITTE_WIDGET_MASK((1IIO_ITTE_WIDGET_BITS)-1)
 #define IIO_ITTE_WIDGET_SHIFT   8
 
+#define IIO_ITTE_WIDGET(itte)  \
+   (((itte)  IIO_ITTE_WIDGET_SHIFT)  IIO_ITTE_WIDGET_MASK)
+
 /*
  * Use the top big window as a surrogate for the first small window
  */
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c 
b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2001-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2001-2005 Silicon Graphics, Inc. All rights reserved.
  */
 
 #include linux/types.h
@@ -215,8 +215,8 @@ void sn_dma_flush(uint64_t addr)
int is_tio;
int wid_num;
int i, j;
-   int bwin;
uint64_t flags;
+   uint64_t itte;
struct hubdev_info *hubinfo;
volatile struct sn_flush_device_list *p;
struct sn_flush_nasid_entry *flush_nasid_list;
@@ -233,31 +233,36 @@ void sn_dma_flush(uint64_t addr)
if (!hubinfo) {
BUG();
}
-   is_tio = (nasid  1);
-   if (is_tio) {
-   wid_num = TIO_SWIN_WIDGETNUM(addr);
-   bwin = TIO_BWIN_WINDOWNUM(addr);
-   } else {
-   wid_num = SWIN_WIDGETNUM(addr);
-   bwin = BWIN_WINDOWNUM(addr);
-   }
 
flush_nasid_list = hubinfo-hdi_flush_nasid_list;
if (flush_nasid_list-widget_p == NULL)
return;
-   if (bwin  0) {
-   uint64_t itte = flush_nasid_list-iio_itte[bwin];
 
-   if (is_tio) {
-   wid_num = (itte  TIO_ITTE_WIDGET_SHIFT) 
-   TIO_ITTE_WIDGET_MASK;
-   } else {
-   wid_num = (itte  IIO_ITTE_WIDGET_SHIFT) 
-   IIO_ITTE_WIDGET_MASK;
-   }
+   is_tio = (nasid  1);
+   if (is_tio) {
+   int itte_index;
+
+   if (TIO_HWIN(addr))
+   itte_index = 0;
+   else if (TIO_BWIN_WINDOWNUM(addr))
+   itte_index = TIO_BWIN_WINDOWNUM(addr);
+   else
+   itte_index = -1;
+
+   if (itte_index = 0) {
+   itte = flush_nasid_list-iio_itte[itte_index];
+   if (! TIO_ITTE_VALID(itte))
+   return;
+   wid_num = TIO_ITTE_WIDGET(itte);
+   } else
+   wid_num = TIO_SWIN_WIDGETNUM(addr);
+   } else {
+   if (BWIN_WINDOWNUM(addr)) {
+   itte = flush_nasid_list-iio_itte[BWIN_WINDOWNUM(addr)];
+   wid_num = IIO_ITTE_WIDGET(itte);
+   } else
+   

[IA64-SGI] - New SN hardware support - addr_macros

2005-09-02 Thread Linux Kernel Mailing List
tree 709ed616ca4d62ab61a8127208901cc102ee54b2
parent c9221da9f2796f082642c3498edb2c8783ad4774
author Jack Steiner [EMAIL PROTECTED] Fri, 12 Aug 2005 00:25:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 18 Aug 2005 05:29:11 -0700

[IA64-SGI] - New SN hardware support - addr_macros

Update the SN address macros so that they work on both shub1 
and shub2. Most of the code to support shub2 was added last year
but this patch fixes a few bugs and adds macros to help generate
both processor-specific physical addresses  numalink physical
addresses. More cleanup  optimization will be done later.


Signed-off-by: Jack Steiner [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/sn/addrs.h |   74 +---
 1 files changed, 56 insertions(+), 18 deletions(-)

diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -126,6 +126,7 @@
 #define GLOBAL_MMR_PHYS_ADDR(n,a) (GLOBAL_PHYS_MMR_SPACE | REMOTE_ADDR(n,a))
 #define GLOBAL_CAC_ADDR(n,a)   (CAC_BASE | REMOTE_ADDR(n,a))
 #define CHANGE_NASID(n,x)  ((void *)(((u64)(x)  ~NASID_MASK) | 
NASID_SPACE(n)))
+#define IS_TIO_NASID(n)((n)  1)
 
 
 /* non-II mmr's start at top of big window space (4G) */
@@ -155,10 +156,28 @@
  *   the chiplet id is zero.  If we implement TIO-TIO dma, we might 
need
  *   to insert a chiplet id into this macro.  However, it is our belief
  *   right now that this chiplet id will be ICE, which is also zero.
- *   Nasid starts on bit 40.
  */
-#define PHYS_TO_TIODMA(x)  ( (((u64)(NASID_GET(x)))  40) | 
NODE_OFFSET(x))
-#define PHYS_TO_DMA(x)  ( (((u64)(x)  NASID_MASK)  2) | 
NODE_OFFSET(x))
+#define SH1_TIO_PHYS_TO_DMA(x) 
\
+   u64)(NASID_GET(x)))  40) | NODE_OFFSET(x))
+
+#define SH2_NETWORK_BANK_OFFSET(x) \
+((u64)(x)  ((1UL  (sn_hub_info-nasid_shift - 4)) -1))
+
+#define SH2_NETWORK_BANK_SELECT(x) \
+u64)(x)  (0x3UL  (sn_hub_info-nasid_shift - 4)))   \
+(sn_hub_info-nasid_shift - 4))  36)
+
+#define SH2_NETWORK_ADDRESS(x) 
\
+   (SH2_NETWORK_BANK_OFFSET(x) | SH2_NETWORK_BANK_SELECT(x))
+
+#define SH2_TIO_PHYS_TO_DMA(x) 
\
+(((u64)(NASID_GET(x))  40) | SH2_NETWORK_ADDRESS(x))
+
+#define PHYS_TO_TIODMA(x)  \
+   (is_shub1() ? SH1_TIO_PHYS_TO_DMA(x) : SH2_TIO_PHYS_TO_DMA(x))
+
+#define PHYS_TO_DMA(x) \
+   u64)(x)  NASID_MASK)  2) | NODE_OFFSET(x))
 
 
 /*
@@ -187,6 +206,7 @@
 #define RAW_NODE_SWIN_BASE(n, w)   (NODE_IO_BASE(n) + ((u64) (w)  
SWIN_SIZE_BITS))
 #define BWIN_WIDGET_MASK   0x7
 #define BWIN_WINDOWNUM(x)  (((x)  BWIN_SIZE_BITS)  
BWIN_WIDGET_MASK)
+#define SH1_IS_BIG_WINDOW_ADDR(x)  ((x)  BWIN_TOP)
 
 #define TIO_BWIN_WINDOW_SELECT_MASK0x7
 #define TIO_BWIN_WINDOWNUM(x)  (((x)  TIO_BWIN_SIZE_BITS)  
TIO_BWIN_WINDOW_SELECT_MASK)
@@ -217,10 +237,6 @@
 #define TIO_SWIN_WIDGETNUM(x)  (((x)   TIO_SWIN_SIZE_BITS)  
TIO_SWIN_WIDGET_MASK)
 
 
-#define TIO_IOSPACE_ADDR(n,x)  \
-   /* Move in the Chiplet ID for TIO Local Block MMR */\
-   (REMOTE_ADDR(n,x) | 1UL  (NASID_SHIFT - 2))
-
 /*
  * The following macros produce the correct base virtual address for
  * the hub registers. The REMOTE_HUB_* macro produce
@@ -235,18 +251,40 @@
  * Otherwise, the recommended approach is to use *_HUB_L() and *_HUB_S().
  * They're always safe.
  */
+/* Shub1 TIO  MMR addressing macros */
+#define SH1_TIO_IOSPACE_ADDR(n,x)  \
+   GLOBAL_MMR_ADDR(n,x)
+
+#define SH1_REMOTE_BWIN_MMR(n,x)   \
+   GLOBAL_MMR_ADDR(n,x)
+
+#define SH1_REMOTE_SWIN_MMR(n,x)   \
+   (NODE_SWIN_BASE(n,1) + 0x80UL + (x))
+
+#define SH1_REMOTE_MMR(n,x)\
+   (SH1_IS_BIG_WINDOW_ADDR(x) ? SH1_REMOTE_BWIN_MMR(n,x) : \
+   SH1_REMOTE_SWIN_MMR(n,x))
+
+/* Shub1 TIO  MMR addressing macros */
+#define SH2_TIO_IOSPACE_ADDR(n,x)  \
+   ((UNCACHED | REMOTE_ADDR(n,x) | 1UL  (NASID_SHIFT - 2)))
+
+#define SH2_REMOTE_MMR(n,x)\
+   GLOBAL_MMR_ADDR(n,x)
+
+
+/* TIO  MMR addressing macros that work on both shub1  shub2 */
+#define TIO_IOSPACE_ADDR(n,x)  \
+   ((u64 *)(is_shub1() ? SH1_TIO_IOSPACE_ADDR(n,x) :   \
+SH2_TIO_IOSPACE_ADDR(n,x)))
+
+#define 

[IA64-SGI] - New SN hardware support - use_alias_space

2005-09-02 Thread Linux Kernel Mailing List
tree 8d4e6cb59dac0bb17124f8ecac8dbfe450231b8e
parent 3d14487b2677cc44b5d1ef115d9d4301ec046591
author Jack Steiner [EMAIL PROTECTED] Fri, 12 Aug 2005 00:26:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 18 Aug 2005 05:29:43 -0700

[IA64-SGI] - New SN hardware support - use_alias_space

Use local SHUB alias space when referencing MMRs that are known
to be node local. There is a slight performance benefit  code 
simplification.

Signed-off-by: Jack Steiner [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/irq.c  |   19 +++
 arch/ia64/sn/pci/pcibr/pcibr_dma.c |2 +-
 2 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -5,7 +5,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
  */
 
 #include linux/irq.h
@@ -76,16 +76,14 @@ static void sn_enable_irq(unsigned int i
 
 static void sn_ack_irq(unsigned int irq)
 {
-   uint64_t event_occurred, mask = 0;
-   int nasid;
+   u64 event_occurred, mask = 0;
 
irq = irq  0xff;
-   nasid = get_nasid();
event_occurred =
-   HUB_L((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED));
+   HUB_L((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED));
mask = event_occurred  SH_ALL_INT_MASK;
-   HUB_S((uint64_t *) GLOBAL_MMR_ADDR(nasid, SH_EVENT_OCCURRED_ALIAS),
-mask);
+   HUB_S((u64*)LOCAL_MMR_ADDR(SH_EVENT_OCCURRED_ALIAS),
+ mask);
__set_bit(irq, (volatile void *)pda-sn_in_service_ivecs);
 
move_irq(irq);
@@ -93,15 +91,12 @@ static void sn_ack_irq(unsigned int irq)
 
 static void sn_end_irq(unsigned int irq)
 {
-   int nasid;
int ivec;
-   uint64_t event_occurred;
+   u64 event_occurred;
 
ivec = irq  0xff;
if (ivec == SGI_UART_VECTOR) {
-   nasid = get_nasid();
-   event_occurred = HUB_L((uint64_t *) GLOBAL_MMR_ADDR
-  (nasid, SH_EVENT_OCCURRED));
+   event_occurred = HUB_L((u64*)LOCAL_MMR_ADDR 
(SH_EVENT_OCCURRED));
/* If the UART bit is set here, we may have received an
 * interrupt from the UART that the driver missed.  To
 * make sure, we IPI ourselves to force us to look again.
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c 
b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -297,7 +297,7 @@ void sn_dma_flush(uint64_t addr)
 * If CE ever needs the sn_dma_flush mechanism, we will have
 * to account for that here and in tioce_bus_fixup().
 */
-   uint32_t tio_id = REMOTE_HUB_L(nasid, TIO_NODE_ID);
+   uint32_t tio_id = HUB_L(TIO_IOSPACE_ADDR(nasid, TIO_NODE_ID));
uint32_t revnum = XWIDGET_PART_REV_NUM(tio_id);
 
/* TIOCP BRINGUP WAR (PV907516): Don't write buffer flush reg */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] - New SN hardware support - no_wars

2005-09-02 Thread Linux Kernel Mailing List
tree 920faa4c274b19d789ad217a662e81c7b5f5453a
parent 2fdbb590e4f9b346e5d06cf7f85dcb7a9f2e0a48
author Jack Steiner [EMAIL PROTECTED] Fri, 12 Aug 2005 00:27:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 18 Aug 2005 05:30:44 -0700

[IA64-SGI] - New SN hardware support - no_wars

Disable some shub1-specific code when running on systems with shub2.

Signed-off-by: Jack Steiner [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/sn2/timer_interrupt.c |   22 --
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/arch/ia64/sn/kernel/sn2/timer_interrupt.c 
b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
--- a/arch/ia64/sn/kernel/sn2/timer_interrupt.c
+++ b/arch/ia64/sn/kernel/sn2/timer_interrupt.c
@@ -1,7 +1,7 @@
 /*
  *
  *
- * Copyright (c) 2003 Silicon Graphics, Inc.  All Rights Reserved.
+ * Copyright (c) 2005 Silicon Graphics, Inc.  All Rights Reserved.
  * 
  * This program is free software; you can redistribute it and/or modify it 
  * under the terms of version 2 of the GNU General Public License 
@@ -50,14 +50,16 @@ void sn_timer_interrupt(int irq, void *d
 LED_CPU_HEARTBEAT, LED_CPU_HEARTBEAT);
}
 
-   if (enable_shub_wars_1_1()) {
-   /* Bugfix code for SHUB 1.1 */
-   if (pda-pio_shub_war_cam_addr)
-   *pda-pio_shub_war_cam_addr = 0x8010UL;
+   if (is_shub1()) {
+   if (enable_shub_wars_1_1()) {
+   /* Bugfix code for SHUB 1.1 */
+   if (pda-pio_shub_war_cam_addr)
+   *pda-pio_shub_war_cam_addr = 
0x8010UL;
+   }
+   if (pda-sn_lb_int_war_ticks == 0)
+   sn_lb_int_war_check();
+   pda-sn_lb_int_war_ticks++;
+   if (pda-sn_lb_int_war_ticks = SN_LB_INT_WAR_INTERVAL)
+   pda-sn_lb_int_war_ticks = 0;
}
-   if (pda-sn_lb_int_war_ticks == 0)
-   sn_lb_int_war_check();
-   pda-sn_lb_int_war_ticks++;
-   if (pda-sn_lb_int_war_ticks = SN_LB_INT_WAR_INTERVAL)
-   pda-sn_lb_int_war_ticks = 0;
 }
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] - New SN hardware support - boot_init_shub2

2005-09-02 Thread Linux Kernel Mailing List
tree f02bdaba4ccf801ad31c4981a97098f376fec0f2
parent 0aa2c72e59cf1d09a0b321e4e6292af78a51b8b3
author Jack Steiner [EMAIL PROTECTED] Fri, 12 Aug 2005 00:26:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 18 Aug 2005 05:30:14 -0700

[IA64-SGI] - New SN hardware support - boot_init_shub2

Update the addresses of the pio_write_status_addr so that
they are correct for newer processors. Shub2 did not number
the threads in the order that I had expected.

Signed-off-by: Jack Steiner [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/setup.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -532,8 +532,8 @@ void __init sn_cpu_init(void)
 */
{
u64 pio1[] = {SH1_PIO_WRITE_STATUS_0, 0, 
SH1_PIO_WRITE_STATUS_1, 0};
-   u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_1,
-   SH2_PIO_WRITE_STATUS_2, SH2_PIO_WRITE_STATUS_3};
+   u64 pio2[] = {SH2_PIO_WRITE_STATUS_0, SH2_PIO_WRITE_STATUS_2,
+   SH2_PIO_WRITE_STATUS_1, SH2_PIO_WRITE_STATUS_3};
u64 *pio;
pio = is_shub1() ? pio1 : pio2;
pda-pio_write_status_addr = (volatile unsigned long *) 
LOCAL_MMR_ADDR(pio[slice]);
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] - New SN hardware support - ptc_fixes

2005-09-02 Thread Linux Kernel Mailing List
tree eb9e2b0b971bbe287dd4bef0b46c7307e3258bf0
parent 68b9753f47953930cb94de0223c163f289399091
author Jack Steiner [EMAIL PROTECTED] Fri, 12 Aug 2005 00:28:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 18 Aug 2005 05:32:24 -0700

[IA64-SGI] - New SN hardware support - ptc_fixes

Shub2 provides a much improved mechanism for issuing internode
TLB purges. Add code to support the newer mechanism. There is also 
some debug code (disabled) that is useful for testing.

Collect statistics on the number, type  duration of TLB purges.
This data will be useful for making future improvements in the algorithms.

Signed-off-by: Jack Steiner [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/setup.c|1 
 arch/ia64/sn/kernel/sn2/ptc_deadlock.S |   13 +
 arch/ia64/sn/kernel/sn2/sn2_smp.c  |  256 ++---
 include/asm-ia64/sn/nodepda.h  |3 
 4 files changed, 245 insertions(+), 28 deletions(-)

diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -403,6 +403,7 @@ static void __init sn_init_pdas(char **c
memset(nodepdaindr[cnode], 0, sizeof(nodepda_t));
memset(nodepdaindr[cnode]-phys_cpuid, -1,
sizeof(nodepdaindr[cnode]-phys_cpuid));
+   spin_lock_init(nodepdaindr[cnode]-ptc_lock);
}
 
/*
diff --git a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S 
b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
--- a/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
+++ b/arch/ia64/sn/kernel/sn2/ptc_deadlock.S
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  */
 
 #include asm/types.h
@@ -11,7 +11,7 @@
 
 #define DEADLOCKBITSH_PIO_WRITE_STATUS_WRITE_DEADLOCK_SHFT
 #define WRITECOUNTMASK SH_PIO_WRITE_STATUS_PENDING_WRITE_COUNT_MASK
-#define ALIAS_OFFSET   (SH1_PIO_WRITE_STATUS_0_ALIAS-SH1_PIO_WRITE_STATUS_0)
+#define ALIAS_OFFSET   8
 
 
.global sn2_ptc_deadlock_recovery_core
@@ -36,13 +36,15 @@ sn2_ptc_deadlock_recovery_core:
extr.u  piowcphy=piowc,0,61;;   // Convert piowc to uncached physical 
address
dep piowcphy=-1,piowcphy,63,1
movlmask=WRITECOUNTMASK
+   mov r8=r0
 
 1:
add scr2=ALIAS_OFFSET,piowc // Address of WRITE_STATUS alias 
register 
-   mov scr1=7;;// Clear DEADLOCK, WRITE_ERROR, 
MULTI_WRITE_ERROR
-   st8.rel [scr2]=scr1;;
+   ;;
+   ld8.acq scr1=[scr2];;
 
 5: ld8.acq scr1=[piowc];;  // Wait for PIOs to complete.
+   hint@pause
and scr2=scr1,mask;;// mask of writecount bits
cmp.ne  p6,p0=zeroval,scr2
 (p6)   br.cond.sptk 5b
@@ -57,6 +59,7 @@ sn2_ptc_deadlock_recovery_core:
st8.rel [ptc0]=data0// Write PTC0  wait for completion.
 
 5: ld8.acq scr1=[piowcphy];;   // Wait for PIOs to complete.
+   hint@pause
and scr2=scr1,mask;;// mask of writecount bits
cmp.ne  p6,p0=zeroval,scr2
 (p6)   br.cond.sptk 5b;;
@@ -67,6 +70,7 @@ sn2_ptc_deadlock_recovery_core:
 (p7)   st8.rel [ptc1]=data1;;  // Now write PTC1.
 
 5: ld8.acq scr1=[piowcphy];;   // Wait for PIOs to complete.
+   hint@pause
and scr2=scr1,mask;;// mask of writecount bits
cmp.ne  p6,p0=zeroval,scr2
 (p6)   br.cond.sptk 5b
@@ -77,6 +81,7 @@ sn2_ptc_deadlock_recovery_core:
srlz.i;;
// END   PHYSICAL MODE 
 
+(p8)   add r8=1,r8
 (p8)   br.cond.spnt 1b;;   // Repeat if DEADLOCK occurred.
 
br.ret.sptk rp
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c 
b/arch/ia64/sn/kernel/sn2/sn2_smp.c
--- a/arch/ia64/sn/kernel/sn2/sn2_smp.c
+++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c
@@ -5,7 +5,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  */
 
 #include linux/init.h
@@ -20,6 +20,8 @@
 #include linux/module.h
 #include linux/bitops.h
 #include linux/nodemask.h
+#include linux/proc_fs.h
+#include linux/seq_file.h
 
 #include asm/processor.h
 #include asm/irq.h
@@ -39,12 +41,120 @@
 #include asm/sn/nodepda.h
 #include asm/sn/rw_mmr.h
 
-void sn2_ptc_deadlock_recovery(volatile unsigned long *, unsigned long data0, 
-   volatile unsigned long *, unsigned long data1);
+DEFINE_PER_CPU(struct ptc_stats, ptcstats);
+DECLARE_PER_CPU(struct ptc_stats, ptcstats);
 
 static  __cacheline_aligned DEFINE_SPINLOCK(sn2_global_ptc_lock);
 
-static unsigned long sn2_ptc_deadlock_count;
+void sn2_ptc_deadlock_recovery(short *, short, 

[IA64] - SGI SN hwperf enhancements -

2005-09-02 Thread Linux Kernel Mailing List
tree 3a510269b2e336f58ecc3735877e60c1677a4b11
parent ecc3c30ae39c4d3cbf249a1ebd599465e0e25708
author Mark Goodwin [EMAIL PROTECTED] Thu, 18 Aug 2005 05:17:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 06:24:42 -0700

[IA64] - SGI SN hwperf enhancements -

Add a new exported function for determining the nearest node
with CPUs for I/O nodes and fix a bug where the hwperf dynamic
misc device was being registered before misc_init(). 

Signed-off-by: Mark Goodwin [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/sn2/sn_hwperf.c |  266 +---
 include/asm-ia64/sn/sn2/sn_hwperf.h |   10 +
 2 files changed, 256 insertions(+), 20 deletions(-)

diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c 
b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -59,7 +59,7 @@ static int sn_hwperf_enum_objects(int *n
struct sn_hwperf_object_info *objbuf = NULL;
 
if ((e = sn_hwperf_init())  0) {
-   printk(sn_hwperf_init failed: err %d\n, e);
+   printk(KERN_ERR sn_hwperf_init failed: err %d\n, e);
goto out;
}
 
@@ -111,7 +111,7 @@ static int sn_hwperf_geoid_to_cnode(char
if (sn_hwperf_location_to_bpos(location, rack, bay, slot, slab))
return -1;
 
-   for (cnode = 0; cnode  numionodes; cnode++) {
+   for_each_node(cnode) {
geoid = cnodeid_get_geoid(cnode);
module_id = geo_module(geoid);
this_rack = MODULE_GET_RACK(module_id);
@@ -124,11 +124,13 @@ static int sn_hwperf_geoid_to_cnode(char
}
}
 
-   return cnode  numionodes ? cnode : -1;
+   return node_possible(cnode) ? cnode : -1;
 }
 
 static int sn_hwperf_obj_to_cnode(struct sn_hwperf_object_info * obj)
 {
+   if (!SN_HWPERF_IS_NODE(obj)  !SN_HWPERF_IS_IONODE(obj))
+   BUG();
if (!obj-sn_hwp_this_part)
return -1;
return sn_hwperf_geoid_to_cnode(obj-location);
@@ -192,6 +194,181 @@ static void print_pci_topology(struct se
}
 }
 
+static inline int sn_hwperf_has_cpus(cnodeid_t node)
+{
+   return node_online(node)  nr_cpus_node(node);
+}
+
+static inline int sn_hwperf_has_mem(cnodeid_t node)
+{
+   return node_online(node)  NODE_DATA(node)-node_present_pages;
+}
+
+static struct sn_hwperf_object_info *
+sn_hwperf_findobj_id(struct sn_hwperf_object_info *objbuf,
+   int nobj, int id)
+{
+   int i;
+   struct sn_hwperf_object_info *p = objbuf;
+
+   for (i=0; i  nobj; i++, p++) {
+   if (p-id == id)
+   return p;
+   }
+
+   return NULL;
+
+}
+
+static int sn_hwperf_get_nearest_node_objdata(struct sn_hwperf_object_info 
*objbuf,
+   int nobj, cnodeid_t node, cnodeid_t *near_mem_node, cnodeid_t 
*near_cpu_node)
+{
+   int e;
+   struct sn_hwperf_object_info *nodeobj = NULL;
+   struct sn_hwperf_object_info *op;
+   struct sn_hwperf_object_info *dest;
+   struct sn_hwperf_object_info *router;
+   struct sn_hwperf_port_info ptdata[16];
+   int sz, i, j;
+   cnodeid_t c;
+   int found_mem = 0;
+   int found_cpu = 0;
+
+   if (!node_possible(node))
+   return -EINVAL;
+
+   if (sn_hwperf_has_cpus(node)) {
+   if (near_cpu_node)
+   *near_cpu_node = node;
+   found_cpu++;
+   }
+
+   if (sn_hwperf_has_mem(node)) {
+   if (near_mem_node)
+   *near_mem_node = node;
+   found_mem++;
+   }
+
+   if (found_cpu  found_mem)
+   return 0; /* trivially successful */
+
+   /* find the argument node object */
+   for (i=0, op=objbuf; i  nobj; i++, op++) {
+   if (!SN_HWPERF_IS_NODE(op)  !SN_HWPERF_IS_IONODE(op))
+   continue;
+   if (node == sn_hwperf_obj_to_cnode(op)) {
+   nodeobj = op;
+   break;
+   }
+   }
+   if (!nodeobj) {
+   e = -ENOENT;
+   goto err;
+   }
+
+   /* get it's interconnect topology */
+   sz = op-ports * sizeof(struct sn_hwperf_port_info);
+   if (sz  sizeof(ptdata))
+   BUG();
+   e = ia64_sn_hwperf_op(sn_hwperf_master_nasid,
+ SN_HWPERF_ENUM_PORTS, nodeobj-id, sz,
+ (u64)ptdata, 0, 0, NULL);
+   if (e != SN_HWPERF_OP_OK) {
+   e = -EINVAL;
+   goto err;
+   }
+
+   /* find nearest node with cpus and nearest memory */
+   for (router=NULL, j=0; j  op-ports; j++) {
+   dest = sn_hwperf_findobj_id(objbuf, nobj, ptdata[j].conn_id);
+   if (!dest || SN_HWPERF_FOREIGN(dest) ||
+   !SN_HWPERF_IS_NODE(dest) || SN_HWPERF_IS_IONODE(dest)) {
+   

[IA64] - SGI SN hwperf enhancements -

2005-09-02 Thread Linux Kernel Mailing List
tree 37a15b2e8249386b230e29fe6a067ad7184d0223
parent 60a3ba0bb45995ecf9cfe208527d7cfd6128d053
author Mark Goodwin [EMAIL PROTECTED] Tue, 16 Aug 2005 14:51:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 06:25:21 -0700

[IA64] - SGI SN hwperf enhancements -

Update the SN pci device info to use the nearest node function
to allocate driver memory on the nearest node (rather than
defaulting to node 0).

Signed-off-by: Mark Goodwin [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/pci/pcibr/pcibr_provider.c |   20 ++--
 1 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -15,6 +15,7 @@
 #include asm/sn/pcibus_provider_defs.h
 #include asm/sn/pcidev.h
 #include asm/sn/sn_sal.h
+#include asm/sn/sn2/sn_hwperf.h
 #include xtalk/xwidgetdev.h
 #include xtalk/hubdev.h
 
@@ -88,6 +89,7 @@ void *
 pcibr_bus_fixup(struct pcibus_bussoft *prom_bussoft, struct pci_controller 
*controller)
 {
int nasid, cnode, j;
+   cnodeid_t near_cnode;
struct hubdev_info *hubdev_info;
struct pcibus_info *soft;
struct sn_flush_device_list *sn_flush_device_list;
@@ -161,12 +163,18 @@ pcibr_bus_fixup(struct pcibus_bussoft *p
memset(soft-pbi_int_ate_resource.ate, 0,
   (soft-pbi_int_ate_size * sizeof(uint64_t)));
 
-   if (prom_bussoft-bs_asic_type == PCIIO_ASIC_TYPE_TIOCP)
-   /*
-* TIO PCI Bridge with no closest node information.
-* FIXME: Find another way to determine the closest node
-*/
-   controller-node = -1;
+   if (prom_bussoft-bs_asic_type == PCIIO_ASIC_TYPE_TIOCP) {
+   /* TIO PCI Bridge: find nearest node with CPUs */
+   int e = sn_hwperf_get_nearest_node(cnode, NULL, near_cnode);
+
+   if (e  0) {
+   near_cnode = (cnodeid_t)-1; /* use any node */
+   printk(KERN_WARNING pcibr_bus_fixup: failed to find 
+   near node with CPUs to TIO node %d, err=%d\n,
+   cnode, e);
+   }
+   controller-node = near_cnode;
+   }
else
controller-node = cnode;
return soft;
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] SGI SN remove redundant partition SAL call

2005-09-02 Thread Linux Kernel Mailing List
tree fdc500b570471049213c1ba623b7f8c5645768d7
parent 5390970d1c11b6d5d6a8253a718ed100e2178e14
author Russ Anderson ([EMAIL PROTECTED]) Thu, 18 Aug 2005 00:00:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 06:26:13 -0700

[IA64] SGI SN remove redundant partition SAL call

Clean up of SGI SN partitioning related code.
The SN_SAL_GET_SN_INFO SAL call returns the partition ID, making
the SN_SAL_SYSCTL_PARTITION_GET SAL call redundant.  Remove sn_partid
and use sn_partition_id.

Signed-off-by: Russ Anderson ([EMAIL PROTECTED])
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/setup.c  |2 -
 arch/ia64/sn/kernel/sn2/sn_proc_fs.c |4 +-
 include/asm-ia64/sn/geo.h|3 --
 include/asm-ia64/sn/sn_sal.h |   48 ---
 4 files changed, 3 insertions(+), 54 deletions(-)

diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c
--- a/arch/ia64/sn/kernel/setup.c
+++ b/arch/ia64/sn/kernel/setup.c
@@ -80,8 +80,6 @@ EXPORT_PER_CPU_SYMBOL(__sn_cnodeid_to_na
 DEFINE_PER_CPU(struct nodepda_s *, __sn_nodepda);
 EXPORT_PER_CPU_SYMBOL(__sn_nodepda);
 
-partid_t sn_partid = -1;
-EXPORT_SYMBOL(sn_partid);
 char sn_system_serial_number_string[128];
 EXPORT_SYMBOL(sn_system_serial_number_string);
 u64 sn_partition_serial_number;
diff --git a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c 
b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
--- a/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
+++ b/arch/ia64/sn/kernel/sn2/sn_proc_fs.c
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 2000-2004 Silicon Graphics, Inc. All rights reserved.
+ * Copyright (C) 2000-2005 Silicon Graphics, Inc. All rights reserved.
  */
 #include linux/config.h
 #include asm/uaccess.h
@@ -15,7 +15,7 @@
 
 static int partition_id_show(struct seq_file *s, void *p)
 {
-   seq_printf(s, %d\n, sn_local_partid());
+   seq_printf(s, %d\n, sn_partition_id);
return 0;
 }
 
diff --git a/include/asm-ia64/sn/geo.h b/include/asm-ia64/sn/geo.h
--- a/include/asm-ia64/sn/geo.h
+++ b/include/asm-ia64/sn/geo.h
@@ -3,7 +3,7 @@
  * License.  See the file COPYING in the main directory of this archive
  * for more details.
  *
- * Copyright (C) 1992 - 1997, 2000-2004 Silicon Graphics, Inc. All rights 
reserved.
+ * Copyright (C) 1992 - 1997, 2000-2005 Silicon Graphics, Inc. All rights 
reserved.
  */
 
 #ifndef _ASM_IA64_SN_GEO_H
@@ -108,7 +108,6 @@ typedef union geoid_u {
 #define INVALID_SLAB(slabid_t)-1
 #define INVALID_SLOT(slotid_t)-1
 #define INVALID_MODULE  ((moduleid_t)-1)
-#define INVALID_PARTID  ((partid_t)-1)
 
 static inline slabid_t geo_slab(geoid_t g)
 {
diff --git a/include/asm-ia64/sn/sn_sal.h b/include/asm-ia64/sn/sn_sal.h
--- a/include/asm-ia64/sn/sn_sal.h
+++ b/include/asm-ia64/sn/sn_sal.h
@@ -55,7 +55,6 @@
 #define  SN_SAL_BUS_CONFIG0x0237
 #define  SN_SAL_SYS_SERIAL_GET0x0238
 #define  SN_SAL_PARTITION_SERIAL_GET  0x0239
-#define  SN_SAL_SYSCTL_PARTITION_GET  0x023a
 #define  SN_SAL_SYSTEM_POWER_DOWN 0x023b
 #define  SN_SAL_GET_MASTER_BASEIO_NASID   0x023c
 #define  SN_SAL_COHERENCE  0x023d
@@ -587,35 +586,6 @@ sn_partition_serial_number_val(void) {
 }
 
 /*
- * Returns the partition id of the nasid passed in as an argument,
- * or INVALID_PARTID if the partition id cannot be retrieved.
- */
-static inline partid_t
-ia64_sn_sysctl_partition_get(nasid_t nasid)
-{
-   struct ia64_sal_retval ret_stuff;
-   ia64_sal_oemcall_nolock(ret_stuff, SN_SAL_SYSCTL_PARTITION_GET, nasid,
-   0, 0, 0, 0, 0, 0);
-   if (ret_stuff.status != 0)
-   return INVALID_PARTID;
-   return ((partid_t)ret_stuff.v0);
-}
-
-/*
- * Returns the partition id of the current processor.
- */
-
-extern partid_t sn_partid;
-
-static inline partid_t
-sn_local_partid(void) {
-   if (unlikely(sn_partid  0)) {
-   sn_partid = 
ia64_sn_sysctl_partition_get(cpuid_to_nasid(smp_processor_id()));
-   }
-   return sn_partid;
-}
-
-/*
  * Returns the physical address of the partition's reserved page through
  * an iterative number of calls.
  *
@@ -1020,24 +990,6 @@ ia64_sn_get_sn_info(int fc, u8 *shubtype
ret_stuff.v2 = 0;
SAL_CALL_NOLOCK(ret_stuff, SN_SAL_GET_SN_INFO, fc, 0, 0, 0, 0, 0, 0);
 
-/* BEGIN HACK - temp til old proms no longer supported /
-   if (ret_stuff.status == SALRET_NOT_IMPLEMENTED) {
-   int nasid = get_sapicid()  0xfff;;
-#define SH_SHUB_ID_NODES_PER_BIT_MASK 0x001fUL 
  
-#define SH_SHUB_ID_NODES_PER_BIT_SHFT 48   

-   if (shubtype) *shubtype = 0;
-   if 

[IA64] altix: Abstract irq_affinity at the sn pci provider

2005-09-02 Thread Linux Kernel Mailing List
tree 7783a2e701b7ae866be858e9121ec70f91fe4fa9
parent 5b9021bc5800796e23e4994f8cf2dc61536be0a7
author Mark Maule [EMAIL PROTECTED] Fri, 26 Aug 2005 01:45:00 -0700
committer Tony Luck [EMAIL PROTECTED] Sat, 27 Aug 2005 02:09:01 -0700

[IA64] altix: Abstract irq_affinity at the sn pci provider

Altix patch to abstract irq_affinity down to the pci provider level since
different SGI hardware implements this in different ways.

Signed-off-by: Mark Maule [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/irq.c  |6 ++--
 arch/ia64/sn/pci/pcibr/pcibr_provider.c|5 ++-
 arch/ia64/sn/pci/tioca_provider.c  |3 +-
 arch/ia64/sn/pci/tioce_provider.c  |   40 -
 include/asm-ia64/sn/pcibus_provider_defs.h |1 
 5 files changed, 49 insertions(+), 6 deletions(-)

diff --git a/arch/ia64/sn/kernel/irq.c b/arch/ia64/sn/kernel/irq.c
--- a/arch/ia64/sn/kernel/irq.c
+++ b/arch/ia64/sn/kernel/irq.c
@@ -127,6 +127,7 @@ static void sn_set_affinity_irq(unsigned
int local_widget, status;
nasid_t local_nasid;
struct sn_irq_info *new_irq_info;
+   struct sn_pcibus_provider *pci_provider;
 
new_irq_info = kmalloc(sizeof(struct sn_irq_info), GFP_ATOMIC);
if (new_irq_info == NULL)
@@ -166,8 +167,9 @@ static void sn_set_affinity_irq(unsigned
new_irq_info-irq_cpuid = cpuid;
register_intr_pda(new_irq_info);
 
-   if (IS_PCI_BRIDGE_ASIC(new_irq_info-irq_bridge_type))
-   pcibr_change_devices_irq(new_irq_info);
+   pci_provider = sn_pci_provider[new_irq_info-irq_bridge_type];
+   if (pci_provider  pci_provider-target_interrupt)
+   (pci_provider-target_interrupt)(new_irq_info);
 
spin_lock(sn_irq_info_lock);
list_replace_rcu(sn_irq_info-list, new_irq_info-list);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c 
b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
--- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c
@@ -198,7 +198,7 @@ void pcibr_force_interrupt(struct sn_irq
}
 }
 
-void pcibr_change_devices_irq(struct sn_irq_info *sn_irq_info)
+void pcibr_target_interrupt(struct sn_irq_info *sn_irq_info)
 {
struct pcidev_info *pcidev_info;
struct pcibus_info *pcibus_info;
@@ -233,7 +233,8 @@ struct sn_pcibus_provider pcibr_provider
.dma_map_consistent = pcibr_dma_map_consistent,
.dma_unmap = pcibr_dma_unmap,
.bus_fixup = pcibr_bus_fixup,
-   .force_interrupt = pcibr_force_interrupt
+   .force_interrupt = pcibr_force_interrupt,
+   .target_interrupt = pcibr_target_interrupt
 };
 
 int
diff --git a/arch/ia64/sn/pci/tioca_provider.c 
b/arch/ia64/sn/pci/tioca_provider.c
--- a/arch/ia64/sn/pci/tioca_provider.c
+++ b/arch/ia64/sn/pci/tioca_provider.c
@@ -657,7 +657,8 @@ static struct sn_pcibus_provider tioca_p
.dma_map_consistent = tioca_dma_map,
.dma_unmap = tioca_dma_unmap,
.bus_fixup = tioca_bus_fixup,
-   .force_interrupt = NULL
+   .force_interrupt = NULL,
+   .target_interrupt = NULL
 };
 
 /**
diff --git a/arch/ia64/sn/pci/tioce_provider.c 
b/arch/ia64/sn/pci/tioce_provider.c
--- a/arch/ia64/sn/pci/tioce_provider.c
+++ b/arch/ia64/sn/pci/tioce_provider.c
@@ -669,6 +669,43 @@ tioce_force_interrupt(struct sn_irq_info
 }
 
 /**
+ * tioce_target_interrupt - implement set_irq_affinity for tioce resident
+ * functions.  Note:  only applies to line interrupts, not MSI's.
+ *
+ * @sn_irq_info: SN IRQ context
+ *
+ * Given an sn_irq_info, set the associated CE device's interrupt destination
+ * register.  Since the interrupt destination registers are on a per-ce-slot
+ * basis, this will retarget line interrupts for all functions downstream of
+ * the slot.
+ */
+static void
+tioce_target_interrupt(struct sn_irq_info *sn_irq_info)
+{
+   struct pcidev_info *pcidev_info;
+   struct tioce_common *ce_common;
+   struct tioce *ce_mmr;
+   int bit;
+
+   pcidev_info = (struct pcidev_info *)sn_irq_info-irq_pciioinfo;
+   if (!pcidev_info)
+   return;
+
+   ce_common = (struct tioce_common *)pcidev_info-pdi_pcibus_info;
+   ce_mmr = (struct tioce *)ce_common-ce_pcibus.bs_base;
+
+   bit = sn_irq_info-irq_int_bit;
+
+   ce_mmr-ce_adm_int_mask |= (1UL  bit);
+   ce_mmr-ce_adm_int_dest[bit] =
+   ((uint64_t)sn_irq_info-irq_irq  INTR_VECTOR_SHFT) |
+  sn_irq_info-irq_xtalkaddr;
+   ce_mmr-ce_adm_int_mask = ~(1UL  bit);
+
+   tioce_force_interrupt(sn_irq_info);
+}
+
+/**
  * tioce_bus_fixup - perform final PCI fixup for a TIO CE bus
  * @prom_bussoft: Common prom/kernel struct representing the bus
  *
@@ -719,7 +756,8 @@ static struct sn_pcibus_provider tioce_p
.dma_map_consistent = 

[IA64-SGI] fix bte_copy() calling smp_processor_id() while preemptible

2005-09-02 Thread Linux Kernel Mailing List
tree 7c0bf2cdece65ae355977bf7aff3925fd20217ea
parent 8409668b561fbe464f7a392e8dc77eca225d27ac
author Russ Anderson ([EMAIL PROTECTED]) Tue, 16 Aug 2005 04:46:00 -0700
committer Tony Luck [EMAIL PROTECTED] Sat, 27 Aug 2005 05:01:37 -0700

[IA64-SGI] fix bte_copy() calling smp_processor_id() while preemptible

bte_copy() calls calls smp_processor_id(), which will get flagged if
preemption if enabled.  raw_smp_processor_id() is used instead 
because we are just using it to pick a BTE interface and are not 
tied to a specific cpu.

Signed-off-by: Russ Anderson ([EMAIL PROTECTED])
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/sn/kernel/bte.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/sn/kernel/bte.c b/arch/ia64/sn/kernel/bte.c
--- a/arch/ia64/sn/kernel/bte.c
+++ b/arch/ia64/sn/kernel/bte.c
@@ -105,7 +105,7 @@ bte_result_t bte_copy(u64 src, u64 dest,
/*
 * Start with interface corresponding to cpu number
 */
-   bte_first = get_cpu() % btes_per_node;
+   bte_first = raw_smp_processor_id() % btes_per_node;
 
if (mode  BTE_USE_DEST) {
/* try remote then local */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] arch/ia64/hp/sim/boot/fw-emu.c: remove egcs workaround

2005-09-02 Thread Linux Kernel Mailing List
tree d9ff25263dfa04c0926f8865d68e2e505ddfce2f
parent 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf
author Adrian Bunk [EMAIL PROTECTED] Wed, 24 Aug 2005 17:58:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 04:50:37 -0700

[IA64] arch/ia64/hp/sim/boot/fw-emu.c: remove egcs workaround

Kernel 2.6 doesn't support egcs, and I didn't find any user of this 
function.

Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/hp/sim/boot/fw-emu.c |   11 ---
 1 files changed, 11 deletions(-)

diff --git a/arch/ia64/hp/sim/boot/fw-emu.c b/arch/ia64/hp/sim/boot/fw-emu.c
--- a/arch/ia64/hp/sim/boot/fw-emu.c
+++ b/arch/ia64/hp/sim/boot/fw-emu.c
@@ -237,17 +237,6 @@ sal_emulator (long index, unsigned long 
return ((struct sal_ret_values) {status, r9, r10, r11});
 }
 
-
-/*
- * This is here to work around a bug in egcs-1.1.1b that causes the
- * compiler to crash (seems like a bug in the new alias analysis code.
- */
-void *
-id (long addr)
-{
-   return (void *) addr;
-}
-
 struct ia64_boot_param *
 sys_fw_init (const char *args, int arglen)
 {
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] fix IO_SPACE_SPARSE_ENCODING macro ambiguity

2005-09-02 Thread Linux Kernel Mailing List
tree 22081641f3873ec2f7632005357be03ca1468e3d
parent 38d26b9f577ec63ba64926c45f4ee3805ed2041c
author Bjorn Helgaas [EMAIL PROTECTED] Tue, 23 Aug 2005 23:24:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 04:55:09 -0700

[IA64] fix IO_SPACE_SPARSE_ENCODING macro ambiguity

Parenthesize p to avoid ambiguity.  No callers have a problem today;
this is just to clean up the bad form.

Signed-off-by: Bjorn Helgaas [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/io.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h
--- a/include/asm-ia64/io.h
+++ b/include/asm-ia64/io.h
@@ -41,7 +41,7 @@
 #define IO_SPACE_BASE(space)   ((space)  IO_SPACE_BITS)
 #define IO_SPACE_PORT(port)((port)  (IO_SPACE_SIZE - 1))
 
-#define IO_SPACE_SPARSE_ENCODING(p)p)  2)  12) | (p  0xfff))
+#define IO_SPACE_SPARSE_ENCODING(p)p)  2)  12) | ((p)  0xfff))
 
 struct io_space {
unsigned long mmio_base;/* base in MMIO space */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] Delete erroneous copy_page.o in global lib-y list

2005-09-02 Thread Linux Kernel Mailing List
tree 98afd79d11f51239cd69617865c77e9165ea5f08
parent b5f3616ba73699d07deee1f244179fae49502052
author Kenneth Chen [EMAIL PROTECTED] Sat, 27 Aug 2005 04:57:00 -0700
committer Tony Luck [EMAIL PROTECTED] Sat, 27 Aug 2005 06:01:25 -0700

[IA64] Delete erroneous copy_page.o in global lib-y list

copy_page.o appeared twice in arch/ia64/lib/Makefile. The
one in global lib-y is wrong where it should be just in
lib-$(CONFIG_ITANIUM).

Both copy_page.o and copy_page_mck.o are build for Itanium2
processor and the link order will pick up the low performing
copy_page function (originally written for itanium processor).
In this case, we really want the copy_page_mck.o for optimized
version.

Signed-off-by: Kenneth Chen [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/lib/Makefile |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile
--- a/arch/ia64/lib/Makefile
+++ b/arch/ia64/lib/Makefile
@@ -6,7 +6,7 @@ obj-y := io.o
 
 lib-y := __divsi3.o __udivsi3.o __modsi3.o __umodsi3.o \
__divdi3.o __udivdi3.o __moddi3.o __umoddi3.o   \
-   bitop.o checksum.o clear_page.o csum_partial_copy.o copy_page.o \
+   bitop.o checksum.o clear_page.o csum_partial_copy.o \
clear_user.o strncpy_from_user.o strlen_user.o strnlen_user.o   \
flush.o ip_fast_csum.o do_csum.o\
memset.o strlen.o swiotlb.o
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] remove use of asm/segment.h

2005-09-02 Thread Linux Kernel Mailing List
tree 24e8946ece51b37d54c6a76146d6523eef6c34d8
parent 0572e3da3ff5c3744b2f606ecf296d5f89a4bbdf
author Kumar Gala [EMAIL PROTECTED] Wed, 24 Aug 2005 23:53:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 25 Aug 2005 03:23:30 -0700

[IA64] remove use of asm/segment.h

Removed IA64 architecture specific users of asm/segment.h
The removal of asm-ia64/segment.h itself can wait until all
of the kernel source has been purged of references.

Signed-off-by: Kumar Gala [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/ia32/ia32_signal.c|1 -
 arch/ia64/pci/pci.c |1 -
 arch/ia64/sn/kernel/sn2/sn_hwperf.c |1 -
 3 files changed, 3 deletions(-)

diff --git a/arch/ia64/ia32/ia32_signal.c b/arch/ia64/ia32/ia32_signal.c
--- a/arch/ia64/ia32/ia32_signal.c
+++ b/arch/ia64/ia32/ia32_signal.c
@@ -29,7 +29,6 @@
 #include asm/uaccess.h
 #include asm/rse.h
 #include asm/sigcontext.h
-#include asm/segment.h
 
 #include ia32priv.h
 
diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c
--- a/arch/ia64/pci/pci.c
+++ b/arch/ia64/pci/pci.c
@@ -24,7 +24,6 @@
 
 #include asm/machvec.h
 #include asm/page.h
-#include asm/segment.h
 #include asm/system.h
 #include asm/io.h
 #include asm/sal.h
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c 
b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -36,7 +36,6 @@
 #include asm/topology.h
 #include asm/smp.h
 #include asm/semaphore.h
-#include asm/segment.h
 #include asm/uaccess.h
 #include asm/sal.h
 #include asm/sn/io.h
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64, X86_64] fix swiotlb sizing

2005-09-02 Thread Linux Kernel Mailing List
tree 8b2cca8bedf9305dc9686e25d90b4f15752b88fc
parent 30d5b64b63fa69af31b2cba32e6d71d68526eec9
author Alex Williamson [EMAIL PROTECTED] Fri, 05 Aug 2005 03:06:00 -0700
committer Tony Luck [EMAIL PROTECTED] Fri, 19 Aug 2005 06:33:28 -0700

[IA64, X86_64] fix swiotlb sizing

   Fix swiotlb sizing to match what the comments and the kernel
parameters documentation indicate.  Given a default 16k page size kernel
(ia64) and a 2k swiotlb page size, we're off by a multiple of 8 trying
to size the swiotlb.  When specified on the boot line, the swiotlb is
made 8x bigger than requested.  When left to the default value, it's 8x
smaller than the comments indicate.  For x86_64 the multiplier would be
2x.  The patch below fixes this.  Now, what's a good default swiotlb
size?  Apparently we don't really need 64MB.

Signed-off-by: Alex Williamson [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 arch/ia64/lib/swiotlb.c |5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/arch/ia64/lib/swiotlb.c b/arch/ia64/lib/swiotlb.c
--- a/arch/ia64/lib/swiotlb.c
+++ b/arch/ia64/lib/swiotlb.c
@@ -93,8 +93,7 @@ static int __init
 setup_io_tlb_npages(char *str)
 {
if (isdigit(*str)) {
-   io_tlb_nslabs = simple_strtoul(str, str, 0) 
-   (PAGE_SHIFT - IO_TLB_SHIFT);
+   io_tlb_nslabs = simple_strtoul(str, str, 0);
/* avoid tail segment of size  IO_TLB_SEGSIZE */
io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
}
@@ -117,7 +116,7 @@ swiotlb_init_with_default_size (size_t d
unsigned long i;
 
if (!io_tlb_nslabs) {
-   io_tlb_nslabs = (default_size  PAGE_SHIFT);
+   io_tlb_nslabs = (default_size  IO_TLB_SHIFT);
io_tlb_nslabs = ALIGN(io_tlb_nslabs, IO_TLB_SEGSIZE);
}
 
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64-SGI] fix unaligned memory access in snsc_event.c

2005-09-02 Thread Linux Kernel Mailing List
tree f11678902e54db1205bad348e2a6cdb2017ccfbe
parent 2ba84684e8cf6f980e4e95a2300f53a505eb794e
author Greg Howard [EMAIL PROTECTED] Tue, 16 Aug 2005 03:00:00 -0700
committer Tony Luck [EMAIL PROTECTED] Tue, 16 Aug 2005 04:17:49 -0700

[IA64-SGI] fix unaligned memory access in snsc_event.c

It's been pointed out that environmental events from the system
controllers on Altix machines cause the kernel to complain about
unaligned memory accesses.  This turns out to be because
be32_to_cpup() didn't do everything I thought/hoped it did.
I've added calls to pull the offending integers out of the
buffers using get_unaligned() before feeding them to
be32_to_cpup().

Signed-off-by: Greg Howard [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 drivers/char/snsc_event.c |   11 ---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/char/snsc_event.c b/drivers/char/snsc_event.c
--- a/drivers/char/snsc_event.c
+++ b/drivers/char/snsc_event.c
@@ -19,6 +19,7 @@
 #include linux/sched.h
 #include linux/byteorder/generic.h
 #include asm/sn/sn_sal.h
+#include asm/unaligned.h
 #include snsc.h
 
 static struct subch_data_s *event_sd;
@@ -62,13 +63,16 @@ static int
 scdrv_parse_event(char *event, int *src, int *code, int *esp_code, char *desc)
 {
char *desc_end;
+   __be32 from_buf;
 
/* record event source address */
-   *src = be32_to_cpup((__be32 *)event);
+   from_buf = get_unaligned((__be32 *)event);
+   *src = be32_to_cpup(from_buf);
event += 4; /* move on to event code */
 
/* record the system controller's event code */
-   *code = be32_to_cpup((__be32 *)event);
+   from_buf = get_unaligned((__be32 *)event);
+   *code = be32_to_cpup(from_buf);
event += 4; /* move on to event arguments */
 
/* how many arguments are in the packet? */
@@ -82,7 +86,8 @@ scdrv_parse_event(char *event, int *src,
/* not an integer argument, so give up */
return -1;
}
-   *esp_code = be32_to_cpup((__be32 *)event);
+   from_buf = get_unaligned((__be32 *)event);
+   *esp_code = be32_to_cpup(from_buf);
event += 4;
 
/* parse out the event description */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] Spinlock optimizations

2005-09-02 Thread Linux Kernel Mailing List
tree e5053eba17c84c64e2c86e67adefe56f3ef5ba10
parent bc68552faad0e134eb22281343d5ae5a4873fa80
author Christoph Lameter [EMAIL PROTECTED] Fri, 05 Aug 2005 22:02:00 -0700
committer Tony Luck [EMAIL PROTECTED] Thu, 11 Aug 2005 06:13:10 -0700

[IA64] Spinlock optimizations

1. Nontemporal store for spin unlock.

A nontemporal store will not update the LRU setting for the cacheline. The
cacheline with the lock may therefore be evicted faster from the cpu
caches. Doing so may be useful since it increases the chance that the
exclusive cache line has been evicted when another cpu is trying to
acquire the lock.

The time between dropping and reacquiring a lock on the same cpu is
typically very small so the danger of the cacheline being
evicted is negligible.

2. Avoid semaphore operation in write_unlock and use nontemporal store

write_lock uses a cmpxchg like the regular spin_lock but write_unlock uses
clear_bit which requires a load and then a loop over a cmpxchg. The
following patch makes write_unlock simply use a nontemporal store to clear
the highest 8 bits. We will then still have the lower 3 bytes (24 bits)
left to count the readers.

Doing the byte store will reduce the number of possible readers from 2^31
to 2^24 = 16 million.

These patches were discussed already:

http://marc.theaimsgroup.com/?t=11147205441r=1w=2
http://marc.theaimsgroup.com/?l=linux-ia64m=111401837707849w=2

The nontemporal stores will only work using GCC. If a compiler is used
that does not support inline asm then fallback C code is used. This
will preserve the byte store but not be able to do the nontemporal stores.

Signed-off-by: Christoph Lameter [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/spinlock.h |   33 -
 1 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/include/asm-ia64/spinlock.h b/include/asm-ia64/spinlock.h
--- a/include/asm-ia64/spinlock.h
+++ b/include/asm-ia64/spinlock.h
@@ -93,7 +93,15 @@ _raw_spin_lock_flags (spinlock_t *lock, 
 # endif /* CONFIG_MCKINLEY */
 #endif
 }
+
 #define _raw_spin_lock(lock) _raw_spin_lock_flags(lock, 0)
+
+/* Unlock by doing an ordered store and releasing the cacheline with nta */
+static inline void _raw_spin_unlock(spinlock_t *x) {
+   barrier();
+   asm volatile (st4.rel.nta [%0] = r0\n\t :: r(x));
+}
+
 #else /* !ASM_SUPPORTED */
 #define _raw_spin_lock_flags(lock, flags) _raw_spin_lock(lock)
 # define _raw_spin_lock(x) 
\
@@ -109,16 +117,16 @@ do {  
\
} while (ia64_spinlock_val);
\
}   
\
 } while (0)
+#define _raw_spin_unlock(x)do { barrier(); ((spinlock_t *) x)-lock = 0; } 
while (0)
 #endif /* !ASM_SUPPORTED */
 
 #define spin_is_locked(x)  ((x)-lock != 0)
-#define _raw_spin_unlock(x)do { barrier(); ((spinlock_t *) x)-lock = 0; } 
while (0)
 #define _raw_spin_trylock(x)   (cmpxchg_acq((x)-lock, 0, 1) == 0)
 #define spin_unlock_wait(x)do { barrier(); } while ((x)-lock)
 
 typedef struct {
-   volatile unsigned int read_counter  : 31;
-   volatile unsigned int write_lock:  1;
+   volatile unsigned int read_counter  : 24;
+   volatile unsigned int write_lock:  8;
 #ifdef CONFIG_PREEMPT
unsigned int break_lock;
 #endif
@@ -174,6 +182,13 @@ do {   
\
(result == 0);  
\
 })
 
+static inline void _raw_write_unlock(rwlock_t *x)
+{
+   u8 *y = (u8 *)x;
+   barrier();
+   asm volatile (st1.rel.nta [%0] = r0\n\t :: r(y+3) : memory );
+}
+
 #else /* !ASM_SUPPORTED */
 
 #define _raw_write_lock(l) 
\
@@ -195,14 +210,14 @@ do {  
\
(ia64_val == 0);\
 })
 
+static inline void _raw_write_unlock(rwlock_t *x)
+{
+   barrier();
+   x-write_lock = 0;
+}
+
 #endif /* !ASM_SUPPORTED */
 
 #define _raw_read_trylock(lock) generic_raw_read_trylock(lock)
 
-#define _raw_write_unlock(x)   
\
-({ 
\
-   smp_mb__before_clear_bit(); /* need barrier before releasing 
lock... */ \
-   clear_bit(31, (x)); 
\
-})
-
 #endif /*  _ASM_IA64_SPINLOCK_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  

[IA64-SGI] One new use of UNCACHED needed fixing for sn2 region cleanup

2005-09-02 Thread Linux Kernel Mailing List
tree 7f2f4912712d4b123fbd446683a884bd21ef8e64
parent 329058028523a5b36de449f130111b7671a4f269
author Tony Luck [EMAIL PROTECTED] Tue, 30 Aug 2005 06:13:36 -0700
committer Tony Luck [EMAIL PROTECTED] Tue, 30 Aug 2005 06:13:36 -0700

[IA64-SGI] One new use of UNCACHED needed fixing for sn2 region cleanup

Some shub2 changes were not in the tree when Greg cleaned up the sn2
region definitions in 1b66776da71e33dff5edcc0b096ec3b7c40c75ad, so this
one didn't get fixed.

Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/sn/addrs.h |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/asm-ia64/sn/addrs.h b/include/asm-ia64/sn/addrs.h
--- a/include/asm-ia64/sn/addrs.h
+++ b/include/asm-ia64/sn/addrs.h
@@ -258,7 +258,7 @@
 
 /* Shub1 TIO  MMR addressing macros */
 #define SH2_TIO_IOSPACE_ADDR(n,x)  \
-   ((UNCACHED | REMOTE_ADDR(n,x) | 1UL  (NASID_SHIFT - 2)))
+   ((__IA64_UNCACHED_OFFSET | REMOTE_ADDR(n,x) | 1UL  (NASID_SHIFT - 2)))
 
 #define SH2_REMOTE_MMR(n,x)\
GLOBAL_MMR_ADDR(n,x)
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] Low byte of current-personality is not a bitmask.

2005-09-02 Thread Linux Kernel Mailing List
tree 0a587cec3a6bd4fdd53fcfb75f87bc45da5d1a7f
parent 288ceb8f142249109fd2e9f1bf0492bd6ff6d892
author Tony Luck [EMAIL PROTECTED] Wed, 31 Aug 2005 04:59:24 -0700
committer Tony Luck [EMAIL PROTECTED] Wed, 31 Aug 2005 04:59:24 -0700

[IA64] Low byte of current-personality is not a bitmask.

Peter Staubach pointed out that it is not correct to check
current-personality  PER_LINUX32 (this will have false
hits on several other personality values).

Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/fcntl.h |3 ++-
 1 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/asm-ia64/fcntl.h b/include/asm-ia64/fcntl.h
--- a/include/asm-ia64/fcntl.h
+++ b/include/asm-ia64/fcntl.h
@@ -81,6 +81,7 @@ struct flock {
 
 #define F_LINUX_SPECIFIC_BASE  1024
 
-#define force_o_largefile() ( ! (current-personality  PER_LINUX32) )
+#define force_o_largefile()\
+   (personality(current-personality) != PER_LINUX32)
 
 #endif /* _ASM_IA64_FCNTL_H */
-
To unsubscribe from this list: send the line unsubscribe git-commits-head in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[IA64] Remove rwsem limitation of 32k waiters

2005-09-02 Thread Linux Kernel Mailing List
tree b6a2666e8c2f496c20c97eea06b6e1012593b80b
parent f6fdd7d9c273bb2a20ab467cb57067494f932fa3
author Christoph Lameter [EMAIL PROTECTED] Tue, 23 Aug 2005 02:20:00 -0700
committer Tony Luck [EMAIL PROTECTED] Wed, 24 Aug 2005 00:31:57 -0700

[IA64] Remove rwsem limitation of 32k waiters

We ran into the limit with the maximum number of waiters at one of our sites.

This patch increases the number of possible waiters from 2^15 to 2^31 by using
a long for the counter in struct rw_semaphore. S390 and alpha already do this.

Signed-off-by: Christoph Lameter [EMAIL PROTECTED]
Acked-by: Kenneth Chen [EMAIL PROTECTED]
Signed-off-by: Tony Luck [EMAIL PROTECTED]

 include/asm-ia64/rwsem.h |   35 ++-
 1 files changed, 18 insertions(+), 17 deletions(-)

diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
--- a/include/asm-ia64/rwsem.h
+++ b/include/asm-ia64/rwsem.h
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2003 Ken Chen [EMAIL PROTECTED]
  * Copyright (C) 2003 Asit Mallick [EMAIL PROTECTED]
+ * Copyright (C) 2005 Christoph Lameter [EMAIL PROTECTED]
  *
  * Based on asm-i386/rwsem.h and other architecture implementation.
  *
@@ -11,9 +12,9 @@
  *
  * The lock count is initialized to 0 (no active and no waiting lockers).
  *
- * When a writer subtracts WRITE_BIAS, it'll get 0x0001 for the case
- * of an uncontended lock. Readers increment by 1 and see a positive value
- * when uncontended, negative if there are writers (and maybe) readers
+ * When a writer subtracts WRITE_BIAS, it'll get 0x0001 for
+ * the case of an uncontended lock. Readers increment by 1 and see a positive
+ * value when uncontended, negative if there are writers (and maybe) readers
  * waiting (in which case it goes to sleep).
  */
 
@@ -29,7 +30,7 @@
  * the semaphore definition
  */
 struct rw_semaphore {
-   signed int  count;
+   signed long count;
spinlock_t  wait_lock;
struct list_headwait_list;
 #if RWSEM_DEBUG
@@ -37,10 +38,10 @@ struct rw_semaphore {
 #endif
 };
 
-#define RWSEM_UNLOCKED_VALUE   0x
-#define RWSEM_ACTIVE_BIAS  0x0001
-#define RWSEM_ACTIVE_MASK  0x
-#define RWSEM_WAITING_BIAS (-0x0001)
+#define RWSEM_UNLOCKED_VALUE   __IA64_UL_CONST(0x)
+#define RWSEM_ACTIVE_BIAS  __IA64_UL_CONST(0x0001)
+#define RWSEM_ACTIVE_MASK  __IA64_UL_CONST(0x)
+#define RWSEM_WAITING_BIAS -__IA64_UL_CONST(0x0001)
 #define RWSEM_ACTIVE_READ_BIAS RWSEM_ACTIVE_BIAS
 #define RWSEM_ACTIVE_WRITE_BIAS(RWSEM_WAITING_BIAS + 
RWSEM_ACTIVE_BIAS)
 
@@ -83,7 +84,7 @@ init_rwsem (struct rw_semaphore *sem)
 static inline void
 __down_read (struct rw_semaphore *sem)
 {
-   int result = ia64_fetchadd4_acq((unsigned int *)sem-count, 1);
+   long result = ia64_fetchadd8_acq((unsigned long *)sem-count, 1);
 
if (result  0)
rwsem_down_read_failed(sem);
@@ -95,7 +96,7 @@ __down_read (struct rw_semaphore *sem)
 static inline void
 __down_write (struct rw_semaphore *sem)
 {
-   int old, new;
+   long old, new;
 
do {
old = sem-count;
@@ -112,7 +113,7 @@ __down_write (struct rw_semaphore *sem)
 static inline void
 __up_read (struct rw_semaphore *sem)
 {
-   int result = ia64_fetchadd4_rel((unsigned int *)sem-count, -1);
+   long result = ia64_fetchadd8_rel((unsigned long *)sem-count, -1);
 
if (result  0  (--result  RWSEM_ACTIVE_MASK) == 0)
rwsem_wake(sem);
@@ -124,7 +125,7 @@ __up_read (struct rw_semaphore *sem)
 static inline void
 __up_write (struct rw_semaphore *sem)
 {
-   int old, new;
+   long old, new;
 
do {
old = sem-count;
@@ -141,7 +142,7 @@ __up_write (struct rw_semaphore *sem)
 static inline int
 __down_read_trylock (struct rw_semaphore *sem)
 {
-   int tmp;
+   long tmp;
while ((tmp = sem-count) = 0) {
if (tmp == cmpxchg_acq(sem-count, tmp, tmp+1)) {
return 1;
@@ -156,7 +157,7 @@ __down_read_trylock (struct rw_semaphore
 static inline int
 __down_write_trylock (struct rw_semaphore *sem)
 {
-   int tmp = cmpxchg_acq(sem-count, RWSEM_UNLOCKED_VALUE,
+   long tmp = cmpxchg_acq(sem-count, RWSEM_UNLOCKED_VALUE,
  RWSEM_ACTIVE_WRITE_BIAS);
return tmp == RWSEM_UNLOCKED_VALUE;
 }
@@ -167,7 +168,7 @@ __down_write_trylock (struct rw_semaphor
 static inline void
 __downgrade_write (struct rw_semaphore *sem)
 {
-   int old, new;
+   long old, new;
 
do {
old = sem-count;
@@ -182,7 +183,7 @@ __downgrade_write (struct rw_semaphore *
  * Implement atomic add functionality.  These used to be inline functions, 
but GCC v3.1
  * doesn't quite optimize this stuff right and ends up with bad calls to 
fetchandadd.
  

[ARM] 2834/1: Remove IXP4xx board-specific map_io routines

2005-09-02 Thread Linux Kernel Mailing List
tree 6fbc546cc3de5876ca7938e7c2da96a92b1e2ee8
parent bf4e70e54cf31dcca48d279c7f7e71328eebe749
author Deepak Saxena [EMAIL PROTECTED] Mon, 29 Aug 2005 22:46:29 +0100
committer Russell King [EMAIL PROTECTED] Mon, 29 Aug 2005 22:46:29 +0100

[ARM] 2834/1: Remove IXP4xx board-specific map_io routines

Patch from Deepak Saxena

None of the board-specific map_io routines do anything, so kill them.

Signed-off-by: Deepak Saxena [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/mach-ixp4xx/coyote-setup.c   |9 ++---
 arch/arm/mach-ixp4xx/gtwx5715-setup.c |8 +---
 arch/arm/mach-ixp4xx/ixdp425-setup.c  |   13 -
 3 files changed, 7 insertions(+), 23 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/coyote-setup.c 
b/arch/arm/mach-ixp4xx/coyote-setup.c
--- a/arch/arm/mach-ixp4xx/coyote-setup.c
+++ b/arch/arm/mach-ixp4xx/coyote-setup.c
@@ -24,11 +24,6 @@
 #include asm/mach/arch.h
 #include asm/mach/flash.h
 
-void __init coyote_map_io(void)
-{
-   ixp4xx_map_io();
-}
-
 static struct flash_platform_data coyote_flash_data = {
.map_name   = cfi_probe,
.width  = 2,
@@ -107,7 +102,7 @@ MACHINE_START(ADI_COYOTE, ADI Engineeri
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = coyote_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
@@ -125,7 +120,7 @@ MACHINE_START(IXDPG425, Intel IXDPG425
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = coyote_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
diff --git a/arch/arm/mach-ixp4xx/gtwx5715-setup.c 
b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
--- a/arch/arm/mach-ixp4xx/gtwx5715-setup.c
+++ b/arch/arm/mach-ixp4xx/gtwx5715-setup.c
@@ -101,12 +101,6 @@ static struct platform_device gtwx5715_u
.resource   = gtwx5715_uart_resources,
 };
 
-
-void __init gtwx5715_map_io(void)
-{
-   ixp4xx_map_io();
-}
-
 static struct flash_platform_data gtwx5715_flash_data = {
.map_name   = cfi_probe,
.width  = 2,
@@ -144,7 +138,7 @@ MACHINE_START(GTWX5715, Gemtek GTWX5715
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_UART2_BASE_PHYS,
.io_pg_offst= ((IXP4XX_UART2_BASE_VIRT)  18)  0xfffc,
-   .map_io = gtwx5715_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
diff --git a/arch/arm/mach-ixp4xx/ixdp425-setup.c 
b/arch/arm/mach-ixp4xx/ixdp425-setup.c
--- a/arch/arm/mach-ixp4xx/ixdp425-setup.c
+++ b/arch/arm/mach-ixp4xx/ixdp425-setup.c
@@ -24,11 +24,6 @@
 #include asm/mach/arch.h
 #include asm/mach/flash.h
 
-void __init ixdp425_map_io(void) 
-{
-   ixp4xx_map_io();
-}
-
 static struct flash_platform_data ixdp425_flash_data = {
.map_name   = cfi_probe,
.width  = 2,
@@ -133,7 +128,7 @@ MACHINE_START(IXDP425, Intel IXDP425 De
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = ixdp425_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
@@ -145,7 +140,7 @@ MACHINE_START(IXDP465, Intel IXDP465 De
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = ixdp425_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
@@ -157,7 +152,7 @@ MACHINE_START(IXCDP1100, Intel IXCDP110
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = ixdp425_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = ixp4xx_timer,
.boot_params= 0x0100,
@@ -176,7 +171,7 @@ MACHINE_START(AVILA, Gateworks Avila Ne
.phys_ram   = PHYS_OFFSET,
.phys_io= IXP4XX_PERIPHERAL_BASE_PHYS,
.io_pg_offst= ((IXP4XX_PERIPHERAL_BASE_VIRT)  18)  0xfffc,
-   .map_io = ixdp425_map_io,
+   .map_io = ixp4xx_map_io,
.init_irq   = ixp4xx_init_irq,
.timer  = 

[ARM] 2836/1: Cleanup IXP4xx GPIO code

2005-09-02 Thread Linux Kernel Mailing List
tree 68983f484e96c737cd504ecd08e7bf669a925cec
parent e605ecd7c8a38f65759c938a235a1b84f41a744e
author Deepak Saxena [EMAIL PROTECTED] Mon, 29 Aug 2005 22:46:30 +0100
committer Russell King [EMAIL PROTECTED] Mon, 29 Aug 2005 22:46:30 +0100

[ARM] 2836/1: Cleanup IXP4xx GPIO code

Patch from Deepak Saxena

This patch implements the set_irq_type() hooks for configuring GPIO
IRQ type and updates all the platforms to use it instead of the
gpio_line_config() function which is now used to configure input
vs. output on the pins.

Signed-off-by: Deepak Saxena [EMAIL PROTECTED]
Signed-off-by: Russell King [EMAIL PROTECTED]

 arch/arm/mach-ixp4xx/common.c  |  155 +
 arch/arm/mach-ixp4xx/coyote-pci.c  |7 -
 arch/arm/mach-ixp4xx/gtwx5715-pci.c|   28 ++---
 arch/arm/mach-ixp4xx/ixdp425-pci.c |   12 --
 arch/arm/mach-ixp4xx/ixdpg425-pci.c|4 
 include/asm-arm/arch-ixp4xx/platform.h |   19 +---
 6 files changed, 91 insertions(+), 134 deletions(-)

diff --git a/arch/arm/mach-ixp4xx/common.c b/arch/arm/mach-ixp4xx/common.c
--- a/arch/arm/mach-ixp4xx/common.c
+++ b/arch/arm/mach-ixp4xx/common.c
@@ -38,90 +38,6 @@
 #include asm/mach/irq.h
 #include asm/mach/time.h
 
-enum ixp4xx_irq_type {
-   IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
-};
-static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
-
-/*
- * GPIO acces functions
- */
-
-/*
- * Configure GPIO line for input, interrupt, or output operation
- *
- * TODO: Enable/disable the irq_desc based on interrupt or output mode.
- * TODO: Should these be named ixp4xx_gpio_?
- */
-void gpio_line_config(u8 line, u32 style)
-{
-   static const int gpio2irq[] = {
-   6, 7, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29
-   };
-   u32 enable;
-   volatile u32 *int_reg;
-   u32 int_style;
-   enum ixp4xx_irq_type irq_type;
-
-   enable = *IXP4XX_GPIO_GPOER;
-
-   if (style  IXP4XX_GPIO_OUT) {
-   enable = ~((1)  line);
-   } else if (style  IXP4XX_GPIO_IN) {
-   enable |= ((1)  line);
-
-   switch (style  IXP4XX_GPIO_INTSTYLE_MASK)
-   {
-   case (IXP4XX_GPIO_ACTIVE_HIGH):
-   int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
-   irq_type = IXP4XX_IRQ_LEVEL;
-   break;
-   case (IXP4XX_GPIO_ACTIVE_LOW):
-   int_style = IXP4XX_GPIO_STYLE_ACTIVE_LOW;
-   irq_type = IXP4XX_IRQ_LEVEL;
-   break;
-   case (IXP4XX_GPIO_RISING_EDGE):
-   int_style = IXP4XX_GPIO_STYLE_RISING_EDGE;
-   irq_type = IXP4XX_IRQ_EDGE;
-   break;
-   case (IXP4XX_GPIO_FALLING_EDGE):
-   int_style = IXP4XX_GPIO_STYLE_FALLING_EDGE;
-   irq_type = IXP4XX_IRQ_EDGE;
-   break;
-   case (IXP4XX_GPIO_TRANSITIONAL):
-   int_style = IXP4XX_GPIO_STYLE_TRANSITIONAL;
-   irq_type = IXP4XX_IRQ_EDGE;
-   break;
-   default:
-   int_style = IXP4XX_GPIO_STYLE_ACTIVE_HIGH;
-   irq_type = IXP4XX_IRQ_LEVEL;
-   break;
-   }
-
-   if (style  IXP4XX_GPIO_INTSTYLE_MASK)
-   ixp4xx_config_irq(gpio2irq[line], irq_type);
-
-   if (line = 8) {/* pins 8-15 */ 
-   line -= 8;
-   int_reg = IXP4XX_GPIO_GPIT2R;
-   }
-   else {  /* pins 0-7 */
-   int_reg = IXP4XX_GPIO_GPIT1R;
-   }
-
-   /* Clear the style for the appropriate pin */
-   *int_reg = ~(IXP4XX_GPIO_STYLE_CLEAR  
-   (line * IXP4XX_GPIO_STYLE_SIZE));
-
-   /* Set the new style */
-   *int_reg |= (int_style  (line * IXP4XX_GPIO_STYLE_SIZE));
-   }
-
-   *IXP4XX_GPIO_GPOER = enable;
-}
-
-EXPORT_SYMBOL(gpio_line_config);
-
 /*
  * IXP4xx chipset I/O mapping
  */
@@ -165,6 +81,69 @@ void __init ixp4xx_map_io(void)
  *   (be it PCI or something else) configures that GPIO line
  *   as an IRQ.
  **/
+enum ixp4xx_irq_type {
+   IXP4XX_IRQ_LEVEL, IXP4XX_IRQ_EDGE
+};
+
+static void ixp4xx_config_irq(unsigned irq, enum ixp4xx_irq_type type);
+
+/*
+ * IRQ - GPIO mapping table
+ */
+static int irq2gpio[32] = {
+   -1, -1, -1, -1, -1, -1,  0,  1,
+   -1, -1, -1, -1, -1, -1, -1, -1,
+   

  1   2   >