Re: [PATCH 7/8] b44: race on device closing

2005-11-07 Thread Jeff Garzik

Francois Romieu wrote:

Usual fix:
- b44_interrupt() does not schedule NAPI polling when the device is
  going down;
- b44_close() waits for any scheduled NAPI polling before it starts
  to release the device private structures.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]

---

466c09c176a11241f93af7156538f3dd5f6fb6d1
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -909,6 +909,12 @@ static irqreturn_t b44_interrupt(int irq
istat = imask;
if (istat) {
handled = 1;
+
+   if (unlikely(!netif_running(dev))) {
+   printk(KERN_INFO %s: late interrupt.\n, dev-name);
+   goto out_unlock;
+   }
+
if (netif_rx_schedule_prep(dev)) {
/* NOTE: These writes are posted by the readback of
 *   the ISTAT register below.


If you get to this point, you should still ACK the interrupt to the 
hardware.


Jeff


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


Re: [PATCH]eepro100: remove devices supported by e100

2005-11-07 Thread Scott Feldman


On Nov 5, 2005, at 2:28 AM, Lennert Buytenhek wrote:


On Fri, Nov 04, 2005 at 08:34:05PM -0800, Scott Feldman wrote:



So there is nothing left.  Why not just remove eepro100?



This has been coming up every few months for a while now.  e100  
doesn't

work on a number of ARM platforms due to its (ab)use of the DMA API.

http://www.ussg.iu.edu/hypermail/linux/kernel/0406.3/1438.html
http://www.ussg.iu.edu/hypermail/linux/kernel/0406.3/1481.html


I was going to say that eepro100's speedo_rx_link() does the same DMA  
abuse as e100, but then I noticed one little detail: eepro100 sets  
both EL (end of list) and S (suspend) bits in the RFD as it chains it  
to the RFD list.  e100 was only setting the EL bit.  Hmmm, that's  
interesting.  That means that if HW reads a RFD with the S-bit set,  
it'll process that RFD and then suspend the receive unit.  The  
receive unit will resume when SW clears the S-bit.  There is no need  
for SW to restart the receive unit.  Which means a lot of the receive  
unit state tracking code in the driver goes away.


So here's a patch against 2.6.14.  (Sorry for inlining it; the mailer  
I'm using now will mess with the word wrap).  I can't test this on  
XScale (unless someone has an e100 module for Gumstix :).  It should  
be doing exactly what eepro100 does with RFDs.  I don't believe this  
change will introduce a performance hit because the S-bit and EL-bit  
go hand-in-hand meaning if we're going to suspend because of the S- 
bit, we're on the last resource anyway, so we'll have to wait for SW  
to replenish.


-scott




e100-s-bit.patch
Description: Binary data


Products available for Download

2005-11-07 Thread Terrie Pitts

Well well!

The nation which forgets its defenders will be itself forgotten.


Shipping: instant downolad


MS Works 7.0 $19.95
Adobe Creative Suite Standard $99.95
Autodesk AutoCAD Electrical 2004 $49.95
Macromedia Fontographer 4 $19.95

http://druisoft.com

I have always wanted to be somebody, but I see now I should have been more 
specific.One of the surest signs of the Philistine is his reverence for the 
superior tastes of those who put him down.


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


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Thomas Graf
* Stefan Rompf [EMAIL PROTECTED] 2005-11-07 00:42
 -userspace interaction, including userspace supplicant + locking of 
 operstate_useroverride
 -migrate VLAN + BONDING to use OPER_LOWERLAYERDOWN

I think that bonding should check on the administrative status of
its slaves as well. Why not check for OPER_UP?

 I'd leave making IPV4 not consider routes when interface is OPER_DORMANTL3UP 
 for 2.6.16.

 Unfortunately, me and Krzysztof have totally different opinions if this 
 complexity is needed. I think yes, as it will make it possible to use a 
 userspace supplicant for connection completion (WPA), layer 3 protocols not 
 considering down interfaces for routing decisions (imporant for quagga), dial 
 on demand interfaces, clear state forwarding for stacked interfaces. This is 
 stuff required now, not in a distant future, and if we touch these flags 
 anyway, let's do it right.

I still don't see the point in OPER_DORMANTL3DOWN vs. OPER_DORMANTL3UP.
Can't we put the driver, stacked interface, etc. in charge for dropping
packets which shouldn't be let through yet? I would favour this and have
the dormant state limited to link layer responsibilities.

 This is not yet for applying, just compilation tested, comments welcome. Is 
 my 
 wmb() to avoid 4 byte atomic_t the right idea?

char access is not guaranteed to be atomic, just use int for the states.

Here is how I see things, it's not complete and lacks proper locking but
enough to get the point.

Index: linux-2.6/include/linux/if.h
===
--- linux-2.6.orig/include/linux/if.h
+++ linux-2.6/include/linux/if.h
@@ -42,8 +42,11 @@
 #define IFF_SLAVE  0x800   /* slave of a load balancer */
 
 #define IFF_MULTICAST  0x1000  /* Supports multicast   */
+#define IFF_LINK_UP0x2000  /* lower link up*/
+#define IFF_DORMANT0x4000  /* waiting for external event   */
+#define IFF_WAIT   0x8000  /* auto. enter dormant state*/
 
-#define IFF_VOLATILE   
(IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_RUNNING)
+#define IFF_VOLATILE   
(IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_MASTER|IFF_SLAVE|IFF_LINK_UP|IFF_DORMANT|IFF_RUNNING)
 
 #define IFF_PORTSEL0x2000  /* can set media type   */
 #define IFF_AUTOMEDIA  0x4000  /* auto media select active */
@@ -80,6 +83,16 @@
 #define IF_PROTO_FR_ETH_PVC 0x200B
 #define IF_PROTO_RAW0x200C  /* RAW Socket   */
 
+/* RFC 2863 operational status */
+enum {
+   IF_OPER_UNKNOWN,
+   IF_OPER_NOTPRESENT,
+   IF_OPER_DOWN,
+   IF_OPER_LOWERLAYERDOWN,
+   IF_OPER_TESTING,
+   IF_OPER_DORMANT,
+   IF_OPER_UP,
+};
 
 /*
  * Device mapping structure. I'd just gone off and designed a 
Index: linux-2.6/include/linux/netdevice.h
===
--- linux-2.6.orig/include/linux/netdevice.h
+++ linux-2.6/include/linux/netdevice.h
@@ -230,7 +230,8 @@ enum netdev_state_t
__LINK_STATE_SCHED,
__LINK_STATE_NOCARRIER,
__LINK_STATE_RX_SCHED,
-   __LINK_STATE_LINKWATCH_PENDING
+   __LINK_STATE_LINKWATCH_PENDING,
+   __LINK_STATE_DORMANT,
 };
 
 
@@ -751,6 +752,23 @@ static inline void netif_device_attach(s
}
 }
 
+static inline void netif_dormant_on(struct net_device *dev)
+{
+   if (!test_and_set_bit(__LINK_STATE_DORMANT, dev-state))
+   linkwatch_fire_event(dev);
+}
+
+static inline void netif_dormant_off(struct net_device *dev)
+{
+   if (test_and_clear_bit(__LINK_STATE_DORMANT, dev-state))
+   linkwatch_fire_event(dev);
+}
+
+static inline int netif_dormant(struct net_device *dev)
+{
+   return test_bit(__LINK_STATE_DORMANT, dev-state);
+}
+
 /*
  * Network interface message level settings
  */
@@ -926,6 +944,7 @@ extern void dev_mcast_init(void);
 extern int netdev_max_backlog;
 extern int weight_p;
 extern int netdev_set_master(struct net_device *dev, struct 
net_device *master);
+extern int dev_oper_state(struct net_device *dev);
 extern int skb_checksum_help(struct sk_buff *skb, int inward);
 /* rx skb timestamps */
 extern voidnet_enable_timestamp(void);
Index: linux-2.6/net/core/dev.c
===
--- linux-2.6.orig/net/core/dev.c
+++ linux-2.6/net/core/dev.c
@@ -994,6 +994,23 @@ int call_netdevice_notifiers(unsigned lo
return notifier_call_chain(netdev_chain, val, v);
 }
 
+int dev_oper_state(struct net_device *dev)
+{
+   if (!netif_device_present(dev))
+   return IF_OPER_NOTPRESENT;
+
+   if (!netif_running(dev))
+   return IF_OPER_DOWN;
+
+   if (!netif_carrier_ok(dev))
+   return IF_OPER_LOWERLAYERDOWN;
+
+   if (netif_dormant(dev))
+   return 

[PATCH][MCAST]Clear MAF_GSQUERY flag when process MLDv1 general query messages.

2005-11-07 Thread Yan Zheng

Hi.


MAF_GSQUERY flag may cause problem when MLDv1 compatibility mode expires.  




Signed-off-by: Yan Zheng [EMAIL PROTECTED]

Index: net/ipv6/mcast.c

--- linux-2.6.14/net/ipv6/mcast.c   2005-11-05 09:09:47.0 +0800
+++ linux/net/ipv6/mcast.c  2005-11-07 21:57:27.0 +0800
@@ -1166,6 +1166,7 @@ int igmp6_event_query(struct sk_buff *sk
if (group_type == IPV6_ADDR_ANY) {
for (ma = idev-mc_list; ma; ma=ma-next) {
spin_lock_bh(ma-mca_lock);
+   ma-mca_flags = ~MAF_GSQUERY;
igmp6_group_queried(ma, max_delay);
spin_unlock_bh(ma-mca_lock);
}

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


Re: [PATCH][MCAST]Clear MAF_GSQUERY flag when process MLDv1 general query messages.

2005-11-07 Thread John W. Linville
On Mon, Nov 07, 2005 at 10:13:34PM +0800, Yan Zheng wrote:

 MAF_GSQUERY flag may cause problem when MLDv1 compatibility mode expires.  

Could you be more specific about what problem it will cause?

Thanks,

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


Re: [PATCH][MCAST]Clear MAF_GSQUERY flag when process MLDv1 general query messages.

2005-11-07 Thread Yan Zheng
 Could you be more specific about what problem it will cause?

 Thanks,

 John
 --
 John W. Linville
 [EMAIL PROTECTED]


If the first query message receive after expiration is MLDv2 general
query and MAF_GSQUERY flag is set. The report message only contains
sources marked by last MLDv2 Multicast Address and Source Specific
Queries . Although this circumstance happens  rare, I think it's
better have it fixed


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


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Krzysztof Halasa
Stefan Rompf [EMAIL PROTECTED] writes:

 Unfortunately, me and Krzysztof have totally different opinions if this 
 complexity is needed.

I wouldn't call it unfortunate.
I'll happily use your interface if it's available and I assume
it will be available when it's needed, clean, robust and complete.

David? Jeff? Your opinion maybe? Not sure if you have my patch sent
a week ago, can resend.
-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Stefan Rompf
Am Montag 07 November 2005 14:50 schrieb Thomas Graf:

  -migrate VLAN + BONDING to use OPER_LOWERLAYERDOWN

 I think that bonding should check on the administrative status of
 its slaves as well. Why not check for OPER_UP?

Yes, currently it seems to ignore admin status and does not even maintain its 
own operative status.

 I still don't see the point in OPER_DORMANTL3DOWN vs. OPER_DORMANTL3UP.

Seems my English is really bad ;-)

 Can't we put the driver, stacked interface, etc. in charge for dropping
 packets which shouldn't be let through yet? I would favour this and have
 the dormant state limited to link layer responsibilities.

Imagine this situation:

 +---+
 | 1 |
 +---+
   |+---+   +---+
   +| 2 |---| 3 |
A   +---+ B +---+
  |   | +---+
  +---+-| 4 |
  C +---+

1,2,3,4 are acting as routers with the quagga daemon running. A,B,C are 
networks.

Now (1) wants to reach (4). Normally, the packet would travel to (2) via (A), 
from there to (4) via (C).

But what happens when the link from (2) to (C) fails? The routing protocol 
would realize it (actually it was me how has added IFF_RUNNING support to 
quagga) and add a route to (C) via (3) on (B). However, the connected route 
would still have precedence and the linux IP stack on (2) would happily try 
to continue using the broken link to (C), even if we add juju magic to the 
link layer to recognize and drop L3 packets.

That's why I think L3 protocols should be responsible for not using a broken 
link and why we need OPER_DORMANTL3DOWN.

OPER_DORMANTL3UP is another beast. Dial on demand interfaces may be dormant, 
but of course layer L3 must consider routes pointing to them, or they would 
never dial.

I see this clearly as a kernel problem, we should not expect userspace to 
workaround this limitation. And it's even useful without a routing daemon if 
a host has more than one network interface.

 char access is not guaranteed to be atomic, just use int for the states.

OTOH, we don't need to be completely atomic as the netif_carrier_*-functions 
already require driver controlled synchronisation. We just need to make sure 
that the caches are coherent before linkwatch kernel thread runs.

 +#define IFF_LINK_UP  0x2000  /* lower link up*/
 +#define IFF_DORMANT  0x4000  /* waiting for external event   */
 +#define IFF_WAIT 0x8000  /* auto. enter dormant state*/

 +int dev_oper_state(struct net_device *dev)
 +{
 + if (!netif_device_present(dev))
 + return IF_OPER_NOTPRESENT;
 +
 + if (!netif_running(dev))
 + return IF_OPER_DOWN;

No, !netif_running() is ADMIN down, mostly representing the IFF_UP flag.

 + if (!netif_carrier_ok(dev))
 + return IF_OPER_LOWERLAYERDOWN;

No, this is OPER_DOWN. LOWERLAYERDOWN is IMHO f.e. for VLANs stacked on a 
physical interface that is OPER_DOWN.

  void netif_carrier_on(struct net_device *dev)
  {
 + if ((dev-flags  IFF_WAIT) 
 + test_bit(__LINK_STATE_NOCARRIER, dev-state))
 + netif_dormant_on(dev);

That would be for avoiding the userspace supplicant race I assume. Bad problem 
here: To allow software/userspace controlled probe and association packets, 
wireless devices must not go to netif_carrier_off() anymore when the 
association is lost or must have a way to transmit packets without using the 
kernel scheduler ;-( May be wireless developers could live with this 
limitation.

Your solution would work for Krzysztof and for WPA/802.1X, but with the 
limitation I've just mentioned. However, as it does not define a clear point 
for L3 protocols to start, it would not enhance support for routing daemons 
and dialup interfaces, what my idea can do. As I've already used linux boxes 
as routers in a redundant topology, I consider this important.

What to do now? I have the impression that most arguments are said. Maybe 
someone like acme or davem should chime in and decide which direction to 
take?

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


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread David S. Miller
From: Krzysztof Halasa [EMAIL PROTECTED]
Date: Mon, 07 Nov 2005 17:37:40 +0100

 David?

I'm still 20,000+ emails deep in backlog after my 2 week
vaction, so I won't be able to look into this for at least
a few more days, at best.

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


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Krzysztof Halasa
Stefan Rompf [EMAIL PROTECTED] writes:

 + /* Operation state */
 + unsigned char operstate_kernel;
 + unsigned char operstate_useroverride;

8 bits don't make sense. OTOH I think all writes and possibly reads would
need spinlocks.

 +void netif_set_kernel_operstate(struct net_device *dev, unsigned char 
 newstate) {
 + char oldstate = dev-operstate_kernel;
 + if (oldstate != newstate) {
 + dev-operstate_kernel = newstate;
 + wmb();
 + linkwatch_fire_event(dev);
 + }
 +}

You can't assume any serialization for this function as it could be
called from anywhere anytime - it would require a spinlock (even with
simple Ethernet).

OTOH I think we could just do that spinlock and forget about it, given
all read and write accesses are atomic (so we can safely read without
spinlock).


Even without user override, I don't know how do you plan entering
the following device states:

+   OPER_UNKNOWN = 0,
+   OPER_DOWN = 16,
+   OPER_LOWERLAYERDOWN,
+   OPER_TESTING = 32,
+   OPER_DORMANTL3DOWN = 48, /* OS queue start from here */
+   OPER_DORMANTL3UP = 64, /* L3 should try using interface */
+   OPER_UP = 96

I understand OPEN_DOWN and OPEN_UP (despite their names) aren't used
for setting administrative status? What's their exact meaning (WRT
administrative status)?

I don't exactly understand relation between operstate_kernel and
__LINK_STATE_* flags. Do you plan removing them or not?
-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Thomas Graf
* Stefan Rompf [EMAIL PROTECTED] 2005-11-07 17:41
  Can't we put the driver, stacked interface, etc. in charge for dropping
  packets which shouldn't be let through yet? I would favour this and have
  the dormant state limited to link layer responsibilities.
 
 Imagine this situation:
 
  +---+
  | 1 |
  +---+
|+---+   +---+
+| 2 |---| 3 |
 A   +---+ B +---+
   |   | +---+
   +---+-| 4 |
   C +---+
 
 1,2,3,4 are acting as routers with the quagga daemon running. A,B,C are 
 networks.
 
 Now (1) wants to reach (4). Normally, the packet would travel to (2) via (A), 
 from there to (4) via (C).
 
 But what happens when the link from (2) to (C) fails? The routing protocol 
 would realize it (actually it was me how has added IFF_RUNNING support to 
 quagga) and add a route to (C) via (3) on (B). However, the connected route 
 would still have precedence and the linux IP stack on (2) would happily try 
 to continue using the broken link to (C), even if we add juju magic to the 
 link layer to recognize and drop L3 packets.
 
 That's why I think L3 protocols should be responsible for not using a broken 
 link and why we need OPER_DORMANTL3DOWN.

I'm sorry, I don't get the point. I assume the above is not a carrier
failure but something else to be detected by a keepalive protocol. That
keepalive protocol could put the interface into dormant state and thus
control the IFF_RUNNING flag with the queues enabled so it can continue
sending. Isn't it the routing daemon's fault when preferring a route
which has the IFF_RUNNING flag cleared? I'm sorry fot not getting it. ;-)

 OPER_DORMANTL3UP is another beast. Dial on demand interfaces may be dormant, 
 but of course layer L3 must consider routes pointing to them, or they would 
 never dial.

This is clear, the packet must get to the interface in order to actually
trigger the dial.

 OTOH, we don't need to be completely atomic as the netif_carrier_*-functions 
 already require driver controlled synchronisation. We just need to make sure 
 that the caches are coherent before linkwatch kernel thread runs.

The reason we now have netif_carrier_* instead of |= IFF_RUNNING as it
used to be is exactly atomicty. Since you write to oper_state from
various locations the operation must be atomic to avoid corruption.

  +#define IFF_LINK_UP0x2000  /* lower link up
  */
  +#define IFF_DORMANT0x4000  /* waiting for external event   
  */
  +#define IFF_WAIT   0x8000  /* auto. enter dormant state*/
 
  +int dev_oper_state(struct net_device *dev)
  +{
  +   if (!netif_device_present(dev))
  +   return IF_OPER_NOTPRESENT;
  +
  +   if (!netif_running(dev))
  +   return IF_OPER_DOWN;
 
 No, !netif_running() is ADMIN down, mostly representing the IFF_UP flag.

Right but the RFC specifies that admin. down implies operational down:

 If ifAdminStatus is down(2) then ifOperStatus
should be down(2). If ifAdminStatus is changed to up(1)
then ifOperStatus should change to up(1) if the interface is
ready to transmit and receive network traffic; it should
change to dormant(5) if the interface is waiting for
external actions (such as a serial line waiting for an
incoming connection); it should remain in the down(2) state
if and only if there is a fault that prevents it from going
to the up(1) state; it should remain in the notPresent(6)
state if the interface has missing (typically, hardware)
components.

This also describes why your scheme cannot work, we have to memorize
the status of for example carrier state.

  +   if (!netif_carrier_ok(dev))
  +   return IF_OPER_LOWERLAYERDOWN;
 
 No, this is OPER_DOWN. LOWERLAYERDOWN is IMHO f.e. for VLANs stacked on a 
 physical interface that is OPER_DOWN.

Correct, I agree although I don't understand this. The physical lower
link is just like a the lower interface(s) of a stackable interface. I
can't seem to understand how the RFC proposes to retreive the carrier
state while the interface is administratively down.

   void netif_carrier_on(struct net_device *dev)
   {
  +   if ((dev-flags  IFF_WAIT) 
  +   test_bit(__LINK_STATE_NOCARRIER, dev-state))
  +   netif_dormant_on(dev);
 
 That would be for avoiding the userspace supplicant race I assume. Bad 
 problem 
 here: To allow software/userspace controlled probe and association packets, 
 wireless devices must not go to netif_carrier_off() anymore when the 
 association is lost or must have a way to transmit packets without using the 
 kernel scheduler ;-( May be wireless developers could live with this 
 limitation.

The wireless driver can just issue netif_dormant_on(). the automatic
dormant state when the carrier is on again is just for userspace to
guarneteed actions after the link has been down.

 What to do now? I have the impression that 

[GIT PATCH] RFC3484 compliant source address selection

2005-11-07 Thread YOSHIFUJI Hideaki / 吉藤英明
Hello.

David, this is what I promised before.

Please pull the following changesets, which implement
the source address selection algorythm described in RFC3484; e.g.: 

 - avoid using daprecated address
 - prefer address in appropriate scope / on appropriate interface
 - (minimum support of) matching label
 - prefer longest matching address

Changesets are available at:

git://git.skbuff.net/gitroot/yoshfuji/linux-2.6.14+git+saddrselect-20051107.git

I'd like to give special thanks to Perry Lorier and Ian McDonald.
Thank you again.

===

HEADLINES
-
 [IPV6]: Put addr_diff() into common header for future use.
 [IPV6]: Make ipv6_addr_type() more generic so that we can use it for source 
address selection.
 [IPV6]: RFC3484 compliant source address selection

DIFFSTAT

 include/net/ipv6.h   |   67 +++-
 net/ipv6/addrconf.c  |  430 +-
 net/ipv6/ip6_fib.c   |   54 --
 net/ipv6/ipv6_syms.c |2 
 4 files changed, 352 insertions(+), 201 deletions(-)

CHANGELOGS
--

[IPV6]: Put addr_diff() into common header for future use.

Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED]

diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 65ec866..98661fa 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -341,6 +341,54 @@ static inline int ipv6_addr_any(const st
 }
 
 /*
+ * find the first different bit between two addresses
+ * length of address must be a multiple of 32bits
+ */
+static inline int __ipv6_addr_diff(const void *token1, const void *token2, int 
addrlen)
+{
+   const __u32 *a1 = token1, *a2 = token2;
+   int i;
+
+   addrlen = 2;
+
+   for (i = 0; i  addrlen; i++) {
+   __u32 xb = a1[i] ^ a2[i];
+   if (xb) {
+   int j = 31;
+
+   xb = ntohl(xb);
+   while ((xb  (1  j)) == 0)
+   j--;
+
+   return (i * 32 + 31 - j);
+   }
+   }
+
+   /*
+*  we should *never* get to this point since that 
+*  would mean the addrs are equal
+*
+*  However, we do get to it 8) And exacly, when
+*  addresses are equal 8)
+*
+*  ip route add ::/128 via ...
+*  ip route add ::/64 via ...
+*  and we are here.
+*
+*  Ideally, this function should stop comparison
+*  at prefix length. It does not, but it is still OK,
+*  if returned value is greater than prefix length.
+*  --ANK (980803)
+*/
+   return (addrlen  5);
+}
+
+static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct 
in6_addr *a2)
+{
+   return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
+}
+
+/*
  * Prototypes exported by ipv6
  */
 
diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
index 4fcc5a7..1bf6d9a 100644
--- a/net/ipv6/ip6_fib.c
+++ b/net/ipv6/ip6_fib.c
@@ -127,56 +127,6 @@ static __inline__ int addr_bit_set(void 
return htonl(1  ((~fn_bit)0x1F))  addr[fn_bit5];
 }
 
-/*
- * find the first different bit between two addresses
- * length of address must be a multiple of 32bits
- */
-
-static __inline__ int addr_diff(void *token1, void *token2, int addrlen)
-{
-   __u32 *a1 = token1;
-   __u32 *a2 = token2;
-   int i;
-
-   addrlen = 2;
-
-   for (i = 0; i  addrlen; i++) {
-   __u32 xb;
-
-   xb = a1[i] ^ a2[i];
-
-   if (xb) {
-   int j = 31;
-
-   xb = ntohl(xb);
-
-   while ((xb  (1  j)) == 0)
-   j--;
-
-   return (i * 32 + 31 - j);
-   }
-   }
-
-   /*
-*  we should *never* get to this point since that 
-*  would mean the addrs are equal
-*
-*  However, we do get to it 8) And exacly, when
-*  addresses are equal 8)
-*
-*  ip route add ::/128 via ...
-*  ip route add ::/64 via ...
-*  and we are here.
-*
-*  Ideally, this function should stop comparison
-*  at prefix length. It does not, but it is still OK,
-*  if returned value is greater than prefix length.
-*  --ANK (980803)
-*/
-
-   return addrlen5;
-}
-
 static __inline__ struct fib6_node * node_alloc(void)
 {
struct fib6_node *fn;
@@ -296,11 +246,11 @@ insert_above:
 
/* find 1st bit in difference between the 2 addrs.
 
-  See comment in addr_diff: bit may be an invalid value,
+  See comment in __ipv6_addr_diff: bit may be an invalid value,
   but if it is = plen, the value is ignored in any case

Re: [PATCH 2.6.14] ipv4: ip_queue_xmit ip id increment off by one

2005-11-07 Thread David S. Miller
From: Tom Young [EMAIL PROTECTED]
Date: Mon, 07 Nov 2005 15:59:49 +1100

 The socket ip id currently gets incremented by 1 + the number of
 segments leading to an increment of 2 in the standard non-TSO case.
 This patch fixes 'more' to be a count of extra segments.
 
 Signed-off-by: Thomas Young [EMAIL PROTECTED]

The tso_segs field is zero for non-TSO frames, so your patch breaks
non-TSO frames whilst fixing TSO ones :-)
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Krzysztof Halasa
Stefan Rompf [EMAIL PROTECTED] writes:

 But what happens when the link from (2) to (C) fails? The routing protocol 
 would realize it (actually it was me how has added IFF_RUNNING support to 
 quagga) and add a route to (C) via (3) on (B). However, the connected
 route 
 would still have precedence and the linux IP stack on (2) would happily try 
 to continue using the broken link to (C), even if we add juju magic to the 
 link layer to recognize and drop L3 packets.

Linux should just IMHO drop direct route when !IFF_RUNNING.

Another thing is if you have quagga (never used it, but I done things
like that with mrtd and even without IFF_RUNNING I think) you can
configure /32 mask on the managed interface and let quagga add dynamic
routes. That's what quagga and not the kernel is for - dynamic routing,
right?

 OPER_DORMANTL3UP is another beast. Dial on demand interfaces may be dormant, 
 but of course layer L3 must consider routes pointing to them, or they would 
 never dial.

I'm not entirely against L3DOWN/UP idea. Normally dial-up devices show
IFF_RUNNING and the internal state is not visible. I would rather do it
with another flag (and another patch, when they are users), signaling
that the device isn't yet connected even if it's IFF_RUNNING.

 OTOH, we don't need to be completely atomic as the netif_carrier_*-functions 
 already require driver controlled synchronisation.

We can't assume anything like this.

 We just need to make sure 
 that the caches are coherent before linkwatch kernel thread runs.

wmb() is for gcc and bus reordering etc, not needed here.

 Bad
 problem 
 here: To allow software/userspace controlled probe and association packets, 
 wireless devices must not go to netif_carrier_off() anymore when the 
 association is lost

I'm told it doesn't seem a problem not limitation at all, right?
-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2.6.14 (take #2)] fec_8xx: make CONFIG_FEC_8XX depend on CONFIG_8xx

2005-11-07 Thread John W. Linville
Change CONFIG_FEC_8XX to depend on CONFIG_8xx instead of CONFIG_FEC.
CONFIG_FEC depends on ColdFire CPUs, which does not apply for the
PPC 8xx processors.

Signed-off-by: John W. Linville [EMAIL PROTECTED]
---

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

diff --git a/drivers/net/fec_8xx/Kconfig b/drivers/net/fec_8xx/Kconfig
index 94e7a9a..a84c232 100644
--- a/drivers/net/fec_8xx/Kconfig
+++ b/drivers/net/fec_8xx/Kconfig
@@ -1,6 +1,6 @@
 config FEC_8XX
tristate Motorola 8xx FEC driver
-   depends on NET_ETHERNET  FEC
+   depends on NET_ETHERNET  8xx
select MII
 
 config FEC_8XX_GENERIC_PHY
-- 
John W. Linville
[EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Thomas Graf
* Krzysztof Halasa [EMAIL PROTECTED] 2005-11-07 18:04
 Thomas Graf [EMAIL PROTECTED] writes:
   void netif_carrier_on(struct net_device *dev)
   {
  +   if ((dev-flags  IFF_WAIT) 
  +   test_bit(__LINK_STATE_NOCARRIER, dev-state))
  +   netif_dormant_on(dev);
 ^^
 Does not prevent spurious momentary IFF_RUNNING: netif_dormant_off()
 may come after it before the session is established as an effect
 of pre-carrier-flap activity (due to asynchronous notification) - so,
 in comparison to my patch, I don't see the gain. Not sure what locking
 (short of a single spinlock for all those flags) could solve that but
 I'm not a spinlock expert.

Well, firstly we cannot provide a perfect notification schema.
Take for example the carrier, when we reach netif_carrier_off(),
the carrier might in fact be up already. We then fire linkwatch
and while we wait for the workqueue to handle it, the carrier
state may theoretically change again. Events to userspace can
get lost due to various reasons, for example memory pressure.

What I actually want to say is that we probably cannot guarentee
an up-to-date informal of all parties, what we can do is avoid
is inconsistency. So considering the above case, netif_carrier_on()
has to be syncronized by the caller, this means the carrier state
may not change while we're inside the function. Secondly we know
that when the function is called, there must have been no carrier
for some time _if_ the carrier is currently set to off. This
means that the above code is only issued for legal carrier
resumes. The fact that we go to dormant state before changing the
carrier state makes dev_oper_state() behave correctly because in
case we actually call dev_oper_state() between netif_dormant_on()
and setting the carrier bit the interface will still be seen as
down and then switches to dormant in a single atomic operation.

 Protocol driver must still call netif_dormant_on() itself or IFF_RUNNING
 may be stuck for long.

The IFF_WAIT flag can only be set by root, it is in his reponsibly
to handle this correctly. It is intended for userspace although
it can of course be used by drivers or stackable interfaces as well.

  if (test_and_clear_bit(__LINK_STATE_NOCARRIER, dev-state))
  linkwatch_fire_event(dev);
  -   if (netif_running(dev))
  +
  +   if (netif_running(dev)  !netif_dormant(dev));
  __netdev_watchdog_up(dev);
 ^
 Could be called even if the above netif_dormant_on() set the status.
 Hope the protocol resets it when it gets 'carrier down' event.

Theoretically yes, it has the same issues as all other link states.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Stefan Rompf
Am Montag 07 November 2005 18:45 schrieb Thomas Graf:

 I'm sorry, I don't get the point. I assume the above is not a carrier
 failure but something else to be detected by a keepalive protocol. 

No, it's a carrier failure. Try this, eth1 is an ethernet interface without 
the cable connected:

dose:~ # ip addr add 192.168.200.1/24 dev eth1
dose:~ # ip link set eth1 up
dose:~ # ifconfig eth1 | fgrep UP
  UP BROADCAST MULTICAST  MTU:1500  Metric:1
dose:~ # ip route show 192.168.200.0/24
192.168.200.0/24 dev eth1  proto kernel  scope link  src 192.168.200.1
dose:~ # ping 192.168.200.10
PING 192.168.200.10 (192.168.200.10) 56(84) bytes of data.
From 192.168.200.1: icmp_seq=2 Destination Host Unreachable
dose:~ # arp
192.168.200.10   (incomplete) eth1

Even though the interface is not IFF_RUNNING and queueing is therefore 
disabled, the kernel created a route pointing to it and uses it.

 Isn't it the routing daemon's fault when preferring a route 
 which has the IFF_RUNNING flag cleared? I'm sorry fot not getting it. ;-)

As the kernel maintains this connected route, userspace is IMHO not 
responsible. Quagga could add its routes with a higher metric (administrative 
distance in cisco terms), kernel should use them as soon as the connected 
route becomes unavailable due to carrier failure (or dormant for wireless 
interfaces).

And now if we support this, we'd need a dormant state with the route disabled 
and one with it enabled.

Btw, adding a userspace workaround would be dangerous. If the routing daemon 
crashes while a link is down, the userspace removed connected route would not 
come back, leaving the router unreachable on this interface. *Very* bad.

  OTOH, we don't need to be completely atomic as the
  netif_carrier_*-functions already require driver controlled
  synchronisation. We just need to make sure that the caches are coherent
  before linkwatch kernel thread runs.

 The reason we now have netif_carrier_* instead of |= IFF_RUNNING as it
 used to be is exactly atomicty. Since you write to oper_state from
 various locations the operation must be atomic to avoid corruption.

No, it's because the IFF_* flags are a bit field that can only be changed from 
process context protected by rtnl/dev_base_lock, different to 
__LINK_STATE_NO_CARRIER (or a operational state field) that must be 
accessible from interrupts.

  No, !netif_running() is ADMIN down, mostly representing the IFF_UP flag.

 Right but the RFC specifies that admin. down implies operational down:

Indeed, but we should not set OPER_DOWN if and only if admin is down ;-)

 This also describes why your scheme cannot work, we have to memorize
 the status of for example carrier state.

Can't see that requirement from RFC, and devices are normally initialized in 
their open()-methods.

 We're not far apart, the difference is for the additional L3 disabled
 dormant state which I don't understand yet and secondaly that I continue
 to keep the current link states with the addition of a new dormant state
 and then translate it into the RFC2863 operational status.

Ok, so I hope a finally managed to make my point clear about the different 
dormant states ;-)

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


Re: [RFC] TSO problems with congestion updates

2005-11-07 Thread David S. Miller
From: Stephen Hemminger [EMAIL PROTECTED]
Date: Mon, 7 Nov 2005 11:22:15 -0800

 I am looking into creating a function tcp_is_application_limited()
 to replace the old in flight check. It is kind of the logical inverse
 of the nagle check code on output. 

That's a great idea, I was going to suggest something like that
actuall.

This is the crux of it, the application-limited check just needs
to be adjusted to account for things TSO does.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/2 2.6.14-git10] prism54 : Transmit stats updated in wrong place

2005-11-07 Thread Roger While
Move update of the transmit statistics to the correct place.

Signed-off-by: Roger While [EMAIL PROTECTED]
diff -Naur linux-2.6.14orig/drivers/net/wireless/prism54/islpci_eth.c linux-2.6.14/drivers/net/wireless/prism54/islpci_eth.c
--- linux-2.6.14orig/drivers/net/wireless/prism54/islpci_eth.c	2005-11-07 15:43:45.0 +0100
+++ linux-2.6.14/drivers/net/wireless/prism54/islpci_eth.c	2005-11-07 16:05:28.0 +0100
@@ -227,17 +227,17 @@
 		priv-data_low_tx_full = 1;
 	}
 
+	/* set the transmission time */
+	ndev-trans_start = jiffies;
+	priv-statistics.tx_packets++;
+	priv-statistics.tx_bytes += skb-len;
+
 	/* trigger the device */
 	islpci_trigger(priv);
 
 	/* unlock the driver code */
 	spin_unlock_irqrestore(priv-slock, flags);
 
-	/* set the transmission time */
-	ndev-trans_start = jiffies;
-	priv-statistics.tx_packets++;
-	priv-statistics.tx_bytes += skb-len;
-
 	return 0;
 
   drop_free:


[PATCH 1/2 2.6.14-git10] prism54 : Unused variable / extraneous udelay

2005-11-07 Thread Roger While
In isl_38xx.c :
The variable counter is defined and incremented but never
used except if the driver is hand-compiled setting
VERBOSE  SHOW_ERROR_MESSAGES.
Move the definition and the increment to within the
#if VERBOSE ..   block.

Remove extraneous udelay's.
These are not required when triggering the device.

Signed-off-by: Roger While [EMAIL PROTECTED]
diff -Naur linux-2.6.14orig/drivers/net/wireless/prism54/isl_38xx.c linux-2.6.14/drivers/net/wireless/prism54/isl_38xx.c
--- linux-2.6.14orig/drivers/net/wireless/prism54/isl_38xx.c	2005-10-28 02:02:08.0 +0200
+++ linux-2.6.14/drivers/net/wireless/prism54/isl_38xx.c	2005-11-07 16:04:03.0 +0100
@@ -112,9 +112,10 @@
 void
 isl38xx_trigger_device(int asleep, void __iomem *device_base)
 {
-	u32 reg, counter = 0;
+	u32 reg;
 
 #if VERBOSE  SHOW_ERROR_MESSAGES
+	u32 counter = 0;
 	struct timeval current_time;
 	DEBUG(SHOW_FUNCTION_CALLS, isl38xx trigger device\n);
 #endif
@@ -131,7 +132,6 @@
 		  current_time.tv_sec, (long)current_time.tv_usec,
 		  readl(device_base + ISL38XX_CTRL_STAT_REG));
 #endif
-		udelay(ISL38XX_WRITEIO_DELAY);
 
 		reg = readl(device_base + ISL38XX_INT_IDENT_REG);
 		if (reg == 0xabadface) {
@@ -145,7 +145,9 @@
 			while (reg = readl(device_base + ISL38XX_CTRL_STAT_REG),
 			   (reg  ISL38XX_CTRL_STAT_SLEEPMODE) == 0) {
 udelay(ISL38XX_WRITEIO_DELAY);
+#if VERBOSE  SHOW_ERROR_MESSAGES
 counter++;
+#endif
 			}
 
 #if VERBOSE  SHOW_ERROR_MESSAGES
@@ -153,10 +155,6 @@
 			  %08li.%08li Device register read %08x\n,
 			  current_time.tv_sec, (long)current_time.tv_usec,
 			  readl(device_base + ISL38XX_CTRL_STAT_REG));
-#endif
-			udelay(ISL38XX_WRITEIO_DELAY);
-
-#if VERBOSE  SHOW_ERROR_MESSAGES
 			do_gettimeofday(current_time);
 			DEBUG(SHOW_TRACING,
 			  %08li.%08li Device asleep counter %i\n,
@@ -171,7 +169,6 @@
 
 		/* perform another read on the Device Status Register */
 		reg = readl(device_base + ISL38XX_CTRL_STAT_REG);
-		udelay(ISL38XX_WRITEIO_DELAY);
 
 #if VERBOSE  SHOW_ERROR_MESSAGES
 		do_gettimeofday(current_time);
@@ -187,7 +184,6 @@
 
 		isl38xx_w32_flush(device_base, ISL38XX_DEV_INT_UPDATE,
   ISL38XX_DEV_INT_REG);
-		udelay(ISL38XX_WRITEIO_DELAY);
 	}
 }
 


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Thomas Graf
* Stefan Rompf [EMAIL PROTECTED] 2005-11-07 20:25
 dose:~ # ip addr add 192.168.200.1/24 dev eth1
 dose:~ # ip link set eth1 up
 dose:~ # ifconfig eth1 | fgrep UP
   UP BROADCAST MULTICAST  MTU:1500  Metric:1
 dose:~ # ip route show 192.168.200.0/24
 192.168.200.0/24 dev eth1  proto kernel  scope link  src 192.168.200.1
 dose:~ # ping 192.168.200.10
 PING 192.168.200.10 (192.168.200.10) 56(84) bytes of data.
 From 192.168.200.1: icmp_seq=2 Destination Host Unreachable
 dose:~ # arp
 192.168.200.10   (incomplete) eth1
 
 Even though the interface is not IFF_RUNNING and queueing is therefore 
 disabled, the kernel created a route pointing to it and uses it.

Yes, just like it is supposed to do.

  Isn't it the routing daemon's fault when preferring a route 
  which has the IFF_RUNNING flag cleared? I'm sorry fot not getting it. ;-)
 
 As the kernel maintains this connected route, userspace is IMHO not 
 responsible. Quagga could add its routes with a higher metric (administrative 
 distance in cisco terms), kernel should use them as soon as the connected 
 route becomes unavailable due to carrier failure (or dormant for wireless 
 interfaces).

Then how are you going to implement OSPF which has its own link state
detection? It's basically the same just that checking the carrier is
a very weak solution. The routes, especially the local routes, must
exist while there is no carrier.

 Btw, adding a userspace workaround would be dangerous. If the routing daemon 
 crashes while a link is down, the userspace removed connected route would not 
 come back, leaving the router unreachable on this interface. *Very* bad.

I think this is a very weak excuse to move something into the kernel
that can exist in userspace. The routing daemon has to check the
interfaces on start-up eventually bringing up interfaces so all you have
to make sure is that it doesn't crash all the time and that you supervise
the process somehow.

  The reason we now have netif_carrier_* instead of |= IFF_RUNNING as it
  used to be is exactly atomicty. Since you write to oper_state from
  various locations the operation must be atomic to avoid corruption.
 
 No, it's because the IFF_* flags are a bit field that can only be changed 
 from 
 process context protected by rtnl/dev_base_lock, different to 
 __LINK_STATE_NO_CARRIER (or a operational state field) that must be 
 accessible from interrupts.

I'm not sure about what exactly you're argueing. Using a char for the
operational state may imply bit operations on some architectures.
There goes your atomicity. dev-flags is certainly not protected by
dev_base_lock, I'm not even sure if the rtnl semaphore is acquired for
all write accesses to dev-flags.

   No, !netif_running() is ADMIN down, mostly representing the IFF_UP flag.
 
  Right but the RFC specifies that admin. down implies operational down:
 
 Indeed, but we should not set OPER_DOWN if and only if admin is down ;-)

So you mean we should not follow the RFC in this case? What operational
status would it be then? OPER_UNKNOWN?

  This also describes why your scheme cannot work, we have to memorize
  the status of for example carrier state.
 
 Can't see that requirement from RFC, and devices are normally initialized in 
 their open()-methods.

It's an SNMP RFC, it's not supposed to tell us how to manage interface
states in the kernel. The carrier state is event driven, which means
that when we don't memorize this information while we announce the
interface as down we'd have to ask the drivers about the carrier state
when we put it up again which is just non-sense.

I have a hard time seeing you first not following the RFC and then
relying on it like it would be the overall perfect solution.

 Ok, so I hope a finally managed to make my point clear about the different 
 dormant states ;-)

I understand your idea but I don't agree.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH] atmel: memset correct range

2005-11-07 Thread Alexey Dobriyan
Signed-off-by: Alexey Dobriyan [EMAIL PROTECTED]
---

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

--- a/drivers/net/wireless/atmel.c
+++ b/drivers/net/wireless/atmel.c
@@ -2217,7 +2217,7 @@ static int atmel_get_range(struct net_de
int k,i,j;
 
dwrq-length = sizeof(struct iw_range);
-   memset(range, 0, sizeof(range));
+   memset(range, 0, sizeof(struct iw_range));
range-min_nwid = 0x;
range-max_nwid = 0x;
range-num_channels = 0;

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


[PATCH 1/2] LSM-IPSec Network Hooks

2005-11-07 Thread Trent Jaeger
Hi,

Format modifications for Linux patch style.

Regards,
Trent.
--

This patch series implements per packet access control via the
extension of the Linux Security Modules (LSM) interface by hooks in
the XFRM and pfkey subsystems that leverage IPSec security
associations to label packets.  Extensions to the SELinux LSM are
included that leverage the patch for this purpose.

This patch implements the changes necessary to the XFRM subsystem,
pfkey interface, ipv4/ipv6, and xfrm_user interface to restrict a
socket to use only authorized security associations (or no security
association) to send/receive network packets.

Patch purpose:

The patch is designed to enable access control per packets based on
the strongly authenticated IPSec security association.  Such access
controls augment the existing ones based on network interface and IP
address.  The former are very coarse-grained, and the latter can be
spoofed.  By using IPSec, the system can control access to remote
hosts based on cryptographic keys generated using the IPSec mechanism.
This enables access control on a per-machine basis or per-application
if the remote machine is running the same mechanism and trusted to
enforce the access control policy.

Patch design approach:

The overall approach is that policy (xfrm_policy) entries set by
user-level programs (e.g., setkey for ipsec-tools) are extended with a
security context that is used at policy selection time in the XFRM
subsystem to restrict the sockets that can send/receive packets via
security associations (xfrm_states) that are built from those
policies.  

A presentation available at
www.selinux-symposium.org/2005/presentations/session2/2-3-jaeger.pdf
from the SELinux symposium describes the overall approach.

Patch implementation details: 

On output, the policy retrieved (via xfrm_policy_lookup or
xfrm_sk_policy_lookup) must be authorized for the security context of
the socket and the same security context is required for resultant
security association (retrieved or negotiated via racoon in
ipsec-tools).  This is enforced in xfrm_state_find.

On input, the policy retrieved must also be authorized for the socket
(at __xfrm_policy_check), and the security context of the policy must
also match the security association being used.

The patch has virtually no impact on packets that do not use IPSec.
The existing Netfilter (outgoing) and LSM rcv_skb hooks are used as
before.

Also, if IPSec is used without security contexts, the impact is
minimal.  The LSM must allow such policies to be selected for the
combination of socket and remote machine, but subsequent IPSec
processing proceeds as in the original case.

Testing:

The pfkey interface is tested using the ipsec-tools.  ipsec-tools have
been modified (a separate ipsec-tools patch is available for version
0.5) that supports assignment of xfrm_policy entries and security
associations with security contexts via setkey and the negotiation
using the security contexts via racoon.

The xfrm_user interface is tested via ad hoc programs that set
security contexts.  These programs are also available from me, and
contain programs for setting, getting, and deleting policy for testing
this interface.  Testing of sa functions was done by tracing kernel
behavior.

---

 include/linux/pfkeyv2.h  |   13 ++-
 include/linux/security.h |  132 +++
 include/linux/xfrm.h |   29 ++
 include/net/flow.h   |7 -
 include/net/xfrm.h   |   27 +-
 net/core/flow.c  |8 +
 net/key/af_key.c |  197 +--
 net/xfrm/xfrm_policy.c   |   88 
 net/xfrm/xfrm_state.c|9 +-
 net/xfrm/xfrm_user.c |  148 +--
 security/Kconfig |   13 +++
 security/dummy.c |   45 ++
 12 files changed, 655 insertions(+), 61 deletions(-)

diff -puN include/linux/pfkeyv2.h~lsm-xfrm-nethooks include/linux/pfkeyv2.h
--- linux-2.6.14/include/linux/pfkeyv2.h~lsm-xfrm-nethooks  2005-11-07 
10:42:19.0 -0500
+++ linux-2.6.14-root/include/linux/pfkeyv2.h   2005-11-07 10:42:19.0 
-0500
@@ -216,6 +216,16 @@ struct sadb_x_nat_t_port {
 } __attribute__((packed));
 /* sizeof(struct sadb_x_nat_t_port) == 8 */
 
+/* Generic LSM security context */
+struct sadb_x_sec_ctx {
+   uint16_tsadb_x_sec_len;
+   uint16_tsadb_x_sec_exttype;
+   uint8_t sadb_x_ctx_alg;  /* LSMs: e.g., selinux == 1 */
+   uint8_t sadb_x_ctx_doi;
+   uint16_tsadb_x_ctx_len;
+} __attribute__((packed));
+/* sizeof(struct sadb_sec_ctx) = 8 */
+
 /* Message types */
 #define SADB_RESERVED  0
 #define SADB_GETSPI1
@@ -325,7 +335,8 @@ struct sadb_x_nat_t_port {
 #define SADB_X_EXT_NAT_T_SPORT 21
 #define SADB_X_EXT_NAT_T_DPORT 22
 #define SADB_X_EXT_NAT_T_OA23
-#define SADB_EXT_MAX   23

Re: [RFC] TSO problems with congestion updates

2005-11-07 Thread Stephen Hemminger
The core of what I am now testing is:



+/* RFC2861 Check whether we are limited by application or congestion window
+ * This is the inverse of tcp_tso_should_defer
+ */
+static inline int tcp_cwnd_full(const struct tcp_sock *tp, u32 in_flight,
+   u32 ack_seq)
+{
+   u32 left;
+
+   if (in_flight = tp-snd_cwnd)
+   return 1;
+
+   left = tp-snd_cwnd - in_flight;
+   if (sysctl_tcp_tso_win_divisor)
+   return left  tp-snd_cwnd / sysctl_tcp_tso_win_divisor;
+   else
+   return left = tcp_max_burst(tp);
+}
+
 /* Check that window update is acceptable.
  * The function assumes that snd_una=ack=snd_next.
  */
@@ -2360,12 +2377,13 @@ static int tcp_ack(struct sock *sk, stru
 
if (tcp_ack_is_dubious(sk, flag)) {
/* Advanve CWND, if state allows this. */
-   if ((flag  FLAG_DATA_ACKED)  tcp_may_raise_cwnd(sk, flag))
-   tcp_cong_avoid(sk, ack,  seq_rtt, prior_in_flight, 0);
+   if ((flag  FLAG_DATA_ACKED)  tcp_may_raise_cwnd(sk, flag)
+tcp_cwnd_full(tp, prior_in_flight, ack))
+   tcp_cong_avoid(sk, ack, seq_rtt, 0);
tcp_fastretrans_alert(sk, prior_snd_una, prior_packets, flag);
} else {
-   if ((flag  FLAG_DATA_ACKED))
-   tcp_cong_avoid(sk, ack, seq_rtt, prior_in_flight, 1);
+   if ((flag  FLAG_DATA_ACKED)  tcp_cwnd_full(tp, 
prior_in_flight, ack))
+   tcp_cong_avoid(sk, ack, seq_rtt, 1);
}
 
 
-- 
Stephen Hemminger [EMAIL PROTECTED]
OSDL http://developer.osdl.org/~shemminger
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Stefan Rompf
Am Montag 07 November 2005 22:04 schrieb Thomas Graf:

  As the kernel maintains this connected route, userspace is IMHO not
  responsible. Quagga could add its routes with a higher metric
  (administrative distance in cisco terms), kernel should use them as soon
  as the connected route becomes unavailable due to carrier failure (or
  dormant for wireless interfaces).

 Then how are you going to implement OSPF which has its own link state
 detection? It's basically the same just that checking the carrier is
 a very weak solution.

What do you mean with OSPF link state detection? That a router and the 
(backup) designated router of a network must see each others hello before 
they exchange routing information? This has nothing to do with the question 
whether the kernel uses a kernel created route pointing to the oper down 
interface or not.

 The routes, especially the local routes, must 
 exist while there is no carrier.

I don't want the kernel to remove these routes, that would be broken. I want 
them be marked as inactive or unusable and being ignored by the routing 
decision while in this state. But maybe such a behaviour change should be 
configurable.

 I think this is a very weak excuse to move something into the kernel
 that can exist in userspace.

Even then, the kernel creates this connected route implicitely when the 
interface is brought admin up, and is therefore responsible for it.

Obviously we disagree here.

 I'm not sure about what exactly you're argueing. Using a char for the
 operational state may imply bit operations on some architectures.

Ok, you got that point.

 There goes your atomicity. dev-flags is certainly not protected by
 dev_base_lock, I'm not even sure if the rtnl semaphore is acquired for
 all write accesses to dev-flags.

dev-flags is, look f.e. at dev_ioctl(); dev-state is not. But beside a short 
locking howto in core/dev.c, this is really not very well documented. May be 
this is the reason why some stuff in dev.c does not look totally race 
free ;-)

 So you mean we should not follow the RFC in this case? What operational
 status would it be then? OPER_UNKNOWN?

Well actually I meant you shouldn't have this difference in your 
dev_oper_state() function:

 +   if (!netif_running(dev))
 +   return IF_OPER_DOWN;
 +
 +   if (!netif_carrier_ok(dev))
 +   return IF_OPER_LOWERLAYERDOWN;

Both should be IF_OPER_DOWN then.

  Can't see that requirement from RFC, and devices are normally initialized
  in their open()-methods.

 It's an SNMP RFC, it's not supposed to tell us how to manage interface
 states in the kernel. The carrier state is event driven, which means
 that when we don't memorize this information while we announce the
 interface as down we'd have to ask the drivers about the carrier state
 when we put it up again which is just non-sense.

OTOH, (ethernet) drivers usually check link state when they are opened, so 
there should be a valid operstate after dev-open() returns. Anyway, there is 
indeed no reason to force operstate to some value from core, beside setting 
it to unknown when struct net_device is allocated.

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


Re: [RFC] TSO problems with congestion updates

2005-11-07 Thread David S. Miller
From: Stephen Hemminger [EMAIL PROTECTED]
Date: Mon, 7 Nov 2005 14:14:20 -0800

 The core of what I am now testing is:

Looks good but I'm starting to hate that divide, and now we'll
have to eat it for every ACK too :-/
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Krzysztof Halasa
Stefan Rompf [EMAIL PROTECTED] writes:

 I don't want the kernel to remove these routes, that would be broken.

Why exactly?
They would be brought back when the carrier raises again, of course.

 I want 
 them be marked as inactive or unusable and being ignored by the routing 
 decision while in this state.

Why do we need inactive or unusable routes in the kernel?
-- 
Krzysztof Halasa
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.14] ipv4: ip_queue_xmit ip id increment off by one

2005-11-07 Thread David S. Miller
From: Tom Young [EMAIL PROTECTED]
Date: Tue, 08 Nov 2005 10:33:50 +1100

 I'm not convinced that is true, I don't have a TSO supported card and I
 get tso_segs to be 1 inside the ip_queue_xmit function.
 Looking through tcp_output.c, all references I could find expected
 tso_segs to be a count of segments to send seemingly regardless of
 whether TSO was in use.

TCP ends up setting it to 1 but other protocols do not.

But other protocols use ip_queue_xmit() as well, such as DCCP
and SCTP, and they won't change it from it's alloc_skb() time
value of 0.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [NF+IPsec 4/6]: Make IPsec input processing symetrical to output

2005-11-07 Thread Kazunori Miyazawa

Yasuyuki KOZAKAI wrote:

Hi, Patrick,

From: Patrick McHardy [EMAIL PROTECTED]
Date: Sat, 05 Nov 2005 10:55:57 +0100



Also, I thought Yoshifuji-san's objection is not just about
transport mode packets passing through netif_rx twice, but
passing through netfilter twice as well?


I think so, but he didn't mention a reason why he objects to it.
I also don't think it can be done otherwise while still keeping
netfilter just working for all cases, which IMO is highly
desirable.



I try to comment based on discussion with Yoshifuji-san and Miyazawa-san.

We think it's confusing for user to mix decrypted packets and pre-decrypted
ones to same hook. For example, if user want to accept packets encrypted by
transport mode ESP and drop others, he will do iptables -A INPUT -p esp -j
ACCEPT and iptables -P INPUT DROP. But decrypted packets will be dropped
because of the 2nd command. Of cause the match module 'policy' will be helpful
in such case, but it's simple if he can different name of hook with INPUT.

And, in logical, the hook for decrypted packet and the one for pre-decrypted
packet is different like the current LOCAL_IN and LOCAL_OUT. Their place and
the packets they can see, are different.

This can be said about output path. The hook for encrypted packet and the one
for pre-encrypted packet is different.

In the current, LOCAL_OUT see pre-encrypted packet. I've been assuming
that LOCAL_OUT see the packets just before sending them from network device.
This is the reason why I said I support the way - which means LOCAL_OUT
doesn't see pre-encrypted packet.

Meanwhile the hook to see pre-encrypted packet is necessary for NAT
indeed as you pointed out. Then our suggestion is adding new hook
with new name, and distinguishing cleary between the usage of new and
current hook.



I agree to add new hooks. I think current LOCAL_IN and LOCAL_OUT have
two roles. One is a filter in the IP or the layer 3 and the other is
a filter of the layer 4 such as TCP.

I guess contrack and NAT may work as a filter of the layer 4 even if
they affect IP stack. On the other hand, LOCAL_IN and LOCAL_OUT are used
as a layer 3 filter.

If we keep current LOCAL_IN and put new hook in front of the layer 4 processing,
I think, it will be useful for IPv6 users because we will able to filter a 
packet
before and after the extention header processing, which are routing header, 
IPsec and
Mobile IPv6 for example.

I can not explain advantage in the output process clearly because the stackable
destination process is too special :-


BTW, tunnel mode is special case. We can avoid confusing by operation
and so on. For example, using different address for inner and outer header.
We agree to call netif_rx() twice for tunneled packets, as ever.

Regards,

-- Yasuyuki Kozakai


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


Re: [RFC] TSO problems with congestion updates

2005-11-07 Thread Stephen Hemminger
On Mon, 07 Nov 2005 15:15:15 -0800 (PST)
David S. Miller [EMAIL PROTECTED] wrote:

 From: Stephen Hemminger [EMAIL PROTECTED]
 Date: Mon, 7 Nov 2005 14:14:20 -0800
 
  The core of what I am now testing is:
 
 Looks good but I'm starting to hate that divide, and now we'll
 have to eat it for every ACK too :-/

it could be limited to power of 2 and a shift?

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


Re: [1/1] connector: fix documentation test module.

2005-11-07 Thread David S. Miller
From: Evgeniy Polyakov [EMAIL PROTECTED]
Date: Tue, 1 Nov 2005 22:28:30 +0300

 Patch from Carlo Comin vl4d spine-group.org
 
 Signed-off-by: Evgeniy Polyakov [EMAIL PROTECTED]

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


Re: [PKT_SCHED]: Correctly handle empty ematch trees

2005-11-07 Thread David S. Miller
From: Thomas Graf [EMAIL PROTECTED]
Date: Wed, 2 Nov 2005 00:41:10 +0100

 Fixes an invalid memory reference when the basic classifier
 is used without any ematches but just actions.
 
 Signed-off-by: Thomas Graf [EMAIL PROTECTED]

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


Re: [PATCH 2.6.14] ipv4: ip_queue_xmit ip id increment off by one

2005-11-07 Thread Tom Young
On Mon, 2005-11-07 at 16:16 -0800, David S. Miller wrote:
 TCP ends up setting it to 1 but other protocols do not.
 
 But other protocols use ip_queue_xmit() as well, such as DCCP
 and SCTP, and they won't change it from it's alloc_skb() time
 value of 0.

Thanks for clearing that up, I see that I was being too TCP-centric now
in my see if I broke anything testing. My patch solves my immediate
needs, but I will revisit this later and attempt a more generic solution
if time permits. 

Thanks,
Tom

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


Re: Patch: RFC2863 #1 (incomplete)

2005-11-07 Thread Paul Jakma

On Mon, 7 Nov 2005, Krzysztof Halasa wrote:


Stefan Rompf [EMAIL PROTECTED] writes:


But what happens when the link from (2) to (C) fails? The routing protocol
would realize it (actually it was me how has added IFF_RUNNING support to
quagga) and add a route to (C) via (3) on (B). However, the connected
route
would still have precedence and the linux IP stack on (2) would happily try
to continue using the broken link to (C), even if we add juju magic to the
link layer to recognize and drop L3 packets.


Linux should just IMHO drop direct route when !IFF_RUNNING.


ACK, please do. It's the kernel's route, the kernel should manage it. 
The reason setup of the connected route became automatic in 2.3 was, 
iirc, because its pointless to have an UPRUNNING interface without a 
connected route - exact same reasoning suggests that interface which 
is !(UPRUNNING) should have the kernel connected route removed by 
kernel.


regards,
--
Paul Jakma  [EMAIL PROTECTED]   [EMAIL PROTECTED]   Key ID: 64A2FF6A
Fortune:
 Leela: Is there some way to keep them from breeding?
 Paul: Cold showers don't work on Antarctic creatures.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2.6.14] ipv4: ip_queue_xmit ip id increment off by one

2005-11-07 Thread Herbert Xu
Tom Young [EMAIL PROTECTED] wrote:
 
 Thanks for clearing that up, I see that I was being too TCP-centric now
 in my see if I broke anything testing. My patch solves my immediate
 needs, but I will revisit this later and attempt a more generic solution
 if time permits. 

How about something like this?


[IPV4] Fix ip_queue_xmit identity increment for TSO packets

When ip_queue_xmit calls ip_select_ident_more for IP identity selection
it gives it the wrong packet count for TSO packets.  The ip_select_*
functions expect one less than the number of packets, so we need to
subtract one for TSO packets.

This bug was diagnosed and fixed by Tom Young.

Signed-off-by: Herbert Xu [EMAIL PROTECTED]

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c
+++ b/net/ipv4/ip_output.c
@@ -353,7 +353,8 @@ packet_routed:
ip_options_build(skb, opt, inet-daddr, rt, 0);
}
 
-   ip_select_ident_more(iph, rt-u.dst, sk, skb_shinfo(skb)-tso_segs);
+   ip_select_ident_more(iph, rt-u.dst, sk,
+(skb_shinfo(skb)-tso_segs ?: 1) - 1);
 
/* Add an IP checksum. */
ip_send_check(iph);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 28/58] ipw2x00: Switched firmware error dumping so that it will capture a log available

2005-11-07 Thread jketreno
Switched firmware error dumping so that it will capture a log available
via sysfs even if debugging disabled.  When a firmware error is
captured, it will be dumped to the kernel log (if debug enabled) and
captured in memory to be retrieved via sysfs.

If an error has already been captured, subsequent errors will be
dropped.

The existing error can be cleared by writing to the error log entry.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |  253 -
 drivers/net/wireless/ipw2200.h |   30 
 2 files changed, 205 insertions(+), 78 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 6e862c2..a3283ca 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -428,6 +428,7 @@ static inline void ipw_disable_interrupt
ipw_write32(priv, IPW_INTA_MASK_R, ~IPW_INTA_MASK_ALL);
 }
 
+#ifdef CONFIG_IPW_DEBUG
 static char *ipw_error_desc(u32 val)
 {
switch (val) {
@@ -466,56 +467,35 @@ static char *ipw_error_desc(u32 val)
}
 }
 
-static void ipw_dump_nic_error_log(struct ipw_priv *priv)
+static void ipw_dump_error_log(struct ipw_priv *priv,
+  struct ipw_fw_error *error)
 {
-   u32 desc, time, blink1, blink2, ilink1, ilink2, idata, i, count, base;
+   u32 i;
 
-   base = ipw_read32(priv, IPWSTATUS_ERROR_LOG);
-   count = ipw_read_reg32(priv, base);
+   if (!error) {
+   IPW_ERROR(Error allocating and capturing error log.  
+ Nothing to dump.\n);
+   return;
+   }
 
-   if (ERROR_START_OFFSET = count * ERROR_ELEM_SIZE) {
-   IPW_ERROR(Start IPW Error Log Dump:\n);
-   IPW_ERROR(Status: 0x%08X, Config: %08X\n,
- priv-status, priv-config);
-   }
-
-   for (i = ERROR_START_OFFSET;
-i = count * ERROR_ELEM_SIZE; i += ERROR_ELEM_SIZE) {
-   desc = ipw_read_reg32(priv, base + i);
-   time = ipw_read_reg32(priv, base + i + 1 * sizeof(u32));
-   blink1 = ipw_read_reg32(priv, base + i + 2 * sizeof(u32));
-   blink2 = ipw_read_reg32(priv, base + i + 3 * sizeof(u32));
-   ilink1 = ipw_read_reg32(priv, base + i + 4 * sizeof(u32));
-   ilink2 = ipw_read_reg32(priv, base + i + 5 * sizeof(u32));
-   idata = ipw_read_reg32(priv, base + i + 6 * sizeof(u32));
+   IPW_ERROR(Start IPW Error Log Dump:\n);
+   IPW_ERROR(Status: 0x%08X, Config: %08X\n,
+ error-status, error-config);
 
+   for (i = 0; i  error-elem_len; i++)
IPW_ERROR(%s %i 0x%08x  0x%08x  0x%08x  0x%08x  0x%08x\n,
- ipw_error_desc(desc), time, blink1, blink2,
- ilink1, ilink2, idata);
-   }
+ ipw_error_desc(error-elem[i].desc),
+ error-elem[i].time,
+ error-elem[i].blink1,
+ error-elem[i].blink2,
+ error-elem[i].link1,
+ error-elem[i].link2, error-elem[i].data);
+   for (i = 0; i  error-log_len; i++)
+   IPW_ERROR(%i\t0x%08x\t%i\n,
+ error-log[i].time,
+ error-log[i].event, error-log[i].data);
 }
-
-static void ipw_dump_nic_event_log(struct ipw_priv *priv)
-{
-   u32 ev, time, data, i, count, base;
-
-   base = ipw_read32(priv, IPW_EVENT_LOG);
-   count = ipw_read_reg32(priv, base);
-
-   if (EVENT_START_OFFSET = count * EVENT_ELEM_SIZE)
-   IPW_ERROR(Start IPW Event Log Dump:\n);
-
-   for (i = EVENT_START_OFFSET;
-i = count * EVENT_ELEM_SIZE; i += EVENT_ELEM_SIZE) {
-   ev = ipw_read_reg32(priv, base + i);
-   time = ipw_read_reg32(priv, base + i + 1 * sizeof(u32));
-   data = ipw_read_reg32(priv, base + i + 2 * sizeof(u32));
-
-#ifdef CONFIG_IPW_DEBUG
-   IPW_ERROR(%i\t0x%08x\t%i\n, time, data, ev);
 #endif
-   }
-}
 
 static inline int ipw_is_init(struct ipw_priv *priv)
 {
@@ -1058,6 +1038,130 @@ static ssize_t store_debug_level(struct 
 static DRIVER_ATTR(debug_level, S_IWUSR | S_IRUGO,
   show_debug_level, store_debug_level);
 
+static inline u32 ipw_get_event_log_len(struct ipw_priv *priv)
+{
+   return ipw_read_reg32(priv, ipw_read32(priv, IPW_EVENT_LOG));
+}
+
+static void ipw_capture_event_log(struct ipw_priv *priv,
+ u32 log_len, struct ipw_event *log)
+{
+   u32 base;
+
+   if (log_len) {
+   base = ipw_read32(priv, IPW_EVENT_LOG);
+   ipw_read_indirect(priv, base + sizeof(base) + sizeof(u32),
+ (u8 *) log, sizeof(*log) * log_len);
+   }
+}
+
+static struct ipw_fw_error *ipw_alloc_error_log(struct ipw_priv *priv)
+{
+   struct 

[PATCH 27/58] ipw2x00: Modified ipw_config and STATUS_INIT setting to correct race condition

2005-11-07 Thread jketreno
Modified ipw_config and STATUS_INIT setting to correct race condition
with request_scan being called before initialized if invoked from
insmod, resulting in no association occurring during boot until iwlist
scan is run.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   29 +++--
 1 file changed, 15 insertions(+), 14 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index f825aa4..6e862c2 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10465,9 +10465,17 @@ static int ipw_config(struct ipw_priv *p
if (ipw_send_host_complete(priv))
goto error;
 
-   /* If configured to try and auto-associate, kick off a scan */
-   if (priv-config  CFG_ASSOCIATE)
-   queue_work(priv-workqueue, priv-request_scan);
+   priv-status |= STATUS_INIT;
+
+   ipw_led_init(priv);
+   ipw_led_radio_on(priv);
+   priv-notif_missed_beacons = 0;
+
+   /* Set hardware WEP key if it is configured. */
+   if ((priv-capability  CAP_PRIVACY_ON) 
+   (priv-ieee-sec.level == SEC_LEVEL_1) 
+   !(priv-ieee-host_encrypt || priv-ieee-host_decrypt))
+   ipw_set_hwcrypto_keys(priv);
 
return 0;
 
@@ -10773,17 +10781,10 @@ static int ipw_up(struct ipw_priv *priv)
rc = ipw_config(priv);
if (!rc) {
IPW_DEBUG_INFO(Configured device on count %i\n, i);
-   ipw_led_init(priv);
-   ipw_led_radio_on(priv);
-   priv-notif_missed_beacons = 0;
-   priv-status |= STATUS_INIT;
-
-   /* Set hardware WEP key if it is configured. */
-   if ((priv-capability  CAP_PRIVACY_ON) 
-   (priv-ieee-sec.level == SEC_LEVEL_1) 
-   !(priv-ieee-host_encrypt ||
- priv-ieee-host_decrypt))
-   ipw_set_hwcrypto_keys(priv);
+
+   /* If configure to try and auto-associate, kick
+* off a scan. */
+   queue_work(priv-workqueue, priv-request_scan);
 
return 0;
}

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


[PATCH 53/58] ipw2x00: Added channel support for ipw2200 cards identified as 'ZZR'

2005-11-07 Thread jketreno
Added channel support for ipw2200 cards identified as 'ZZR'

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   18 +-
 1 file changed, 17 insertions(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 750e43e..081957a 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10495,6 +10495,17 @@ static const struct ieee80211_geo ipw_ge
   {5210, 42}, {5230, 46}},
 },
 
+   {   /* Rest of World */
+ZZR,
+.bg_channels = 14,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}, {2467, 12},
+   {2472, 13}, {2484, 14, IEEE80211_CH_B_ONLY |
+IEEE80211_CH_PASSIVE_ONLY}},
+},
+
{   /* High Band */
 ZZH,
 .bg_channels = 13,
@@ -10711,8 +10722,13 @@ static int ipw_up(struct ipw_priv *priv)
ipw_geos[j].name, 3))
break;
}
-   if (j == ARRAY_SIZE(ipw_geos))
+   if (j == ARRAY_SIZE(ipw_geos)) {
+   IPW_WARNING(SKU [%c%c%c] not recognized.\n,
+   priv-eeprom[EEPROM_COUNTRY_CODE + 0],
+   priv-eeprom[EEPROM_COUNTRY_CODE + 1],
+   priv-eeprom[EEPROM_COUNTRY_CODE + 2]);
j = 0;
+   }
if (ipw_set_geo(priv-ieee, ipw_geos[j])) {
IPW_WARNING(Could not set geography.);
return 0;

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


[PATCH 26/58] ipw2x00: Fix firmware error when setting tx_power.

2005-11-07 Thread jketreno
Fix firmware error when setting tx_power.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |  131 +
 1 file changed, 55 insertions(+), 76 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 105b114..f825aa4 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2084,6 +2084,50 @@ static int ipw_send_tx_power(struct ipw_
return 0;
 }
 
+static int ipw_set_tx_power(struct ipw_priv *priv)
+{
+   const struct ieee80211_geo *geo = ieee80211_get_geo(priv-ieee);
+   struct ipw_tx_power tx_power;
+   s8 max_power;
+   int i;
+
+   memset(tx_power, 0, sizeof(tx_power));
+
+   /* configure device for 'G' band */
+   tx_power.ieee_mode = IPW_G_MODE;
+   tx_power.num_channels = geo-bg_channels;
+   for (i = 0; i  geo-bg_channels; i++) {
+   max_power = geo-bg[i].max_power;
+   tx_power.channels_tx_power[i].channel_number =
+   geo-bg[i].channel;
+   tx_power.channels_tx_power[i].tx_power = max_power ?
+   min(max_power, priv-tx_power) : priv-tx_power;
+   }
+   if (ipw_send_tx_power(priv, tx_power))
+   return -EIO;
+
+   /* configure device to also handle 'B' band */
+   tx_power.ieee_mode = IPW_B_MODE;
+   if (ipw_send_tx_power(priv, tx_power))
+   return -EIO;
+
+   /* configure device to also handle 'A' band */
+   if (priv-ieee-abg_true) {
+   tx_power.ieee_mode = IPW_A_MODE;
+   tx_power.num_channels = geo-a_channels;
+   for (i = 0; i  tx_power.num_channels; i++) {
+   max_power = geo-a[i].max_power;
+   tx_power.channels_tx_power[i].channel_number =
+   geo-a[i].channel;
+   tx_power.channels_tx_power[i].tx_power = max_power ?
+   min(max_power, priv-tx_power) : priv-tx_power;
+   }
+   if (ipw_send_tx_power(priv, tx_power))
+   return -EIO;
+   }
+   return 0;
+}
+
 static int ipw_send_rts_threshold(struct ipw_priv *priv, u16 rts)
 {
struct ipw_rts_threshold rts_threshold = {
@@ -8869,79 +8913,33 @@ static int ipw_wx_set_txpow(struct net_d
union iwreq_data *wrqu, char *extra)
 {
struct ipw_priv *priv = ieee80211_priv(dev);
-   const struct ieee80211_geo *geo = ieee80211_get_geo(priv-ieee);
-   struct ipw_tx_power tx_power;
-   int i;
+   int err = 0;
 
down(priv-sem);
if (ipw_radio_kill_sw(priv, wrqu-power.disabled)) {
-   up(priv-sem);
-   return -EINPROGRESS;
+   err = -EINPROGRESS;
+   goto out;
}
 
if (!wrqu-power.fixed)
wrqu-power.value = IPW_TX_POWER_DEFAULT;
 
if (wrqu-power.flags != IW_TXPOW_DBM) {
-   up(priv-sem);
-   return -EINVAL;
+   err = -EINVAL;
+   goto out;
}
 
if ((wrqu-power.value  IPW_TX_POWER_MAX) ||
(wrqu-power.value  IPW_TX_POWER_MIN)) {
-   up(priv-sem);
-   return -EINVAL;
+   err = -EINVAL;
+   goto out;
}
 
priv-tx_power = wrqu-power.value;
-
-   memset(tx_power, 0, sizeof(tx_power));
-
-   /* configure device for 'G' band */
-   tx_power.ieee_mode = IPW_G_MODE;
-   tx_power.num_channels = geo-bg_channels;
-   for (i = 0; i  geo-bg_channels; i++) {
-   int max_power = geo-bg[i].max_power;
-
-   tx_power.channels_tx_power[i].channel_number = i + 1;
-   if (max_power != 0  priv-tx_power  max_power)
-   tx_power.channels_tx_power[i].tx_power = max_power;
-   else
-   tx_power.channels_tx_power[i].tx_power = priv-tx_power;
-   }
-   if (ipw_send_tx_power(priv, tx_power))
-   goto error;
-
-   /* configure device to also handle 'B' band */
-   tx_power.ieee_mode = IPW_B_MODE;
-   if (ipw_send_tx_power(priv, tx_power))
-   goto error;
-
-   /* configure device to also handle 'A' band */
-   if (priv-ieee-abg_true) {
-   tx_power.ieee_mode = IPW_A_MODE;
-   tx_power.num_channels = geo-a_channels;
-   for (i = 0; i  geo-a_channels; i++) {
-   int max_power = geo-a[i].max_power;
-
-   tx_power.channels_tx_power[i].channel_number = i + 1;
-   if (max_power != 0  priv-tx_power  max_power)
-   tx_power.channels_tx_power[i].tx_power =
-   max_power;
-   else
-   tx_power.channels_tx_power[i].tx_power =
-   

[PATCH 35/58] ipw2x00: [Bug 760] Fix setting WEP key in monitor mode causes IV lost.

2005-11-07 Thread jketreno
[Bug 760] Fix setting WEP key in monitor mode causes IV lost.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 4cdb474..bda292f 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -7907,7 +7907,7 @@ static void ipw_handle_data_packet(struc
IPW_DEBUG_RX(Rx packet of %d bytes.\n, rxb-skb-len);
 
/* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
-   if (!priv-ieee-host_decrypt)
+   if (!priv-ieee-host_decrypt  priv-ieee-iw_mode != IW_MODE_MONITOR)
ipw_rebuild_decrypted_skb(priv, rxb-skb);
 
if (!ieee80211_rx(priv-ieee, rxb-skb, stats))

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


[PATCH 16/58] ipw2x00: Changed default # of missed beacons to miss before disassociation to 24

2005-11-07 Thread jketreno
Changed default # of missed beacons to miss before disassociation to 24
(vs. 9 which is too low in most environments)

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index 28667d3..9bf8aa4 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -244,7 +244,7 @@ enum connection_manager_assoc_states {
 #define HOST_NOTIFICATION_S36_MEASUREMENT_REFUSED   31
 
 #define HOST_NOTIFICATION_STATUS_BEACON_MISSING 1
-#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT   9
+#define IPW_MB_DISASSOCIATE_THRESHOLD_DEFAULT   24
 #define IPW_MB_ROAMING_THRESHOLD_DEFAULT8
 #define IPW_REAL_RATE_RX_PACKET_THRESHOLD   300
 

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


[PATCH 12/58] ipw2x00: Fix hardware encryption (both WEP and AES) doesn't work with fragmentation.

2005-11-07 Thread jketreno
Fix hardware encryption (both WEP and AES) doesn't work with fragmentation.
Firmware sends received packets with double sized ICV/MIC.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 1b6f027..8f7e9ac 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -7587,7 +7587,10 @@ static void ipw_rebuild_decrypted_skb(st
memmove(skb-data + IEEE80211_3ADDR_LEN,
skb-data + IEEE80211_3ADDR_LEN + 8,
skb-len - IEEE80211_3ADDR_LEN - 8);
-   skb_trim(skb, skb-len - 8);/* MIC */
+   if (fc  IEEE80211_FCTL_MOREFRAGS)
+   skb_trim(skb, skb-len - 16);   /* 2*MIC */
+   else
+   skb_trim(skb, skb-len - 8);/* MIC */
break;
case SEC_LEVEL_2:
break;
@@ -7596,7 +7599,10 @@ static void ipw_rebuild_decrypted_skb(st
memmove(skb-data + IEEE80211_3ADDR_LEN,
skb-data + IEEE80211_3ADDR_LEN + 4,
skb-len - IEEE80211_3ADDR_LEN - 4);
-   skb_trim(skb, skb-len - 4);/* ICV */
+   if (fc  IEEE80211_FCTL_MOREFRAGS)
+   skb_trim(skb, skb-len - 8);/* 2*ICV */
+   else
+   skb_trim(skb, skb-len - 4);/* ICV */
break;
case SEC_LEVEL_0:
break;

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


[PATCH 40/58] ipw2x00: Mixed PTK/GTK CCMP/TKIP support.

2005-11-07 Thread jketreno
Mixed PTK/GTK CCMP/TKIP support.

Signed-off-by: Hong Liu [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   50 ++---
 1 file changed, 37 insertions(+), 13 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index d417ed7..c9b306a 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -5771,7 +5771,8 @@ static void ipw_set_hwcrypto_keys(struct
DCT_FLAG_EXT_SECURITY_CCM,
priv-ieee-sec.active_key);
 
-   ipw_send_wep_keys(priv, DCW_WEP_KEY_SEC_TYPE_CCM);
+   if (!priv-ieee-host_mc_decrypt)
+   ipw_send_wep_keys(priv, DCW_WEP_KEY_SEC_TYPE_CCM);
break;
case SEC_LEVEL_2:
if (priv-ieee-sec.flags  SEC_ACTIVE_KEY)
@@ -5786,9 +5787,6 @@ static void ipw_set_hwcrypto_keys(struct
default:
break;
}
-
-   ipw_set_hw_decrypt_unicast(priv, priv-ieee-sec.level);
-   ipw_set_hw_decrypt_multicast(priv, priv-ieee-sec.level);
 }
 
 static void ipw_adhoc_check(void *data)
@@ -6473,6 +6471,7 @@ static int ipw_wpa_set_encryption(struct
  struct ipw_param *param, int param_len)
 {
int ret = 0;
+   int group_key = 0;
struct ipw_priv *priv = ieee80211_priv(dev);
struct ieee80211_device *ieee = priv-ieee;
struct ieee80211_crypto_ops *ops;
@@ -6502,6 +6501,9 @@ static int ipw_wpa_set_encryption(struct
return -EINVAL;
}
 
+   if (param-u.crypt.idx != 0)
+   group_key = 1;
+
sec.flags |= SEC_ENABLED | SEC_ENCRYPT;
if (strcmp(param-u.crypt.alg, none) == 0) {
if (crypt) {
@@ -6517,11 +6519,19 @@ static int ipw_wpa_set_encryption(struct
sec.encrypt = 1;
 
/* IPW HW cannot build TKIP MIC, host decryption still needed. */
-   if (strcmp(param-u.crypt.alg, TKIP) == 0)
-   ieee-host_encrypt_msdu = 1;
+   if (strcmp(param-u.crypt.alg, TKIP) == 0) {
+   if (group_key)
+   ieee-host_mc_decrypt = 1;
+   else
+   ieee-host_encrypt_msdu = 1;
+   }
 
-   if (!(ieee-host_encrypt || ieee-host_encrypt_msdu ||
- ieee-host_decrypt))
+   /*if (!(ieee-host_encrypt || ieee-host_encrypt_msdu ||
+  ieee-host_decrypt))
+  goto skip_host_crypt; */
+   if (group_key ? !ieee-host_mc_decrypt :
+   !(ieee-host_encrypt || ieee-host_decrypt ||
+ ieee-host_encrypt_msdu))
goto skip_host_crypt;
 
ops = ieee80211_get_crypto_ops(param-u.crypt.alg);
@@ -6604,6 +6614,9 @@ static int ipw_wpa_set_encryption(struct
sec.flags |= SEC_LEVEL;
sec.level = SEC_LEVEL_3;
}
+   /* Don't set sec level for group keys. */
+   if (group_key)
+   sec.flags = ~SEC_LEVEL;
}
   done:
if (ieee-set_security)
@@ -6953,15 +6966,21 @@ static int ipw_wx_set_encodeext(struct n
struct iw_encode_ext *ext = (struct iw_encode_ext *)extra;
 
if (hwcrypto) {
-   /* IPW HW can't build TKIP MIC, host decryption still needed */
if (ext-alg == IW_ENCODE_ALG_TKIP) {
-   priv-ieee-host_encrypt = 0;
-   priv-ieee-host_encrypt_msdu = 1;
-   priv-ieee-host_decrypt = 1;
+   /* IPW HW can't build TKIP MIC,
+  host decryption still needed */
+   if (ext-ext_flags  IW_ENCODE_EXT_GROUP_KEY)
+   priv-ieee-host_mc_decrypt = 1;
+   else {
+   priv-ieee-host_encrypt = 0;
+   priv-ieee-host_encrypt_msdu = 1;
+   priv-ieee-host_decrypt = 1;
+   }
} else {
priv-ieee-host_encrypt = 0;
priv-ieee-host_encrypt_msdu = 0;
priv-ieee-host_decrypt = 0;
+   priv-ieee-host_mc_decrypt = 0;
}
}
 
@@ -7878,6 +7897,7 @@ static void ipw_handle_data_packet(struc
   struct ipw_rx_mem_buffer *rxb,
   struct ieee80211_rx_stats *stats)
 {
+   struct ieee80211_hdr_4addr *hdr;
struct ipw_rx_packet *pkt = (struct ipw_rx_packet *)rxb-skb-data;
 
/* We received data from the HW, so stop the watchdog */
@@ -7907,7 +7927,10 @@ static void ipw_handle_data_packet(struc
IPW_DEBUG_RX(Rx packet of %d bytes.\n, rxb-skb-len);
 
/* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
-   if (!priv-ieee-host_decrypt  priv-ieee-iw_mode != 

[PATCH 49/58] ipw2x00: Fix 'Driver using old /proc/net/wireless support, please fix driver !' message.

2005-11-07 Thread jketreno
Fix 'Driver using old /proc/net/wireless support, please fix driver !' message.

Wireless extensions moved the get_wireless_stats handler from being
in net_device into wireless_handler.

Signed-off-by: Benoit Boissinot [EMAIL PROTECTED]
Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   19 ---
 drivers/net/wireless/ipw2200.h |2 ++
 2 files changed, 14 insertions(+), 7 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 0b1c6fe..b89ede1 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -125,6 +125,7 @@ static int ipw_send_qos_info_command(str
 *qos_param);
 #endif /* CONFIG_IPW_QOS */
 
+static struct iw_statistics *ipw_get_wireless_stats(struct net_device *dev);
 static void ipw_remove_current_network(struct ipw_priv *priv);
 static void ipw_rx(struct ipw_priv *priv);
 static int ipw_queue_tx_reclaim(struct ipw_priv *priv,
@@ -8883,6 +8884,13 @@ static int ipw_wx_get_range(struct net_d
range-num_frequency = i;
 
up(priv-sem);
+
+   /* Event capability (kernel + driver) */
+   range-event_capa[0] = (IW_EVENT_CAPA_K_0 |
+   IW_EVENT_CAPA_MASK(SIOCGIWTHRSPY) |
+   IW_EVENT_CAPA_MASK(SIOCGIWAP));
+   range-event_capa[1] = IW_EVENT_CAPA_K_1;
+
IPW_DEBUG_WX(GET Range\n);
return 0;
 }
@@ -,10 +10007,9 @@ static struct iw_handler_def ipw_wx_hand
.num_private_args = ARRAY_SIZE(ipw_priv_args),
.private = ipw_priv_handler,
.private_args = ipw_priv_args,
+   .get_wireless_stats = ipw_get_wireless_stats,
 };
 
-static struct iw_public_data ipw_wx_data;
-
 /*
  * Get wireless statistics.
  * Called by /proc/net/wireless
@@ -11487,9 +11494,6 @@ static int ipw_pci_probe(struct pci_dev 
SET_MODULE_OWNER(net_dev);
SET_NETDEV_DEV(net_dev, pdev-dev);
 
-   ipw_wx_data.spy_data = priv-ieee-spy_data;
-   ipw_wx_data.ieee80211 = priv-ieee;
-
down(priv-sem);
 
priv-ieee-hard_start_xmit = ipw_net_hard_start_xmit;
@@ -11514,8 +11518,9 @@ static int ipw_pci_probe(struct pci_dev 
net_dev-get_stats = ipw_net_get_stats;
net_dev-set_multicast_list = ipw_net_set_multicast_list;
net_dev-set_mac_address = ipw_net_set_mac_address;
-   net_dev-get_wireless_stats = ipw_get_wireless_stats;
-   net_dev-wireless_data = ipw_wx_data;
+   priv-wireless_data.spy_data = priv-ieee-spy_data;
+   priv-wireless_data.ieee80211 = priv-ieee;
+   net_dev-wireless_data = priv-wireless_data;
net_dev-wireless_handlers = ipw_wx_handler_def;
net_dev-ethtool_ops = ipw_ethtool_ops;
net_dev-irq = pdev-irq;
diff --git a/drivers/net/wireless/ipw2200.h b/drivers/net/wireless/ipw2200.h
index 28f1216..3e76994 100644
--- a/drivers/net/wireless/ipw2200.h
+++ b/drivers/net/wireless/ipw2200.h
@@ -1228,6 +1228,8 @@ struct ipw_priv {
 
struct iw_statistics wstats;
 
+   struct iw_public_data wireless_data;
+
struct workqueue_struct *workqueue;
 
struct work_struct adhoc_check;

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


[PATCH 17/58] ipw2x00: Updated to support ieee80211 callback to is_queue_full for 802.11e

2005-11-07 Thread jketreno
Updated to support ieee80211 callback to is_queue_full for 802.11e
support.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   40 +++-
 1 file changed, 31 insertions(+), 9 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 0923038..3b3a4a0 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -9654,8 +9654,8 @@ modify to send one tfd per fragment inst
 we need to heavily modify the ieee80211_skb_to_txb.
 */
 
-static inline void ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
- int pri)
+static inline int ipw_tx_skb(struct ipw_priv *priv, struct ieee80211_txb *txb,
+int pri)
 {
struct ieee80211_hdr_3addr *hdr = (struct ieee80211_hdr_3addr *)
txb-fragments[0]-data;
@@ -9672,6 +9672,11 @@ static inline void ipw_tx_skb(struct ipw
u16 remaining_bytes;
int fc;
 
+   /* If there isn't room in the queue, we return busy and let the
+* network stack requeue the packet for us */
+   if (ipw_queue_space(q)  q-high_mark)
+   return NETDEV_TX_BUSY;
+
switch (priv-ieee-iw_mode) {
case IW_MODE_ADHOC:
hdr_len = IEEE80211_3ADDR_LEN;
@@ -9837,14 +9842,28 @@ static inline void ipw_tx_skb(struct ipw
q-first_empty = ipw_queue_inc_wrap(q-first_empty, q-n_bd);
ipw_write32(priv, q-reg_w, q-first_empty);
 
-   if (ipw_queue_space(q)  q-high_mark)
-   netif_stop_queue(priv-net_dev);
-
-   return;
+   return NETDEV_TX_OK;
 
   drop:
IPW_DEBUG_DROP(Silently dropping Tx packet.\n);
ieee80211_txb_free(txb);
+   return NETDEV_TX_OK;
+}
+
+static int ipw_net_is_queue_full(struct net_device *dev, int pri)
+{
+   struct ipw_priv *priv = ieee80211_priv(dev);
+#ifdef CONFIG_IPW_QOS
+   int tx_id = ipw_get_tx_queue_number(priv, pri);
+   struct clx2_tx_queue *txq = priv-txq[tx_id];
+#else
+   struct clx2_tx_queue *txq = priv-txq[0];
+#endif /* CONFIG_IPW_QOS */
+
+   if (ipw_queue_space(txq-q)  txq-q.high_mark)
+   return 1;
+
+   return 0;
 }
 
 static int ipw_net_hard_start_xmit(struct ieee80211_txb *txb,
@@ -9852,6 +9871,7 @@ static int ipw_net_hard_start_xmit(struc
 {
struct ipw_priv *priv = ieee80211_priv(dev);
unsigned long flags;
+   int ret;
 
IPW_DEBUG_TX(dev-xmit(%d bytes)\n, txb-payload_size);
spin_lock_irqsave(priv-lock, flags);
@@ -9863,11 +9883,12 @@ static int ipw_net_hard_start_xmit(struc
goto fail_unlock;
}
 
-   ipw_tx_skb(priv, txb, pri);
-   __ipw_led_activity_on(priv);
+   ret = ipw_tx_skb(priv, txb, pri);
+   if (ret == NETDEV_TX_OK)
+   __ipw_led_activity_on(priv);
spin_unlock_irqrestore(priv-lock, flags);
 
-   return 0;
+   return ret;
 
   fail_unlock:
spin_unlock_irqrestore(priv-lock, flags);
@@ -10706,6 +10727,7 @@ static int ipw_pci_probe(struct pci_dev 
 
priv-ieee-hard_start_xmit = ipw_net_hard_start_xmit;
priv-ieee-set_security = shim__set_security;
+   priv-ieee-is_queue_full = ipw_net_is_queue_full;
 
 #ifdef CONFIG_IPW_QOS
priv-ieee-handle_management_frame = ipw_handle_management_frame;

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


[PATCH 25/58] ipw2x00: Fix ipw_wx_get_txpow shows wrong disabled value.

2005-11-07 Thread jketreno
Fix ipw_wx_get_txpow shows wrong disabled value.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 2633e0d..105b114 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8957,7 +8957,7 @@ static int ipw_wx_get_txpow(struct net_d
up(priv-sem);
 
IPW_DEBUG_WX(GET TX Power - %s %d \n,
-wrqu-power.disabled ? ON : OFF, wrqu-power.value);
+wrqu-power.disabled ? OFF : ON, wrqu-power.value);
 
return 0;
 }

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


[PATCH 36/58] ipw2x00: Don't set hardware WEP if we are actually using TKIP/AES.

2005-11-07 Thread jketreno
Don't set hardware WEP if we are actually using TKIP/AES.

Signed-off-by: Hong Liu [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index eaf4707..83ba08c 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5443,8 +5443,11 @@ static void shim__set_security(struct ne
else
memcpy(priv-ieee-sec.keys[i], sec-keys[i],
   sec-key_sizes[i]);
-   priv-ieee-sec.flags |= (1  i);
-   priv-status |= STATUS_SECURITY_UPDATED;
+   if (sec-level == SEC_LEVEL_1) {
+   priv-ieee-sec.flags |= (1  i);
+   priv-status |= STATUS_SECURITY_UPDATED;
+   } else
+   priv-ieee-sec.flags = ~(1  i);
}
}
 

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


[PATCH 42/58] ipw2x00: Fixed problem with get_cmd_string not existing if CONFIG_IPW_DEBUG disabled.

2005-11-07 Thread jketreno
Fixed problem with get_cmd_string not existing if CONFIG_IPW_DEBUG disabled.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 --
 1 file changed, 2 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index e36a1fd..43dab7a 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1809,7 +1809,6 @@ static void ipw_irq_tasklet(struct ipw_p
spin_unlock_irqrestore(priv-lock, flags);
 }
 
-#ifdef CONFIG_IPW_DEBUG
 #define IPW_CMD(x) case IPW_CMD_ ## x : return #x
 static char *get_cmd_string(u8 cmd)
 {
@@ -1868,7 +1867,6 @@ static char *get_cmd_string(u8 cmd)
return UNKNOWN;
}
 }
-#endif
 
 #define HOST_COMPLETE_TIMEOUT HZ
 static int ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)

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


[PATCH 48/58] ipw2x00: Pulled out a stray KERNEL_VERSION check around the suspend handler.

2005-11-07 Thread jketreno
Pulled out a stray KERNEL_VERSION check around the suspend handler.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |4 
 1 file changed, 4 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index dba1049..ed4f1a5 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -6709,11 +6709,7 @@ static void __devexit ipw2100_pci_remove
 }
 
 #ifdef CONFIG_PM
-#if LINUX_VERSION_CODE  KERNEL_VERSION(2,6,11)
-static int ipw2100_suspend(struct pci_dev *pci_dev, u32 state)
-#else
 static int ipw2100_suspend(struct pci_dev *pci_dev, pm_message_t state)
-#endif
 {
struct ipw2100_priv *priv = pci_get_drvdata(pci_dev);
struct net_device *dev = priv-net_dev;

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


[PATCH 0/58] ipw2x00: Catch ipw2100 and ipw2200 up to the out-of-tree versions

2005-11-07 Thread James Ketrenos
This series brings the ipw2100 and ipw2200 drivers up to be in sync w/ 
the current out of tree drivers (ipw2100 v1.1.3 and ipw2200 v1.0.8)

The ipw2100 hasn't changed a whole lot vs. what is currently in-tree.  

The ipw2200, on the other hand, has undergone quite extensive changes.  
There is still quite a bit of cleanup to be done on the ipw2200, as well 
as resolving some of the known issues (you can query the current bugs at 
http://bughost.org)  Folks have been asking why in-tree is so out of 
sync; this series resolves that issue.

NOTE:  End users should really not be using this version of the driver 
and should only be using the versions that have gone through a full 
validation (stable versions) as those are the only versions that have 
been tested for regulatory compliance (you can see the README.ipw2100 / 
README.ipw2200 for more details on this [contained in patch 58/58])

Thanks,
James

diffstat of the changeset:

 Documentation/networking/README.ipw2100 |  128 
 Documentation/networking/README.ipw2200 |  196 
 MAINTAINERS |   18 
 drivers/net/wireless/ipw2100.c  | 2862 +++--
 drivers/net/wireless/ipw2100.h  |  171 
 drivers/net/wireless/ipw2200.c  | 6861 +---
 drivers/net/wireless/ipw2200.h  |  592 +-
 7 files changed, 7719 insertions(+), 3109 deletions(-)

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


[PATCH 52/58] ipw2x00: Removed warning about TKIP not being configured if countermeasures are

2005-11-07 Thread jketreno
Removed warning about TKIP not being configured if countermeasures are
configured.

Countermeasures default to being turned off when wpa_supplicant runs,
regardless of if TKIP is being used.  They are only turned on if a TKIP
is running.  The warning we were printing is therefore not needed.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |   10 ++
 drivers/net/wireless/ipw2200.c |   10 ++
 2 files changed, 4 insertions(+), 16 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index ed4f1a5..76841cb 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5866,11 +5866,8 @@ static int ipw2100_wpa_set_param(struct 
 
case IPW2100_PARAM_TKIP_COUNTERMEASURES:
crypt = priv-ieee-crypt[priv-ieee-tx_keyidx];
-   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags) 
{
-   IPW_DEBUG_WARNING(Can't set TKIP countermeasures: 
- crypt not set!\n);
+   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags)
break;
-   }
 
flags = crypt-ops-get_flags(crypt-priv);
 
@@ -7935,11 +7932,8 @@ static int ipw2100_wx_set_auth(struct ne
 
case IW_AUTH_TKIP_COUNTERMEASURES:
crypt = priv-ieee-crypt[priv-ieee-tx_keyidx];
-   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags) 
{
-   IPW_DEBUG_WARNING(Can't set TKIP countermeasures: 
- crypt not set!\n);
+   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags)
break;
-   }
 
flags = crypt-ops-get_flags(crypt-priv);
 
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 8941929..750e43e 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -6357,11 +6357,8 @@ static int ipw_wx_set_auth(struct net_de
 
case IW_AUTH_TKIP_COUNTERMEASURES:
crypt = priv-ieee-crypt[priv-ieee-tx_keyidx];
-   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags) 
{
-   IPW_WARNING(Can't set TKIP countermeasures: 
-   crypt not set!\n);
+   if (!crypt || !crypt-ops-set_flags || !crypt-ops-get_flags)
break;
-   }
 
flags = crypt-ops-get_flags(crypt-priv);
 
@@ -6453,11 +6450,8 @@ static int ipw_wx_get_auth(struct net_de
 
case IW_AUTH_TKIP_COUNTERMEASURES:
crypt = priv-ieee-crypt[priv-ieee-tx_keyidx];
-   if (!crypt || !crypt-ops-get_flags) {
-   IPW_WARNING(Can't get TKIP countermeasures: 
-   crypt not set!\n);
+   if (!crypt || !crypt-ops-get_flags)
break;
-   }
 
param-value = (crypt-ops-get_flags(crypt-priv) 
IEEE80211_CRYPTO_TKIP_COUNTERMEASURES) ? 1 : 0;

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


[PATCH 14/58] ipw2x00: [bug 667] Fix the notorious No space for Tx bug.

2005-11-07 Thread jketreno
[bug 667] Fix the notorious No space for Tx bug.

We send SYSTEM_CONFIG command after the TGI_KEY command if hardware
encryption is enabled. It sometimes causes a firmware stall (firmware
doesn't respond to any request) and finally bungs up the Tx send queue.
The solution is to send SYSTEM_CONFIG command in the post association
stage from a workqueue.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   46 -
 drivers/net/wireless/ipw2200.h |1 
 2 files changed, 24 insertions(+), 23 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 93ed871..f3048f8 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -3589,6 +3589,12 @@ static void ipw_bg_disassociate(void *da
up(priv-sem);
 }
 
+static void ipw_system_config(void *data)
+{
+   struct ipw_priv *priv = data;
+   ipw_send_system_config(priv, priv-sys_config);
+}
+
 struct ipw_status_code {
u16 status;
const char *reason;
@@ -4060,6 +4066,8 @@ static inline void ipw_rx_notification(s
 
priv-status = ~STATUS_ASSOCIATING;
priv-status |= STATUS_ASSOCIATED;
+   queue_work(priv-workqueue,
+  priv-system_config);
 
 #ifdef CONFIG_IPW_QOS
 #define IPW_GET_PACKET_STYPE(x) WLAN_FC_GET_STYPE( \
@@ -5553,45 +5561,36 @@ static void ipw_set_hwcrypto_keys(struct
 {
switch (priv-ieee-sec.level) {
case SEC_LEVEL_3:
-   if (!(priv-ieee-sec.flags  SEC_ACTIVE_KEY))
-   break;
+   if (priv-ieee-sec.flags  SEC_ACTIVE_KEY)
+   ipw_send_tgi_tx_key(priv,
+   DCT_FLAG_EXT_SECURITY_CCM,
+   priv-ieee-sec.active_key);
 
-   ipw_send_tgi_tx_key(priv, DCT_FLAG_EXT_SECURITY_CCM,
-   priv-ieee-sec.active_key);
ipw_send_wep_keys(priv, DCW_WEP_KEY_SEC_TYPE_CCM);
-
priv-sys_config.disable_unicast_decryption = 0;
priv-sys_config.disable_multicast_decryption = 0;
priv-ieee-host_decrypt = 0;
-   if (ipw_send_system_config(priv, priv-sys_config))
-   IPW_ERROR(ipw_send_system_config failed\n);
-
break;
case SEC_LEVEL_2:
-   if (!(priv-ieee-sec.flags  SEC_ACTIVE_KEY))
-   break;
-
-   ipw_send_tgi_tx_key(priv, DCT_FLAG_EXT_SECURITY_TKIP,
-   priv-ieee-sec.active_key);
+   if (priv-ieee-sec.flags  SEC_ACTIVE_KEY)
+   ipw_send_tgi_tx_key(priv,
+   DCT_FLAG_EXT_SECURITY_TKIP,
+   priv-ieee-sec.active_key);
 
priv-sys_config.disable_unicast_decryption = 1;
priv-sys_config.disable_multicast_decryption = 1;
priv-ieee-host_decrypt = 1;
-   if (ipw_send_system_config(priv, priv-sys_config))
-   IPW_ERROR(ipw_send_system_config failed\n);
-
break;
case SEC_LEVEL_1:
ipw_send_wep_keys(priv, DCW_WEP_KEY_SEC_TYPE_WEP);
-
priv-sys_config.disable_unicast_decryption = 0;
priv-sys_config.disable_multicast_decryption = 0;
priv-ieee-host_decrypt = 0;
-   if (ipw_send_system_config(priv, priv-sys_config))
-   IPW_ERROR(ipw_send_system_config failed\n);
-
break;
case SEC_LEVEL_0:
+   priv-sys_config.disable_unicast_decryption = 1;
+   priv-sys_config.disable_multicast_decryption = 1;
+   break;
default:
break;
}
@@ -10113,6 +10112,7 @@ static int ipw_setup_deferred_work(struc
INIT_WORK(priv-adhoc_check, ipw_bg_adhoc_check, priv);
INIT_WORK(priv-associate, ipw_bg_associate, priv);
INIT_WORK(priv-disassociate, ipw_bg_disassociate, priv);
+   INIT_WORK(priv-system_config, ipw_system_config, priv);
INIT_WORK(priv-rx_replenish, ipw_bg_rx_queue_replenish, priv);
INIT_WORK(priv-adapter_restart, ipw_bg_adapter_restart, priv);
INIT_WORK(priv-rf_kill, ipw_bg_rf_kill, priv);
@@ -10206,10 +10206,10 @@ static void shim__set_security(struct ne
priv-ieee-sec.level = sec-level;
priv-ieee-sec.flags |= SEC_LEVEL;
priv-status |= STATUS_SECURITY_UPDATED;
-   }
 
-   if (!priv-ieee-host_encrypt)
-   ipw_set_hwcrypto_keys(priv);
+   if (!priv-ieee-host_encrypt  (sec-flags  SEC_ENCRYPT))
+   ipw_set_hwcrypto_keys(priv);
+   }
 
/* To match 

[PATCH 55/58] ipw2x00: Fixed parameter reordering in firmware log routine.

2005-11-07 Thread jketreno
Fixed parameter reordering in firmware log routine.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index c1ae6d4..f49b012 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -526,7 +526,7 @@ static void ipw_dump_error_log(struct ip
for (i = 0; i  error-log_len; i++)
IPW_ERROR(%i\t0x%08x\t%i\n,
  error-log[i].time,
- error-log[i].event, error-log[i].data);
+ error-log[i].data, error-log[i].event);
 }
 #endif
 

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


[PATCH 29/58] ipw2x00: Changed all of the ipw_send_cmd() calls to return any ipw_send_cmd error

2005-11-07 Thread jketreno
Changed all of the ipw_send_cmd() calls to return any ipw_send_cmd error
codes to the caller and changed ipw_send_cmd itself to print the error
message to the syslog indicating which command failed to be sent.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |  187 +++--
 1 file changed, 34 insertions(+), 153 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index a3283ca..ef10077 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -1817,9 +1817,10 @@ static int ipw_send_cmd(struct ipw_priv 
 
spin_lock_irqsave(priv-lock, flags);
if (priv-status  STATUS_HCMD_ACTIVE) {
-   IPW_ERROR(Already sending a command\n);
+   IPW_ERROR(Failed to send %s: Already sending a command.\n,
+ get_cmd_string(cmd-cmd));
spin_unlock_irqrestore(priv-lock, flags);
-   return -1;
+   return -EAGAIN;
}
 
priv-status |= STATUS_HCMD_ACTIVE;
@@ -1832,6 +1833,8 @@ static int ipw_send_cmd(struct ipw_priv 
rc = ipw_queue_tx_hcmd(priv, cmd-cmd, cmd-param, cmd-len, 0);
if (rc) {
priv-status = ~STATUS_HCMD_ACTIVE;
+   IPW_ERROR(Failed to send %s: Reason %d\n,
+ get_cmd_string(cmd-cmd), rc);
spin_unlock_irqrestore(priv-lock, flags);
return rc;
}
@@ -1844,9 +1847,8 @@ static int ipw_send_cmd(struct ipw_priv 
if (rc == 0) {
spin_lock_irqsave(priv-lock, flags);
if (priv-status  STATUS_HCMD_ACTIVE) {
-   IPW_DEBUG_INFO(Command completion failed out after 
-  %dms.\n,
-  1000 * (HOST_COMPLETE_TIMEOUT / HZ));
+   IPW_ERROR(Failed to send %s: Command timed out.\n,
+ get_cmd_string(cmd-cmd));
priv-status = ~STATUS_HCMD_ACTIVE;
spin_unlock_irqrestore(priv-lock, flags);
return -EIO;
@@ -1855,7 +1857,8 @@ static int ipw_send_cmd(struct ipw_priv 
}
 
if (priv-status  STATUS_RF_KILL_HW) {
-   IPW_DEBUG_INFO(Command aborted due to RF Kill Switch\n);
+   IPW_ERROR(Failed to send %s: Aborted due to RF kill switch.\n,
+ get_cmd_string(cmd-cmd));
return -EIO;
}
 
@@ -1874,12 +1877,7 @@ static int ipw_send_host_complete(struct
return -1;
}
 
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send HOST_COMPLETE command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 static int ipw_send_system_config(struct ipw_priv *priv,
@@ -1896,12 +1894,7 @@ static int ipw_send_system_config(struct
}
 
memcpy(cmd.param, config, sizeof(*config));
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send SYSTEM_CONFIG command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 static int ipw_send_ssid(struct ipw_priv *priv, u8 * ssid, int len)
@@ -1917,12 +1910,7 @@ static int ipw_send_ssid(struct ipw_priv
}
 
memcpy(cmd.param, ssid, cmd.len);
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send SSID command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 static int ipw_send_adapter_address(struct ipw_priv *priv, u8 * mac)
@@ -1941,12 +1929,7 @@ static int ipw_send_adapter_address(stru
   priv-net_dev-name, MAC_ARG(mac));
 
memcpy(cmd.param, mac, ETH_ALEN);
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send ADAPTER_ADDRESS command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 /*
@@ -2011,12 +1994,7 @@ static int ipw_send_scan_request_ext(str
};
 
memcpy(cmd.param, request, sizeof(*request));
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send SCAN_REQUEST_EXT command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 static int ipw_send_scan_abort(struct ipw_priv *priv)
@@ -2031,12 +2009,7 @@ static int ipw_send_scan_abort(struct ip
return -1;
}
 
-   if (ipw_send_cmd(priv, cmd)) {
-   IPW_ERROR(failed to send SCAN_ABORT command\n);
-   return -1;
-   }
-
-   return 0;
+   return ipw_send_cmd(priv, cmd);
 }
 
 static int ipw_set_sensitivity(struct ipw_priv *priv, u16 sens)
@@ -2048,12 +2021,7 @@ static int ipw_set_sensitivity(struct ip
struct ipw_sensitivity_calib *calib = (struct 

[PATCH 31/58] ipw2x00: Migrated some of the channel verification code back into the driver to

2005-11-07 Thread jketreno
Migrated some of the channel verification code back into the driver to
keep regulatory consistency in one location.

Signed-off-by: James Ketrenos
---
 drivers/net/wireless/ipw2200.c |  173 -
 1 file changed, 152 insertions(+), 21 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index bcb5993..40759e5 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -149,6 +149,12 @@ static int init_supported_rates(struct i
 static void ipw_set_hwcrypto_keys(struct ipw_priv *);
 static void ipw_send_wep_keys(struct ipw_priv *, int);
 
+static int ipw_is_valid_channel(struct ieee80211_device *, u8);
+static int ipw_channel_to_index(struct ieee80211_device *, u8);
+static u8 ipw_freq_to_channel(struct ieee80211_device *, u32);
+static int ipw_set_geo(struct ieee80211_device *, const struct ieee80211_geo 
*);
+static const struct ieee80211_geo *ipw_get_geo(struct ieee80211_device *);
+
 static int snprint_line(char *buf, size_t count,
const u8 * data, u32 len, u32 ofs)
 {
@@ -1596,7 +1602,7 @@ static ssize_t store_speed_scan(struct d
break;
}
 
-   if (ieee80211_is_valid_channel(priv-ieee, channel))
+   if (ipw_is_valid_channel(priv-ieee, channel))
priv-speed_scan[pos++] = channel;
else
IPW_WARNING(Skipping invalid channel request: %d\n,
@@ -2194,7 +2200,7 @@ static int ipw_send_tx_power(struct ipw_
 
 static int ipw_set_tx_power(struct ipw_priv *priv)
 {
-   const struct ieee80211_geo *geo = ieee80211_get_geo(priv-ieee);
+   const struct ieee80211_geo *geo = ipw_get_geo(priv-ieee);
struct ipw_tx_power tx_power;
s8 max_power;
int i;
@@ -5503,6 +5509,15 @@ static int ipw_best_network(struct ipw_p
return 0;
}
 
+   /* Filter out invalid channel in current GEO */
+   if (!ipw_is_valid_channel(priv-ieee, network-channel)) {
+   IPW_DEBUG_ASSOC(Network '%s ( MAC_FMT )' excluded 
+   because of invalid channel in current GEO\n,
+   escape_essid(network-ssid, network-ssid_len),
+   MAC_ARG(network-bssid));
+   return 0;
+   }
+
/* Ensure that the rates supported by the driver are compatible with
 * this AP, including verification of basic rates (mandatory) */
if (!ipw_compatible_rates(priv, network, rates)) {
@@ -5540,7 +,7 @@ static int ipw_best_network(struct ipw_p
 static void ipw_adhoc_create(struct ipw_priv *priv,
 struct ieee80211_network *network)
 {
-   const struct ieee80211_geo *geo = ieee80211_get_geo(priv-ieee);
+   const struct ieee80211_geo *geo = ipw_get_geo(priv-ieee);
int i;
 
/*
@@ -,10 +5570,10 @@ static void ipw_adhoc_create(struct ipw_
 * FW fatal error.
 *
 */
-   switch (ieee80211_is_valid_channel(priv-ieee, priv-channel)) {
+   switch (ipw_is_valid_channel(priv-ieee, priv-channel)) {
case IEEE80211_52GHZ_BAND:
network-mode = IEEE_A;
-   i = ieee80211_channel_to_index(priv-ieee, priv-channel);
+   i = ipw_channel_to_index(priv-ieee, priv-channel);
if (i == -1)
BUG();
if (geo-a[i].flags  IEEE80211_CH_PASSIVE_ONLY) {
@@ -5572,6 +5587,13 @@ static void ipw_adhoc_create(struct ipw_
network-mode = IEEE_G;
else
network-mode = IEEE_B;
+   i = ipw_channel_to_index(priv-ieee, priv-channel);
+   if (i == -1)
+   BUG();
+   if (geo-bg[i].flags  IEEE80211_CH_PASSIVE_ONLY) {
+   IPW_WARNING(Overriding invalid channel\n);
+   priv-channel = geo-bg[0].channel;
+   }
break;
 
default:
@@ -5899,7 +5921,7 @@ static void ipw_add_scan_channels(struct
const struct ieee80211_geo *geo;
int i;
 
-   geo = ieee80211_get_geo(priv-ieee);
+   geo = ipw_get_geo(priv-ieee);
 
if (priv-ieee-freq_band  IEEE80211_52GHZ_BAND) {
int start = channel_index;
@@ -5909,7 +5931,11 @@ static void ipw_add_scan_channels(struct
continue;
channel_index++;
scan-channels_list[channel_index] = geo-a[i].channel;
-   ipw_set_scan_type(scan, channel_index, scan_type);
+   ipw_set_scan_type(scan, channel_index,
+ geo-a[i].
+ flags  IEEE80211_CH_PASSIVE_ONLY ?
+ IPW_SCAN_PASSIVE_FULL_DWELL_SCAN :
+

[PATCH 56/58] ipw2x00: Updated firmware version stamp to 2.4 from 2.3 so it will use the latest firmware.

2005-11-07 Thread jketreno
Updated firmware version stamp to 2.4 from 2.3 so it will use the latest 
firmware.
You can obtain the firmware at http://ipw2200.sf.net/firmware.php

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index f49b012..56709d2 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -2834,7 +2834,7 @@ struct fw_chunk {
 };
 
 #define IPW_FW_MAJOR_VERSION 2
-#define IPW_FW_MINOR_VERSION 3
+#define IPW_FW_MINOR_VERSION 4
 
 #define IPW_FW_MINOR(x) ((x  0xff)  8)
 #define IPW_FW_MAJOR(x) (x  0xff)

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


[PATCH 19/58] ipw2x00: Added more useful geography encoding so people's experience with

2005-11-07 Thread jketreno
Added more useful geography encoding so people's experience with
iwconfig matches what their hardware can actually do in regard to
supported channel maps, etc.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |  279 ++---
 1 file changed, 259 insertions(+), 20 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 073721f..6e79ae2 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -10374,28 +10374,256 @@ static int ipw_config(struct ipw_priv *p
return -EIO;
 }
 
-static const struct ieee80211_geo ipw_geo = {
-   ---,
-   .bg_channels = 11,
-   .bg = {{2412, 1}, {2417, 2}, {2422, 3},
-  {2427, 4}, {2432, 5}, {2437, 6},
-  {2442, 7}, {2447, 8}, {2452, 9},
-  {2457, 10}, {2462, 11}},
-   .a_channels = 8,
-   .a = {{5180, 36},
- {5200, 40},
- {5220, 44},
- {5240, 48},
- {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
- {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
- {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
- {5320, 64, IEEE80211_CH_PASSIVE_ONLY}},
+/*
+ * NOTE:
+ *
+ * These tables have been tested in conjunction with the
+ * Intel PRO/Wireless 2200BG and 2915ABG Network Connection Adapters.
+ *
+ * Altering this values, using it on other hardware, or in geographies
+ * not intended for resale of the above mentioned Intel adapters has
+ * not been tested.
+ *
+ */
+static const struct ieee80211_geo ipw_geos[] = {
+   {   /* Restricted */
+---,
+.bg_channels = 11,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}},
+},
+
+   {   /* Custom US/Canada */
+ZZF,
+.bg_channels = 11,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}},
+.a_channels = 8,
+.a = {{5180, 36},
+  {5200, 40},
+  {5220, 44},
+  {5240, 48},
+  {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
+  {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
+  {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
+  {5320, 64, IEEE80211_CH_PASSIVE_ONLY}},
+},
+
+   {   /* Rest of World */
+ZZD,
+.bg_channels = 13,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}, {2467, 12},
+   {2472, 13}},
+},
+
+   {   /* Custom USA  Europe  High */
+ZZA,
+.bg_channels = 11,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}},
+.a_channels = 13,
+.a = {{5180, 36},
+  {5200, 40},
+  {5220, 44},
+  {5240, 48},
+  {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
+  {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
+  {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
+  {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
+  {5745, 149},
+  {5765, 153},
+  {5785, 157},
+  {5805, 161},
+  {5825, 165}},
+},
+
+   {   /* Custom NA  Europe */
+ZZB,
+.bg_channels = 11,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}},
+.a_channels = 13,
+.a = {{5180, 36},
+  {5200, 40},
+  {5220, 44},
+  {5240, 48},
+  {5260, 52, IEEE80211_CH_PASSIVE_ONLY},
+  {5280, 56, IEEE80211_CH_PASSIVE_ONLY},
+  {5300, 60, IEEE80211_CH_PASSIVE_ONLY},
+  {5320, 64, IEEE80211_CH_PASSIVE_ONLY},
+  {5745, 149, IEEE80211_CH_PASSIVE_ONLY},
+  {5765, 153, IEEE80211_CH_PASSIVE_ONLY},
+  {5785, 157, IEEE80211_CH_PASSIVE_ONLY},
+  {5805, 161, IEEE80211_CH_PASSIVE_ONLY},
+  {5825, 165, IEEE80211_CH_PASSIVE_ONLY}},
+},
+
+   {   /* Custom Japan */
+ZZC,
+.bg_channels = 11,
+.bg = {{2412, 1}, {2417, 2}, {2422, 3},
+   {2427, 4}, {2432, 5}, {2437, 6},
+   {2442, 7}, {2447, 8}, {2452, 9},
+   {2457, 10}, {2462, 11}},
+.a_channels = 4,
+.a = {{5170, 34}, {5190, 38},
+  {5210, 42}, {5230, 

[PATCH 10/58] ipw2x00: Move code from ipw2100_wpa_enable to IPW2100_PARAM_DROP_UNENCRYPTED to

2005-11-07 Thread jketreno
Move code from ipw2100_wpa_enable to IPW2100_PARAM_DROP_UNENCRYPTED to
support wpa_supplicant with open AP. We need this to make driver_ipw
work.

driver_ext has already had the similar code with the WE-18 support
added.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2100.c |   24 +---
 1 file changed, 21 insertions(+), 3 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index 73287ab..eaf4707 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -5880,9 +5880,27 @@ static int ipw2100_wpa_set_param(struct 
 
break;
 
-   case IPW2100_PARAM_DROP_UNENCRYPTED:
-   priv-ieee-drop_unencrypted = value;
-   break;
+   case IPW2100_PARAM_DROP_UNENCRYPTED:{
+   /* See IW_AUTH_DROP_UNENCRYPTED handling for details */
+   struct ieee80211_security sec = {
+   .flags = SEC_ENABLED,
+   .enabled = value,
+   };
+   priv-ieee-drop_unencrypted = value;
+   /* We only change SEC_LEVEL for open mode. Others
+* are set by ipw_wpa_set_encryption.
+*/
+   if (!value) {
+   sec.flags |= SEC_LEVEL;
+   sec.level = SEC_LEVEL_0;
+   } else {
+   sec.flags |= SEC_LEVEL;
+   sec.level = SEC_LEVEL_1;
+   }
+   if (priv-ieee-set_security)
+   priv-ieee-set_security(priv-ieee-dev, sec);
+   break;
+   }
 
case IPW2100_PARAM_PRIVACY_INVOKED:
priv-ieee-privacy_invoked = value;

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


[PATCH 54/58] ipw2x00: Fixed problem with not being able to send broadcast packets.

2005-11-07 Thread jketreno
Fixed problem with not being able to send broadcast packets.

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 081957a..c1ae6d4 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -7456,7 +7456,8 @@ static void ipw_handle_data_packet(struc
/* HW decrypt will not clear the WEP bit, MIC, PN, etc. */
hdr = (struct ieee80211_hdr_4addr *)rxb-skb-data;
if (priv-ieee-iw_mode != IW_MODE_MONITOR 
-   (is_multicast_ether_addr(hdr-addr1) ?
+   ((is_multicast_ether_addr(hdr-addr1) ||
+ is_broadcast_ether_addr(hdr-addr1)) ?
 !priv-ieee-host_mc_decrypt : !priv-ieee-host_decrypt))
ipw_rebuild_decrypted_skb(priv, rxb-skb);
 
@@ -9652,7 +9653,8 @@ static inline int ipw_tx_skb(struct ipw_
switch (priv-ieee-iw_mode) {
case IW_MODE_ADHOC:
hdr_len = IEEE80211_3ADDR_LEN;
-   unicast = !is_multicast_ether_addr(hdr-addr1);
+   unicast = !(is_multicast_ether_addr(hdr-addr1) ||
+   is_broadcast_ether_addr(hdr-addr1));
id = ipw_find_station(priv, hdr-addr1);
if (id == IPW_INVALID_STATION) {
id = ipw_add_station(priv, hdr-addr1);
@@ -9667,7 +9669,8 @@ static inline int ipw_tx_skb(struct ipw_
 
case IW_MODE_INFRA:
default:
-   unicast = !is_multicast_ether_addr(hdr-addr3);
+   unicast = !(is_multicast_ether_addr(hdr-addr3) ||
+   is_broadcast_ether_addr(hdr-addr3));
hdr_len = IEEE80211_3ADDR_LEN;
id = 0;
break;

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


[PATCH 57/58] ipw2x00: Update version ipw2200 stamp to 1.0.8

2005-11-07 Thread jketreno
Update version ipw2200 stamp to 1.0.8
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 56709d2..136884c 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -32,7 +32,7 @@
 
 #include ipw2200.h
 
-#define IPW2200_VERSION 1.0.7
+#define IPW2200_VERSION git-1.0.8
 #define DRV_DESCRIPTIONIntel(R) PRO/Wireless 2200/2915 Network Driver
 #define DRV_COPYRIGHT  Copyright(c) 2003-2005 Intel Corporation
 #define DRV_VERSION IPW2200_VERSION

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


[PATCH 24/58] ipw2x00: [Bug 701] Fix a misuse of ieee-mode with ieee-iw_mode.

2005-11-07 Thread jketreno
[Bug 701] Fix a misuse of ieee-mode with ieee-iw_mode.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 626e78a..2633e0d 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -8223,7 +8223,7 @@ static int ipw_sw_reset(struct ipw_priv 
priv-power_mode = IPW_POWER_AC;
priv-tx_power = IPW_TX_POWER_DEFAULT;
 
-   return old_mode == priv-ieee-mode;
+   return old_mode == priv-ieee-iw_mode;
 }
 
 /*

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


[PATCH 44/58] ipw2x00: Fixes problem with WEP not working (association succeeds, but no Tx/Rx)

2005-11-07 Thread jketreno
Fixes problem with WEP not working (association succeeds, but no Tx/Rx)

Signed-off-by: James Ketrenos [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index 43dab7a..217b657 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -5789,6 +5789,8 @@ static void ipw_set_hwcrypto_keys(struct
break;
case SEC_LEVEL_1:
ipw_send_wep_keys(priv, DCW_WEP_KEY_SEC_TYPE_WEP);
+   ipw_set_hw_decrypt_unicast(priv, priv-ieee-sec.level);
+   ipw_set_hw_decrypt_multicast(priv, priv-ieee-sec.level);
break;
case SEC_LEVEL_0:
default:

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


[PATCH 2/58] ipw2x00: IPW_DEBUG has already included DRV_NAME, remove double prefix print.

2005-11-07 Thread jketreno
IPW_DEBUG has already included DRV_NAME, remove double prefix print.
---
 drivers/net/wireless/ipw2100.c |   16 +++-
 1 file changed, 7 insertions(+), 9 deletions(-)
---
diff --git a/drivers/net/wireless/ipw2100.c b/drivers/net/wireless/ipw2100.c
index a15eef1..449c1c0 100644
--- a/drivers/net/wireless/ipw2100.c
+++ b/drivers/net/wireless/ipw2100.c
@@ -1833,7 +1833,7 @@ static void ipw2100_down(struct ipw2100_
 
 #ifdef ACPI_CSTATE_LIMIT_DEFINED
if (priv-config  CFG_C3_DISABLED) {
-   IPW_DEBUG_INFO(DRV_NAME : Resetting C3 transitions.\n);
+   IPW_DEBUG_INFO(: Resetting C3 transitions.\n);
acpi_set_cstate_limit(priv-cstate_limit);
priv-config = ~CFG_C3_DISABLED;
}
@@ -1858,8 +1858,7 @@ static void ipw2100_reset_adapter(struct
int associated = priv-status  STATUS_ASSOCIATED;
 
spin_lock_irqsave(priv-low_lock, flags);
-   IPW_DEBUG_INFO(DRV_NAME : %s: Restarting adapter.\n,
-  priv-net_dev-name);
+   IPW_DEBUG_INFO(: %s: Restarting adapter.\n, priv-net_dev-name);
priv-resets++;
priv-status = ~(STATUS_ASSOCIATED | STATUS_ASSOCIATING);
priv-status |= STATUS_SECURITY_UPDATED;
@@ -2062,7 +2061,7 @@ static void isr_indicate_rf_kill(struct 
 
 #ifdef ACPI_CSTATE_LIMIT_DEFINED
if (priv-config  CFG_C3_DISABLED) {
-   IPW_DEBUG_INFO(DRV_NAME : Resetting C3 transitions.\n);
+   IPW_DEBUG_INFO(: Resetting C3 transitions.\n);
acpi_set_cstate_limit(priv-cstate_limit);
priv-config = ~CFG_C3_DISABLED;
}
@@ -2300,11 +2299,11 @@ static inline void ipw2100_corruption_de
int limit;
 #endif
 
-   IPW_DEBUG_INFO(DRV_NAME : PCI latency error detected at 
-  0x%04zX.\n, i * sizeof(struct ipw2100_status));
+   IPW_DEBUG_INFO(: PCI latency error detected at 0x%04zX.\n,
+  i * sizeof(struct ipw2100_status));
 
 #ifdef ACPI_CSTATE_LIMIT_DEFINED
-   IPW_DEBUG_INFO(DRV_NAME : Disabling C3 transitions.\n);
+   IPW_DEBUG_INFO(: Disabling C3 transitions.\n);
limit = acpi_get_cstate_limit();
if (limit  2) {
priv-cstate_limit = limit;
@@ -4001,8 +4000,7 @@ static ssize_t store_debug_level(struct 
} else
val = simple_strtoul(p, p, 10);
if (p == buf)
-   IPW_DEBUG_INFO(DRV_NAME
-  : %s is not in hex or decimal form.\n, buf);
+   IPW_DEBUG_INFO(: %s is not in hex or decimal form.\n, buf);
else
ipw2100_debug_level = val;
 

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


[PATCH 41/58] ipw2x00: Card with WEP enabled and using shared-key auth will have firmware

2005-11-07 Thread jketreno
Card with WEP enabled and using shared-key auth will have firmware
error when it tries to auth to a WPA ap. The patch filters out WPA
networks if the card is not wpa enabled when selecting network to
associate to.

Signed-off-by: Hong Liu [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   10 ++
 1 file changed, 10 insertions(+)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index c9b306a..e36a1fd 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -5510,6 +5510,15 @@ static int ipw_best_network(struct ipw_p
return 0;
}
 
+   if (!priv-ieee-wpa_enabled  (network-wpa_ie_len  0 ||
+network-rsn_ie_len  0)) {
+   IPW_DEBUG_ASSOC(Network '%s ( MAC_FMT )' excluded 
+   because of WPA capability mismatch.\n,
+   escape_essid(network-ssid, network-ssid_len),
+   MAC_ARG(network-bssid));
+   return 0;
+   }
+
if ((priv-config  CFG_STATIC_BSSID) 
memcmp(network-bssid, priv-bssid, ETH_ALEN)) {
IPW_DEBUG_ASSOC(Network '%s ( MAC_FMT )' excluded 
@@ -6228,6 +6237,7 @@ static int ipw_wpa_enable(struct ipw_pri
 {
/* This is called when wpa_supplicant loads and closes the driver
 * interface. */
+   priv-ieee-wpa_enabled = value;
return 0;
 }
 

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


[PATCH 23/58] ipw2x00: Fixes the ad-hoc network WEP key list issue.

2005-11-07 Thread jketreno
Fixes the ad-hoc network WEP key list issue.

If we configure the wep keys after creating the ibss network, the
beacons of this network will not show correctly (it still shows key
off in iwlist scan report). This is because we don't update the
beacon info in firmware.

Signed-off-by: Hong Liu [EMAIL PROTECTED]
Signed-off-by: Zhu Yi [EMAIL PROTECTED]
---
 drivers/net/wireless/ipw2200.c |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/drivers/net/wireless/ipw2200.c b/drivers/net/wireless/ipw2200.c
index c6da5f5..626e78a 100644
--- a/drivers/net/wireless/ipw2200.c
+++ b/drivers/net/wireless/ipw2200.c
@@ -9169,11 +9169,19 @@ static int ipw_wx_set_encode(struct net_
 {
struct ipw_priv *priv = ieee80211_priv(dev);
int ret;
+   u32 cap = priv-capability;
 
down(priv-sem);
ret = ieee80211_wx_set_encode(priv-ieee, info, wrqu, key);
-   up(priv-sem);
 
+   /* In IBSS mode, we need to notify the firmware to update
+* the beacon info after we changed the capability. */
+   if (cap != priv-capability 
+   priv-ieee-iw_mode == IW_MODE_ADHOC 
+   priv-status  STATUS_ASSOCIATED)
+   ipw_disassociate(priv);
+
+   up(priv-sem);
return ret;
 }
 

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


[PATCH 0/3] ieee80211: Lindent, WEP group key bug, update version to 1.1.7

2005-11-07 Thread James Ketrenos
This series does the following:

[1/3] scripts/Lindent on ieee80211 subsystem.
[2/3] Fix problem with WEP unicast key  index 0
[3/3] Stamp as 1.1.7

You can pull this series from:

rsync://bughost.org/repos/ieee80211-delta/.git/

Thanks,
James

---

diffstat of the series:

 include/net/ieee80211.h  |2 +-
 net/ieee80211/ieee80211_wx.c |   14 +-
 2 files changed, 10 insertions(+), 6 deletions(-)

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


[PATCH 1/58] ipw2x00 -- available via web

2005-11-07 Thread James Ketrenos
Patch 1/58 is 185k; if it doesn't make it through to netdev, you can
view it at:

http://bughost.org/pre/0001-0058.ipw2x00.Lindent.patch

It was generated by running Lindent and removing any trailing whitespace
in drivers/net/wireless/ipw2{1,2}00.{c,h} 

Nothing too thrilling...

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


Request pull from git://git.tuxdriver.com/git/netdev-jwl.git (resend w/o patch)

2005-11-07 Thread John W. Linville
(Resending w/o the patch, in case it is too big for the list...)

The following changes since commit 0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26:
  Linus Torvalds:
Merge master.kernel.org:/.../sam/kbuild

are found in the git repository at:

  git://git.tuxdriver.com/git/netdev-jwl.git

Adrian Bunk:
  fix NET_RADIO=n, IEEE80211=y compile
  kill include/linux/eeprom.h
  drivers/net/s2io.c: make functions static

Alexey Dobriyan:
  atmel: memset correct range

Jay Vosburgh:
  bonding: fix feature consolidation

Luiz Fernando Capitulino:
  Fix sparse warning in e100 driver.

Panagiotis Issaris:
  wireless net: Conversions of kmalloc/memset to kzalloc

Roger While:
  prism54 : Unused variable / extraneous udelay
  prism54 : Transmit stats updated in wrong place

 drivers/net/bonding/bond_main.c   |   32 ++-
 drivers/net/bonding/bonding.h |7 -
 drivers/net/e100.c|6 +
 drivers/net/ns83820.c |   13 ---
 drivers/net/s2io.c|   43 +
 drivers/net/wireless/airo.c   |   36 +++-
 drivers/net/wireless/airo_cs.c|6 -
 drivers/net/wireless/atmel.c  |2 
 drivers/net/wireless/atmel_cs.c   |6 -
 drivers/net/wireless/ipw2100.c|4 -
 drivers/net/wireless/prism54/isl_38xx.c   |   12 +--
 drivers/net/wireless/prism54/islpci_eth.c |   10 +-
 drivers/net/wireless/wavelan_cs.c |3 -
 drivers/net/wireless/wl3501_cs.c  |3 -
 include/linux/eeprom.h|  136 -
 net/ieee80211/ieee80211_rx.c  |2 
 16 files changed, 72 insertions(+), 249 deletions(-)
 delete mode 100644 include/linux/eeprom.h

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


Request pull from git://git.tuxdriver.com/git/netdev-jwl.git

2005-11-07 Thread John W. Linville
The following changes since commit 0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26:
  Linus Torvalds:
Merge master.kernel.org:/.../sam/kbuild

are found in the git repository at:

  git://git.tuxdriver.com/git/netdev-jwl.git

Adrian Bunk:
  fix NET_RADIO=n, IEEE80211=y compile
  kill include/linux/eeprom.h
  drivers/net/s2io.c: make functions static

Alexey Dobriyan:
  atmel: memset correct range

Jay Vosburgh:
  bonding: fix feature consolidation

Luiz Fernando Capitulino:
  Fix sparse warning in e100 driver.

Panagiotis Issaris:
  wireless net: Conversions of kmalloc/memset to kzalloc

Roger While:
  prism54 : Unused variable / extraneous udelay
  prism54 : Transmit stats updated in wrong place

 drivers/net/bonding/bond_main.c   |   32 ++-
 drivers/net/bonding/bonding.h |7 -
 drivers/net/e100.c|6 +
 drivers/net/ns83820.c |   13 ---
 drivers/net/s2io.c|   43 +
 drivers/net/wireless/airo.c   |   36 +++-
 drivers/net/wireless/airo_cs.c|6 -
 drivers/net/wireless/atmel.c  |2 
 drivers/net/wireless/atmel_cs.c   |6 -
 drivers/net/wireless/ipw2100.c|4 -
 drivers/net/wireless/prism54/isl_38xx.c   |   12 +--
 drivers/net/wireless/prism54/islpci_eth.c |   10 +-
 drivers/net/wireless/wavelan_cs.c |3 -
 drivers/net/wireless/wl3501_cs.c  |3 -
 include/linux/eeprom.h|  136 -
 net/ieee80211/ieee80211_rx.c  |2 
 16 files changed, 72 insertions(+), 249 deletions(-)
 delete mode 100644 include/linux/eeprom.h

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 8032126..94cec3c 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1604,35 +1604,27 @@ static int bond_sethwaddr(struct net_dev
(NETIF_F_SG|NETIF_F_IP_CSUM|NETIF_F_NO_CSUM|NETIF_F_HW_CSUM)
 
 /* 
- * Compute the features available to the bonding device by 
- * intersection of all of the slave devices' BOND_INTERSECT_FEATURES.
- * Call this after attaching or detaching a slave to update the 
- * bond's features.
+ * Compute the common dev-feature set available to all slaves.  Some
+ * feature bits are managed elsewhere, so preserve feature bits set on
+ * master device that are not part of the examined set.
  */
 static int bond_compute_features(struct bonding *bond)
 {
-   int i;
+   unsigned long features = BOND_INTERSECT_FEATURES;
struct slave *slave;
struct net_device *bond_dev = bond-dev;
-   int features = bond-bond_features;
+   int i;
 
-   bond_for_each_slave(bond, slave, i) {
-   struct net_device * slave_dev = slave-dev;
-   if (i == 0) {
-   features |= BOND_INTERSECT_FEATURES;
-   }
-   features =
-   ~(~slave_dev-features  BOND_INTERSECT_FEATURES);
-   }
+   bond_for_each_slave(bond, slave, i)
+   features = (slave-dev-features  BOND_INTERSECT_FEATURES);
 
-   /* turn off NETIF_F_SG if we need a csum and h/w can't do it */
if ((features  NETIF_F_SG)  
-   !(features  (NETIF_F_IP_CSUM |
- NETIF_F_NO_CSUM |
- NETIF_F_HW_CSUM))) {
+   !(features  (NETIF_F_IP_CSUM |
+ NETIF_F_NO_CSUM |
+ NETIF_F_HW_CSUM)))
features = ~NETIF_F_SG;
-   }
 
+   features |= (bond_dev-features  ~BOND_INTERSECT_FEATURES);
bond_dev-features = features;
 
return 0;
@@ -4561,8 +4553,6 @@ static int __init bond_init(struct net_d
   NETIF_F_HW_VLAN_RX |
   NETIF_F_HW_VLAN_FILTER);
 
-   bond-bond_features = bond_dev-features;
-
 #ifdef CONFIG_PROC_FS
bond_create_proc_entry(bond);
 #endif
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index bbf9da8..1433e91 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -40,8 +40,8 @@
 #include bond_3ad.h
 #include bond_alb.h
 
-#define DRV_VERSION2.6.4
-#define DRV_RELDATESeptember 26, 2005
+#define DRV_VERSION2.6.5
+#define DRV_RELDATENovember 4, 2005
 #define DRV_NAME   bonding
 #define DRV_DESCRIPTIONEthernet Channel Bonding Driver
 
@@ -211,9 +211,6 @@ struct bonding {
struct   bond_params params;
struct   list_head vlan_list;
struct   vlan_group *vlgrp;
-   /* the features the bonding device supports, independently 
-* of any slaves */
-   int  bond_features; 
 };
 
 /**
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index eb169a8..7a6aeae 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1478,7 +1478,7 @@ static inline int 

Re: Request pull from git://git.tuxdriver.com/git/netdev-jwl.git

2005-11-07 Thread Jeff Garzik

John W. Linville wrote:

The following changes since commit 0b154bb7d0cce80e9c0bcf11d4f9e71b59409d26:
  Linus Torvalds:
Merge master.kernel.org:/.../sam/kbuild

are found in the git repository at:

  git://git.tuxdriver.com/git/netdev-jwl.git

Adrian Bunk:
  fix NET_RADIO=n, IEEE80211=y compile
  kill include/linux/eeprom.h
  drivers/net/s2io.c: make functions static

Alexey Dobriyan:
  atmel: memset correct range

Jay Vosburgh:
  bonding: fix feature consolidation

Luiz Fernando Capitulino:
  Fix sparse warning in e100 driver.

Panagiotis Issaris:
  wireless net: Conversions of kmalloc/memset to kzalloc

Roger While:
  prism54 : Unused variable / extraneous udelay
  prism54 : Transmit stats updated in wrong place


pulled, thanks.

Jeff



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


Re: [openib-general] error compiling kernel...

2005-11-07 Thread Grant Grundler
On Mon, Nov 07, 2005 at 11:19:41PM -0500, Sayantan Sur wrote:
...
 Has anyone been able to compile gen2 with 2.6.14?

Yes - but I've run into a different problem.
After fixing up include/rdma to point at drivers/infiniband/include/rdma,
I get a symbol missing from from the modules.


iota:/usr/src/linux-2.6.14# make modules_install
...
if [ -r System.map -a -x /sbin/depmod ]; then /sbin/depmod -ae -F System.map  2.
6.14; fi
WARNING: /lib/modules/2.6.14/kernel/drivers/infiniband/ulp/sdp/ib_sdp.ko needs u
nknown symbol ip_dev_find   
WARNING: /lib/modules/2.6.14/kernel/drivers/infiniband/core/ib_at.ko needs unkno
wn symbol ip_dev_find   
WARNING: /lib/modules/2.6.14/kernel/drivers/infiniband/core/ib_addr.ko needs unk
nown symbol ip_dev_find 
iota:/usr/src/linux-2.6.14#

ip_dev_find() is not exported by net/ipv4/fib_frontend.c.

However, drivers/infiniband is the only module that needs this.
CONFIG_IP_MROUTE is another configurable user but cannot be enabled
as a module.

Patch below adds EXPORT_SYMBOL() to fib_frontend.c.
I'm not trying to assert this is the Right Thing.
It's just the first obvious solution to the immediate problem.

thanks,
grant

Signed-off-by: Grant Grundler [EMAIL PROTECTED]

--- linux-2.6.14-ORIG/net/ipv4/fib_frontend.c   2005-10-27 17:02:08.0 
-0700
+++ linux-2.6.14/net/ipv4/fib_frontend.c2005-11-07 21:29:22.0 
-0800
@@ -662,3 +662,4 @@ void __init ip_fib_init(void)
 
 EXPORT_SYMBOL(inet_addr_type);
 EXPORT_SYMBOL(ip_rt_ioctl);
+EXPORT_SYMBOL(ip_dev_find);
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [openib-general] error compiling kernel...

2005-11-07 Thread Grant Grundler
On Mon, Nov 07, 2005 at 09:59:49PM -0800, Grant Grundler wrote:
 WARNING: /lib/modules/2.6.14/kernel/drivers/infiniband/ulp/sdp/ib_sdp.ko 
 needs unknown symbol ip_dev_find  
  
 Patch below adds EXPORT_SYMBOL() to fib_frontend.c.

...never mind. Johann George just pointed out someone already has
added this diff to the openib.org repository:

https://openib.org/svn/gen2/trunk/src/linux-kernel/patches/linux-2.6.14-fib-frontend.diff

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