d80211: The struct ieee80211_hw_modes array is a pain

2006-12-13 Thread Michael Buesch
I am currently porting the bcm43xx driver to my new Sonics
Silicon Backplane busdriver.
I am having a major pain implementing the hw-modes field
for this. In particular, the problem is allocation.
I always felt sick about hw-modes, but with my new code it's
damn complicated to get allocation of the stuff right.
The problem is, that I do not know in advance which PHYMODEs
my device supports (in fact, we never knew that, but we worked
around it (in a broken way)).
We have the following scenario: The PHYs are probed one after
each other. We have one data structure per PHY. This bites
the static hw-modes array in its ass. I would either have to
allocate it big enough at the first time (wasting lots of memory)
or I'd have to re-allocate it every time a new PHY is probed.
Another (much harder to fix) problem is the opposite of the probing:
Removing the PHYs.

So, what I'd like to have is:

One struct ieee802111_hw_mode which I can embed into the PHY
data structure. This struct is now dynamically registered to the
ieee80211 subsystem (instead of doing a static array pain).

Registering and unregistering would be done with simple linked lists,
perhaps, in d80211.

If nobody has any objections against this approach, I will do a
patch soon.

-- 
Greetings Michael.
-
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: d80211: The struct ieee80211_hw_modes array is a pain

2006-12-13 Thread Ivo Van Doorn

Hi,


I am currently porting the bcm43xx driver to my new Sonics
Silicon Backplane busdriver.
I am having a major pain implementing the hw-modes field
for this. In particular, the problem is allocation.
I always felt sick about hw-modes, but with my new code it's
damn complicated to get allocation of the stuff right.
The problem is, that I do not know in advance which PHYMODEs
my device supports (in fact, we never knew that, but we worked
around it (in a broken way)).
We have the following scenario: The PHYs are probed one after
each other. We have one data structure per PHY. This bites
the static hw-modes array in its ass. I would either have to
allocate it big enough at the first time (wasting lots of memory)
or I'd have to re-allocate it every time a new PHY is probed.
Another (much harder to fix) problem is the opposite of the probing:
Removing the PHYs.

So, what I'd like to have is:

One struct ieee802111_hw_mode which I can embed into the PHY
data structure. This struct is now dynamically registered to the
ieee80211 subsystem (instead of doing a static array pain).

Registering and unregistering would be done with simple linked lists,
perhaps, in d80211.


Sounds good to me. This would also solve the issue where the dscape stack
would always select the first mode in the array as the default mode.
Which means that the array should always be allocated in a specific
order since if B is first followed by G, then B would always be used
(even if G is supported by the AP).

Ivo
-
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


latest linux git doesn't compile ucc_geth_phy.c and ucc_geth.c

2006-12-13 Thread Joakim Tjernlund
drivers/net/ucc_geth.c:4083:45: macro INIT_WORK passed 3 arguments,
but takes just 2
drivers/net/ucc_geth.c: In function `ucc_geth_open':
drivers/net/ucc_geth.c:4083: error: `INIT_WORK' undeclared (first use in
this function)
drivers/net/ucc_geth.c:4083: error: (Each undeclared identifier is
reported only once
drivers/net/ucc_geth.c:4083: error: for each function it appears in.)
drivers/net/ucc_geth.c: At top level:
drivers/net/ucc_geth.c:3924: warning: 'ugeth_phy_change' defined but not
used
make[2]: *** [drivers/net/ucc_geth.o] Error 1

drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here


-
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: latest linux git doesn't compile ucc_geth_phy.c and ucc_geth.c

2006-12-13 Thread Kumar Gala



On Wed, 13 Dec 2006, Joakim Tjernlund wrote:


drivers/net/ucc_geth.c:4083:45: macro INIT_WORK passed 3 arguments,
but takes just 2
drivers/net/ucc_geth.c: In function `ucc_geth_open':
drivers/net/ucc_geth.c:4083: error: `INIT_WORK' undeclared (first use in
this function)
drivers/net/ucc_geth.c:4083: error: (Each undeclared identifier is
reported only once
drivers/net/ucc_geth.c:4083: error: for each function it appears in.)
drivers/net/ucc_geth.c: At top level:
drivers/net/ucc_geth.c:3924: warning: 'ugeth_phy_change' defined but not
used
make[2]: *** [drivers/net/ucc_geth.o] Error 1



This is because of the new INIT_WORK changes.


drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:71: error: conflicting types for 'phy_read'
include/linux/phy.h:355: error: previous declaration of 'phy_read' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here
drivers/net/ucc_geth_phy.c:72: error: conflicting types for 'phy_write'
include/linux/phy.h:356: error: previous declaration of 'phy_write' was
here


This is because of me wanting to get PHY_POLL defined for board code with 
having to include it everywhere it was being used.


Try the following patch and let me know if it works. (Make sure to try 
something that effects the PHY, like link status change or speed).


If it works for you I'll clean it up and send it upstream.

- k

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 8243150..252088f 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -3920,10 +3920,11 @@ static irqreturn_t phy_interrupt(int irq, void *dev_id)
 }

 /* Scheduled by the phy_interrupt/timer to handle PHY changes */
-static void ugeth_phy_change(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-   struct net_device *dev = (struct net_device *)data;
-   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   struct ucc_geth_private *ugeth =
+   container_of(work, struct ucc_geth_private, tq);
+   struct net_device *dev = ugeth-dev;
struct ucc_geth *ug_regs;
int result = 0;

@@ -4080,7 +4081,7 @@ static int ucc_geth_open(struct net_device *dev)
 #endif /* CONFIG_UGETH_NAPI */

/* Set up the PHY change work queue */
-   INIT_WORK(ugeth-tq, ugeth_phy_change, dev);
+   INIT_WORK(ugeth-tq, ugeth_phy_change);

init_timer(ugeth-phy_info_timer);
ugeth-phy_info_timer.function = ugeth_phy_startup_timer;
diff --git a/drivers/net/ucc_geth.h b/drivers/net/ucc_geth.h
diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c
index 5360ec0..95a7674 100644
--- a/drivers/net/ucc_geth_phy.c
+++ b/drivers/net/ucc_geth_phy.c
@@ -68,8 +68,8 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_update_link(struct ugeth_mii_info *mii_info);
 static int genmii_read_status(struct ugeth_mii_info *mii_info);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
+static u16 ugphy_read(struct ugeth_mii_info *mii_info, u16 regnum);
+static void ugphy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);

 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +184,7 @@ static void config_genmii_advert(struct ugeth_mii_info 
*mii_info)
advertise = mii_info-advertising;

/* Setup standard advertisement */
-   adv = phy_read(mii_info, MII_ADVERTISE);
+   adv = ugphy_read(mii_info, MII_ADVERTISE);
adv = ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (advertise  ADVERTISED_10baseT_Half)
adv |= ADVERTISE_10HALF;
@@ -194,7 +194,7 @@ static void config_genmii_advert(struct ugeth_mii_info 
*mii_info)
adv |= ADVERTISE_100HALF;
if (advertise  ADVERTISED_100baseT_Full)
adv |= ADVERTISE_100FULL;
-   phy_write(mii_info, MII_ADVERTISE, adv);
+   ugphy_write(mii_info, MII_ADVERTISE, adv);
 }

 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +204,7 @@ static void genmii_setup_forced(struct ugeth_mii_info 
*mii_info)

ugphy_vdbg(%s: IN, __FUNCTION__);

-   ctrl = phy_read(mii_info, MII_BMCR);
+   ctrl = ugphy_read(mii_info, MII_BMCR);

ctrl =
~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE);
@@ -234,7 +234,7 @@ static void genmii_setup_forced(struct ugeth_mii_info 
*mii_info)
break;
}

-   phy_write(mii_info, MII_BMCR, ctrl);
+   ugphy_write(mii_info, MII_BMCR, ctrl);
 }

 /* Enable and Restart Autonegotiation */
@@ -244,9 

[PATCH] [IPV6] Make fib6_node subtree depend on IPV6_SUBTREES

2006-12-13 Thread Kim Nordlund

Make fib6_node 'subtree' depend on IPV6_SUBTREES.

Signed-off-by: Kim Nordlund [EMAIL PROTECTED]

diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index f9cde44..7be4f4e 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -50,9 +50,9 @@ struct fib6_node
struct fib6_node*parent;
struct fib6_node*left;
struct fib6_node*right;
-
+#ifdef CONFIG_IPV6_SUBTREES
struct fib6_node*subtree;
-
+#endif
struct rt6_info *leaf;
 
__u16   fn_bit; /* bit key */
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9f80518..8c3d568 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -494,7 +494,7 @@ do { \
goto out; \
pn = fn-parent; \
if (FIB6_SUBTREE(pn)  FIB6_SUBTREE(pn) != fn) \
-   fn = fib6_lookup(pn-subtree, NULL, saddr); \
+   fn = fib6_lookup(FIB6_SUBTREE(pn), NULL, 
saddr); \
else \
fn = pn; \
if (fn-fn_flags  RTN_RTINFO) \

-
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] drivers/net: spidernet driver on Celleb

2006-12-13 Thread Linas Vepstas
On Wed, Dec 13, 2006 at 02:54:37PM +1100, Benjamin Herrenschmidt wrote:
 Cell blade because it's using a fiber link

Oh. I didn't know that. 

--linas
-
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/2] d80211, rt2x00: fixes

2006-12-13 Thread Jiri Benc
John, in addition to the previous pull request, please also apply the
following two fixes.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs
-
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] fix some wireless ext stuff

2006-12-13 Thread Jiri Benc
From: Johannes Berg [EMAIL PROTECTED]

This fixes compilation with d80211/cfg80211/wireless ext.

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

--- linux-2.6-git.orig/net/core/net-sysfs.c 2006-12-06 12:31:04.247283692 
+0100
+++ linux-2.6-git/net/core/net-sysfs.c  2006-12-06 12:31:11.865215130 +0100
@@ -329,7 +329,7 @@
.attrs  = netstat_attrs,
 };
 
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
 /* helper function that does all the locking etc for wireless stats */
 static ssize_t wireless_show(struct class_device *cd, char *buf,
 ssize_t (*format)(const struct iw_statistics *,
@@ -462,7 +462,7 @@
if (net-get_stats)
*groups++ = netstat_group;
 
-#ifdef WIRELESS_EXT
+#ifdef CONFIG_WIRELESS_EXT
if (net-wireless_handlers  
net-wireless_handlers-get_wireless_stats)
*groups++ = wireless_group;
 #endif
--- linux-2.6-git.orig/net/d80211/Kconfig   2006-12-06 12:31:58.903791779 
+0100
+++ linux-2.6-git/net/d80211/Kconfig2006-12-06 12:32:07.355715711 +0100
@@ -3,6 +3,7 @@
select CRYPTO
select CRYPTO_ARC4
select CRYPTO_AES
+   select WIRELESS_EXT
---help---
This option enables the hardware independent IEEE 802.11
networking stack.
--- linux-2.6-git.orig/net/wireless/Makefile2006-12-06 12:35:58.838632346 
+0100
+++ linux-2.6-git/net/wireless/Makefile 2006-12-06 12:36:03.541590019 +0100
@@ -12,5 +12,5 @@
 
 # this needs to be compiled in...
 obj-$(CONFIG_CFG80211_WEXT_COMPAT) += wext-compat.o
-obj-$(CONFIG_CFG80211_WEXTNL_COMPAT)$(CONFIG_NET_WIRELESS) += wext-common.o
+obj-$(CONFIG_CFG80211_WEXT_COMPAT)$(CONFIG_NET_WIRELESS) += wext-common.o
 obj-y += $(obj-yy) $(obj-yn) $(obj-ny)


-
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] rt2x00: fix breakage after pkt_type field was removed

2006-12-13 Thread Jiri Benc
Fix breakage after pkt_type field was removed from ieee80211_tx_control.

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

---
 drivers/net/wireless/d80211/rt2x00/rt2400pci.c |2 +-
 drivers/net/wireless/d80211/rt2x00/rt2500pci.c |2 +-
 drivers/net/wireless/d80211/rt2x00/rt2500usb.c |2 +-
 drivers/net/wireless/d80211/rt2x00/rt2x00.h|3 +++
 drivers/net/wireless/d80211/rt2x00/rt61pci.c   |2 +-
 drivers/net/wireless/d80211/rt2x00/rt73usb.c   |2 +-
 6 files changed, 8 insertions(+), 5 deletions(-)

--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt2400pci.c
@@ -1428,7 +1428,7 @@ static void rt2400pci_write_tx_desc(stru
 * to be inserted into the frame.
 */
req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+  is_probe_resp(frame_control));
 
/*
 * Determine with what IFS priority this frame should be send.
--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt2500pci.c
@@ -1569,7 +1569,7 @@ static void rt2500pci_write_tx_desc(stru
 * to be inserted into the frame.
 */
req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+  is_probe_resp(frame_control));
 
/*
 * Determine with what IFS priority this frame should be send.
--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt2500usb.c
@@ -1540,7 +1540,7 @@ static void rt2500usb_write_tx_desc(stru
 * to be inserted into the frame.
 */
req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+  is_probe_resp(frame_control));
 
/*
 * Determine with what IFS priority this frame should be send.
--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt2x00.h
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt2x00.h
@@ -130,6 +130,9 @@ static int rt2x00_debug_level = 0;
 #define is_rts_frame(__fc) \
( !!__fc)   IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_CTL)  \
 (((__fc)   IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_RTS)) )
+#define is_probe_resp(__fc) \
+   ( !!__fc)  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT)  \
+(((__fc)  IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)) )
 
 /*
  * TX result flags.
--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt61pci.c
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt61pci.c
@@ -2024,7 +2024,7 @@ static void rt61pci_write_tx_desc(struct
 * to be inserted into the frame.
 */
req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+  is_probe_resp(frame_control));
 
/*
 * Determine with what IFS priority this frame should be send.
--- dscape.orig/drivers/net/wireless/d80211/rt2x00/rt73usb.c
+++ dscape/drivers/net/wireless/d80211/rt2x00/rt73usb.c
@@ -1803,7 +1803,7 @@ static void rt73usb_write_tx_desc(struct
 * to be inserted into the frame.
 */
req_timestamp = !!(control-queue == IEEE80211_TX_QUEUE_BEACON ||
-  control-pkt_type == PKT_PROBE_RESP);
+  is_probe_resp(frame_control));
 
/*
 * Determine with what IFS priority this frame should be send.
-
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 1/2] rt2x00: fix breakage after pkt_type field was removed

2006-12-13 Thread Ivo van Doorn
On Wednesday 13 December 2006 18:00, Jiri Benc wrote:
 Fix breakage after pkt_type field was removed from ieee80211_tx_control.

Hmm, I must have missed that patch.
Your patch looks good to me.
Thanks

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

Signed-off-by: Ivo van Doorn [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 04/26] rt2x00: EEPROM 93Cx6

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 05:47:41PM +0100, Ivo van Doorn wrote:
 Do you need to actually write data to the eeprom chip?
 Currently the module does not support writing to the eeprom,
 this is something I could add (The original Ralink code, where this module
 is based on also contains the code to write to the EEPROM).

I am going to use it to write the custom pci vendor ID to the eeprom, so
yes I intend to write to it.  The code appears as if it has the ability
to write to the eeprom but I didn't look at all of it carefully yet.  I
don't actually have any need to read it back, although I intend to do so
to verify the contents.

--
Len Sorensen
-
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] rt2x00: Fix crc-itu-t dependency

2006-12-13 Thread Ivo van Doorn
crc-itu-t should only appear in the kernel configuration menu
when rt2x00 is enabled. The module should only be build when
rt2x00 is used, otherwise crc-itu-t is simply in the wrong
location since it is not a network driver.

Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

---

diff --git a/drivers/net/wireless/d80211/rt2x00/Kconfig 
b/drivers/net/wireless/d80211/rt2x00/Kconfig
index c2c2a60..18d61c3 100644
--- a/drivers/net/wireless/d80211/rt2x00/Kconfig
+++ b/drivers/net/wireless/d80211/rt2x00/Kconfig
@@ -93,6 +93,7 @@ config EEPROM_93CX6
 
 config CRC_ITU_T
tristate CRC ITU-T V.41 functions
+   depends on RT2X00
help
  This option is provided for the case where no in-kernel-tree
  modules require CRC ITU-T V.41 functions, but a module built outside
-
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 8/14] d80211: add mising sta_info_put function

2006-12-13 Thread Jiri Benc
From: Mohamed Abbas [EMAIL PROTECTED]

This is small patch adding missing sta_info_put function.

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

---

 net/d80211/ieee80211_ioctl.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

6b29100c7e405c835eac8ebff2ff11774763da05
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 416d92e..1643216 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -3048,6 +3048,7 @@ static struct iw_statistics *ieee80211_g
wstats-qual.qual = 100*tmp_qual/local-hw.maxssi;
wstats-qual.noise = sta-last_noise;
wstats-qual.updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
+   sta_info_put(sta);
}
return wstats;
 }
-- 
1.3.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 5/14] d80211: remove unused references to sub interface data

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

In these three cases the pointer returned by IEEE80211_DEV_TO_SUB_IF()
is never used.

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

---

 net/d80211/ieee80211.c   |4 +---
 net/d80211/ieee80211_iface.c |3 +--
 net/d80211/ieee80211_ioctl.c |2 --
 3 files changed, 2 insertions(+), 7 deletions(-)

c2f74bcf14ecc48919bcdfa79ff0adaec8afb25e
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 6e10db5..664e6d0 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -1362,11 +1362,9 @@ static int ieee80211_master_start_xmit(s
struct ieee80211_tx_control control;
struct ieee80211_tx_packet_data *pkt_data;
struct net_device *odev = NULL;
-   struct ieee80211_sub_if_data *sdata, *osdata;
+   struct ieee80211_sub_if_data *osdata;
int ret;
 
-   sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-
/*
 * copy control out of the skb so other people can use skb-cb
 */
diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c
index bb15442..3d5b73c 100644
--- a/net/d80211/ieee80211_iface.c
+++ b/net/d80211/ieee80211_iface.c
@@ -42,7 +42,7 @@ int ieee80211_if_add(struct net_device *
 {
struct net_device *ndev, *tmp_dev;
struct ieee80211_local *local = dev-ieee80211_ptr;
-   struct ieee80211_sub_if_data *sdata = NULL, *sdata_parent;
+   struct ieee80211_sub_if_data *sdata = NULL;
int ret;
int i;
 
@@ -83,7 +83,6 @@ int ieee80211_if_add(struct net_device *
sdata-type = IEEE80211_IF_TYPE_AP;
sdata-dev = ndev;
sdata-local = local;
-   sdata_parent = IEEE80211_DEV_TO_SUB_IF(dev);
ieee80211_if_sdata_init(sdata);
 
ret = register_netdevice(ndev);
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 63424a7..cb600d7 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -407,10 +407,8 @@ static int ieee80211_ioctl_get_info_sta(
if (param-sta_addr[0] == 0xff  param-sta_addr[1] == 0xff 
param-sta_addr[2] == 0xff  param-sta_addr[3] == 0xff 
param-sta_addr[4] == 0xff  param-sta_addr[5] == 0xff) {
-   struct ieee80211_sub_if_data *sdata;
struct net_device_stats *stats;
 
-   sdata = IEEE80211_DEV_TO_SUB_IF(dev);
stats = ieee80211_dev_stats(local-mdev);
param-u.get_info_sta.rx_bytes = stats-rx_bytes;
param-u.get_info_sta.tx_bytes = stats-tx_bytes;
-- 
1.3.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/14] d80211: allow for hardware crypto of default keys

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

Remove incorrect prohibition of hardware crypto support.  This was
originally present to prevent hardware crypto when more than one
station interface was created for a single hardware device, the code
in question is no longer correct and should be removed.

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

---

 net/d80211/ieee80211_ioctl.c |9 +
 1 files changed, 1 insertions(+), 8 deletions(-)

281859d5a1d5004285bf806286600fa49ecb117b
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index c74b431..ef373f7 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -537,9 +537,7 @@ static int ieee80211_set_encryption(stru
}
key = sdata-keys[idx];
 
-   /* Disable hwaccel for default keys when the interface is not
-* the default one.
-* TODO: consider adding hwaccel support for these; at least
+   /* TODO: consider adding hwaccel support for these; at least
 * Atheros key cache should be able to handle this since AP is
 * only transmitting frames with default keys. */
/* FIX: hw key cache can be used when only one virtual
@@ -548,11 +546,6 @@ static int ieee80211_set_encryption(stru
 * must be used. This should be done automatically
 * based on configured station devices. For the time
 * being, this can be only set at compile time. */
-   /* FIXME: There is no more anything like default
-* interface. We should try hwaccel if there is just one
-* interface - for now, hwaccel is unconditionaly
-* disabled. */
-   try_hwaccel = 0;
} else {
set_tx_key = 0;
if (idx != 0) {
-- 
1.3.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 0/14] d80211: pull request

2006-12-13 Thread Jiri Benc
Please pull from
git://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.git up
to obtain following patches:

David Kimdon:
  d80211: allow for hardware crypto of default keys
  d80211: set default_wep_only dynamically
  d80211: fix potential interface name overflow
  d80211: fix potential invalid array index returning key information
  d80211: remove unused references to sub interface data
  d80211: fix invalid check for sub interface type AP
  d80211: do not pass an invalid key index to set_key()

Jiri Benc:
  Merge branch 'from-john'

Michael Buesch:
  d80211: Fix errorcode in ieee80211_update_hw

Michael Wu:
  d80211: remove pkt_type/pkt_probe_resp
  d80211: move 802.11 defines to linux/ieee80211.h
  d80211: merge d80211_shared.h into d80211.h
  d80211: merge d80211_mgmt.h into linux/ieee80211.h
  d80211: move d80211_common.h to net/d80211

Mohamed Abbas:
  d80211: add mising sta_info_put function


-- 
Jiri Benc
SUSE Labs
-
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 10/14] d80211: Fix errorcode in ieee80211_update_hw

2006-12-13 Thread Jiri Benc
From: Michael Buesch [EMAIL PROTECTED]

ieee80211_update_hw should return a proper error code
instead of hardcoded -1.

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

---

 net/d80211/ieee80211.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

cca5b9bc1f21e1d9a616e0f8e2fea04140a51a07
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 8d543f2..9e7e1b3 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -4635,7 +4635,7 @@ int ieee80211_update_hw(struct ieee80211
 
if (!hw-modes || !hw-modes-channels || !hw-modes-rates ||
!hw-modes-num_channels || !hw-modes-num_rates)
-   return -1;
+   return -EINVAL;
 
ieee80211_precalc_modes(local);
local-hw.conf.phymode = hw-modes[0].mode;
-- 
1.3.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 13/14] d80211: merge d80211_mgmt.h into linux/ieee80211.h

2006-12-13 Thread Jiri Benc
From: Michael Wu [EMAIL PROTECTED]

This merges d80211_mgmt.h with linux/ieee80211.h, to keep all the general
802.11 definitions in one place.

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

---

 drivers/net/wireless/d80211/bcm43xx/bcm43xx.h |1 
 include/linux/ieee80211.h |  208 +++
 include/net/d80211_mgmt.h |  223 -
 net/d80211/ieee80211.c|1 
 net/d80211/ieee80211_iface.c  |1 
 net/d80211/ieee80211_ioctl.c  |1 
 net/d80211/ieee80211_sta.c|1 
 7 files changed, 208 insertions(+), 228 deletions(-)
 delete mode 100644 include/net/d80211_mgmt.h

3c00986b08e969cc141bd094dfd8e2f20340c8c7
diff --git a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h 
b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
index 2a18875..a607857 100644
--- a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
@@ -14,7 +14,6 @@ #include asm/io.h
 #include linux/ssb.h
 #include linux/wireless.h
 #include net/d80211.h
-#include net/d80211_mgmt.h
 #include net/d80211_common.h
 
 #include bcm43xx_debugfs.h
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index 9afa694..fe9ef26 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -104,4 +104,212 @@ struct ieee80211_hdr {
__u8 addr4[6];
 } __attribute__ ((packed));
 
+
+struct ieee80211_mgmt {
+   __le16 frame_control;
+   __le16 duration;
+   __u8 da[6];
+   __u8 sa[6];
+   __u8 bssid[6];
+   __le16 seq_ctrl;
+   union {
+   struct {
+   __le16 auth_alg;
+   __le16 auth_transaction;
+   __le16 status_code;
+   /* possibly followed by Challenge text */
+   __u8 variable[0];
+   } __attribute__ ((packed)) auth;
+   struct {
+   __le16 reason_code;
+   } __attribute__ ((packed)) deauth;
+   struct {
+   __le16 capab_info;
+   __le16 listen_interval;
+   /* followed by SSID and Supported rates */
+   u8 variable[0];
+   } __attribute__ ((packed)) assoc_req;
+   struct {
+   __le16 capab_info;
+   __le16 status_code;
+   __le16 aid;
+   /* followed by Supported rates */
+   __u8 variable[0];
+   } __attribute__ ((packed)) assoc_resp, reassoc_resp;
+   struct {
+   __le16 capab_info;
+   __le16 listen_interval;
+   __u8 current_ap[6];
+   /* followed by SSID and Supported rates */
+   __u8 variable[0];
+   } __attribute__ ((packed)) reassoc_req;
+   struct {
+   __le16 reason_code;
+   } __attribute__ ((packed)) disassoc;
+   struct {
+   __le64 timestamp;
+   __le16 beacon_int;
+   __le16 capab_info;
+   /* followed by some of SSID, Supported rates,
+* FH Params, DS Params, CF Params, IBSS Params, TIM */
+   __u8 variable[0];
+   } __attribute__ ((packed)) beacon;
+   struct {
+   /* only variable items: SSID, Supported rates */
+   __u8 variable[0];
+   } __attribute__ ((packed)) probe_req;
+   struct {
+   __le64 timestamp;
+   __le16 beacon_int;
+   __le16 capab_info;
+   /* followed by some of SSID, Supported rates,
+* FH Params, DS Params, CF Params, IBSS Params */
+   __u8 variable[0];
+   } __attribute__ ((packed)) probe_resp;
+   struct {
+   __u8 category;
+   union {
+   struct {
+   __u8 action_code;
+   __u8 dialog_token;
+   __u8 status_code;
+   __u8 variable[0];
+   } __attribute__ ((packed)) wme_action;
+   struct{
+   __u8 action_code;
+   __u8 element_id;
+   __u8 length;
+   __u8 switch_mode;
+   __u8 new_chan;
+   __u8 switch_count;
+   

[PATCH 9/14] d80211: remove pkt_type/pkt_probe_resp

2006-12-13 Thread Jiri Benc
From: Michael Wu [EMAIL PROTECTED]

Nobody uses pkt_type, and the information can be obtained from the
header. This removes it and the associated code that keeps tracks of it.

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

---

 include/net/d80211.h   |1 -
 net/d80211/ieee80211.c |7 ---
 net/d80211/ieee80211_i.h   |3 +--
 net/d80211/ieee80211_sta.c |   17 +++--
 4 files changed, 8 insertions(+), 20 deletions(-)

67e20838fff9a011cb83a02ca21d39d73313a42f
diff --git a/include/net/d80211.h b/include/net/d80211.h
index 30980e1..f7f6318 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -135,7 +135,6 @@ struct ieee80211_low_level_stats {
 #define HW_KEY_IDX_INVALID -1
 
 struct ieee80211_tx_control {
-   enum { PKT_NORMAL = 0, PKT_PROBE_RESP } pkt_type;
int tx_rate; /* Transmit rate, given as the hw specific value for the
  * rate (from struct ieee80211_rate) */
int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 664e6d0..8d543f2 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -1393,8 +1393,6 @@ #endif
control.flags |= IEEE80211_TXCTL_REQ_TX_STATUS;
if (pkt_data-do_not_encrypt)
control.flags |= IEEE80211_TXCTL_DO_NOT_ENCRYPT;
-   control.pkt_type =
-   pkt_data-pkt_probe_resp ? PKT_PROBE_RESP : PKT_NORMAL;
if (pkt_data-requeue)
control.flags |= IEEE80211_TXCTL_REQUEUE;
control.queue = pkt_data-queue;
@@ -1626,10 +1624,6 @@ ieee80211_mgmt_start_xmit(struct sk_buff
 pkt_data-ifindex = sdata-dev-ifindex;
pkt_data-mgmt_iface = (sdata-type == IEEE80211_IF_TYPE_MGMT);
 
-   if ((fc  IEEE80211_FCTL_FTYPE) == IEEE80211_FTYPE_MGMT 
-   (fc  IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PROBE_RESP)
-   pkt_data-pkt_probe_resp = 1;
-
skb-priority = 20; /* use hardcoded priority for mgmt TX queue */
skb-dev = sdata-local-mdev;
 
@@ -4048,7 +4042,6 @@ static void ieee80211_remove_tx_extra(st
pkt_data-mgmt_iface = (control-type == IEEE80211_IF_TYPE_MGMT);
pkt_data-req_tx_status = !!(control-flags  
IEEE80211_TXCTL_REQ_TX_STATUS);
pkt_data-do_not_encrypt = !!(control-flags  
IEEE80211_TXCTL_DO_NOT_ENCRYPT);
-   pkt_data-pkt_probe_resp = (control-pkt_type == PKT_PROBE_RESP);
pkt_data-requeue = !!(control-flags  IEEE80211_TXCTL_REQUEUE);
pkt_data-queue = control-queue;
 
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index 5615d6d..a7a4bc9 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -155,10 +155,9 @@ struct ieee80211_tx_packet_data {
unsigned long jiffies;
unsigned int req_tx_status:1;
unsigned int do_not_encrypt:1;
-   unsigned int pkt_probe_resp:1;
unsigned int requeue:1;
-   unsigned int queue:4;
unsigned int mgmt_iface:1;
+   unsigned int queue:4;
 };
 
 struct ieee80211_tx_stored_packet {
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 04bd5cd..7594022 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -384,7 +384,7 @@ static void ieee80211_set_associated(str
 
 
 static void ieee80211_sta_tx(struct net_device *dev, struct sk_buff *skb,
-int encrypt, int probe_resp)
+int encrypt)
 {
struct ieee80211_sub_if_data *sdata;
struct ieee80211_tx_packet_data *pkt_data;
@@ -398,8 +398,6 @@ static void ieee80211_sta_tx(struct net_
pkt_data-ifindex = sdata-dev-ifindex;
pkt_data-mgmt_iface = (sdata-type == IEEE80211_IF_TYPE_MGMT);
pkt_data-do_not_encrypt = !encrypt;
-   if (probe_resp)
-   pkt_data-pkt_probe_resp = 1;
 
dev_queue_xmit(skb);
 }
@@ -436,7 +434,7 @@ static void ieee80211_send_auth(struct n
if (extra)
memcpy(skb_put(skb, extra_len), extra, extra_len);
 
-   ieee80211_sta_tx(dev, skb, encrypt, 0);
+   ieee80211_sta_tx(dev, skb, encrypt);
 }
 
 
@@ -573,7 +571,7 @@ static void ieee80211_send_assoc(struct 
if (ifsta-assocreq_ies)
memcpy(ifsta-assocreq_ies, ies, ifsta-assocreq_ies_len);
 
-   ieee80211_sta_tx(dev, skb, 0, 0);
+   ieee80211_sta_tx(dev, skb, 0);
 }
 
 
@@ -600,7 +598,7 @@ static void ieee80211_send_deauth(struct
skb_put(skb, 2);
mgmt-u.deauth.reason_code = cpu_to_le16(reason);
 
-   ieee80211_sta_tx(dev, skb, 0, 0);
+   ieee80211_sta_tx(dev, skb, 0);
 }
 
 
@@ -627,7 +625,7 @@ static void ieee80211_send_disassoc(stru
skb_put(skb, 2);
mgmt-u.disassoc.reason_code = cpu_to_le16(reason);
 
-   ieee80211_sta_tx(dev, skb, 0, 0);
+   ieee80211_sta_tx(dev, skb, 0);
 }
 
 
@@ -803,7 +801,7 @@ static void ieee80211_send_probe_req(str
  

[PATCH 12/14] d80211: merge d80211_shared.h into d80211.h

2006-12-13 Thread Jiri Benc
From: Michael Wu [EMAIL PROTECTED]

This merges d80211_shared.h into d80211.h.

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

---

 include/net/d80211.h|   32 +-
 include/net/d80211_shared.h |   46 ---
 2 files changed, 31 insertions(+), 47 deletions(-)
 delete mode 100644 include/net/d80211_shared.h

3dbbcd7c8aaec66320f38835ceea04f5ce4bc456
diff --git a/include/net/d80211.h b/include/net/d80211.h
index 688c625..c7e5bb3 100644
--- a/include/net/d80211.h
+++ b/include/net/d80211.h
@@ -16,7 +16,6 @@ #include linux/skbuff.h
 #include linux/wireless.h
 #include linux/device.h
 #include linux/ieee80211.h
-#include d80211_shared.h
 
 /* Note! Only ieee80211_tx_status_irqsafe() and ieee80211_rx_irqsafe() can be
  * called in hardware interrupt context. The low-level driver must not call any
@@ -47,6 +46,10 @@ #include d80211_shared.h
 #define IEEE80211_VERSION 2
 
 
+#define IEEE80211_CHAN_W_SCAN 0x0001
+#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x0002
+#define IEEE80211_CHAN_W_IBSS 0x0004
+
 /* Channel information structure. Low-level driver is expected to fill in chan,
  * freq, and val fields. Other fields will be filled in by 80211.o based on
  * hostapd information and low-level driver does not need to use them. The
@@ -61,6 +64,22 @@ struct ieee80211_channel {
 unsigned char antenna_max;
 };
 
+#define IEEE80211_RATE_ERP 0x0001
+#define IEEE80211_RATE_BASIC 0x0002
+#define IEEE80211_RATE_PREAMBLE2 0x0004
+#define IEEE80211_RATE_SUPPORTED 0x0010
+#define IEEE80211_RATE_OFDM 0x0020
+#define IEEE80211_RATE_CCK 0x0040
+#define IEEE80211_RATE_TURBO 0x0080
+#define IEEE80211_RATE_MANDATORY 0x0100
+
+#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
+#define IEEE80211_RATE_MODULATION(f) \
+(f  (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
+
+/* Low-level driver should set PREAMBLE2, OFDM, CCK, and TURBO flags.
+ * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
+ * configuration. */
 struct ieee80211_rate {
int rate; /* rate in 100 kbps */
int val; /* hw specific value for the rate */
@@ -77,6 +96,17 @@ struct ieee80211_rate {
   * optimizing channel utilization estimates */
 };
 
+/* 802.11g is backwards-compatible with 802.11b, so a wlan card can
+ * actually be both in 11b and 11g modes at the same time. */
+enum {
+   MODE_IEEE80211A = 0 /* IEEE 802.11a */,
+   MODE_IEEE80211B = 1 /* IEEE 802.11b only */,
+   MODE_ATHEROS_TURBO = 2 /* Atheros Turbo mode (2x.11a at 5 GHz) */,
+   MODE_IEEE80211G = 3 /* IEEE 802.11g (and 802.11b compatibility) */,
+   MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */,
+   NUM_IEEE80211_MODES = 5
+};
+
 struct ieee80211_hw_modes {
int mode;
int num_channels;
diff --git a/include/net/d80211_shared.h b/include/net/d80211_shared.h
deleted file mode 100644
index 2f1bb42..000
--- a/include/net/d80211_shared.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * IEEE 802.11 -- shared defines for low-level drivers, 80211.o, and hostapd
- * Copyright 2002-2004, Instant802 Networks, Inc.
- * Copyright 2005, Devicescape Software, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef D80211_SHARED_H
-#define D80211_SHARED_H
-
-/* 802.11g is backwards-compatible with 802.11b, so a wlan card can
- * actually be both in 11b and 11g modes at the same time. */
-enum {
-   MODE_IEEE80211A = 0 /* IEEE 802.11a */,
-   MODE_IEEE80211B = 1 /* IEEE 802.11b only */,
-   MODE_ATHEROS_TURBO = 2 /* Atheros Turbo mode (2x.11a at 5 GHz) */,
-   MODE_IEEE80211G = 3 /* IEEE 802.11g (and 802.11b compatibility) */,
-   MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */,
-   NUM_IEEE80211_MODES = 5
-};
-
-#define IEEE80211_CHAN_W_SCAN 0x0001
-#define IEEE80211_CHAN_W_ACTIVE_SCAN 0x0002
-#define IEEE80211_CHAN_W_IBSS 0x0004
-
-/* Low-level driver should set PREAMBLE2, OFDM, CCK, and TURBO flags.
- * BASIC, SUPPORTED, ERP, and MANDATORY flags are set in 80211.o based on the
- * configuration. */
-#define IEEE80211_RATE_ERP 0x0001
-#define IEEE80211_RATE_BASIC 0x0002
-#define IEEE80211_RATE_PREAMBLE2 0x0004
-#define IEEE80211_RATE_SUPPORTED 0x0010
-#define IEEE80211_RATE_OFDM 0x0020
-#define IEEE80211_RATE_CCK 0x0040
-#define IEEE80211_RATE_TURBO 0x0080
-#define IEEE80211_RATE_MANDATORY 0x0100
-
-#define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2)
-#define IEEE80211_RATE_MODULATION(f) \
-(f  (IEEE80211_RATE_CCK | IEEE80211_RATE_OFDM))
-
-
-#endif /* D80211_SHARED_H */
-- 
1.3.0

-
To unsubscribe from this list: send the line unsubscribe netdev in
the 

[PATCH 3/14] d80211: fix potential interface name overflow

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

dev-name and ndev-name are both IFNAMSIZ in length, the .%d is
not guarenteed to fit in ndev-name.

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

---

 net/d80211/ieee80211_iface.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

e268081fcce1027a23420bfe74c59bf130742bce
diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c
index ae1fb9e..bb15442 100644
--- a/net/d80211/ieee80211_iface.c
+++ b/net/d80211/ieee80211_iface.c
@@ -56,7 +56,8 @@ int ieee80211_if_add(struct net_device *
if (strlen(name) == 0) {
i = 0;
do {
-   sprintf(ndev-name, %s.%d, dev-name, i++);
+   snprintf(ndev-name, sizeof(ndev-name), %s.%d,
+dev-name, i++);
tmp_dev = dev_get_by_name(ndev-name);
if (!tmp_dev)
break;
-- 
1.3.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 6/14] d80211: fix invalid check for sub interface type AP

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

We should be checking the type member, not the raw pointer.

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

---

 net/d80211/ieee80211_ioctl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

7511a31ac07b8cb4141fe2d47abd55b9875b84a9
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index cb600d7..4be86c9 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -1996,7 +1996,7 @@ static int ieee80211_ioctl_siwscan(struc
sdata-type == IEEE80211_IF_TYPE_IBSS) {
ssid = sdata-u.sta.ssid;
ssid_len = sdata-u.sta.ssid_len;
-   } else if (sdata == IEEE80211_IF_TYPE_AP) {
+   } else if (sdata-type == IEEE80211_IF_TYPE_AP) {
ssid = sdata-u.ap.ssid;
ssid_len = sdata-u.ap.ssid_len;
} else
-- 
1.3.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/14] d80211: move d80211_common.h to net/d80211

2006-12-13 Thread Jiri Benc
From: Michael Wu [EMAIL PROTECTED]

This moves d80211_common.h to net/d80211/ieee80211_common.h since
d80211 drivers should not include this file.

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

---

 drivers/net/wireless/d80211/bcm43xx/bcm43xx.h |1 
 include/net/d80211_common.h   |   98 -
 net/d80211/ieee80211.c|2 -
 net/d80211/ieee80211_common.h |   98 +
 net/d80211/wpa.c  |2 -
 5 files changed, 100 insertions(+), 101 deletions(-)
 delete mode 100644 include/net/d80211_common.h
 create mode 100644 net/d80211/ieee80211_common.h

4ae94181f808da96352478c6d4102e3b0b5dfaac
diff --git a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h 
b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
index a607857..55258e7 100644
--- a/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
+++ b/drivers/net/wireless/d80211/bcm43xx/bcm43xx.h
@@ -14,7 +14,6 @@ #include asm/io.h
 #include linux/ssb.h
 #include linux/wireless.h
 #include net/d80211.h
-#include net/d80211_common.h
 
 #include bcm43xx_debugfs.h
 #include bcm43xx_leds.h
diff --git a/include/net/d80211_common.h b/include/net/d80211_common.h
deleted file mode 100644
index 31167f0..000
--- a/include/net/d80211_common.h
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * IEEE 802.11 driver (80211.o) -- hostapd interface
- * Copyright 2002-2004, Instant802 Networks, Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- */
-
-#ifndef D80211_COMMON_H
-#define D80211_COMMON_H
-
-#include linux/types.h
-
-/*
- * This is common header information with user space. It is used on all
- * frames sent to wlan#ap interface.
- */
-
-#define IEEE80211_FI_VERSION 0x80211001
-
-struct ieee80211_frame_info {
-   __be32 version;
-   __be32 length;
-   __be64 mactime;
-   __be64 hosttime;
-   __be32 phytype;
-   __be32 channel;
-   __be32 datarate;
-   __be32 antenna;
-   __be32 priority;
-   __be32 ssi_type;
-   __be32 ssi_signal;
-   __be32 ssi_noise;
-   __be32 preamble;
-   __be32 encoding;
-
-   /* Note: this structure is otherwise identical to capture format used
-* in linux-wlan-ng, but this additional field is used to provide meta
-* data about the frame to hostapd. This was the easiest method for
-* providing this information, but this might change in the future. */
-   __be32 msg_type;
-} __attribute__ ((packed));
-
-
-enum ieee80211_msg_type {
-   ieee80211_msg_normal = 0,
-   ieee80211_msg_tx_callback_ack = 1,
-   ieee80211_msg_tx_callback_fail = 2,
-   ieee80211_msg_passive_scan = 3,
-   ieee80211_msg_wep_frame_unknown_key = 4,
-   ieee80211_msg_michael_mic_failure = 5,
-   /* hole at 6, was monitor but never sent to userspace */
-   ieee80211_msg_sta_not_assoc = 7,
-   ieee80211_msg_set_aid_for_sta = 8 /* used by Intersil MVC driver */,
-   ieee80211_msg_key_threshold_notification = 9,
-   ieee80211_msg_radar = 11,
-};
-
-struct ieee80211_msg_set_aid_for_sta {
-   charsta_address[ETH_ALEN];
-   u16 aid;
-};
-
-struct ieee80211_msg_key_notification {
-   int tx_rx_count;
-   char ifname[IFNAMSIZ];
-   u8 addr[ETH_ALEN]; /* ff:ff:ff:ff:ff:ff for broadcast keys */
-};
-
-
-enum ieee80211_phytype {
-ieee80211_phytype_fhss_dot11_97  = 1,
-ieee80211_phytype_dsss_dot11_97  = 2,
-ieee80211_phytype_irbaseband = 3,
-ieee80211_phytype_dsss_dot11_b   = 4,
-ieee80211_phytype_pbcc_dot11_b   = 5,
-ieee80211_phytype_ofdm_dot11_g   = 6,
-ieee80211_phytype_pbcc_dot11_g   = 7,
-ieee80211_phytype_ofdm_dot11_a   = 8,
-ieee80211_phytype_dsss_dot11_turbog = 255,
-ieee80211_phytype_dsss_dot11_turbo = 256,
-};
-
-enum ieee80211_ssi_type {
-ieee80211_ssi_none = 0,
-ieee80211_ssi_norm = 1, /* normalized, 0-1000 */
-ieee80211_ssi_dbm = 2,
-ieee80211_ssi_raw = 3, /* raw SSI */
-};
-
-struct ieee80211_radar_info {
-   int channel;
-   int radar;
-   int radar_type;
-};
-
-#endif /* D80211_COMMON_H */
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 6e6d8bd..13484fb 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -22,7 +22,7 @@ #include net/iw_handler.h
 #include linux/compiler.h
 #include linux/bitmap.h
 
-#include net/d80211_common.h
+#include ieee80211_common.h
 #include ieee80211_i.h
 #include ieee80211_rate.h
 #include wep.h
diff --git a/net/d80211/ieee80211_common.h b/net/d80211/ieee80211_common.h
new file mode 100644
index 000..06c970d
--- /dev/null
+++ b/net/d80211/ieee80211_common.h
@@ -0,0 +1,98 @@
+/*
+ * IEEE 802.11 driver (80211.o) -- 

[PATCH 4/14] d80211: fix potential invalid array index returning key information

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

sdata-keys[] has NUM_DEFAULT_KEYS elements, don't access past that.

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

---

 net/d80211/ieee80211_ioctl.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

11355b4c0aadecd31e43c5e6d5de652030aa0cf5
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 7de1fee..63424a7 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -803,7 +803,7 @@ static int ieee80211_ioctl_get_encryptio
param-sta_addr[2] == 0xff  param-sta_addr[3] == 0xff 
param-sta_addr[4] == 0xff  param-sta_addr[5] == 0xff) {
sta = NULL;
-   if (param-u.crypt.idx  NUM_DEFAULT_KEYS) {
+   if (param-u.crypt.idx = NUM_DEFAULT_KEYS) {
param-u.crypt.idx = sdata-default_key ?
sdata-default_key-keyidx : 0;
return 0;
-- 
1.3.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 2/14] d80211: set default_wep_only dynamically

2006-12-13 Thread Jiri Benc
From: David Kimdon [EMAIL PROTECTED]

Without this change d80211 relies on userspace to let it know when it can
configure default wep keys.  It is always safe to set default_wep_only if there
is a single station interface.  This allows for hardware accelleration for
the case of a single station interface.

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

---

 net/d80211/ieee80211_i.h |1 +
 net/d80211/ieee80211_iface.c |4 
 net/d80211/ieee80211_ioctl.c |   30 ++
 3 files changed, 35 insertions(+), 0 deletions(-)

3498e00a7cb36a9e309bf4aefd1a012a7971afb3
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index ef303da..5615d6d 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -607,6 +607,7 @@ extern const struct iw_handler_def ieee8
 int ieee80211_set_hw_encryption(struct net_device *dev,
struct sta_info *sta, u8 addr[ETH_ALEN],
struct ieee80211_key *key);
+void ieee80211_update_default_wep_only(struct ieee80211_local *local);
 
 /* ieee80211_scan.c */
 void ieee80211_init_scan(struct ieee80211_local *local);
diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c
index 3e9d531..ae1fb9e 100644
--- a/net/d80211/ieee80211_iface.c
+++ b/net/d80211/ieee80211_iface.c
@@ -97,6 +97,7 @@ int ieee80211_if_add(struct net_device *
}
 
list_add(sdata-list, local-sub_if_list);
+   ieee80211_update_default_wep_only(local);
 
return 0;
 
@@ -164,6 +165,7 @@ void ieee80211_if_del_mgmt(struct ieee80
 void ieee80211_if_set_type(struct net_device *dev, int type)
 {
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
+   struct ieee80211_local *local = dev-ieee80211_ptr;
 
sdata-type = type;
switch (type) {
@@ -205,6 +207,7 @@ void ieee80211_if_set_type(struct net_de
   dev-name, __FUNCTION__, type);
}
ieee80211_sysfs_change_if_type(dev);
+   ieee80211_update_default_wep_only(local);
 }
 
 /* Must be called with rtnl lock held. */
@@ -329,6 +332,7 @@ int ieee80211_if_remove(struct net_devic
strcmp(name, sdata-dev-name) == 0 
sdata-dev != local-mdev) {
__ieee80211_if_del(local, sdata);
+   ieee80211_update_default_wep_only(local);
return 0;
}
}
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index ef373f7..7de1fee 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -2357,6 +2357,36 @@ static int ieee80211_ioctl_default_wep_o
 }
 
 
+void ieee80211_update_default_wep_only(struct ieee80211_local *local)
+{
+   int i = 0;
+   struct ieee80211_sub_if_data *sdata;
+
+   spin_lock_bh(local-sub_if_lock);
+   list_for_each_entry(sdata, local-sub_if_list, list) {
+
+   if (sdata-dev == local-mdev)
+   continue;
+
+   /* If there is an AP interface then depend on userspace to
+  set default_wep_only correctly. */
+   if (sdata-type == IEEE80211_IF_TYPE_AP) {
+   spin_unlock_bh(local-sub_if_lock);
+   return;
+   }
+
+   i++;
+   }
+
+   if (i = 1)
+   ieee80211_ioctl_default_wep_only(local, 1);
+   else
+   ieee80211_ioctl_default_wep_only(local, 0);
+
+   spin_unlock_bh(local-sub_if_lock);
+}
+
+
 static int ieee80211_ioctl_prism2_param(struct net_device *dev,
struct iw_request_info *info,
void *wrqu, char *extra)
-- 
1.3.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 11/14] d80211: move 802.11 defines to linux/ieee80211.h

2006-12-13 Thread Jiri Benc
From: Michael Wu [EMAIL PROTECTED]

This moves 802.11 defines from net/d80211.h into linux/ieee80211.h.

It also renames IEEE80211_DATA_LEN to IEEE80211_MAX_DATA_LEN to better
match the other definitions.

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

---

 include/linux/Kbuild  |1 
 include/linux/ieee80211.h |  107 +
 include/net/d80211.h  |   90 --
 net/d80211/ieee80211.c|4 +-
 4 files changed, 111 insertions(+), 91 deletions(-)
 create mode 100644 include/linux/ieee80211.h

a2e9253024872101863b1557b116bc95cd2190ef
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index c051f75..e6dccc8 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -72,6 +72,7 @@ header-y += hysdn_if.h
 header-y += i2c-dev.h
 header-y += i8k.h
 header-y += icmp.h
+header-y += ieee80211.h
 header-y += if_addr.h
 header-y += if_arcnet.h
 header-y += if_arp.h
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
new file mode 100644
index 000..9afa694
--- /dev/null
+++ b/include/linux/ieee80211.h
@@ -0,0 +1,107 @@
+/*
+ * IEEE 802.11 defines
+ *
+ * Copyright (c) 2001-2002, SSH Communications Security Corp and Jouni Malinen
+ * [EMAIL PROTECTED]
+ * Copyright (c) 2002-2003, Jouni Malinen [EMAIL PROTECTED]
+ * Copyright (c) 2005, Devicescape Software, Inc.
+ * Copyright (c) 2006, Michael Wu [EMAIL PROTECTED]
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef IEEE80211_H
+#define IEEE80211_H
+
+#include linux/types.h
+
+#define FCS_LEN 4
+
+#define IEEE80211_FCTL_VERS0x0003
+#define IEEE80211_FCTL_FTYPE   0x000c
+#define IEEE80211_FCTL_STYPE   0x00f0
+#define IEEE80211_FCTL_TODS0x0100
+#define IEEE80211_FCTL_FROMDS  0x0200
+#define IEEE80211_FCTL_MOREFRAGS   0x0400
+#define IEEE80211_FCTL_RETRY   0x0800
+#define IEEE80211_FCTL_PM  0x1000
+#define IEEE80211_FCTL_MOREDATA0x2000
+#define IEEE80211_FCTL_PROTECTED   0x4000
+#define IEEE80211_FCTL_ORDER   0x8000
+
+#define IEEE80211_SCTL_FRAG0x000F
+#define IEEE80211_SCTL_SEQ 0xFFF0
+
+#define IEEE80211_FTYPE_MGMT   0x
+#define IEEE80211_FTYPE_CTL0x0004
+#define IEEE80211_FTYPE_DATA   0x0008
+
+/* management */
+#define IEEE80211_STYPE_ASSOC_REQ  0x
+#define IEEE80211_STYPE_ASSOC_RESP 0x0010
+#define IEEE80211_STYPE_REASSOC_REQ0x0020
+#define IEEE80211_STYPE_REASSOC_RESP   0x0030
+#define IEEE80211_STYPE_PROBE_REQ  0x0040
+#define IEEE80211_STYPE_PROBE_RESP 0x0050
+#define IEEE80211_STYPE_BEACON 0x0080
+#define IEEE80211_STYPE_ATIM   0x0090
+#define IEEE80211_STYPE_DISASSOC   0x00A0
+#define IEEE80211_STYPE_AUTH   0x00B0
+#define IEEE80211_STYPE_DEAUTH 0x00C0
+#define IEEE80211_STYPE_ACTION 0x00D0
+
+/* control */
+#define IEEE80211_STYPE_PSPOLL 0x00A0
+#define IEEE80211_STYPE_RTS0x00B0
+#define IEEE80211_STYPE_CTS0x00C0
+#define IEEE80211_STYPE_ACK0x00D0
+#define IEEE80211_STYPE_CFEND  0x00E0
+#define IEEE80211_STYPE_CFENDACK   0x00F0
+
+/* data */
+#define IEEE80211_STYPE_DATA   0x
+#define IEEE80211_STYPE_DATA_CFACK 0x0010
+#define IEEE80211_STYPE_DATA_CFPOLL0x0020
+#define IEEE80211_STYPE_DATA_CFACKPOLL 0x0030
+#define IEEE80211_STYPE_NULLFUNC   0x0040
+#define IEEE80211_STYPE_CFACK  0x0050
+#define IEEE80211_STYPE_CFPOLL 0x0060
+#define IEEE80211_STYPE_CFACKPOLL  0x0070
+#define IEEE80211_STYPE_QOS_DATA   0x0080
+#define IEEE80211_STYPE_QOS_DATA_CFACK 0x0090
+#define IEEE80211_STYPE_QOS_DATA_CFPOLL0x00A0
+#define IEEE80211_STYPE_QOS_DATA_CFACKPOLL 0x00B0
+#define IEEE80211_STYPE_QOS_NULLFUNC   0x00C0
+#define IEEE80211_STYPE_QOS_CFACK  0x00D0
+#define IEEE80211_STYPE_QOS_CFPOLL 0x00E0
+#define IEEE80211_STYPE_QOS_CFACKPOLL  0x00F0
+
+
+/* miscellaneous IEEE 802.11 constants */
+#define IEEE80211_MAX_FRAG_THRESHOLD   2346
+#define IEEE80211_MAX_RTS_THRESHOLD2347
+#define IEEE80211_MAX_AID  2007
+#define IEEE80211_MAX_TIM_LEN  251
+#define IEEE80211_MAX_DATA_LEN 2304
+/* Maximum size for the MA-UNITDATA primitive, 802.11 standard section
+   6.2.1.1.2.
+
+   The figure in section 7.1.2 suggests a body size of up to 2312
+   bytes is allowed, which is a bit confusing, I suspect this
+   represents the 2304 bytes of real data, plus a possible 8 bytes of
+   WEP IV and ICV. (this interpretation suggested by Ramiro Barreiro) */
+
+
+struct ieee80211_hdr {
+   __le16 

Re: [PATCH 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 06:00:35PM +0100, Jiri Benc wrote:
 John, in addition to the previous pull request, please also apply the
 following two fixes.

What is the state of the rx2x00 driver by now?  I have been playing
around with an rt2500 based card, with some success but not enough for
me to switch over from wired ethernet yet on my machine.  I used to get
lots of hard lockups, but with the latest cvs snapshot in debian's
rt2x00-source package, it no longer seems to lockup.  It also now works
with WPA without using wpa_supplicant (Yay!  Good work.), it does
however very frequently pause the transfer, and then after a while (20
or 30 seconds probably) it will start moving data again and my transfer
will continue.  Is this considered normal for now?  My card happens to
be a linksys WMP54G version 4.0.  At least pauses beat crashes.  It's
going the right way for a work in progress.

I guess I should go read the bug tracking system and try out newer cvs
versions. :)

--
Len Sorensen
-
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 04/26] rt2x00: EEPROM 93Cx6

2006-12-13 Thread Ivo van Doorn
On Wednesday 13 December 2006 18:05, Lennart Sorensen wrote:
 On Wed, Dec 13, 2006 at 05:47:41PM +0100, Ivo van Doorn wrote:
  Do you need to actually write data to the eeprom chip?
  Currently the module does not support writing to the eeprom,
  this is something I could add (The original Ralink code, where this module
  is based on also contains the code to write to the EEPROM).
 
 I am going to use it to write the custom pci vendor ID to the eeprom, so
 yes I intend to write to it.  The code appears as if it has the ability
 to write to the eeprom but I didn't look at all of it carefully yet.  I
 don't actually have any need to read it back, although I intend to do so
 to verify the contents.

Currently the module does not contain any code to actually write to
the eeprom. I'll create a patch to add support for the writing.
-
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 1/16] Spidernet DMA coalescing

2006-12-13 Thread Linas Vepstas
On Thu, Dec 07, 2006 at 10:11:51AM +, Christoph Hellwig wrote:
 On Wed, Dec 06, 2006 at 05:27:45PM -0600, Linas Vepstas wrote:
  
  The current driver code performs 512 DMA mappings of a bunch of 
  32-byte structures. This is silly, as they are all in contiguous 
  memory. Ths patch changes the code to DMA map the entie area
  with just one call.
 
 This is still wrong.  The descriptor array must be in dma_alloc_coherent
 memory, not a streaming mapping.  (I also think I pointed this out a while
 ago when I made dma_alloc_coherent node-aware)

Sorry, I missed this the first time. I'm splitting this off now; will 
resubmit shortly.

--linas
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Ivo van Doorn
On Wednesday 13 December 2006 18:12, Lennart Sorensen wrote:
 On Wed, Dec 13, 2006 at 06:00:35PM +0100, Jiri Benc wrote:
  John, in addition to the previous pull request, please also apply the
  following two fixes.
 
 What is the state of the rx2x00 driver by now?  I have been playing
 around with an rt2500 based card, with some success but not enough for
 me to switch over from wired ethernet yet on my machine.  I used to get
 lots of hard lockups, but with the latest cvs snapshot in debian's
 rt2x00-source package, it no longer seems to lockup.  It also now works
 with WPA without using wpa_supplicant (Yay!  Good work.), it does
 however very frequently pause the transfer, and then after a while (20
 or 30 seconds probably) it will start moving data again and my transfer
 will continue.  Is this considered normal for now?  My card happens to
 be a linksys WMP54G version 4.0.  At least pauses beat crashes.  It's
 going the right way for a work in progress.
 
 I guess I should go read the bug tracking system and try out newer cvs
 versions. :)

Well results seem to vary between users. Since recently users have started
reporting panics and freezes with rt2x00. I have not yet traced that problem
to the source, because the panics I have received don't contain any rt2x00
or d80211 functions. But the presence of the rt2x00 module is the
important factor in reproducing the crash. :(
Others however seem to have more success with rt2x00, master mode
seems to work with reasonable speed. Association with managed mode
is still very shortlifed. People who manage to get associated are being
kicked from the AP quite quickly. (This could be because d80211 is not
sending NULL-frames every once in a while).

But since results vary much between users, I can still descrive the rt2x00
state as experimental driver

Ivo
-
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] d80211: Fix 64bit printk warnings

2006-12-13 Thread Michael Buesch
Fix several warnings due to incompatible datatypes on
64bit platforms.

Signed-off-by: Michael Buesch [EMAIL PROTECTED]

Index: jbenc-dscape.git/net/d80211/ieee80211_sta.c
===
--- jbenc-dscape.git.orig/net/d80211/ieee80211_sta.c2006-12-13 
18:44:27.0 +0100
+++ jbenc-dscape.git/net/d80211/ieee80211_sta.c 2006-12-13 18:49:59.0 
+0100
@@ -1371,9 +1371,12 @@ static void ieee80211_rx_bss_info(struct
if (time_after(jiffies, last_tsf_debug + 5 * HZ)) {
printk(KERN_DEBUG RX beacon SA= MAC_FMT  BSSID=
   MAC_FMT  TSF=0x%llx BCN=0x%llx diff=%lld 
-  @%ld\n,
+  @%lu\n,
   MAC_ARG(mgmt-sa), MAC_ARG(mgmt-bssid),
-  tsf, timestamp, tsf - timestamp, jiffies);
+  (unsigned long long)tsf,
+  (unsigned long long)timestamp,
+  (unsigned long long)(tsf - timestamp),
+  jiffies);
last_tsf_debug = jiffies;
}
 #endif /* CONFIG_D80211_IBSS_DEBUG */
@@ -2697,7 +2700,7 @@ ieee80211_sta_scan_result(struct net_dev
if (buf) {
memset(iwe, 0, sizeof(iwe));
iwe.cmd = IWEVCUSTOM;
-   sprintf(buf, tsf=%016llx, bss-timestamp);
+   sprintf(buf, tsf=%016llx, (unsigned long 
long)(bss-timestamp));
iwe.u.data.length = strlen(buf);
current_ev = iwe_stream_add_point(current_ev, end_buf,
  iwe, buf);

-- 
Greetings Michael.
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Dan Williams
On Wed, 2006-12-13 at 12:12 -0500, Lennart Sorensen wrote:
 On Wed, Dec 13, 2006 at 06:00:35PM +0100, Jiri Benc wrote:
  John, in addition to the previous pull request, please also apply the
  following two fixes.
 
 What is the state of the rx2x00 driver by now?  I have been playing
 around with an rt2500 based card, with some success but not enough for
 me to switch over from wired ethernet yet on my machine.  I used to get
 lots of hard lockups, but with the latest cvs snapshot in debian's
 rt2x00-source package, it no longer seems to lockup.  It also now works
 with WPA without using wpa_supplicant (Yay!  Good work.), it does

How, by private ioctls?  That's just wrong; I believe you still need to
go through the 4-way handshake to get the right keying information even
if you use PSK, which means you still need the supplicant, right?

dan

 however very frequently pause the transfer, and then after a while (20
 or 30 seconds probably) it will start moving data again and my transfer
 will continue.  Is this considered normal for now?  My card happens to
 be a linksys WMP54G version 4.0.  At least pauses beat crashes.  It's
 going the right way for a work in progress.
 
 I guess I should go read the bug tracking system and try out newer cvs
 versions. :)
 
 --
 Len Sorensen
 -
 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

-
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] d80211: Fix passing of invalid pointer

2006-12-13 Thread Michael Buesch
ieee80211_hw pointers have to be passed to ops-set_key()
and ops-get_tsf().

Signed-off-by: Michael Buesch [EMAIL PROTECTED]

Index: jbenc-dscape.git/net/d80211/ieee80211_iface.c
===
--- jbenc-dscape.git.orig/net/d80211/ieee80211_iface.c  2006-12-13 
13:23:56.0 +0100
+++ jbenc-dscape.git/net/d80211/ieee80211_iface.c   2006-12-13 
18:46:33.0 +0100
@@ -228,8 +228,8 @@ void ieee80211_if_reinit(struct net_devi
 * really much point in disabling the keys at this point. */
memset(addr, 0xff, ETH_ALEN);
if (local-ops-set_key)
-   local-ops-set_key(dev, DISABLE_KEY, addr,
-  local-keys[i], 0);
+   local-ops-set_key(local_to_hw(local), DISABLE_KEY, 
addr,
+   local-keys[i], 0);
 #endif
ieee80211_key_free(sdata-keys[i]);
}
Index: jbenc-dscape.git/net/d80211/ieee80211_sta.c
===
--- jbenc-dscape.git.orig/net/d80211/ieee80211_sta.c2006-12-13 
18:42:47.0 +0100
+++ jbenc-dscape.git/net/d80211/ieee80211_sta.c 2006-12-13 18:50:14.0 
+0100
@@ -1365,7 +1365,7 @@ static void ieee80211_rx_bss_info(struct
static unsigned long last_tsf_debug = 0;
u64 tsf;
if (local-ops-get_tsf)
-   tsf = local-ops-get_tsf(local-mdev);
+   tsf = local-ops-get_tsf(local_to_hw(local));
else
tsf = -1LLU;
if (time_after(jiffies, last_tsf_debug + 5 * HZ)) {

-- 
Greetings Michael.
-
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: [Bugme-new] [Bug 7665] New: getsockopt(IPV6_*CAST_HOPS) returns -1

2006-12-13 Thread Brian Haley

David Miller wrote:

I wonder, since the most accurate return value is tied to the route,
what is expected of this getsockopt() before a socket's identity
(and therefore route) is known?


A search for RTAX_HOPLIMIT found very little code that ever sets it, 
iproute2 was the only important one, so the interface/system default is 
probably the only one that's ever used.


-Brian
-
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 3/3] d80211: fix workqueue breakage

2006-12-13 Thread Jiri Benc
On Tue, 12 Dec 2006 12:55:53 -0500, Michael Wu wrote:
 - schedule_work(local-scan_work);
 + schedule_work(local-scan_work.work);

Hm, what is the preferred way here:
schedule_work(some_delayed_work.work)
or
schedule_delayed_work(some_delayed_work, 0)?

The result is the same, I just would like to know what is preferred so
next time when workqueues are rewritten ;-) we have fewer troubles.

Thanks,

 Jiri

-- 
Jiri Benc
SUSE Labs
-
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.17.13 2/2] LARTC: trace control for netem: kernelspace

2006-12-13 Thread Stephen Hemminger
On Sat, 09 Dec 2006 10:17:55 +0100
Rainer Baumann [EMAIL PROTECTED] wrote:

 Hi Stephens
 
 I just wanted to ask you if everything went right with TCN and we will
 find it in 2.6.20 as you wrote two months ago.
 
 Cheers
 Rainer
 
 Stephen Hemminger wrote:
  On Tue, 26 Sep 2006 22:17:57 +0200
  Rainer Baumann [EMAIL PROTECTED] wrote:
 

  Hi Stephens
 
  We merged your changes into our patch
  http://tcn.hypert.net/tcn_kernel_2_6_18.patch
  Please let us know if we should do further adoptions to our
  implementation and/or resubmit the adapted patch.
 
  Cheers+thanx,
  Rainer
  
 
  I'll test it out, and send off to Dave for 2.6.20, 2.6.19 is so in
  flux right now that adding more seems not like a good idea.
 
 

 
 -
 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

If I get a cleaned up version to test, I have some time to check it
before 2.6.20
-
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] eeprom_93cx6: Add write support

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 07:56:50PM +0100, Ivo van Doorn wrote:
 This patch addes support for writing to the eeprom,
 this also moves some duplicate code into seperate functions.
 
 Signed-off-by Ivo van Doorn [EMAIL PROTECTED]

Thank you.  I will have a try with that to see if I can get that to work
with the jsm driver.  Too bad the serial drivers don't have any
geteeprom/seteeprom standard ioctl's the way ethtool does for network
devices.

--
Len Sorensen
-
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] add init_dummy_netdev() for napi only dummy intefaces

2006-12-13 Thread Stephen Hemminger
On Tue, 12 Dec 2006 16:27:38 +1100
Benjamin Herrenschmidt [EMAIL PROTECTED] wrote:

 This adds an init_dummy_netdev() function that gets a network device
 structure (allocation and lifetime entirely under caller's control) and
 initialize the minimum amount of fields so it can be used to schedule
 NAPI polls without registering a full blown interface. This is to be
 used by drivers that need to tie several hardware interfaces to a single
 NAPI poll scheduler due to HW limitations.
 
 It also updates the ibm_emac driver to use that instead of doing it's
 own initializations by hand.
 
 Symbol is exported GPL only a I don't think we want binary drivers doing
 that sort of acrobatics (if we want them at all).
 
 Signed-off-by: Benjamin Herrenschmidt [EMAIL PROTECTED]
 ---

Could we split off the NAPI context part of network_device instead?
I'll work up something for 2.6.21.
-
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] Add support for LAN8187 and LAN8700 PHYs

2006-12-13 Thread Steve Glendinning
This patch adds support for two additional PHY parts with identical
interrupt abstraction to the existing LAN83C185.

Functions have been renamed from lan83c185_* to smsc_phy_* as they are
used by multiple PHY models.

Signed-off-by: Steve Glendinning [EMAIL PROTECTED]
---
 drivers/net/phy/Kconfig |2 +-
 drivers/net/phy/smsc.c  |  112 +--
 2 files changed, 90 insertions(+), 24 deletions(-)

diff --git a/drivers/net/phy/Kconfig b/drivers/net/phy/Kconfig
index f994f12..09b69df 100644
--- a/drivers/net/phy/Kconfig
+++ b/drivers/net/phy/Kconfig
@@ -54,7 +54,7 @@ config SMSC_PHY
tristate Drivers for SMSC PHYs
depends on PHYLIB
---help---
- Currently supports the LAN83C185 PHY
+ Currently supports the LAN83C185, LAN8187 and LAN8700 PHYs.
 
 config BROADCOM_PHY
tristate Drivers for Broadcom PHYs
diff --git a/drivers/net/phy/smsc.c b/drivers/net/phy/smsc.c
index b1d8ed4..d431146 100644
--- a/drivers/net/phy/smsc.c
+++ b/drivers/net/phy/smsc.c
@@ -12,6 +12,7 @@
  * Free Software Foundation;  either version 2 of the  License, or (at your
  * option) any later version.
  *
+ * Support added for SMSC LAN8187 and LAN8700 by [EMAIL PROTECTED]
  */
 
 #include linux/kernel.h
@@ -21,43 +22,43 @@
 #include linux/phy.h
 #include linux/netdevice.h
 
-#define MII_LAN83C185_ISF 29 /* Interrupt Source Flags */
-#define MII_LAN83C185_IM  30 /* Interrupt Mask */
+#define MII_SMSC_ISF 29 /* Interrupt Source Flags */
+#define MII_SMSC_IM  30 /* Interrupt Mask */
 
-#define MII_LAN83C185_ISF_INT1 (11) /* Auto-Negotiation Page Received */
-#define MII_LAN83C185_ISF_INT2 (12) /* Parallel Detection Fault */
-#define MII_LAN83C185_ISF_INT3 (13) /* Auto-Negotiation LP Ack */
-#define MII_LAN83C185_ISF_INT4 (14) /* Link Down */
-#define MII_LAN83C185_ISF_INT5 (15) /* Remote Fault Detected */
-#define MII_LAN83C185_ISF_INT6 (16) /* Auto-Negotiation complete */
-#define MII_LAN83C185_ISF_INT7 (17) /* ENERGYON */
+#define MII_SMSC_ISF_INT1 (11) /* Auto-Negotiation Page Received */
+#define MII_SMSC_ISF_INT2 (12) /* Parallel Detection Fault */
+#define MII_SMSC_ISF_INT3 (13) /* Auto-Negotiation LP Ack */
+#define MII_SMSC_ISF_INT4 (14) /* Link Down */
+#define MII_SMSC_ISF_INT5 (15) /* Remote Fault Detected */
+#define MII_SMSC_ISF_INT6 (16) /* Auto-Negotiation complete */
+#define MII_SMSC_ISF_INT7 (17) /* ENERGYON */
 
-#define MII_LAN83C185_ISF_INT_ALL (0x0e)
+#define MII_SMSC_ISF_INT_ALL (0x0e)
 
-#define MII_LAN83C185_ISF_INT_PHYLIB_EVENTS \
-   (MII_LAN83C185_ISF_INT6 | MII_LAN83C185_ISF_INT4)
+#define MII_SMSC_ISF_INT_PHYLIB_EVENTS \
+   (MII_SMSC_ISF_INT6 | MII_SMSC_ISF_INT4)
 
 
-static int lan83c185_config_intr(struct phy_device *phydev)
+static int smsc_phy_config_intr(struct phy_device *phydev)
 {
-   int rc = phy_write (phydev, MII_LAN83C185_IM,
+   int rc = phy_write (phydev, MII_SMSC_IM,
((PHY_INTERRUPT_ENABLED == phydev-interrupts)
-   ? MII_LAN83C185_ISF_INT_PHYLIB_EVENTS
+   ? MII_SMSC_ISF_INT_PHYLIB_EVENTS
: 0));
 
return rc  0 ? rc : 0;
 }
 
-static int lan83c185_ack_interrupt(struct phy_device *phydev)
+static int smsc_phy_ack_interrupt(struct phy_device *phydev)
 {
-   int rc = phy_read (phydev, MII_LAN83C185_ISF);
+   int rc = phy_read (phydev, MII_SMSC_ISF);
 
return rc  0 ? rc : 0;
 }
 
-static int lan83c185_config_init(struct phy_device *phydev)
+static int smsc_phy_config_init(struct phy_device *phydev)
 {
-   return lan83c185_ack_interrupt (phydev);
+   return smsc_phy_ack_interrupt (phydev);
 }
 
 
@@ -73,22 +74,87 @@ static struct phy_driver lan83c185_driver = {
/* basic functions */
.config_aneg= genphy_config_aneg,
.read_status= genphy_read_status,
-   .config_init= lan83c185_config_init,
+   .config_init= smsc_phy_config_init,
 
/* IRQ related */
-   .ack_interrupt  = lan83c185_ack_interrupt,
-   .config_intr= lan83c185_config_intr,
+   .ack_interrupt  = smsc_phy_ack_interrupt,
+   .config_intr= smsc_phy_config_intr,
+
+   .driver = { .owner = THIS_MODULE, }
+};
+
+static struct phy_driver lan8187_driver = {
+   .phy_id = 0x0007c0b0, /* OUI=0x00800f, Model#=0x0b */
+   .phy_id_mask= 0xfff0,
+   .name   = SMSC LAN8187,
+
+   .features   = (PHY_BASIC_FEATURES | SUPPORTED_Pause
+   | SUPPORTED_Asym_Pause),
+   .flags  = PHY_HAS_INTERRUPT | PHY_HAS_MAGICANEG,
+
+   /* basic functions */
+   .config_aneg= genphy_config_aneg,
+   .read_status= genphy_read_status,
+   .config_init= smsc_phy_config_init,
+
+   /* IRQ related */
+   .ack_interrupt  = smsc_phy_ack_interrupt,
+   .config_intr= smsc_phy_config_intr,
+
+   .driver = { .owner = THIS_MODULE, }
+};
+

[PATCH 1/4][SCTP]: Handle address add/delete events in a more efficient way.

2006-12-13 Thread Sridhar Samudrala
[SCTP]: Handle address add/delete events in a more efficient way.

Currently in SCTP, we maintain a local address list by rebuilding the whole
list from the device list whenever we get a address add/delete event.

This patch fixes it by only adding/deleting the address for which we
receive the event.

Also removed the sctp_local_addr_lock() which is no longer needed as we
now use list_for_each_safe() to traverse this list. This fixes the bugs
in sctp_copy_laddrs_xxx() routines where we do copy_to_user() while
holding this lock.

Signed-off-by: Sridhar Samudrala [EMAIL PROTECTED]

---
 include/net/sctp/structs.h |6 +---
 net/sctp/ipv6.c|   38 
 net/sctp/protocol.c|   69 
 net/sctp/socket.c  |   34 ++
 4 files changed, 81 insertions(+), 66 deletions(-)

diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index c089f93..b00d85e 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -201,13 +201,12 @@ extern struct sctp_globals {
struct sctp_bind_hashbucket *port_hashtable;
 
/* This is the global local address list.
-* We actively maintain this complete list of interfaces on
-* the system by catching routing events.
+* We actively maintain this complete list of addresses on
+* the system by catching address add/delete events.
 *
 * It is a list of sctp_sockaddr_entry.
 */
struct list_head local_addr_list;
-   spinlock_t local_addr_lock;

/* Flag to indicate if addip is enabled. */
int addip_enable;
@@ -243,7 +242,6 @@ #define sctp_port_rover (sctp_globals.
 #define sctp_port_alloc_lock   (sctp_globals.port_alloc_lock)
 #define sctp_port_hashtable(sctp_globals.port_hashtable)
 #define sctp_local_addr_list   (sctp_globals.local_addr_list)
-#define sctp_local_addr_lock   (sctp_globals.local_addr_lock)
 #define sctp_addip_enable  (sctp_globals.addip_enable)
 #define sctp_prsctp_enable (sctp_globals.prsctp_enable)
 
diff --git a/net/sctp/ipv6.c b/net/sctp/ipv6.c
index 3c3e560..d8d36de 100644
--- a/net/sctp/ipv6.c
+++ b/net/sctp/ipv6.c
@@ -78,8 +78,44 @@ #include net/sctp/sctp.h
 
 #include asm/uaccess.h
 
+/* Event handler for inet6 address addition/deletion events.  */
+int sctp_inet6addr_event(struct notifier_block *this, unsigned long ev,
+void *ptr)
+{
+   struct inet6_ifaddr *ifa = (struct inet6_ifaddr *)ptr;
+   struct sctp_sockaddr_entry *addr;
+   struct list_head *pos, *temp;
+
+   switch (ev) {
+   case NETDEV_UP:
+   addr = kmalloc(sizeof(struct sctp_sockaddr_entry), GFP_ATOMIC);
+   if (addr) {
+   addr-a.v6.sin6_family = AF_INET6;
+   addr-a.v6.sin6_port = 0;
+   memcpy(addr-a.v6.sin6_addr, ifa-addr,
+sizeof(struct in6_addr));
+   addr-a.v6.sin6_scope_id = ifa-idev-dev-ifindex;
+   list_add_tail(addr-list, sctp_local_addr_list);
+   }
+   break;
+   case NETDEV_DOWN:
+   list_for_each_safe(pos, temp, sctp_local_addr_list) {
+   addr = list_entry(pos, struct sctp_sockaddr_entry, 
list);
+   if (ipv6_addr_equal(addr-a.v6.sin6_addr, ifa-addr)) 
{
+   list_del(pos);
+   kfree(addr);
+   break;
+   }
+   }
+
+   break;
+   }
+
+   return NOTIFY_DONE;
+}
+
 static struct notifier_block sctp_inet6addr_notifier = {
-   .notifier_call = sctp_inetaddr_event,
+   .notifier_call = sctp_inet6addr_event,
 };
 
 /* ICMP error handler. */
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index f2ba861..b61f334 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -163,7 +163,7 @@ static void sctp_v4_copy_addrlist(struct
 /* Extract our IP addresses from the system and stash them in the
  * protocol structure.
  */
-static void __sctp_get_local_addr_list(void)
+static void sctp_get_local_addr_list(void)
 {
struct net_device *dev;
struct list_head *pos;
@@ -179,17 +179,8 @@ static void __sctp_get_local_addr_list(v
read_unlock(dev_base_lock);
 }
 
-static void sctp_get_local_addr_list(void)
-{
-   unsigned long flags;
-
-   sctp_spin_lock_irqsave(sctp_local_addr_lock, flags);
-   __sctp_get_local_addr_list();
-   sctp_spin_unlock_irqrestore(sctp_local_addr_lock, flags);
-}
-
 /* Free the existing local addresses.  */
-static void __sctp_free_local_addr_list(void)
+static void sctp_free_local_addr_list(void)
 {
struct sctp_sockaddr_entry *addr;
struct list_head *pos, *temp;
@@ -201,27 +192,15 @@ 

Re: [PATCH] add init_dummy_netdev() for napi only dummy intefaces

2006-12-13 Thread Benjamin Herrenschmidt
On Wed, 2006-12-13 at 11:35 -0800, Stephen Hemminger wrote:

 Could we split off the NAPI context part of network_device instead?
 I'll work up something for 2.6.21.

That would do the trick too... though I prefer not putting my hands in
network_device too much myself :-)

Ben

-
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/4][SCTP]: Enable auto loading of SCTP when creating an ipv6 SCTP socket.

2006-12-13 Thread Sridhar Samudrala
[SCTP]: Enable auto loading of SCTP when creating an ipv6 SCTP socket.

Signed-off-by: Sridhar Samudrala [EMAIL PROTECTED]

---
 net/sctp/protocol.c |1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c
index b61f334..3a3db56 100644
--- a/net/sctp/protocol.c
+++ b/net/sctp/protocol.c
@@ -1258,6 +1258,7 @@ module_exit(sctp_exit);
  * __stringify doesn't likes enums, so use IPPROTO_SCTP value (132) directly.
  */
 MODULE_ALIAS(net-pf- __stringify(PF_INET) -proto-132);
+MODULE_ALIAS(net-pf- __stringify(PF_INET6) -proto-132);
 MODULE_AUTHOR(Linux Kernel SCTP developers [EMAIL PROTECTED]);
 MODULE_DESCRIPTION(Support for the SCTP protocol (RFC2960));
 MODULE_LICENSE(GPL);


-
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 4/4][SCTP]: Change adaption - adaptation as per the latest API draft.

2006-12-13 Thread Sridhar Samudrala
[SCTP]: Change adaption - adaptation as per the latest API draft.

Signed-off-by: Ivan Skytte Jorgensen [EMAIL PROTECTED]
Signed-off-by: Sridhar Samudrala [EMAIL PROTECTED]

---
 include/linux/sctp.h|   10 +-
 include/net/sctp/structs.h  |8 
 include/net/sctp/ulpevent.h |2 +-
 include/net/sctp/user.h |   28 ++--
 net/sctp/sm_make_chunk.c|   24 
 net/sctp/sm_statefuns.c |   32 
 net/sctp/socket.c   |   34 +-
 net/sctp/ulpevent.c |   20 ++--
 8 files changed, 79 insertions(+), 79 deletions(-)

diff --git a/include/linux/sctp.h b/include/linux/sctp.h
index 35108fe..d4f8656 100644
--- a/include/linux/sctp.h
+++ b/include/linux/sctp.h
@@ -180,7 +180,7 @@ typedef enum {
SCTP_PARAM_ERR_CAUSE= __constant_htons(0xc003),
SCTP_PARAM_SET_PRIMARY  = __constant_htons(0xc004),
SCTP_PARAM_SUCCESS_REPORT   = __constant_htons(0xc005),
-   SCTP_PARAM_ADAPTION_LAYER_IND   = __constant_htons(0xc006),
+   SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
 
 } sctp_param_t; /* enum */
 
@@ -281,11 +281,11 @@ typedef struct sctp_ecn_capable_param {
sctp_paramhdr_t param_hdr;
 } __attribute__((packed)) sctp_ecn_capable_param_t;
 
-/* ADDIP Section 3.2.6 Adaption Layer Indication */
-typedef struct sctp_adaption_ind_param {
+/* ADDIP Section 3.2.6 Adaptation Layer Indication */
+typedef struct sctp_adaptation_ind_param {
struct sctp_paramhdr param_hdr;
-   __be32 adaption_ind;
-} __attribute__((packed)) sctp_adaption_ind_param_t;
+   __be32 adaptation_ind;
+} __attribute__((packed)) sctp_adaptation_ind_param_t;
 
 /* RFC 2960.  Section 3.3.3 Initiation Acknowledgement (INIT ACK) (2):
  *   The INIT ACK chunk is used to acknowledge the initiation of an SCTP
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 8d7f26d..c9075d0 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -306,7 +306,7 @@ struct sctp_sock {
__u8 disable_fragments;
__u8 pd_mode;
__u8 v4mapped;
-   __u32 adaption_ind;
+   __u32 adaptation_ind;
 
/* Receive to here while partial delivery is in effect. */
struct sk_buff_head pd_lobby;
@@ -388,7 +388,7 @@ struct sctp_cookie {
/* Padding for future use */
__u8 padding;   
 
-   __u32 adaption_ind; 
+   __u32 adaptation_ind;   
 

/* This is a shim for my peer's INIT packet, followed by
@@ -431,7 +431,7 @@ union sctp_params {
struct sctp_ipv4addr_param *v4;
struct sctp_ipv6addr_param *v6;
union sctp_addr_param *addr;
-   struct sctp_adaption_ind_param *aind;
+   struct sctp_adaptation_ind_param *aind;
 };
 
 /* RFC 2960.  Section 3.3.5 Heartbeat.
@@ -1483,7 +1483,7 @@ struct sctp_association {
__u8asconf_capable;  /* Does peer support ADDIP? */
__u8prsctp_capable;  /* Can peer do PR-SCTP? */
 
-   __u32   adaption_ind;/* Adaption Code point. */
+   __u32   adaptation_ind;  /* Adaptation Code point. */
 
/* This mask is used to disable sending the ASCONF chunk
 * with specified parameter to peer.
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 1a4ddc1..2923e3d 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -120,7 +120,7 @@ struct sctp_ulpevent *sctp_ulpevent_make
const struct sctp_association *asoc,
__u32 indication, gfp_t gfp);
 
-struct sctp_ulpevent *sctp_ulpevent_make_adaption_indication(
+struct sctp_ulpevent *sctp_ulpevent_make_adaptation_indication(
const struct sctp_association *asoc, gfp_t gfp);
 
 struct sctp_ulpevent *sctp_ulpevent_make_rcvmsg(struct sctp_association *asoc,
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 9e4a39f..4116b0d 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -75,8 +75,8 @@ #define SCTP_AUTOCLOSE SCTP_AUTOCLOSE
 #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR
SCTP_PRIMARY_ADDR,
 #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR
-   SCTP_ADAPTION_LAYER,  
-#define SCTP_ADAPTION_LAYER SCTP_ADAPTION_LAYER
+   SCTP_ADAPTATION_LAYER,  
+#define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER
SCTP_DISABLE_FRAGMENTS,
 #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS
SCTP_PEER_ADDR_PARAMS,
@@ -331,17 +331,17 @@ struct sctp_shutdown_event {
 };
 
 /*
- * 5.3.1.6 SCTP_ADAPTION_INDICATION
+ * 5.3.1.6 SCTP_ADAPTATION_INDICATION
  *
- *   When a peer sends a Adaption Layer Indication parameter , SCTP
+ *   When a peer sends a Adaptation Layer Indication parameter , SCTP
  *   delivers this notification to inform the application
- *   that of the peers requested adaption layer.
+ *   

Re: [PATCH 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 12:38:43PM -0500, Dan Williams wrote:
 How, by private ioctls?  That's just wrong; I believe you still need to
 go through the 4-way handshake to get the right keying information even
 if you use PSK, which means you still need the supplicant, right?

All I did was add this to /etc/network/interfaces:

iface wlan0 inet static
address 192.168.1.51
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.254
broadcast 192.168.1.255
pre-up ifconfig wlan0 up
pre-up iwpriv wlan0 set AuthMode=WPAPSK
pre-up iwpriv wlan0 set EncrypType=TKIP
pre-up iwconfig wlan0 essid USR8054
pre-up iwpriv wlan0 set WPAPSK=My WPA passphrase...

It seems to work, although I guess I could be wrong.  It was what I
found in the documentation for the rt2x00 driver for doing WPA.  It
looks nothing like the wpa_supplicant stuff I used to have with an older
version of the driver.  My understanding was that the rt2x00 driver
and/or d80211 stack took care of it now.

--
Len Sorensen
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 06:56:57PM +0100, Ivo van Doorn wrote:
 rt2x00 completely uses the dscape stack, so I am not sure how he is
 managing this wpa without wpa_supplicant with rt2x00.
 Lennart, are you using rt2x00 or the legacy rt2500 driver?

rt2x00 with dscape stack.

--
Len Sorensen
-
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/14]: Spidernet RX-side patches

2006-12-13 Thread Linas Vepstas

Andrew, 

Please apply; these patches obsolete/replace the series of 16 patches
I'd previously sent, by addressing problems raised by Christoph Hellwig
and Jeff Garzik. 

Most of te focus of this series of patches is to simplify the RX code
be removing extraneous flags, branches, arguments, etc. The first
few patches are the biggest: using dma_alloc_coherent for the rings,
and removing a bogus tasklet that does work that could be better done in
the poll loop. The rest are mostly cleanup.

--linas
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 06:49:07PM +0100, Ivo van Doorn wrote:
 Well results seem to vary between users. Since recently users have started
 reporting panics and freezes with rt2x00. I have not yet traced that problem
 to the source, because the panics I have received don't contain any rt2x00
 or d80211 functions. But the presence of the rt2x00 module is the
 important factor in reproducing the crash. :(
 Others however seem to have more success with rt2x00, master mode
 seems to work with reasonable speed. Association with managed mode
 is still very shortlifed. People who manage to get associated are being
 kicked from the AP quite quickly. (This could be because d80211 is not
 sending NULL-frames every once in a while).

I should do some more testing and submit a report of how it is behaving.
Anything specific worth checking if it misbehaves (so far misbehaving
seems to be pausing the network transmissions for a short period and
then resuming).

 But since results vary much between users, I can still descrive the rt2x00
 state as experimental driver

Well every once in a while I load a new version and see how it is.
Eventually I hope it will work perfectly, and I can move my mythtv box
into the living room with the TV using wireless, rather than sitting in
the basement next to the router machine using wired ethernet.  Running
ethernet cable through the wall when the basement is all finished just
seems like too much work.  I got an rt based card because I knew it was
being worked on.  I know someday it will simply work, which is good
enough for me.

--
Len Sorensen
-
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] add init_dummy_netdev() for napi only dummy intefaces

2006-12-13 Thread Stephen Hemminger
On Thu, 14 Dec 2006 07:42:32 +1100
Benjamin Herrenschmidt [EMAIL PROTECTED] wrote:

 On Wed, 2006-12-13 at 11:35 -0800, Stephen Hemminger wrote:
 
  Could we split off the NAPI context part of network_device instead?
  I'll work up something for 2.6.21.
 
 That would do the trick too... though I prefer not putting my hands in
 network_device too much myself :-)
 
 Ben
 

There are other cases that need it as well (like backlog_device)
-
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/14] Spidernet add net_ratelimit to suppress long output

2006-12-13 Thread Linas Vepstas

This patch adds net_ratelimit to many of the printks in order to
limit extraneous warning messages (created in response to Bug 28554).
This patch supercedes all previous ratelimit patches.
This has been tested, please apply.

From: James K Lewis [EMAIL PROTECTED]
Signed-off-by: James K Lewis [EMAIL PROTECTED]
Signed-off-by: Linas Vepstas [EMAIL PROTECTED]


 drivers/net/spider_net.c |   11 +--
 drivers/net/spider_net.h |2 +-
 2 files changed, 6 insertions(+), 7 deletions(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
13:04:04.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 13:19:59.0 
-0600
@@ -1038,11 +1038,10 @@ spider_net_decode_one_descr(struct spide
 
if ( (status != SPIDER_NET_DESCR_COMPLETE) 
 (status != SPIDER_NET_DESCR_FRAME_END) ) {
-   if (netif_msg_rx_err(card)) {
+   if (netif_msg_rx_err(card))
pr_err(%s: RX descriptor with state %d\n,
   card-netdev-name, status);
-   card-spider_stats.rx_desc_unk_state++;
-   }
+   card-spider_stats.rx_desc_unk_state++;
goto refill;
}
 
@@ -1361,7 +1360,7 @@ spider_net_handle_error_irq(struct spide
case SPIDER_NET_GRFAFLLINT: /* fallthrough */
case SPIDER_NET_GRMFLLINT:
if (netif_msg_intr(card)  net_ratelimit())
-   pr_debug(Spider RX RAM full, incoming packets 
+   pr_err(Spider RX RAM full, incoming packets 
   might be discarded!\n);
spider_net_rx_irq_off(card);
tasklet_schedule(card-rxram_full_tl);
@@ -1379,7 +1378,7 @@ spider_net_handle_error_irq(struct spide
case SPIDER_NET_GDCDCEINT: /* fallthrough */
case SPIDER_NET_GDBDCEINT: /* fallthrough */
case SPIDER_NET_GDADCEINT:
-   if (netif_msg_intr(card))
+   if (netif_msg_intr(card)  net_ratelimit())
pr_err(got descriptor chain end interrupt, 
   restarting DMAC %c.\n,
   'D'-(i-SPIDER_NET_GDDDCEINT)/3);
@@ -1450,7 +1449,7 @@ spider_net_handle_error_irq(struct spide
break;
}
 
-   if ((show_error)  (netif_msg_intr(card)))
+   if ((show_error)  (netif_msg_intr(card))  net_ratelimit())
pr_err(Got error interrupt on %s, GHIINT0STS = 0x%08x, 
   GHIINT1STS = 0x%08x, GHIINT2STS = 0x%08x\n,
   card-netdev-name,
Index: linux-2.6.19-git7/drivers/net/spider_net.h
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.h 2006-12-13 
12:04:02.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.h  2006-12-13 13:19:59.0 
-0600
@@ -24,7 +24,7 @@
 #ifndef _SPIDER_NET_H
 #define _SPIDER_NET_H
 
-#define VERSION 1.6 A
+#define VERSION 1.6 B
 
 #include sungem_phy.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


[PATCH 3/14] Spidernet remove rxramfull tasklet

2006-12-13 Thread Linas Vepstas

Get rid of the rxramfull tasklet, and let the NAPI poll routine
deal with this situation. (The rxramfull interrupt is simply 
stating that the h/w has run out of room for incoming packets).

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |   24 +---
 drivers/net/spider_net.h |1 -
 2 files changed, 1 insertion(+), 24 deletions(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:24:04.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:24:07.0 
-0600
@@ -1221,24 +1221,6 @@ spider_net_set_mac(struct net_device *ne
 }
 
 /**
- * spider_net_handle_rxram_full - cleans up RX ring upon RX RAM full interrupt
- * @card: card structure
- *
- * spider_net_handle_rxram_full empties the RX ring so that spider can put
- * more packets in it and empty its RX RAM. This is called in bottom half
- * context
- */
-static void
-spider_net_handle_rxram_full(struct spider_net_card *card)
-{
-   while (spider_net_decode_one_descr(card, 0))
-   ;
-   spider_net_enable_rxchtails(card);
-   spider_net_enable_rxdmac(card);
-   netif_rx_schedule(card-netdev);
-}
-
-/**
  * spider_net_handle_error_irq - handles errors raised by an interrupt
  * @card: card structure
  * @status_reg: interrupt status register 0 (GHIINT0STS)
@@ -1363,7 +1345,7 @@ spider_net_handle_error_irq(struct spide
pr_err(Spider RX RAM full, incoming packets 
   might be discarded!\n);
spider_net_rx_irq_off(card);
-   tasklet_schedule(card-rxram_full_tl);
+   netif_rx_schedule(card-netdev);
show_error = 0;
break;
 
@@ -1895,7 +1877,6 @@ spider_net_stop(struct net_device *netde
 {
struct spider_net_card *card = netdev_priv(netdev);
 
-   tasklet_kill(card-rxram_full_tl);
netif_poll_disable(netdev);
netif_carrier_off(netdev);
netif_stop_queue(netdev);
@@ -2037,9 +2018,6 @@ spider_net_setup_netdev(struct spider_ne
 
pci_set_drvdata(card-pdev, netdev);
 
-   card-rxram_full_tl.data = (unsigned long) card;
-   card-rxram_full_tl.func =
-   (void (*)(unsigned long)) spider_net_handle_rxram_full;
init_timer(card-tx_timer);
card-tx_timer.function =
(void (*)(unsigned long)) spider_net_cleanup_tx_ring;
Index: linux-2.6.19-git7/drivers/net/spider_net.h
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.h 2006-12-13 
14:24:04.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.h  2006-12-13 14:24:07.0 
-0600
@@ -442,7 +442,6 @@ struct spider_net_card {
struct spider_net_descr_chain rx_chain;
struct spider_net_descr *low_watermark;
 
-   struct tasklet_struct rxram_full_tl;
struct timer_list tx_timer;
struct work_struct tx_timeout_task;
atomic_t tx_timeout_task_counter;
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 5/14] Spidernet RX skb mem leak

2006-12-13 Thread Linas Vepstas

One of the unlikely error branches has an skb memory leak.
Fix this by handling the error conditions consistently.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |   18 +-
 1 file changed, 9 insertions(+), 9 deletions(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:24:13.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:24:16.0 
-0600
@@ -913,8 +913,8 @@ spider_net_do_ioctl(struct net_device *n
  *
  * returns 1 on success, 0 if no packet was passed to the stack
  *
- * iommu-unmaps the skb, fills out skb structure and passes the data to the
- * stack. The descriptor state is not changed.
+ * Fills out skb structure and passes the data to the stack.
+ * The descriptor state is not changed.
  */
 static int
 spider_net_pass_skb_up(struct spider_net_descr *descr,
@@ -929,10 +929,6 @@ spider_net_pass_skb_up(struct spider_net
 
netdev = card-netdev;
 
-   /* unmap descriptor */
-   pci_unmap_single(card-pdev, descr-buf_addr, SPIDER_NET_MAX_FRAME,
-   PCI_DMA_FROMDEVICE);
-
/* the cases we'll throw away the packet immediately */
if (data_error  SPIDER_NET_DESTROY_RX_FLAGS) {
if (netif_msg_rx_err(card))
@@ -1015,6 +1011,11 @@ spider_net_decode_one_descr(struct spide
chain-tail = descr-next;
 
result = 0;
+
+   /* unmap descriptor */
+   pci_unmap_single(card-pdev, descr-buf_addr,
+   SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
+
if ( (status == SPIDER_NET_DESCR_RESPONSE_ERROR) ||
 (status == SPIDER_NET_DESCR_PROTECTION_ERROR) ||
 (status == SPIDER_NET_DESCR_FORCE_END) ) {
@@ -1022,8 +1023,6 @@ spider_net_decode_one_descr(struct spide
pr_err(%s: dropping RX descriptor with state %d\n,
   card-netdev-name, status);
card-netdev_stats.rx_dropped++;
-   pci_unmap_single(card-pdev, descr-buf_addr,
-   SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
dev_kfree_skb_irq(descr-skb);
goto refill;
}
@@ -1031,9 +1030,10 @@ spider_net_decode_one_descr(struct spide
if ( (status != SPIDER_NET_DESCR_COMPLETE) 
 (status != SPIDER_NET_DESCR_FRAME_END) ) {
if (netif_msg_rx_err(card))
-   pr_err(%s: RX descriptor with state %d\n,
+   pr_err(%s: RX descriptor with unkown state %d\n,
   card-netdev-name, status);
card-spider_stats.rx_desc_unk_state++;
+   dev_kfree_skb_irq(descr-skb);
goto refill;
}
 
-
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 11/14] Spidernet Memory barrier

2006-12-13 Thread Linas Vepstas

Add memory barrier to make sure that the rest of the 
RX descriptor state is flushed to memory before we tell 
the hardware that its ready to go.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |1 +
 1 file changed, 1 insertion(+)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:28:19.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:28:23.0 
-0600
@@ -419,6 +419,7 @@ spider_net_prepare_rx_descr(struct spide
card-spider_stats.rx_iommu_map_error++;
descr-dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
} else {
+   wmb();
descr-dmac_cmd_status = SPIDER_NET_DESCR_CARDOWNED |
 SPIDER_NET_DMAC_NOINTR_COMPLETE;
}
-
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/14] Spidernet Avoid possible RX chain corruption

2006-12-13 Thread Linas Vepstas

Delete possible source of chain corruption; the hardware
already knows the location of the tail, and writing it
again is likely to mess it up.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]



 drivers/net/spider_net.c |1 -
 1 file changed, 1 deletion(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:28:23.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:28:25.0 
-0600
@@ -513,7 +513,6 @@ spider_net_alloc_rx_skbs(struct spider_n
/* This will allocate the rest of the rx buffers;
 * if not, it's business as usual later on. */
spider_net_refill_rx_chain(card);
-   spider_net_enable_rxchtails(card);
spider_net_enable_rxdmac(card);
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 8/14] Spidernet RX Refill

2006-12-13 Thread Linas Vepstas

The invocation of the rx ring refill routine is haphazard,
it can be called from a central location.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |   13 -
 1 file changed, 4 insertions(+), 9 deletions(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:27:35.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:28:11.0 
-0600
@@ -980,17 +980,11 @@ spider_net_decode_one_descr(struct spide
 
status = spider_net_get_descr_status(descr);
 
-   /* nothing in the descriptor yet */
-   if (status == SPIDER_NET_DESCR_CARDOWNED)
+   /* Nothing in the descriptor, or ring must be empty */
+   if ((status == SPIDER_NET_DESCR_CARDOWNED) ||
+   (status == SPIDER_NET_DESCR_NOT_IN_USE))
return 0;
 
-   if (status == SPIDER_NET_DESCR_NOT_IN_USE) {
-   /* not initialized yet, the ring must be empty */
-   spider_net_refill_rx_chain(card);
-   spider_net_enable_rxdmac(card);
-   return 0;
-   }
-
/* descriptor definitively used -- move on tail */
chain-tail = descr-next;
 
@@ -1074,6 +1068,7 @@ spider_net_poll(struct net_device *netde
netdev-quota -= packets_done;
*budget -= packets_done;
spider_net_refill_rx_chain(card);
+   spider_net_enable_rxdmac(card);
 
/* if all packets are in the stack, enable interrupts and return 0 */
/* if not, return 1 */
-
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 7/14] Spidernet Cleanup return codes

2006-12-13 Thread Linas Vepstas

Simplify the somewhat convoluted use of return codes
in the rx buffer handling.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |   32 
 1 file changed, 12 insertions(+), 20 deletions(-)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:24:20.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:27:35.0 
-0600
@@ -911,12 +911,10 @@ spider_net_do_ioctl(struct net_device *n
  * @descr: descriptor to process
  * @card: card structure
  *
- * returns 1 on success, 0 if no packet was passed to the stack
- *
  * Fills out skb structure and passes the data to the stack.
  * The descriptor state is not changed.
  */
-static int
+static void
 spider_net_pass_skb_up(struct spider_net_descr *descr,
   struct spider_net_card *card)
 {
@@ -961,8 +959,6 @@ spider_net_pass_skb_up(struct spider_net
/* update netdevice statistics */
card-netdev_stats.rx_packets++;
card-netdev_stats.rx_bytes += skb-len;
-
-   return 1;
 }
 
 /**
@@ -981,7 +977,6 @@ spider_net_decode_one_descr(struct spide
struct spider_net_descr_chain *chain = card-rx_chain;
struct spider_net_descr *descr = chain-tail;
int status;
-   int result;
 
status = spider_net_get_descr_status(descr);
 
@@ -999,8 +994,6 @@ spider_net_decode_one_descr(struct spide
/* descriptor definitively used -- move on tail */
chain-tail = descr-next;
 
-   result = 0;
-
/* unmap descriptor */
pci_unmap_single(card-pdev, descr-buf_addr,
SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
@@ -1012,8 +1005,7 @@ spider_net_decode_one_descr(struct spide
pr_err(%s: dropping RX descriptor with state %d\n,
   card-netdev-name, status);
card-netdev_stats.rx_dropped++;
-   dev_kfree_skb_irq(descr-skb);
-   goto refill;
+   goto bad_desc;
}
 
if ( (status != SPIDER_NET_DESCR_COMPLETE) 
@@ -1022,8 +1014,7 @@ spider_net_decode_one_descr(struct spide
pr_err(%s: RX descriptor with unkown state %d\n,
   card-netdev-name, status);
card-spider_stats.rx_desc_unk_state++;
-   dev_kfree_skb_irq(descr-skb);
-   goto refill;
+   goto bad_desc;
}
 
/* The cases we'll throw away the packet immediately */
@@ -1033,17 +1024,18 @@ spider_net_decode_one_descr(struct spide
   data_status=x%08x, data_error=x%08x\n,
   card-netdev-name,
   descr-data_status, descr-data_error);
-   card-spider_stats.rx_desc_error++;
-   dev_kfree_skb_irq(descr-skb);
-   goto refill;
+   goto bad_desc;
}
 
-   /* ok, we've got a packet in descr */
-   result = spider_net_pass_skb_up(descr, card);
-refill:
-   /* change the descriptor state: */
+   /* Ok, we've got a packet in descr */
+   spider_net_pass_skb_up(descr, card);
descr-dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
-   return result;
+   return 1;
+
+bad_desc:
+   dev_kfree_skb_irq(descr-skb);
+   descr-dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
+   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 9/14] Spidernet Remove unused variable

2006-12-13 Thread Linas Vepstas

Remove unused variable; this makes code easier to read.
Tweak commentary.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


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

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:28:11.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:28:15.0 
-0600
@@ -367,21 +367,20 @@ spider_net_free_rx_chain_contents(struct
 }
 
 /**
- * spider_net_prepare_rx_descr - reinitializes a rx descriptor
+ * spider_net_prepare_rx_descr - Reinitialize RX descriptor
  * @card: card structure
  * @descr: descriptor to re-init
  *
- * return 0 on succes, 0 on failure
+ * Return 0 on succes, 0 on failure.
  *
- * allocates a new rx skb, iommu-maps it and attaches it to the descriptor.
- * Activate the descriptor state-wise
+ * Allocates a new rx skb, iommu-maps it and attaches it to the
+ * descriptor. Mark the descriptor as activated, ready-to-use.
  */
 static int
 spider_net_prepare_rx_descr(struct spider_net_card *card,
struct spider_net_descr *descr)
 {
dma_addr_t buf;
-   int error = 0;
int offset;
int bufsize;
 
@@ -409,7 +408,7 @@ spider_net_prepare_rx_descr(struct spide
(SPIDER_NET_RXBUF_ALIGN - 1);
if (offset)
skb_reserve(descr-skb, SPIDER_NET_RXBUF_ALIGN - offset);
-   /* io-mmu-map the skb */
+   /* iommu-map the skb */
buf = pci_map_single(card-pdev, descr-skb-data,
SPIDER_NET_MAX_FRAME, PCI_DMA_FROMDEVICE);
descr-buf_addr = buf;
@@ -424,7 +423,7 @@ spider_net_prepare_rx_descr(struct spide
 SPIDER_NET_DMAC_NOINTR_COMPLETE;
}
 
-   return error;
+   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 13/14] Spidernet RX Debugging printout

2006-12-13 Thread Linas Vepstas

Add some debugging and error printing.

The show_rx_chain() prints out the status of the rx chain,
which shows that the status of the descriptors gets
messed up after the second  subsequent RX ramfulls.

Print out contents of bad packets if error occurs.

Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
Cc: James K Lewis [EMAIL PROTECTED]
Cc: Arnd Bergmann [EMAIL PROTECTED]


 drivers/net/spider_net.c |   46 ++
 1 file changed, 46 insertions(+)

Index: linux-2.6.19-git7/drivers/net/spider_net.c
===
--- linux-2.6.19-git7.orig/drivers/net/spider_net.c 2006-12-13 
14:30:43.0 -0600
+++ linux-2.6.19-git7/drivers/net/spider_net.c  2006-12-13 14:32:13.0 
-0600
@@ -961,6 +961,34 @@ spider_net_pass_skb_up(struct spider_net
card-netdev_stats.rx_bytes += skb-len;
 }
 
+#ifdef DEBUG
+static void show_rx_chain(struct spider_net_card *card)
+{
+   struct spider_net_descr_chain *chain = card-rx_chain;
+   struct spider_net_descr *start= chain-tail;
+   struct spider_net_descr *descr= start;
+   int status;
+
+   int cnt = 0;
+   int cstat = spider_net_get_descr_status(descr);
+   printk(KERN_INFO RX chain tail at descr=%ld\n,
+(start - card-descr) - card-tx_chain.num_desc);
+   status = cstat;
+   do
+   {
+   status = spider_net_get_descr_status(descr);
+   if (cstat != status) {
+   printk(KERN_INFO Have %d descrs with stat=x%08x\n, 
cnt, cstat);
+   cstat = status;
+   cnt = 0;
+   }
+   cnt ++;
+   descr = descr-next;
+   } while (descr != start);
+   printk(KERN_INFO Last %d descrs with stat=x%08x\n, cnt, cstat);
+}
+#endif
+
 /**
  * spider_net_decode_one_descr - processes an rx descriptor
  * @card: card structure
@@ -1021,6 +1049,24 @@ spider_net_decode_one_descr(struct spide
goto bad_desc;
}
 
+   if (descr-dmac_cmd_status  0xfefe) {
+   pr_err(%s: bad status, cmd_status=x%08x\n,
+  card-netdev-name,
+  descr-dmac_cmd_status);
+   pr_err(buf_addr=x%08x\n, descr-buf_addr);
+   pr_err(buf_size=x%08x\n, descr-buf_size);
+   pr_err(next_descr_addr=x%08x\n, descr-next_descr_addr);
+   pr_err(result_size=x%08x\n, descr-result_size);
+   pr_err(valid_size=x%08x\n, descr-valid_size);
+   pr_err(data_status=x%08x\n, descr-data_status);
+   pr_err(data_error=x%08x\n, descr-data_error);
+   pr_err(bus_addr=x%08x\n, descr-bus_addr);
+   pr_err(which=%ld\n, descr - card-rx_chain.ring);
+
+   card-spider_stats.rx_desc_error++;
+   goto bad_desc;
+   }
+
/* Ok, we've got a packet in descr */
spider_net_pass_skb_up(descr, card);
descr-dmac_cmd_status = SPIDER_NET_DESCR_NOT_IN_USE;
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Ivo Van Doorn

Hi,


 How, by private ioctls?  That's just wrong; I believe you still need to
 go through the 4-way handshake to get the right keying information even
 if you use PSK, which means you still need the supplicant, right?

All I did was add this to /etc/network/interfaces:

iface wlan0 inet static
address 192.168.1.51
network 192.168.1.0
netmask 255.255.255.0
gateway 192.168.1.254
broadcast 192.168.1.255
pre-up ifconfig wlan0 up
pre-up iwpriv wlan0 set AuthMode=WPAPSK
pre-up iwpriv wlan0 set EncrypType=TKIP
pre-up iwconfig wlan0 essid USR8054
pre-up iwpriv wlan0 set WPAPSK=My WPA passphrase...


That is definately the rt2500 legacy driver and _not_ the rt2x00 driver.


It seems to work, although I guess I could be wrong.  It was what I
found in the documentation for the rt2x00 driver for doing WPA.  It
looks nothing like the wpa_supplicant stuff I used to have with an older
version of the driver.  My understanding was that the rt2x00 driver
and/or d80211 stack took care of it now.


Correct, that is why those iwpriv commands are the clear evidence
you are not using rt2x00 but rt2500 legacy. Check which driver is loaded
rt2500 means legacy
rt2500pci means rt2x00.

Ivo
-
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 0/2] d80211, rt2x00: fixes

2006-12-13 Thread Lennart Sorensen
On Wed, Dec 13, 2006 at 10:28:15PM +0100, Ivo Van Doorn wrote:
 That is definately the rt2500 legacy driver and _not_ the rt2x00 driver.

Yeah I just noticed that a few minutes ago.  I had been trying out both
to see how they worked, and I left the old module loaded by accident.

 Correct, that is why those iwpriv commands are the clear evidence
 you are not using rt2x00 but rt2500 legacy. Check which driver is loaded
 rt2500 means legacy
 rt2500pci means rt2x00.

Yep I am now poking with the wpa_supplicant again, getting other
interesting messages from it.

I will try to give a report on how my system behaves with the 2x00
driver soon since apparently some of my testing was with the wrong
driver.  Oops. :)

--
Len Sorensen
-
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] zd1211rw-d80211: Use LED class

2006-12-13 Thread Ulrich Kunitz
Michael,

please detach a little bit from LEDs.

A trigger is a generic concept. It doesn't need to have a special
binding to what it triggers. It could be a buzzer, it could be
an LED, it could be text output on an LCD.

So we could have link status change trigger, for which functions
could be registered. There is no reason for the upper layer d80211
code to know, that it triggers an LED. A netlink event generator
could only be one of the users of those generic triggers.

My other opinion is that I find it overkill to handle the LED on a
WLAN adapter as an independent device instantiating a device class
in Linux. I mean on the other hands we break APIs for four or
eight bytes and here we spend a whole device strucuture and sysfs
directory for something the wlan device firmware represents with a
single bit. To call the housekeeping functions overkill under
these circumstances appears not to be very rational.

It should also be mentioned that the LEDs on the ZD1211 devices
are not independent devices, because they are partly controlled
by the firmware. That's exactly where some of the issues with your
patch are.

Let the device drivers do the blinking, but give them a chance to
know about status changes at the MAC layer, without mandating to
implement a LED device. Using the same triggers by a netlink event
generator, would make the code even simpler.

-- 
Uli Kunitz
-
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: wake on LAN with sky2

2006-12-13 Thread Stephen Hemminger
On Tue, 12 Dec 2006 21:27:20 +0100
Tino Keitel [EMAIL PROTECTED] wrote:

 Hi folks,
 
 I just tried the sk98lin driver version 8.41.2.3 and was happy that it
 seems to support wake on LAN with the Marvell 88E8053 PCIe chip.
 However, after resume from suspend to RAM, the machine hangs. As it
 doesn't hang with sky2, it looks like this particular driver breaks
 suspend to RAM. ($%?#!!!)



 A quick look into sk98lin_suspend() shows that there is not much stuff
 in there. Am I right that I just have to port that stuff to sky2? The
 affected file skge.c is licenced under the GPL v2 or later.
 
 Regards,
 Tino
 -


I was working on Wol for sky2, and got part way, but discovered that on my
test machine there were worse problems. The current code in the power management
resume runs the ACPI finish routine after the device resume. The ACPI finish
routine calls the BIOS, the BIOS then breaks MSI support.

The fix for that will be to reorder the PM resume code, but doing it right
means making the process thaw code SMP safe  There are some patches
slowly working through the PM tree to fix this..

Anyway, this is as far as I got.

---
 drivers/net/sky2.c |   92 +++--
 drivers/net/sky2.h |   19 --
 2 files changed, 96 insertions(+), 15 deletions(-)

--- sky2.orig/drivers/net/sky2.c2006-11-09 14:47:59.0 -0800
+++ sky2/drivers/net/sky2.c 2006-11-09 14:51:21.0 -0800
@@ -539,16 +539,21 @@
 
 static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff)
 {
+   struct sky2_port *sky2 = netdev_priv(hw-dev[port]);
u32 reg1;
static const u32 phy_power[]
= { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD };
 
+   reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
+   if (sky2-wol)
+   reg1 |= PCI_Y2_PIG_ENA;
+   else
+   reg1 = ~PCI_Y2_PIG_ENA;
+
/* looks like this XL is back asswards .. */
if (hw-chip_id == CHIP_ID_YUKON_XL  hw-chip_rev  1)
onoff = !onoff;
 
-   reg1 = sky2_pci_read32(hw, PCI_DEV_REG1);
-
if (onoff)
/* Turn off phy power saving */
reg1 = ~phy_power[port];
@@ -568,6 +573,50 @@
spin_unlock_bh(sky2-phy_lock);
 }
 
+/* Put device in state to listen for Wake On Lan */
+static void sky2_wol_init(struct sky2_port *sky2)
+{
+   struct sky2_hw *hw = sky2-hw;
+   unsigned port = sky2-port;
+   enum flow_control save_mode;
+   u16 ctrl;
+
+   sky2_phy_power(hw, port, 1);
+
+   sky2_write16(hw, B0_CTST, CS_RST_CLR);
+   sky2_write16(hw, SK_REG(port, GMAC_LINK_CTRL), GMLC_RST_CLR);
+   sky2_write8(hw, SK_REG(port, GPHY_CTRL), GPC_RST_CLR);
+   sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_RST_CLR);
+
+   /* Force no F/C when for WOL, re-enable when link comes up */
+   save_mode = sky2-flow_mode;
+   sky2-flow_mode = FC_NONE;
+   sky2_phy_reinit(sky2);
+   sky2-flow_mode = save_mode;
+
+   gma_write16(hw, port, GM_GP_CTRL,
+   GM_GPCR_FC_TX_DIS|GM_GPCR_TX_ENA|
+   GM_GPCR_RX_ENA|GM_GPCR_FC_RX_DIS|
+   GM_GPCR_DUP_FULL|GM_GPCR_AU_FCT_DIS);
+
+   sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR);
+
+   sky2_write16(hw, WOL_REGS(port, WOL_CTRL_STAT), WOL_CTL_CLEAR_RESULT);
+   ctrl = 0;
+   if (sky2-wol  WAKE_PHY)
+   ctrl |= WOL_CTL_ENA_PME_ON_LINK_CHG|WOL_CTL_ENA_LINK_CHG_UNIT;
+   else
+   ctrl |= WOL_CTL_DIS_PME_ON_LINK_CHG|WOL_CTL_DIS_LINK_CHG_UNIT;
+
+   if (sky2-wol  WAKE_MAGIC)
+   ctrl |= WOL_CTL_ENA_PME_ON_MAGIC_PKT|WOL_CTL_ENA_MAGIC_PKT_UNIT;
+   else
+   ctrl |= 
WOL_CTL_DIS_PME_ON_MAGIC_PKT|WOL_CTL_DIS_MAGIC_PKT_UNIT;;
+
+   ctrl |= WOL_CTL_DIS_PME_ON_PATTERN|WOL_CTL_DIS_PATTERN_UNIT;
+   sky2_write16(hw, WOL_REGS(port, WOL_CTRL_STAT), ctrl);
+}
+
 static void sky2_mac_init(struct sky2_hw *hw, unsigned port)
 {
struct sky2_port *sky2 = netdev_priv(hw-dev[port]);
@@ -1551,6 +1600,8 @@
sky2-rx_ring = NULL;
sky2-tx_ring = NULL;
 
+   if (sky2-wol)
+   sky2_wol_init(sky2);
return 0;
 }
 
@@ -2525,6 +2576,35 @@
return 0;
 }
 
+static const u8 wol_supported = WAKE_PHY | WAKE_MAGIC;
+
+static void sky2_get_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+{
+   const struct sky2_port *sky2 = netdev_priv(dev);
+
+   wol-supported = wol_supported;
+   wol-wolopts = sky2-wol;
+}
+
+static int sky2_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
+{
+   struct sky2_port *sky2 = netdev_priv(dev);
+   struct sky2_hw *hw = sky2-hw;
+
+   if (wol-wolopts  ~wol_supported)
+   return -EOPNOTSUPP;
+
+   sky2-wol = wol-wolopts;
+
+   if (hw-chip_id == CHIP_ID_YUKON_EC_U)
+   sky2_write32(hw, B0_CTST, sky2-wol
+? Y2_HW_WOL_ON : Y2_HW_WOL_OFF);
+
+

Re: [PATCH] zd1211rw-d80211: Use LED class

2006-12-13 Thread Michael Wu
On Wednesday 13 December 2006 17:54, Ulrich Kunitz wrote:
 I mean on the other hands we break APIs for four or 
 eight bytes and here we spend a whole device strucuture and sysfs
 directory for something the wlan device firmware represents with a
 single bit. To call the housekeeping functions overkill under
 these circumstances appears not to be very rational.

I do not consider the housekeeping functions overkill, but the function that 
it performs (eg. not confusing the user by keeping the LED off) can be done 
with less brute force.

 It should also be mentioned that the LEDs on the ZD1211 devices
 are not independent devices, because they are partly controlled
 by the firmware. That's exactly where some of the issues with your
 patch are.

The link light can be treated as an independent device as long as the other 
LED bit is not flipped. As I mentioned before, fixing that isn't a problem.

 Let the device drivers do the blinking, but give them a chance to
 know about status changes at the MAC layer, without mandating to
 implement a LED device. 
I guess you don't like the LED trigger code currently in d80211 then and would 
rather see it removed. As far as I can tell, this patch is just a symptom of 
that issue.

-Michael Wu


pgp5JTyWMOqu6.pgp
Description: PGP signature


[PATCH] Update ucc_geth.c for new workqueue structure

2006-12-13 Thread timur
From: Timur Tabi [EMAIL PROTECTED]

The workqueue interface changed with David Howell's patch on 11/22/2006
(SHA 65f27f38446e1976cc98fd3004b110fedcddd189).  Several drivers were
updated with that patch to handle the new interface, but ucc_geth.c
was not one of them.  This patch updates ucc_geth.c to support the new
model.

A compiler warning in set_mac_addr() was also fixed.

Signed-off-by: Timur Tabi [EMAIL PROTECTED]
Signed-off-by: Kumar Gala [EMAIL PROTECTED]

---
 drivers/net/ucc_geth.c |   12 +++-
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c
index 1f05511..d33bb0c 100644
--- a/drivers/net/ucc_geth.c
+++ b/drivers/net/ucc_geth.c
@@ -29,6 +29,7 @@
 #include linux/fsl_devices.h
 #include linux/ethtool.h
 #include linux/mii.h
+#include linux/workqueue.h
 
 #include asm/of_platform.h
 #include asm/uaccess.h
@@ -472,7 +473,7 @@ static void put_enet_addr_container(stru
kfree(enet_addr_cont);
 }
 
-static int set_mac_addr(__be16 __iomem *reg, u8 *mac)
+static void set_mac_addr(__be16 __iomem *reg, u8 *mac)
 {
out_be16(reg[0], ((u16)mac[5]  8) | mac[4]);
out_be16(reg[1], ((u16)mac[3]  8) | mac[2]);
@@ -3918,10 +3919,11 @@ static irqreturn_t phy_interrupt(int irq
 }
 
 /* Scheduled by the phy_interrupt/timer to handle PHY changes */
-static void ugeth_phy_change(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-   struct net_device *dev = (struct net_device *)data;
-   struct ucc_geth_private *ugeth = netdev_priv(dev);
+   struct ucc_geth_private *ugeth =
+   container_of(work, struct ucc_geth_private, tq);
+   struct net_device *dev = ugeth-dev;
struct ucc_geth *ug_regs;
int result = 0;
 
@@ -4078,7 +4080,7 @@ static int ucc_geth_open(struct net_devi
 #endif /* CONFIG_UGETH_NAPI */
 
/* Set up the PHY change work queue */
-   INIT_WORK(ugeth-tq, ugeth_phy_change, dev);
+   INIT_WORK(ugeth-tq, ugeth_phy_change);
 
init_timer(ugeth-phy_info_timer);
ugeth-phy_info_timer.function = ugeth_phy_startup_timer;
-- 
1.4.4

-
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] Fix phy_read/write redefinition errors in ucc_geth_phy.c

2006-12-13 Thread timur
From: Timur Tabi [EMAIL PROTECTED]

The local versions of phy_read() and phy_write() in ucc_geth_phy.c conflict
with the prototypes in include/linux/phy.h, so this patch renames them, 
moves them to the top of the file (while eliminating the redundant prototype),
and makes them static.

Signed-off-by: Timur Tabi [EMAIL PROTECTED]
Signed-off-by: Kumar Gala [EMAIL PROTECTED]

---
 drivers/net/ucc_geth_phy.c |  134 ++--
 1 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/drivers/net/ucc_geth_phy.c b/drivers/net/ucc_geth_phy.c
index 5360ec0..3c86592 100644
--- a/drivers/net/ucc_geth_phy.c
+++ b/drivers/net/ucc_geth_phy.c
@@ -68,8 +68,31 @@ static int gbit_config_aneg(struct ugeth
 static int genmii_config_aneg(struct ugeth_mii_info *mii_info);
 static int genmii_update_link(struct ugeth_mii_info *mii_info);
 static int genmii_read_status(struct ugeth_mii_info *mii_info);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
+
+static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16 regnum)
+{
+   u16 retval;
+   unsigned long flags;
+
+   ugphy_vdbg(%s: IN, __FUNCTION__);
+
+   spin_lock_irqsave(mii_info-mdio_lock, flags);
+   retval = mii_info-mdio_read(mii_info-dev, mii_info-mii_id, regnum);
+   spin_unlock_irqrestore(mii_info-mdio_lock, flags);
+
+   return retval;
+}
+
+static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info, u16 regnum, 
u16 val)
+{
+   unsigned long flags;
+
+   ugphy_vdbg(%s: IN, __FUNCTION__);
+
+   spin_lock_irqsave(mii_info-mdio_lock, flags);
+   mii_info-mdio_write(mii_info-dev, mii_info-mii_id, regnum, val);
+   spin_unlock_irqrestore(mii_info-mdio_lock, flags);
+}
 
 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +207,7 @@ static void config_genmii_advert(struct
advertise = mii_info-advertising;
 
/* Setup standard advertisement */
-   adv = phy_read(mii_info, MII_ADVERTISE);
+   adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE);
adv = ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
if (advertise  ADVERTISED_10baseT_Half)
adv |= ADVERTISE_10HALF;
@@ -194,7 +217,7 @@ static void config_genmii_advert(struct
adv |= ADVERTISE_100HALF;
if (advertise  ADVERTISED_100baseT_Full)
adv |= ADVERTISE_100FULL;
-   phy_write(mii_info, MII_ADVERTISE, adv);
+   ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv);
 }
 
 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +227,7 @@ static void genmii_setup_forced(struct u
 
ugphy_vdbg(%s: IN, __FUNCTION__);
 
-   ctrl = phy_read(mii_info, MII_BMCR);
+   ctrl = ucc_geth_phy_read(mii_info, MII_BMCR);
 
ctrl =
~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE);
@@ -234,7 +257,7 @@ static void genmii_setup_forced(struct u
break;
}
 
-   phy_write(mii_info, MII_BMCR, ctrl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctrl);
 }
 
 /* Enable and Restart Autonegotiation */
@@ -244,9 +267,9 @@ static void genmii_restart_aneg(struct u
 
ugphy_vdbg(%s: IN, __FUNCTION__);
 
-   ctl = phy_read(mii_info, MII_BMCR);
+   ctl = ucc_geth_phy_read(mii_info, MII_BMCR);
ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
-   phy_write(mii_info, MII_BMCR, ctl);
+   ucc_geth_phy_write(mii_info, MII_BMCR, ctl);
 }
 
 static int gbit_config_aneg(struct ugeth_mii_info *mii_info)
@@ -261,14 +284,14 @@ static int gbit_config_aneg(struct ugeth
config_genmii_advert(mii_info);
advertise = mii_info-advertising;
 
-   adv = phy_read(mii_info, MII_1000BASETCONTROL);
+   adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL);
adv = ~(MII_1000BASETCONTROL_FULLDUPLEXCAP |
 MII_1000BASETCONTROL_HALFDUPLEXCAP);
if (advertise  SUPPORTED_1000baseT_Half)
adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP;
if (advertise  SUPPORTED_1000baseT_Full)
adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP;
-   phy_write(mii_info, MII_1000BASETCONTROL, adv);
+   ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv);
 
/* Start/Restart aneg */
genmii_restart_aneg(mii_info);
@@ -298,10 +321,10 @@ static int genmii_update_link(struct uge
ugphy_vdbg(%s: IN, __FUNCTION__);
 
/* Do a fake read */
-   phy_read(mii_info, MII_BMSR);
+   ucc_geth_phy_read(mii_info, MII_BMSR);
 
/* Read link and autonegotiation status */
-   status = phy_read(mii_info, MII_BMSR);
+   status = ucc_geth_phy_read(mii_info, MII_BMSR);
if ((status  BMSR_LSTATUS) == 0)

ucc_geth patches

2006-12-13 Thread timur
These two patches were originally sent to linuxppc-dev, but they should have 
been sent here 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: wake on LAN with sky2

2006-12-13 Thread Tino Keitel
On Wed, Dec 13, 2006 at 14:58:18 -0800, Stephen Hemminger wrote:
 On Tue, 12 Dec 2006 21:27:20 +0100
 Tino Keitel [EMAIL PROTECTED] wrote:
 
  Hi folks,
  
  I just tried the sk98lin driver version 8.41.2.3 and was happy that it
  seems to support wake on LAN with the Marvell 88E8053 PCIe chip.
  However, after resume from suspend to RAM, the machine hangs. As it
  doesn't hang with sky2, it looks like this particular driver breaks
  suspend to RAM. ($%?#!!!)
 
 
 
  A quick look into sk98lin_suspend() shows that there is not much stuff
  in there. Am I right that I just have to port that stuff to sky2? The
  affected file skge.c is licenced under the GPL v2 or later.
  
  Regards,
  Tino
  -
 
 
 I was working on Wol for sky2, and got part way, but discovered that on my
 test machine there were worse problems. The current code in the power 
 management
 resume runs the ACPI finish routine after the device resume. The ACPI finish
 routine calls the BIOS, the BIOS then breaks MSI support.
 
 The fix for that will be to reorder the PM resume code, but doing it right
 means making the process thaw code SMP safe  There are some patches
 slowly working through the PM tree to fix this..
 
 Anyway, this is as far as I got.

Thanks for the patch. I just tried it with 2.6.19. The link LED on the
switch is active after suspend, but no wakeup after sending the WOL
packets, neigher with p nor with g setting in ethtool. After the
resume, the interface is silent, I have to reload sky2.ko to get it
working again.

Regards,
Tino
-
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/14] Spidernet add net_ratelimit to suppress long output

2006-12-13 Thread Michael Ellerman
On Wed, 2006-12-13 at 15:08 -0600, Linas Vepstas wrote:
 This patch adds net_ratelimit to many of the printks in order to
 limit extraneous warning messages (created in response to Bug 28554).

Bug 28554 in which bug tracking system? I can't find it in LTC or
kernel.org bugzilla.

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part


Re: kernel panic with the newly merged md5 signature support

2006-12-13 Thread Leigh Brown
On Wed, December 13, 2006 1:29 am, David Miller said:
 I think we're still not onto the right fix.

 I took a look, and the issue seems to simply be that the
 __tcp_put_md5sig_pool() is not doing the reference count
 thing that __tcp_get_md5sig_pool() does (via tcp_md5sig_users).

 The direct call to __tcp_free_md5sig_pool() seems to be
 what causes this problem, we should be invoking
 tcp_free_md5sig_pool() instead.

 Can you give this patch a try?  Thanks.
[...]

I just had to kill the parameter:-

--- net/ipv4/tcp.c.orig 2006-12-10 21:46:26.0 +
+++ net/ipv4/tcp.c  2006-12-13 17:38:29.0 +
@@ -2362,7 +2362,7 @@ struct tcp_md5sig_pool *__tcp_get_md5sig
 EXPORT_SYMBOL(__tcp_get_md5sig_pool);

 void __tcp_put_md5sig_pool(void) {
-   __tcp_free_md5sig_pool(tcp_md5sig_pool);
+   tcp_free_md5sig_pool();
 }

 EXPORT_SYMBOL(__tcp_put_md5sig_pool);

It still seems to me that it shouldn't be necessary to alloc and free
the pool from tcp_(get|put)_md5sig_pool, as you'll always have alloc'd
the pool before calculating the hash, but I'm happy enough as at least
its working now.

Cheers,

Leigh.

-
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 12/14] Spidernet Avoid possible RX chain corruption

2006-12-13 Thread Michael Ellerman
On Wed, 2006-12-13 at 15:23 -0600, Linas Vepstas wrote:
 Delete possible source of chain corruption; the hardware
 already knows the location of the tail, and writing it
 again is likely to mess it up.
 
 Signed-off-by: Linas Vepstas [EMAIL PROTECTED]
 Cc: James K Lewis [EMAIL PROTECTED]
 Cc: Arnd Bergmann [EMAIL PROTECTED]
 
 
 
  drivers/net/spider_net.c |1 -
  1 file changed, 1 deletion(-)
 
 Index: linux-2.6.19-git7/drivers/net/spider_net.c
 ===
 --- linux-2.6.19-git7.orig/drivers/net/spider_net.c   2006-12-13 
 14:28:23.0 -0600
 +++ linux-2.6.19-git7/drivers/net/spider_net.c2006-12-13 
 14:28:25.0 -0600
 @@ -513,7 +513,6 @@ spider_net_alloc_rx_skbs(struct spider_n
   /* This will allocate the rest of the rx buffers;
* if not, it's business as usual later on. */
   spider_net_refill_rx_chain(card);
 - spider_net_enable_rxchtails(card);
   spider_net_enable_rxdmac(card);
   return 0;

Didn't you just add that line?

From [PATCH 10/14] Spidernet RX Chain tail:

 @@ -501,17 +501,18 @@ spider_net_alloc_rx_skbs(struct spider_n
 
 snip comment change
  
 -   /* this will allocate the rest of the rx buffers; if not, it's
 -* business as usual later on */
 +   /* This will allocate the rest of the rx buffers;
 +* if not, it's business as usual later on. */
 spider_net_refill_rx_chain(card);
 +   spider_net_enable_rxchtails(card);
 spider_net_enable_rxdmac(card);
 return 0;

cheers

-- 
Michael Ellerman
OzLabs, IBM Australia Development Lab

wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)

We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person


signature.asc
Description: This is a digitally signed message part


Re: kernel panic with the newly merged md5 signature support

2006-12-13 Thread David Miller
From: Leigh Brown [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 23:43:50 - (GMT)

 I just had to kill the parameter:-
 
 --- net/ipv4/tcp.c.orig   2006-12-10 21:46:26.0 +
 +++ net/ipv4/tcp.c2006-12-13 17:38:29.0 +
 @@ -2362,7 +2362,7 @@ struct tcp_md5sig_pool *__tcp_get_md5sig
  EXPORT_SYMBOL(__tcp_get_md5sig_pool);
 
  void __tcp_put_md5sig_pool(void) {
 - __tcp_free_md5sig_pool(tcp_md5sig_pool);
 + tcp_free_md5sig_pool();
  }
 
  EXPORT_SYMBOL(__tcp_put_md5sig_pool);
 
 It still seems to me that it shouldn't be necessary to alloc and free
 the pool from tcp_(get|put)_md5sig_pool, as you'll always have alloc'd
 the pool before calculating the hash, but I'm happy enough as at least
 its working now.

Once a socket adds an MD5 signature, there will be at least a
single reference, so it won't get release until all sockets with
MD5 signatures are closed and released.

The quick hold/release cases are for transitory references to the
per-cpu MD5 pool, such as when sending resets or SYN+ACKs
-
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 1/4][SCTP]: Handle address add/delete events in a more efficient way.

2006-12-13 Thread David Miller
From: Sridhar Samudrala [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 12:44:44 -0800

 [SCTP]: Handle address add/delete events in a more efficient way.
 
 Currently in SCTP, we maintain a local address list by rebuilding the whole
 list from the device list whenever we get a address add/delete event.
 
 This patch fixes it by only adding/deleting the address for which we
 receive the event.
 
 Also removed the sctp_local_addr_lock() which is no longer needed as we
 now use list_for_each_safe() to traverse this list. This fixes the bugs
 in sctp_copy_laddrs_xxx() routines where we do copy_to_user() while
 holding this lock.
 
 Signed-off-by: Sridhar Samudrala [EMAIL PROTECTED]

Applied, thanks Sridhar.
-
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/4][SCTP]: Enable auto loading of SCTP when creating an ipv6 SCTP socket.

2006-12-13 Thread David Miller
From: Sridhar Samudrala [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 12:44:47 -0800

 [SCTP]: Enable auto loading of SCTP when creating an ipv6 SCTP socket.
 
 Signed-off-by: Sridhar Samudrala [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: [PATCH 4/4][SCTP]: Change adaption - adaptation as per the latest API draft.

2006-12-13 Thread David Miller
From: Sridhar Samudrala [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 12:44:52 -0800

 diff --git a/include/linux/sctp.h b/include/linux/sctp.h
 index 35108fe..d4f8656 100644
 --- a/include/linux/sctp.h
 +++ b/include/linux/sctp.h
 @@ -180,7 +180,7 @@ typedef enum {
   SCTP_PARAM_ERR_CAUSE= __constant_htons(0xc003),
   SCTP_PARAM_SET_PRIMARY  = __constant_htons(0xc004),
   SCTP_PARAM_SUCCESS_REPORT   = __constant_htons(0xc005),
 - SCTP_PARAM_ADAPTION_LAYER_IND   = __constant_htons(0xc006),
 + SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
  
  } sctp_param_t; /* enum */
  

I don't care what the API draft says, you will break existing
userspace applications by changing this define.

Please keep around a compatible define, and then add the new one.

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: [PATCH 3/4][SCTP]: Add support for SCTP_CONTEXT socket option.

2006-12-13 Thread David Miller
From: Sridhar Samudrala [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 12:44:50 -0800

 [SCTP]: Add support for SCTP_CONTEXT socket option.
 
 Signed-off-by: Ivan Skytte Jorgensen [EMAIL PROTECTED]
 Signed-off-by: Sridhar Samudrala [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: [PATCH] [IPV6] Make fib6_node subtree depend on IPV6_SUBTREES

2006-12-13 Thread David Miller
From: Kim Nordlund [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 17:03:26 +0200 (EET)

 
 Make fib6_node 'subtree' depend on IPV6_SUBTREES.
 
 Signed-off-by: Kim Nordlund [EMAIL PROTECTED]

Patch applied, thanks Kim.
-
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 4/4][SCTP]: Change adaption - adaptation as per the latest API draft.

2006-12-13 Thread Sridhar Samudrala
On Wed, 2006-12-13 at 16:35 -0800, David Miller wrote:
 From: Sridhar Samudrala [EMAIL PROTECTED]
 Date: Wed, 13 Dec 2006 12:44:52 -0800
 
  diff --git a/include/linux/sctp.h b/include/linux/sctp.h
  index 35108fe..d4f8656 100644
  --- a/include/linux/sctp.h
  +++ b/include/linux/sctp.h
  @@ -180,7 +180,7 @@ typedef enum {
  SCTP_PARAM_ERR_CAUSE= __constant_htons(0xc003),
  SCTP_PARAM_SET_PRIMARY  = __constant_htons(0xc004),
  SCTP_PARAM_SUCCESS_REPORT   = __constant_htons(0xc005),
  -   SCTP_PARAM_ADAPTION_LAYER_IND   = __constant_htons(0xc006),
  +   SCTP_PARAM_ADAPTATION_LAYER_IND = __constant_htons(0xc006),
 
   } sctp_param_t; /* enum */
 
 
 I don't care what the API draft says, you will break existing
 userspace applications by changing this define.
 
 Please keep around a compatible define, and then add the new one.

These parameters are not used by user-space apps. They define the
parameters used by the protocol in SCTP headers that go on wire.

The kernel version of SCTP user-space API is present in
include/net/sctp/user.h and this patch does modify names of a socket
option, notification and fields in the associated structures.

But user-space should not use any SCTP kernel header files. It gets this
API via include/netinet/sctp.h that is included in lksctp-tools package.

This patch will not break any existing apps that use the
library/header-file from the released versions of lksctp-tools.

I will add compatible defines in the next release of lksctp-tools so
that it can be used with old apps as well as new apps that can use
the new names.

Thanks
Sridhar

-
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/3][BNX2]: Fix panic in bnx2_tx_int().

2006-12-13 Thread Michael Chan
[BNX2]: Fix panic in bnx2_tx_int().

There was an off-by-one bug in bnx2_tx_avail().  If the tx ring is
completely full, the producer and consumer indices may be apart by
256 even though the ring size is only 255.  One entry in the ring is
unused and must be properly accounted for when calculating the number
of available entries.  The bug caused the tx ring entries to be
reused by mistake, overwriting active entries, and ultimately causing
it to crash.

This bug rarely occurs because the tx ring is rarely completely full.
We always stop when there is less than MAX_SKB_FRAGS entries available
in the ring.

Thanks to Corey Kovacs [EMAIL PROTECTED] and Andy Gospodarek
[EMAIL PROTECTED] for reporting the problem and helping to collect
debug information.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 7d824cf..f296c37 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -217,9 +217,16 @@ static inline u32 bnx2_tx_avail(struct b
u32 diff;
 
smp_mb();
-   diff = TX_RING_IDX(bp-tx_prod) - TX_RING_IDX(bp-tx_cons);
-   if (diff  MAX_TX_DESC_CNT)
-   diff = (diff  MAX_TX_DESC_CNT) - 1;
+
+   /* The ring uses 256 indices for 255 entries, one of them
+* needs to be skipped.
+*/
+   diff = bp-tx_prod - bp-tx_cons;
+   if (unlikely(diff = TX_DESC_CNT)) {
+   diff = 0x;
+   if (diff == TX_DESC_CNT)
+   diff = MAX_TX_DESC_CNT;
+   }
return (bp-tx_ring_size - diff);
 }
 


-
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/3][BNX2]: Fix bug in bnx2_nvram_write().

2006-12-13 Thread Michael Chan
[BNX2]: Fix bug in bnx2_nvram_write().

Length was not calculated correctly if the NVRAM offset is on a non-
aligned offset.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index f296c37..4fa7cef 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -3096,7 +3096,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 of
 
if ((align_start = (offset32  3))) {
offset32 = ~3;
-   len32 += align_start;
+   len32 += (4 - align_start);
if ((rc = bnx2_nvram_read(bp, offset32, start, 4)))
return rc;
}
@@ -3114,7 +3114,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 of
 
if (align_start || align_end) {
buf = kmalloc(len32, GFP_KERNEL);
-   if (buf == 0)
+   if (buf == NULL)
return -ENOMEM;
if (align_start) {
memcpy(buf, start, 4);


-
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 3/3][BNX2]: Fix minor loopback problem.

2006-12-13 Thread Michael Chan
[BNX2]: Fix minor loopback problem.

Use the configured MAC address instead of the permanent MAC address
for loopback frames.

Update version to 1.5.2.

Signed-off-by: Michael Chan [EMAIL PROTECTED]

diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c
index 4fa7cef..ada5e9b 100644
--- a/drivers/net/bnx2.c
+++ b/drivers/net/bnx2.c
@@ -57,8 +57,8 @@
 
 #define DRV_MODULE_NAMEbnx2
 #define PFX DRV_MODULE_NAME: 
-#define DRV_MODULE_VERSION 1.5.1
-#define DRV_MODULE_RELDATE November 15, 2006
+#define DRV_MODULE_VERSION 1.5.2
+#define DRV_MODULE_RELDATE December 13, 2006
 
 #define RUN_AT(x) (jiffies + (x))
 
@@ -4005,7 +4005,7 @@ bnx2_run_loopback(struct bnx2 *bp, int l
if (!skb)
return -ENOMEM;
packet = skb_put(skb, pkt_size);
-   memcpy(packet, bp-mac_addr, 6);
+   memcpy(packet, bp-dev-dev_addr, 6);
memset(packet + 6, 0x0, 8);
for (i = 14; i  pkt_size; i++)
packet[i] = (unsigned char) (i  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


Re: [PATCH 4/4][SCTP]: Change adaption - adaptation as per the latest API draft.

2006-12-13 Thread David Miller
From: Sridhar Samudrala [EMAIL PROTECTED]
Date: Wed, 13 Dec 2006 17:38:52 -0800

 These parameters are not used by user-space apps. They define the
 parameters used by the protocol in SCTP headers that go on wire.

There is no __KERNEL__ ifdef protection for these defines,
and the linux/sctp.h header is exported to userspace via
include/linux/Kbuild, therefore the interface is exposed to
userspace and you cannot break it.

Those are the facts.

Your lksctp tool package might provide an alternative header,
that's fine, but it doesn't change the situations with respect
to linux/sctp.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


[PATCH 0/6] d80211: add more IEEE802.11e/WMM support

2006-12-13 Thread Zhu Yi
Hi,

The following patches add more advanced IEEE802.11e/WMM features for d80211.
Your comments are welcome.


[PATCH 1/6] d80211: add IEEE802.11e/WMM MLMEs, Status Code and Reason Code
[PATCH 2/6] d80211: create wifi.h to define WIFI OUIs
[PATCH 3/6] d80211: fix classify_1d() priority selection
[PATCH 4/6] d80211: add IEEE802.11e/WMM Traffic Stream (TS) Management support
[PATCH 5/6] d80211: add IEEE 802.11e Direct Link Setup (DLS) support
[PATCH 6/6] d80211: add sysfs interface for QoS functions


Thanks,
-yi
-
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/6] d80211: add IEEE802.11e/WMM MLMEs, Status Code and Reason Code

2006-12-13 Thread Zhu Yi
Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 include/net/d80211_mgmt.h |  148 +
 1 files changed, 148 insertions(+), 0 deletions(-)

d83f6236e756f5f0bb1484d99188f06704de
diff --git a/include/net/d80211_mgmt.h b/include/net/d80211_mgmt.h
index 87141d4..450c0a2 100644
--- a/include/net/d80211_mgmt.h
+++ b/include/net/d80211_mgmt.h
@@ -14,6 +14,39 @@
 
 #include linux/types.h
 
+struct ieee802_11_ts_info {
+   __le16 traffic_type:1;
+   __le16 tsid:4;
+   __le16 direction:2;
+   __le16 access_policy:2;
+   __le16 aggregation:1;
+   __le16 apsd:1;
+   __le16 up:3;
+   __le16 ack_policy:2;
+   u8 schedule:1;
+   u8 reserved:7;
+} __attribute__ ((packed));
+
+struct ieee802_11_elem_tspec {
+   struct ieee802_11_ts_info ts_info;
+   __le16 nominal_msdu_size;
+   __le16 max_msdu_size;
+   __le32 min_service_interval;
+   __le32 max_service_interval;
+   __le32 inactivity_interval;
+   __le32 suspension_interval;
+   __le32 service_start_time;
+   __le32 min_data_rate;
+   __le32 mean_data_rate;
+   __le32 peak_data_rate;
+   __le32 burst_size;
+   __le32 delay_bound;
+   __le32 min_phy_rate;
+   __le16 surplus_band_allow;
+   __le16 medium_time;
+} __attribute__ ((packed));
+
+
 struct ieee80211_mgmt {
__le16 frame_control;
__le16 duration;
@@ -81,9 +114,51 @@ struct ieee80211_mgmt {
struct {
u8 action_code;
u8 dialog_token;
+   u8 variable[0];
+   } __attribute__ ((packed)) addts_req;
+   struct {
+   u8 action_code;
+   u8 dialog_token;
+   __le16 status_code;
+   u8 variable[0];
+   } __attribute__ ((packed)) addts_resp;
+   struct {
+   u8 action_code;
+   struct ieee802_11_ts_info ts_info;
+   __le16 reason_code;
+   } __attribute__ ((packed)) delts;
+   struct {
+   u8 action_code;
+   u8 dialog_token;
u8 status_code;
u8 variable[0];
} __attribute__ ((packed)) wme_action;
+   struct {
+   u8 action_code;
+   u8 dest[6];
+   u8 src[6];
+   __le16 capab_info;
+   __le16 timeout;
+   /* Followed by Supported Rates and
+* Extended Supported Rates */
+   u8 variable[0];
+   } __attribute__ ((packed)) dls_req;
+   struct {
+   u8 action_code;
+   __le16 status_code;
+   u8 dest[6];
+   u8 src[6];
+   /* Followed by Capability Information,
+* Supported Rates and Extended
+* Supported Rates */
+   u8 variable[0];
+   } __attribute__ ((packed)) dls_resp;
+   struct {
+   u8 action_code;
+   u8 dest[6];
+   u8 src[6];
+   __le16 reason_code;
+   } __attribute__ ((packed)) dls_teardown;
struct{
u8 action_code;
u8 element_id;
@@ -150,6 +225,18 @@ enum ieee80211_statuscode {
WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
+   /* 802.11e */
+   WLAN_STATUS_UNSPECIFIED_QOS = 32,
+   WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
+   WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
+   WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
+   WLAN_STATUS_REQUEST_DECLINED = 37,
+   WLAN_STATUS_INVALID_QOS_PARAM = 38,
+   WLAN_STATUS_CHANGE_TSPEC = 39,
+   WLAN_STATUS_WAIT_TS_DELAY = 47,
+   WLAN_STATUS_NO_DIRECT_LINK = 48,
+   

[PATCH 2/6] d80211: create wifi.h to define WIFI OUIs

2006-12-13 Thread Zhu Yi
Replace hard coded WIFI OUIs and parse TSPEC information element.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 net/d80211/ieee80211_sta.c |   36 
 net/d80211/wifi.h  |   28 
 2 files changed, 60 insertions(+), 4 deletions(-)
 create mode 100644 net/d80211/wifi.h

d30f04a9e760702363bdad8aef47477762f6d06f
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 4985afe..cf11e88 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -27,6 +27,7 @@
 
 #include net/d80211.h
 #include net/d80211_mgmt.h
+#include wifi.h
 #include ieee80211_i.h
 #include ieee80211_rate.h
 #include hostapd_ioctl.h
@@ -97,6 +98,8 @@ struct ieee802_11_elems {
u8 wmm_info_len;
u8 *wmm_param;
u8 wmm_param_len;
+   u8 *tspec;
+   u8 tspec_len;
 };
 
 typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
@@ -165,17 +168,34 @@ static ParseRes ieee802_11_parse_elems(u
if (elen = 4  pos[0] == 0x00  pos[1] == 0x50 
pos[2] == 0xf2) {
/* Microsoft OUI (00:50:F2) */
-   if (pos[3] == 1) {
+   if (pos[3] == WIFI_OUI_TYPE_WPA) {
/* OUI Type 1 - WPA IE */
elems-wpa = pos;
elems-wpa_len = elen;
-   } else if (elen = 5  pos[3] == 2) {
-   if (pos[4] == 0) {
+   } else if (elen = 5 
+  pos[3] == WIFI_OUI_TYPE_WMM) {
+   switch (pos[4]) {
+   case WIFI_OUI_STYPE_WMM_INFO:
elems-wmm_info = pos;
elems-wmm_info_len = elen;
-   } else if (pos[4] == 1) {
+   break;
+   case WIFI_OUI_STYPE_WMM_PARAM:
elems-wmm_param = pos;
elems-wmm_param_len = elen;
+   break;
+   case WIFI_OUI_STYPE_WMM_TSPEC:
+   if (elen != 61) {
+   printk(KERN_ERR Wrong 
+  TSPEC size.\n);
+   break;
+   }
+   elems-tspec = pos + 6;
+   elems-tspec_len = elen - 6;
+   break;
+   default:
+   //printk(KERN_ERR Unsupported 
+   //   WiFi OUI %d\n, 
pos[4]);
+   break;
}
}
}
@@ -192,6 +212,14 @@ static ParseRes ieee802_11_parse_elems(u
elems-ext_supp_rates = pos;
elems-ext_supp_rates_len = elen;
break;
+   case WLAN_EID_TSPEC:
+   if (elen != 55) {
+   printk(KERN_ERR Wrong TSPEC size.\n);
+   break;
+   }
+   elems-tspec = pos;
+   elems-tspec_len = elen;
+   break;
default:
 #if 0
printk(KERN_DEBUG IEEE 802.11 element parse ignored 
diff --git a/net/d80211/wifi.h b/net/d80211/wifi.h
new file mode 100644
index 000..8ed1b63
--- /dev/null
+++ b/net/d80211/wifi.h
@@ -0,0 +1,28 @@
+/*
+ * This file defines Wi-Fi(r) OUIs for 80211.o
+ * Copyright 2006, Zhu Yi [EMAIL PROTECTED]  Intel Corp.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef D802_11_WIFI_H
+#define D802_11_WIFI_H
+
+/* WI-FI Alliance OUI Type and Subtype */
+enum wifi_oui_type {
+   WIFI_OUI_TYPE_WPA = 1,
+   WIFI_OUI_TYPE_WMM = 2,
+   WIFI_OUI_TYPE_WSC = 4,
+   WIFI_OUI_TYPE_PSD = 6,
+};
+
+enum wifi_oui_stype_wmm {
+   WIFI_OUI_STYPE_WMM_INFO = 0,
+   WIFI_OUI_STYPE_WMM_PARAM = 1,
+   WIFI_OUI_STYPE_WMM_TSPEC = 2,
+};
+
+
+#endif /* D802_11_WIFI_H */
-- 
1.2.6
-
To unsubscribe from this list: send the line unsubscribe 

[PATCH 3/6] d80211: fix classify_1d() priority selection

2006-12-13 Thread Zhu Yi
I don't see any reason why packets with DSCP=0x40 should have lower IEEE
802.1D priority than packets with DSCP=0x20. Spare  Background. No?

Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 net/d80211/wme.c |4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

e1765ea0d80ad86619300d3253e801883fd745a5
diff --git a/net/d80211/wme.c b/net/d80211/wme.c
index b9505dc..f26fe6c 100644
--- a/net/d80211/wme.c
+++ b/net/d80211/wme.c
@@ -131,9 +131,9 @@ static inline unsigned classify_1d(struc
dscp = ip-tos  0xfc;
switch (dscp) {
case 0x20:
-   return 2;
-   case 0x40:
return 1;
+   case 0x40:
+   return 2;
case 0x60:
return 3;
case 0x80:
-- 
1.2.6
-
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 4/6] d80211: add IEEE802.11e/WMM Traffic Stream (TS) Management support

2006-12-13 Thread Zhu Yi
The d80211 now maintains a sta_ts_data structure for every TSID and
direction combination of all the Taffic Streams. For those admission
control enabled Acesss Categories (AC), STA can initiatively request
a traffic stream. The stack also maintains two variables to record the
admitted time and used time for each TS. In every dot11EDCAAveragingPeriod,
a timer is used to track how much time (in usec) has been used (vs the
admitted time). If it finds the used time is less than the admitted time
in current dot11EDCAAveragingPeriod period, the STA will continue to
fulfil the admitted time in the next period. Otherwise the stack will
reduce the admitted time until the TS has been throttled. Finally both
the AP and STA are able to delete the TS by sending a DELTS MLME.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 net/d80211/ieee80211.c   |4 
 net/d80211/ieee80211_i.h |   49 -
 net/d80211/ieee80211_iface.c |5 +
 net/d80211/ieee80211_sta.c   |  403 ++
 net/d80211/wme.c |   34 +++-
 5 files changed, 480 insertions(+), 15 deletions(-)

d4a326b8493fb465480a68696315c05558c03b2c
diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index 6e10db5..4eba18f 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -4599,6 +4599,10 @@ int ieee80211_register_hw(struct ieee802
goto fail_wep;
}
 
+   /* Initialize QoS Params */
+   local-dot11EDCAAveragingPeriod = 5;
+   local-MPDUExchangeTime = 0;
+
/* TODO: add rtnl locking around device creation and qdisc install */
ieee80211_install_qdisc(local-mdev);
 
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index ef303da..e8929d3 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -56,6 +56,10 @@ struct ieee80211_local;
  * increased memory use (about 2 kB of RAM per entry). */
 #define IEEE80211_FRAGMENT_MAX 4
 
+/* Minimum and Maximum TSID used by EDCA. HCCA uses 0~7; EDCA uses 8~15 */
+#define EDCA_TSID_MIN 8
+#define EDCA_TSID_MAX 15
+
 struct ieee80211_fragment_entry {
unsigned long first_frag_time;
unsigned int seq;
@@ -241,6 +245,7 @@ struct ieee80211_if_sta {
IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED
} state;
struct work_struct work;
+   struct timer_list admit_timer; /* Recompute EDCA admitted time */
u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
u8 ssid[IEEE80211_MAX_SSID_LEN];
size_t ssid_len;
@@ -328,6 +333,19 @@ struct ieee80211_sub_if_data {
 
 #define IEEE80211_DEV_TO_SUB_IF(dev) netdev_priv(dev)
 
+struct sta_ts_data {
+   enum {
+   TS_STATUS_UNUSED= 0,
+   TS_STATUS_ACTIVE= 1,
+   TS_STATUS_INACTIVE  = 2,
+   TS_STATUS_THROTTLING= 3,
+   } status;
+   u8 dialog_token;
+   u8 up;
+   u32 admitted_time_usec;
+   u32 used_time_usec;
+};
+
 struct ieee80211_local {
/* embed the driver visible part.
 * don't cast (use the static inlines below), but we keep
@@ -449,18 +467,19 @@ struct ieee80211_local {
 #ifdef CONFIG_HOSTAPD_WPA_TESTING
u32 wpa_trigger;
 #endif /* CONFIG_HOSTAPD_WPA_TESTING */
-/* SNMP counters */
-/* dot11CountersTable */
-u32 dot11TransmittedFragmentCount;
-u32 dot11MulticastTransmittedFrameCount;
-u32 dot11FailedCount;
+   /* SNMP counters */
+   /* dot11CountersTable */
+   u32 dot11TransmittedFragmentCount;
+   u32 dot11MulticastTransmittedFrameCount;
+   u32 dot11FailedCount;
u32 dot11RetryCount;
u32 dot11MultipleRetryCount;
u32 dot11FrameDuplicateCount;
-u32 dot11ReceivedFragmentCount;
-u32 dot11MulticastReceivedFrameCount;
-u32 dot11TransmittedFrameCount;
-u32 dot11WEPUndecryptableCount;
+   u32 dot11ReceivedFragmentCount;
+   u32 dot11MulticastReceivedFrameCount;
+   u32 dot11TransmittedFrameCount;
+   u32 dot11WEPUndecryptableCount;
+   u32 dot11EDCAAveragingPeriod;
 
 #ifdef CONFIG_D80211_LEDS
int tx_led_counter, rx_led_counter;
@@ -533,6 +552,17 @@ struct ieee80211_local {
* (1  MODE_*) */
 
int user_space_mlme;
+
+   u32 MPDUExchangeTime;
+#define STA_TSID_NUM   16
+#define STA_TSDIR_NUM  2
+   /* HCCA: 0~7, EDCA: 8~15 */
+   struct sta_ts_data ts_data[STA_TSID_NUM][STA_TSDIR_NUM];
+};
+
+enum sta_link_direction {
+   STA_TS_UPLINK = 0,
+   STA_TS_DOWNLINK = 1,
 };
 
 static inline struct ieee80211_local *hw_to_local(
@@ -639,6 +669,7 @@ int ieee80211_set_compression(struct iee
 int ieee80211_init_client(struct net_device *dev);
 /* ieee80211_sta.c */
 void ieee80211_sta_work(void *ptr);
+void ieee80211_admit_refresh(unsigned long ptr);
 void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb,
   struct ieee80211_rx_status 

[PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-13 Thread Zhu Yi
The sysfs interface here is only a proof of concept. It provides a way for
the userspace applications to use the advanced QoS features supported by
d80211 stack. The finial solution should be switched to cfg80211.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 net/d80211/ieee80211_i.h |   13 ++
 net/d80211/ieee80211_sysfs.c |  245 ++
 2 files changed, 258 insertions(+), 0 deletions(-)

83d49f70af1f38c152d8bd3abd69756ec087622e
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index d09f65e..7904033 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -20,6 +20,7 @@
 #include linux/workqueue.h
 #include linux/types.h
 #include linux/spinlock.h
+#include net/d80211_mgmt.h
 #include ieee80211_key.h
 #include sta_info.h
 
@@ -329,6 +330,7 @@ struct ieee80211_sub_if_data {
 int channel_use_raw;
 
struct attribute_group *sysfs_group;
+   struct attribute_group *sysfs_qos_group;
 };
 
 #define IEEE80211_DEV_TO_SUB_IF(dev) netdev_priv(dev)
@@ -702,6 +704,17 @@ struct sta_info * ieee80211_ibss_add_sta
 u8 *addr);
 int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason);
 int ieee80211_sta_disassociate(struct net_device *dev, u16 reason);
+void ieee80211_send_addts(struct net_device *dev,
+ struct ieee802_11_elem_tspec *tspec);
+void wmm_send_addts(struct net_device *dev,
+   struct ieee802_11_elem_tspec *tspec);
+void ieee80211_send_delts(struct net_device *dev, u8 tsid, u8 direction,
+ u32 medium_time);
+void wmm_send_delts(struct net_device *dev, u8 tsid, u8 direction,
+   u32 medium_time);
+void ieee80211_send_dls_req(struct net_device *dev, struct dls_info *dls);
+void ieee80211_send_dls_teardown(struct net_device *dev, u8 *mac, u16 reason);
+void dls_info_add(struct ieee80211_local *local, struct dls_info *dls);
 void dls_info_stop(struct ieee80211_local *local);
 int dls_link_status(struct ieee80211_local *local, u8 *addr);
 
diff --git a/net/d80211/ieee80211_sysfs.c b/net/d80211/ieee80211_sysfs.c
index 6a60077..31dc1f4 100644
--- a/net/d80211/ieee80211_sysfs.c
+++ b/net/d80211/ieee80211_sysfs.c
@@ -13,6 +13,7 @@
 #include linux/netdevice.h
 #include linux/rtnetlink.h
 #include net/d80211.h
+#include net/d80211_mgmt.h
 #include ieee80211_i.h
 #include ieee80211_rate.h
 
@@ -21,6 +22,15 @@
 #define to_net_dev(class) \
container_of(class, struct net_device, class_dev)
 
+/* For sysfs and debug only */
+static struct ieee802_11_elem_tspec _tspec;
+static u8 _dls_mac[ETH_ALEN];
+
+#define TSID _tspec.ts_info.tsid
+#define TSDIR _tspec.ts_info.direction
+#define TSUP _tspec.ts_info.up
+
+
 static inline int rtnl_lock_local(struct ieee80211_local *local)
 {
rtnl_lock();
@@ -657,6 +667,230 @@ static struct class ieee80211_class = {
 #endif
 };
 
+
+/* QoS sysfs entries */
+static ssize_t show_ts_info(struct class_device *dev, char *buf)
+{
+   /* TSID, Direction, UP */
+   return sprintf(buf, %u %u %u\n, TSID, TSDIR, TSUP);
+}
+
+static ssize_t store_ts_info(struct class_device *dev, const char *buf,
+size_t len)
+{
+   unsigned int id, index, up;
+
+   if (sscanf(buf, %u, %u, %u, id, index, up) != 3) {
+   printk(KERN_ERR %s: sscanf error\n, __FUNCTION__);
+   return -EINVAL;
+   }
+   if (id  8 || id  15) {
+   printk(KERN_ERR invalid tsid %d\n, id);
+   return -EINVAL;
+   }
+   if ((index != 0)  (index != 1)  (index != 3)) {
+   printk(KERN_ERR invalid direction %d\n, index);
+   return -EINVAL;
+   }
+   if (up  0 || up  7) {
+   printk(KERN_ERR invalid UP %d\n, up);
+   return -EINVAL;
+   }
+   TSID = id;
+   TSDIR = index;
+   TSUP = up;
+   return len;
+}
+
+static CLASS_DEVICE_ATTR(ts_info, S_IWUSR|S_IRUGO, show_ts_info, 
store_ts_info);
+
+static ssize_t show_tspec(struct class_device *dev, char *buf)
+{
+   /* Nominal MSDU, Max MSDU, Min int, Max int, Inact int,
+* susp int, start, min rate, mean rate, peak rate,
+* max burst, delay, min phy, surp band, medium time */
+   return sprintf(buf,%hu %hu %u %u %u %u %u %u %u %u %u %u %u %hu %hu\n,
+  _tspec.nominal_msdu_size,
+  _tspec.max_msdu_size,
+  _tspec.min_service_interval,
+  _tspec.max_service_interval,
+  _tspec.inactivity_interval,
+  _tspec.suspension_interval,
+  _tspec.service_start_time,
+  _tspec.min_data_rate,
+  _tspec.mean_data_rate,
+  _tspec.peak_data_rate,
+  _tspec.burst_size,
+  _tspec.delay_bound,
+  _tspec.min_phy_rate,
+   

Re: [PATCH 1/6] d80211: add IEEE802.11e/WMM MLMEs, Status Code and Reason Code

2006-12-13 Thread Michael Wu
On Wednesday 13 December 2006 23:02, Zhu Yi wrote:
 Signed-off-by: Zhu Yi [EMAIL PROTECTED]

You should probably have more in the description..

 ---

  include/net/d80211_mgmt.h |  148
 + 1 files changed, 148
 insertions(+), 0 deletions(-)

d80211_mgmt.h was recently merged into include/linux/ieee80211.h.

 d83f6236e756f5f0bb1484d99188f06704de
 diff --git a/include/net/d80211_mgmt.h b/include/net/d80211_mgmt.h
 index 87141d4..450c0a2 100644
 --- a/include/net/d80211_mgmt.h
 +++ b/include/net/d80211_mgmt.h
 @@ -14,6 +14,39 @@

  #include linux/types.h

 +struct ieee802_11_ts_info {
 + __le16 traffic_type:1;
 + __le16 tsid:4;
 + __le16 direction:2;
 + __le16 access_policy:2;
 + __le16 aggregation:1;
 + __le16 apsd:1;
 + __le16 up:3;
 + __le16 ack_policy:2;
 + u8 schedule:1;
 + u8 reserved:7;
 +} __attribute__ ((packed));
 +
Mind eliminating the bitfields?

-Michael Wu


pgp8Ba7jizphp.pgp
Description: PGP signature


Re: [PATCH 1/6] d80211: add IEEE802.11e/WMM MLMEs, Status Code and Reason Code

2006-12-13 Thread Zhu Yi
On Wed, 2006-12-13 at 23:38 -0500, Michael Wu wrote:
 On Wednesday 13 December 2006 23:02, Zhu Yi wrote:
  Signed-off-by: Zhu Yi [EMAIL PROTECTED]
 
 You should probably have more in the description..
 
  ---
 
   include/net/d80211_mgmt.h |  148
  + 1 files changed, 148
  insertions(+), 0 deletions(-)
 
 d80211_mgmt.h was recently merged into include/linux/ieee80211.h.
 
  d83f6236e756f5f0bb1484d99188f06704de
  diff --git a/include/net/d80211_mgmt.h b/include/net/d80211_mgmt.h
  index 87141d4..450c0a2 100644
  --- a/include/net/d80211_mgmt.h
  +++ b/include/net/d80211_mgmt.h
  @@ -14,6 +14,39 @@
 
   #include linux/types.h
 
  +struct ieee802_11_ts_info {
  +   __le16 traffic_type:1;
  +   __le16 tsid:4;
  +   __le16 direction:2;
  +   __le16 access_policy:2;
  +   __le16 aggregation:1;
  +   __le16 apsd:1;
  +   __le16 up:3;
  +   __le16 ack_policy:2;
  +   u8 schedule:1;
  +   u8 reserved:7;
  +} __attribute__ ((packed));
  +
 Mind eliminating the bitfields?

Yeah, I thought of it. But if it is defined something like below

struct ieee802_11_ts_info {
short field;
byte another_field;
} ts_info;

Then,

up = (ts_info.field1  0x3800)  11;
schedule = (ts_info.another_field  0x01);

So if I want to use schedule, I need to know more details (i.e. which
field it belongs to). Are these efficient?

Thanks,
-yi
-
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 3/3] d80211: fix workqueue breakage

2006-12-13 Thread Michael Wu
On Wednesday 13 December 2006 13:13, Jiri Benc wrote:
 On Tue, 12 Dec 2006 12:55:53 -0500, Michael Wu wrote:
  -   schedule_work(local-scan_work);
  +   schedule_work(local-scan_work.work);

 Hm, what is the preferred way here:
 schedule_work(some_delayed_work.work)
 or
 schedule_delayed_work(some_delayed_work, 0)?

Hm, according to David Howells, the second is preferred. I'll update the 
workqueue patch tomorrow.

Thanks,
-Michael Wu


pgp62V3GTJslg.pgp
Description: PGP signature


Re: [PATCH 2/14] Spidernet add net_ratelimit to suppress long output

2006-12-13 Thread Jim Lewis

 It is in the LTC Bugzilla. I just checked and it is still there :)

Jim


On Thu, 2006-12-14 at 10:31 +1100, Michael Ellerman wrote:
 On Wed, 2006-12-13 at 15:08 -0600, Linas Vepstas wrote:
  This patch adds net_ratelimit to many of the printks in order to
  limit extraneous warning messages (created in response to Bug 28554).
 
 Bug 28554 in which bug tracking system? I can't find it in LTC or
 kernel.org bugzilla.
 
 cheers
 

-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Thomas Graf
* Adrian Bunk [EMAIL PROTECTED] 2006-12-13 14:40
 Additionally:
 - it works for me (but my e100 is always initialized before loop)
 - I didn't spot any obvious interdependency with the other Space.c
   drivers
 
 It could be I missed anything, but I don't see any better way to verify 
 this than getting the patch into the next -mm and wait whether someone 
 will scream...

The loopback was traditionally on ifindex 1, some userspace applications
even relied on it but that is no longer true. I think this is safe.
-
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


drivers/net/netxen/: usage of uninitialized variables

2006-12-13 Thread Adrian Bunk
The Coverity checker spotted the following places where variables are 
being used uninitialized:


drivers/net/netxen/netxen_nic_ethtool.c:

--  snip  --

...
static u32 netxen_nic_get_link(struct net_device *dev)
{
struct netxen_port *port = netdev_priv(dev);
struct netxen_adapter *adapter = port-adapter;
__le32 status;

/* read which mode */
if (adapter-ahw.board_type == NETXEN_NIC_GBE) {
if (adapter-phy_read
 adapter-phy_read(adapter, port-portnum,
 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
 status) != 0)
return -EIO;
else
return (netxen_get_phy_link(status));
...

--  snip  --

status is not initiazlized if !adapter-phy_read.


drivers/net/netxen/netxen_nic_ethtool.c:

--  snip  --

...
static int
netxen_nic_set_settings(struct net_device *dev, struct ethtool_cmd 
*ecmd)
{
struct netxen_port *port = netdev_priv(dev);
struct netxen_adapter *adapter = port-adapter;
__le32 status;

/* read which mode */
if (adapter-ahw.board_type == NETXEN_NIC_GBE) {
/* autonegotiation */
if (adapter-phy_write
 adapter-phy_write(adapter, port-portnum,
  NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
  (__le32) ecmd-autoneg) != 0)
return -EIO;
else
port-link_autoneg = ecmd-autoneg;

if (adapter-phy_read
 adapter-phy_read(adapter, port-portnum,
 NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS,
 status) != 0)
return -EIO;

/* speed */
switch (ecmd-speed) {
case SPEED_10:
netxen_set_phy_speed(status, 0);
break;
case SPEED_100:
netxen_set_phy_speed(status, 1);
break;
case SPEED_1000:
netxen_set_phy_speed(status, 2);
break;
}
...

--  snip  --

status is not initiazlized if !adapter-phy_read.


drivers/net/netxen/netxen_nic_isr.c:

--  snip  --

void netxen_handle_port_int(struct netxen_adapter *adapter, u32 portno,
u32 enable)
{
__le32 int_src;
struct netxen_port *port;

/*  This should clear the interrupt source */
if (adapter-phy_read)
adapter-phy_read(adapter, portno,
  NETXEN_NIU_GB_MII_MGMT_ADDR_INT_STATUS,
  int_src);
if (int_src == 0) {
DPRINTK(INFO, No phy interrupts for port #%d\n, portno);
return;
}
...

--  snip  --

int_src is not initiazlized if !adapter-phy_read.


cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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


drivers/net/netxen/netxen_nic_hw.c: stack usage problem

2006-12-13 Thread Adrian Bunk
--  snip  --

...
void netxen_nic_flash_print(struct netxen_adapter *adapter)
{
...
struct netxen_new_user_info user_info;
...

--  snip  --


This allocates 2108 bytes on the stack.

That's too much considering that the complete stack might be only 4 kB.


cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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.19-git19] BUG due to bad argument to ieee80211softmac_assoc_work

2006-12-13 Thread Michael Bommarito

This didn't get much attention on bugzilla and I figured it was
important enough to forward along to the whole list since it's been
lingering around in ieee80211-softmac since 19-git5 at least.
http://bugzilla.kernel.org/show_bug.cgi?id=7657

Somebody was passing the whole mac device structure to
ieee80211softmac_assoc_work instead of just the assocation work, which
lead to much death and locking.

Attached is a patch that fixes this (the actual change is two lines
but context provided in patch for review).  The dmesg containing call
trace is attached to the bugzilla entry above.

-Mike
-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Stephen Hemminger
On Tue, 12 Dec 2006 17:17:56 -0800 (PST)
David Miller [EMAIL PROTECTED] wrote:

 From: Adrian Bunk [EMAIL PROTECTED]
 Date: Tue, 12 Dec 2006 17:24:35 +0100
 
  This patch converts drivers/net/loopback.c to using module_init().
  
  Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 
 I'm not %100 sure of this one, let's look at the comment you
 are deleting:
 
  -/*
  - * The loopback device is global so it can be directly referenced
  - * by the network code. Also, it must be first on device list.
  - */
  -extern int loopback_init(void);
  -
 
 in particular notice the part that says it must be first on the
 device list.
 
 I'm not sure whether that is important any longer.  It probably isn't,
 but we should verify it before applying such a patch.
 
 Since module_init() effectively == device_initcall() for statically
 built objects, which loopback always is, the Makefile ordering does
 not seem to indicate to me that there is anything guarenteeing
 this first on the list invariant.  At least not via object
 file ordering.
 
 So this gives some support to the idea that loopback_dev's position
 on the device list no longer matters.

The dst code makes assumptions that loopback is ifindex 1 as well.
NAK on Adrian's change, it doesn't buy anything
-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Adrian Bunk
On Wed, Dec 13, 2006 at 11:08:01AM -0800, Stephen Hemminger wrote:
 On Tue, 12 Dec 2006 17:17:56 -0800 (PST)
 David Miller [EMAIL PROTECTED] wrote:
 
  From: Adrian Bunk [EMAIL PROTECTED]
  Date: Tue, 12 Dec 2006 17:24:35 +0100
  
   This patch converts drivers/net/loopback.c to using module_init().
   
   Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
  
  I'm not %100 sure of this one, let's look at the comment you
  are deleting:
  
   -/*
   - *   The loopback device is global so it can be directly referenced
   - *   by the network code. Also, it must be first on device list.
   - */
   -extern int loopback_init(void);
   -
  
  in particular notice the part that says it must be first on the
  device list.
  
  I'm not sure whether that is important any longer.  It probably isn't,
  but we should verify it before applying such a patch.
  
  Since module_init() effectively == device_initcall() for statically
  built objects, which loopback always is, the Makefile ordering does
  not seem to indicate to me that there is anything guarenteeing
  this first on the list invariant.  At least not via object
  file ordering.
  
  So this gives some support to the idea that loopback_dev's position
  on the device list no longer matters.
 
 The dst code makes assumptions that loopback is ifindex 1 as well.
...

But that assumption is already false for drivers not handled by Space.c:

E.g. on my computer [1], eth0 [2] has ifindex 1 and lo has ifindex 2.

cu
Adrian

[1] plain 2.6.16.36
[2] built-in e100 driver

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Al Viro
On Tue, Dec 12, 2006 at 05:17:56PM -0800, David Miller wrote:
 From: Adrian Bunk [EMAIL PROTECTED]
 Date: Tue, 12 Dec 2006 17:24:35 +0100
 
  This patch converts drivers/net/loopback.c to using module_init().
  
  Signed-off-by: Adrian Bunk [EMAIL PROTECTED]
 
 I'm not %100 sure of this one, let's look at the comment you
 are deleting:
 
  -/*
  - * The loopback device is global so it can be directly referenced
  - * by the network code. Also, it must be first on device list.
  - */
  -extern int loopback_init(void);
  -
 
 in particular notice the part that says it must be first on the
 device list.
 
 I'm not sure whether that is important any longer.  It probably isn't,
 but we should verify it before applying such a patch.

There might be practical considerations along the lines of we want
lookups for loopback to be fast...
-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Thomas Graf
* Al Viro [EMAIL PROTECTED] 2006-12-13 20:12
 On Tue, Dec 12, 2006 at 05:17:56PM -0800, David Miller wrote:
  I'm not sure whether that is important any longer.  It probably isn't,
  but we should verify it before applying such a patch.
 
 There might be practical considerations along the lines of we want
 lookups for loopback to be fast...

What is this discussion actually about? Since we started registering
devices directly hooked into the init process before device_initcall()
the order is random. Even the bonding device is registered before the
loopback.
-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Thomas Graf
* Adrian Bunk [EMAIL PROTECTED] 2006-12-14 00:12
 On Wed, Dec 13, 2006 at 03:01:43PM -0800, Stephen Hemminger wrote:
  Loopback should be there before protocols are started. It makes sense
  to have a standard startup order.
 
 This actually becomes easier after my patch:
 
 Now that it's untangled from net_olddevs_init(), you can simply change 
 the module_init(loopback_init) to a different initcall level.

Not really, the device management inits as subsys, the ip layer hooks
into fs_initcall() which comes right after. The loopback was actually
registered after the protocol so far. I think Adrian's patch is fine
if the module_init() is changed to device_initcall().
-
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: [2.6 patch] drivers/net/loopback.c: convert to module_init()

2006-12-13 Thread Adrian Bunk
On Thu, Dec 14, 2006 at 12:18:48AM +0100, Thomas Graf wrote:
 * Adrian Bunk [EMAIL PROTECTED] 2006-12-14 00:12
  On Wed, Dec 13, 2006 at 03:01:43PM -0800, Stephen Hemminger wrote:
   Loopback should be there before protocols are started. It makes sense
   to have a standard startup order.
  
  This actually becomes easier after my patch:
  
  Now that it's untangled from net_olddevs_init(), you can simply change 
  the module_init(loopback_init) to a different initcall level.
 
 Not really, the device management inits as subsys, the ip layer hooks
 into fs_initcall() which comes right after. The loopback was actually
 registered after the protocol so far. I think Adrian's patch is fine
 if the module_init() is changed to device_initcall().

It doesn't matter (and I don't care) since for the non-modular case 
(that always applies for loopback), there's:
  #define __initcall(fn) device_initcall(fn)
  #define module_init(x)  __initcall(x);

cu
Adrian

-- 

   Is there not promise of rain? Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   Only a promise, Lao Er said.
   Pearl S. Buck - Dragon Seed

-
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


  1   2   >