Re: [Madwifi-devel] d80211: ANNOUNCE: DadWifi, a port of MadWifi to d80211
On Tue, 2006-10-17 at 21:55 -0700, Stephen Hemminger wrote: On Tue, 2006-10-17 at 18:51 -0700, Stephen Hemminger wrote: I would consider this a BAD thing. You are creating a derived work out of GPL and non-GPL software. This actually will hurt the possible acceptance of the d80211 stack into the mainline kernel. On the contrary, I think this effort with spur interest in d80211, Atheros hardware and stimulate development of OpenHAL. It will also put additional pressure on Atheros to open HAL sources. HAL's are bad as well. You want a real driver, not one that has multiple layers of indirection. I think dissolving HAL once its open is much easier than porting the driver from one 802.11 stack to another. The former is just a matter of moving functions around, making some of them inline, renaming constants, fixing some ugly code. It's a set of simple operations, each of which keeps the driver functional. If anything breaks, it's easy to track back to the minor change that broke it. Porting to another 802.11 stack is a quantum leap that can only be done in one step and that could break lots of things at once. It could also reveal limitations of the new stack that need to be fixed. It's so commendable that somebody is trying to do the hardest part. The technical ability of d80211 to handle a popular chipset would hardly undermine its chances to be included into the kernel. It takes more that one step to achieve free in-kernel support for Atheros chipsets. DadWifi may be one of those steps, OpenHAL or open-sourcing the Atheros HAL would be the other. If Atheros does open source their existing driver. Someone will need to do a new driver that gets rid of the HAL layer. Yes, but this can be evolutionary. Some code from HAL could actually migrate into the kernel or to a userspace utility. We still want country-specific limitations, at least by default, so that users don't break local regulations unknowingly. And even if the complete rewrite is needed, d80211 will be prepared to deal with Atheros cards, because the responsibilities of the firmware and the host software won't change. Should d80211 be merged with the existing 802.11 stack in the kernel, users of DadWifi would be among the testers, and they will ensure that useful features of d80211 are not lost. As a test or transition vehicle it is a DadWifi is good, but hopefully it won't slow the progress to a real open source solution I think it may speed things up. Once the kernel integration is in sight, OpenHAL developers would have a stronger motivation to produce a working and copyright-clean product. Unless I'm missing something obvious, I don't see absolutely anything that could harm the chances of d80211 to make it to the mainline kernel. Christoph et. all will insist that everything be EXPORT_SYMBOL_GPL. That shouldn't be an issue at all. HAL does not and can not call any Linux functions directly. It can only communicate to the kernel through a wrapper that will be under GPL. Note that it's not circumvention of EXPORT_SYMBOL_GPL. It's a direct consequence of the fact that HAL is indeed not derived from Linux. -- Regards, Pavel Roskin - 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: Suppress / delay SYN-ACK
On Tuesday, October 17, 2006 2:54 PM, Eric Dumazet wrote: Well, did you solve Lennert problem if the final (third packet of three packet TCP establishment handshake) packet is missing ? It seems no timer will fire and tell you the socket is not usable... Sorry, but I don't know what you exactly mean with this problem. On my first short tests, when I send the SYN-ACK with the ioctl and don't get an ACK, the first read on the socket returns -1. So I can see that the connection is not established and usable. Martin - 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] [NET] reduce sizeof(struct flow)
From: Eric Dumazet [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 07:42:17 +0200 How many people are using DECNET and want to pay the price of this 20 bytes dnports structure ? I bet you could make that cost get hidden by careful rearrangement of the struct flow, or adjustment of the implementation. BTW, I see assignments to these fields, and as a specific example uli_u.dnports.objnamel but no use of it. Perhaps much of dnports can even be deleted outright. :-) - 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] Changeset of Camellia cipher algorithm.
Hi, This set of the patches enables to use of the Camellia cipher algorithm for the ESP encryption. Git tree is also available on camellia20061017 branch at: git://git.skbuff.net/gitroot/takamiya/camellia20061017 The following patches are available for the top of davem's net-2.6 and herbert's cryptodev-2.6 trees. Thank you. HEADLINES - [PATCH 1/6] [CRYPTO] added Kconfig entry for Camellia. [PATCH 2/6] [CRYPTO] added the code of Camellia cipher algorithm. [PATCH 3/6] [CRYPTO] added the testing code of Camellia cipher algorithm. [PATCH 4/6] [IPSEC] added the definition of Camellia cipher algorithm. [PATCH 5/6] [IPSEC] added the entry of Camellia cipher algorithm to ealg_list[]. [PATCH 6/6] [CRYPTO] added the developer of Camellia cipher algorithm. DIFFSTAT Documentation/crypto/api-intro.txt |5 crypto/Kconfig | 15 crypto/Makefile|1 crypto/camellia.c | 1802 - crypto/tcrypt.c| 43 crypto/tcrypt.h| 166 +++ include/linux/pfkeyv2.h|2 net/xfrm/xfrm_algo.c | 18 8 files changed, 2045 insertions(+), 7 deletions(-) CHANGESETS -- commit 80a5df8127311212e99bd64103771de19c5908dd Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:51:40 2006 +0900 [CRYPTO] added the developer of Camellia cipher algorithm. This patch adds the developer of Camellia cipher algorithm. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] commit 2253254f5a802c1cc8a5fc367fae911172f28846 Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:47:32 2006 +0900 [IPSEC] added the entry of Camellia cipher algorithm to ealg_list[]. This patch adds the entry of Camellia cipher algorithm to ealg_list[]. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] commit 1b6712cdb8fd31482d7e7da56e5f602357ec4aa4 Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:45:24 2006 +0900 [IPSEC] added the definition of Camellia cipher algorithm. This patch adds the definitions used by pfkeyv2 interface for Camellia cipher algorithm. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] commit e86050d8fbd04b1ace9c121ce90799c8210925be Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:43:14 2006 +0900 [CRYPTO] added the testing code of Camellia cipher algorithm. This patch adds the code of Camellia code for testing module. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] commit db41e54cb7081b4cd034378f17b8f8225586e2e2 Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:34:15 2006 +0900 [CRYPTO] added the code of Camellia cipher algorithm. This patch adds the main code of Camellia cipher algorithm. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] commit 01b0c3898fdf1cb4da8cdf5577e58328ecb11e4e Author: Noriaki TAKAMIYA [EMAIL PROTECTED] Date: Tue Oct 17 01:31:35 2006 +0900 [CRYPTO] added Kconfig entry for Camellia. This patch adds the Kconfig entry for Camellia. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] -- Noriaki TAKAMIYA - 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] [IPSEC] added the definition of Camellia cipher algorithm.
This patch adds the definitions used by pfkeyv2 interface for Camellia cipher algorithm. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] --- include/linux/pfkeyv2.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) 1b6712cdb8fd31482d7e7da56e5f602357ec4aa4 diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index d5dd471..b16e474 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h @@ -296,6 +296,7 @@ #define SADB_X_EALG_CASTCBC 6 #define SADB_X_EALG_BLOWFISHCBC7 #define SADB_EALG_NULL 11 #define SADB_X_EALG_AESCBC 12 +#define SADB_X_EALG_CAMELLIACBC22 #define SADB_EALG_MAX 253 /* last EALG */ /* private allocations should use 249-255 (RFC2407) */ #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ -- Noriaki TAKAMIYA - 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] [CRYPTO] added Kconfig entry for Camellia.
Hi, This patch adds the Kconfig entry for Camellia. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] --- crypto/Kconfig | 14 ++ 1 files changed, 14 insertions(+), 0 deletions(-) 01b0c3898fdf1cb4da8cdf5577e58328ecb11e4e diff --git a/crypto/Kconfig b/crypto/Kconfig index cbae839..19858ee 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig @@ -424,6 +424,20 @@ config CRYPTO_CRC32C See Castagnoli93. This implementation uses lib/libcrc32c. Module will be crc32c. +config CRYPTO_CAMELLIA + tristate Camellia cipher algorithms + depends on CRYPTO + help + Camellia cipher algorithms module. + +Camellia is a symmetric key block cipher developed jointly +at NTT and Mitsubishi Electric Corporation. + +The Camellia specifies three key sizes: 128, 192 and 256 bits + +See also: +https://info.isl.ntt.co.jp/crypt/eng/camellia/index_s.html + config CRYPTO_TEST tristate Testing module depends on m -- Noriaki TAKAMIYA - 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/6] [CRYPTO] added the developer of Camellia cipher algorithm.
This patch adds the developer of Camellia cipher algorithm. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] --- Documentation/crypto/api-intro.txt |4 1 files changed, 4 insertions(+), 0 deletions(-) 80a5df8127311212e99bd64103771de19c5908dd diff --git a/Documentation/crypto/api-intro.txt b/Documentation/crypto/api-intro.txt index 5a03a28..e41a79a 100644 --- a/Documentation/crypto/api-intro.txt +++ b/Documentation/crypto/api-intro.txt @@ -193,6 +193,7 @@ Original developers of the crypto algori Kartikey Mahendra Bhatt (CAST6) Jon Oberheide (ARC4) Jouni Malinen (Michael MIC) + NTT(Nippon Telegraph and Telephone Corporation) (Camellia) SHA1 algorithm contributors: Jean-Francois Dive @@ -246,6 +247,9 @@ Tiger algorithm contributors: VIA PadLock contributors: Michal Ludvig +Camellia algorithm contributors: + NTT(Nippon Telegraph and Telephone Corporation) (Camellia) + Generic scatterwalk code by Adam J. Richter [EMAIL PROTECTED] Please send any credits updates or corrections to: -- Noriaki TAKAMIYA - 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/6] [CRYPTO] added the testing code of Camellia cipher algorithm.
This patch adds the code of Camellia code for testing module. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] --- crypto/tcrypt.c | 43 ++ crypto/tcrypt.h | 165 +++ 2 files changed, 207 insertions(+), 1 deletions(-) e86050d8fbd04b1ace9c121ce90799c8210925be diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index b48d011..a9976a0 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c @@ -71,7 +71,8 @@ static char *check[] = { des, md5, des3_ede, rot13, sha1, sha256, blowfish, twofish, serpent, sha384, sha512, md4, aes, cast6, arc4, michael_mic, deflate, crc32c, tea, xtea, - khazad, wp512, wp384, wp256, tnepres, xeta, NULL + khazad, wp512, wp384, wp256, tnepres, xeta, camellia, + NULL }; static void hexdump(unsigned char *buf, unsigned int len) @@ -960,6 +961,20 @@ static void do_test(void) test_cipher(ecb(xeta), DECRYPT, xeta_dec_tv_template, XETA_DEC_TEST_VECTORS); + //CAMELLIA + test_cipher (ecb(camellia), ENCRYPT, +camellia_enc_tv_template, +CAMELLIA_ENC_TEST_VECTORS); + test_cipher (ecb(camellia), DECRYPT, +camellia_dec_tv_template, +CAMELLIA_DEC_TEST_VECTORS); + test_cipher (cbc(camellia), ENCRYPT, +camellia_cbc_enc_tv_template, +CAMELLIA_CBC_ENC_TEST_VECTORS); + test_cipher (cbc(camellia), DECRYPT, +camellia_cbc_dec_tv_template, +CAMELLIA_CBC_DEC_TEST_VECTORS); + test_hash(sha384, sha384_tv_template, SHA384_TEST_VECTORS); test_hash(sha512, sha512_tv_template, SHA512_TEST_VECTORS); test_hash(wp512, wp512_tv_template, WP512_TEST_VECTORS); @@ -1166,6 +1181,21 @@ static void do_test(void) XETA_DEC_TEST_VECTORS); break; + case 31: + test_cipher (ecb(camellia), ENCRYPT, +camellia_enc_tv_template, +CAMELLIA_ENC_TEST_VECTORS); + test_cipher (ecb(camellia), DECRYPT, +camellia_dec_tv_template, +CAMELLIA_DEC_TEST_VECTORS); + test_cipher (cbc(camellia), ENCRYPT, +camellia_cbc_enc_tv_template, +CAMELLIA_CBC_ENC_TEST_VECTORS); + test_cipher (cbc(camellia), DECRYPT, +camellia_cbc_dec_tv_template, +CAMELLIA_CBC_DEC_TEST_VECTORS); + break; + case 100: test_hash(hmac(md5), hmac_md5_tv_template, HMAC_MD5_TEST_VECTORS); @@ -1245,6 +1275,17 @@ static void do_test(void) des_speed_template); break; + case 205: + test_cipher_speed(ecb(camellia), ENCRYPT, sec, NULL, 0, + camellia_speed_template); + test_cipher_speed(ecb(camellia), DECRYPT, sec, NULL, 0, + camellia_speed_template); + test_cipher_speed(cbc(camellia), ENCRYPT, sec, NULL, 0, + camellia_speed_template); + test_cipher_speed(cbc(camellia), DECRYPT, sec, NULL, 0, + camellia_speed_template); + break; + case 300: /* fall through */ diff --git a/crypto/tcrypt.h b/crypto/tcrypt.h index a40c441..3c7d46f 100644 --- a/crypto/tcrypt.h +++ b/crypto/tcrypt.h @@ -2744,6 +2744,150 @@ static struct cipher_testvec xeta_dec_tv }; /* + * CAMELLIA test vectors. + */ +#define CAMELLIA_ENC_TEST_VECTORS 3 +#define CAMELLIA_DEC_TEST_VECTORS 3 +#define CAMELLIA_CBC_ENC_TEST_VECTORS 2 +#define CAMELLIA_CBC_DEC_TEST_VECTORS 2 + +static struct cipher_testvec camellia_enc_tv_template[] = { + { + .key= { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + .klen = 16, + .input = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 }, + .ilen = 16, + .result = { 0x67, 0x67, 0x31, 0x38, 0x54, 0x96, 0x69, 0x73, + 0x08, 0x57, 0x06, 0x56, 0x48, 0xea, 0xbe, 0x43 }, + .rlen = 16, + }, { + .key= { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, + 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10, + 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77 }, + .klen = 24, + .input = {
[PATCH 5/6] [IPSEC] added the entry of Camellia cipher algorithm to ealg_list[].
This patch adds the entry of Camellia cipher algorithm to ealg_list[]. Signed-off-by: Noriaki TAKAMIYA [EMAIL PROTECTED] --- net/xfrm/xfrm_algo.c | 17 + 1 files changed, 17 insertions(+), 0 deletions(-) 2253254f5a802c1cc8a5fc367fae911172f28846 diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c index 5a0dbeb..583292d 100644 --- a/net/xfrm/xfrm_algo.c +++ b/net/xfrm/xfrm_algo.c @@ -249,6 +249,23 @@ static struct xfrm_algo_desc ealg_list[] } }, { + .name = cbc(camellia), +.compat = camellia, + + .uinfo = { + .encr = { + .blockbits = 128, + .defkeybits = 128, + } + }, + .desc = { + .sadb_alg_id = SADB_X_EALG_CAMELLIACBC, + .sadb_alg_ivlen = 8, + .sadb_alg_minbits = 128, + .sadb_alg_maxbits = 256 + } +}, +{ .name = cbc(twofish), .compat = twofish, -- Noriaki TAKAMIYA - 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] [NET] inet_peer : group together avl_left, avl_right, v4daddr to speedup lookups on some CPUS
Hi David Lot of routers still use CPUS with 32 bytes cache lines. (Intel PIII) It make sense to make sure fields used at lookup time are in the same cache line, to reduce cache footprint and speedup lookups. Signed-off-by: Eric Dumazet [EMAIL PROTECTED] --- linux/include/net/inetpeer.h2006-10-18 09:30:12.0 +0200 +++ linux-ed/include/net/inetpeer.h 2006-10-18 09:32:17.0 +0200 @@ -17,14 +17,15 @@ struct inet_peer { + /* group together avl_left,avl_right,v4daddr to speedup lookups */ struct inet_peer*avl_left, *avl_right; + __u32 v4daddr;/* peer's address */ + __u16 avl_height; + __u16 ip_id_count;/* IP ID for the next packet */ struct inet_peer*unused_next, **unused_prevp; __u32 dtime; /* the time of last use of not * referenced entries */ atomic_trefcnt; - __u32 v4daddr;/* peer's address */ - __u16 avl_height; - __u16 ip_id_count;/* IP ID for the next packet */ atomic_trid;/* Frag reception counter */ __u32 tcp_ts; unsigned long tcp_ts_stamp;
Re: [PATCH 0/14] TIPC updates
On Mon, 16 Oct 2006, David Miller wrote: From: Per Liden [EMAIL PROTECTED] Date: Fri, 13 Oct 2006 13:37:23 +0200 (CEST) This patch set includes a number TIPC fixes/cleanups. Please see each individual patch for further description. Please pull from: git://tipc.cslab.ericsson.net/pub/git/tipc.git (rebased on linux/kernel/git/davem/net-2.6.git) I applied everything except patch 8/14, you really need to add proper SKB queue locking to handle that race. I think the performance cost of taking that lock is much overstated, you should never have contention on that lock at all. Ok, we'll take your advice on this. Secondly, I never pull from your trees because I still have to make many fixups to your patches: 1) Please add a proper colon to your changeset header lines, it should be [TIPC]: , not [TIPC] . 2) Please check for trailing whitespace added by your patches. I've given you the command you can use in another email to check this for yourselve before submission. 3) Please get full proper signed-off-by lines from patch submitters, especially when the patch is more than a trivial 1 or 2 liner. Thanks a lot for the feedback. We'll do our best to assure that we follow these rules in the future. /Per - 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] [NET] reduce sizeof(struct flow)
Hi, On Tue, Oct 17, 2006 at 11:53:36PM -0700, David Miller wrote: From: Eric Dumazet [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 07:42:17 +0200 How many people are using DECNET and want to pay the price of this 20 bytes dnports structure ? Point taken :-) Eric, you also need to add a || defined(CONFIG_DECNET_MODULE) I think in your patch, if you want to make this optional. I bet you could make that cost get hidden by careful rearrangement of the struct flow, or adjustment of the implementation. BTW, I see assignments to these fields, and as a specific example uli_u.dnports.objnamel but no use of it. Perhaps much of dnports can even be deleted outright. :-) - Its not used at the moment[*], but would be required for any kind of flow tracking. The objnum field, could be folded into the objname field I guess on the basis that objnamel == 0 means objname[0] represents the objnum, but that doesn't really buy much. Looking at the rearrangement option, and the relative lengths of ipv6 and DECnet node addresses, dn_u is a lot smaller than ip6_u and thus the obj[num|name|namel] fields could be moved into that structure. Even after doing this, dn_u would still be shorter than ip6_u, although 12 bytes longer than ip4_u (if my counting is correct). Is that an acceptable solution? [*] By which I mean, as you've already alluded to, that its set up correctly but not currently read/tested by anything yet. Steve. - 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
[DECNET] Fix input routing bug
This patch fixes a silly bug that has been in the input routing code for some time. It results in trying to send to a node directly when the origin of the packet is via the default router. Its been tested by Alan Kemmerer [EMAIL PROTECTED] who reported the bug and its a fairly obvious fix for a typo. Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] Signed-off-by: Patrick Caulfield [EMAIL PROTECTED] Cc: Alan Kemmerer [EMAIL PROTECTED] diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c index dd0761e..810ab9c 100644 --- a/net/decnet/dn_route.c +++ b/net/decnet/dn_route.c @@ -1270,7 +1270,6 @@ #endif goto e_inval; res.type = RTN_LOCAL; - flags |= RTCF_DIRECTSRC; } else { __le16 src_map = fl.fld_src; free_res = 1; @@ -1341,7 +1340,7 @@ #endif goto make_route; /* Packet was intra-ethernet, so we know its on-link */ - if (cb-rt_flags | DN_RT_F_IE) { + if (cb-rt_flags DN_RT_F_IE) { gateway = cb-src; flags |= RTCF_DIRECTSRC; goto make_route; - 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] [NET] reduce sizeof(struct flow)
On Wednesday 18 October 2006 10:20, Steven Whitehouse wrote: Hi, On Tue, Oct 17, 2006 at 11:53:36PM -0700, David Miller wrote: From: Eric Dumazet [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 07:42:17 +0200 How many people are using DECNET and want to pay the price of this 20 bytes dnports structure ? Point taken :-) Eric, you also need to add a || defined(CONFIG_DECNET_MODULE) I think in your patch, if you want to make this optional. Yes, thank you :) I bet you could make that cost get hidden by careful rearrangement of the struct flow, or adjustment of the implementation. BTW, I see assignments to these fields, and as a specific example uli_u.dnports.objnamel but no use of it. Perhaps much of dnports can even be deleted outright. :-) - Its not used at the moment[*], but would be required for any kind of flow tracking. The objnum field, could be folded into the objname field I guess on the basis that objnamel == 0 means objname[0] represents the objnum, but that doesn't really buy much. Well, as I privately said to David, objnamel is used, at least on 2.6.18 tree ( net/decnet/dn_route.c function compare_keys() memcmp() will read this field and check before comparing objname[] So it is set by dn_sk_ports_copy(), and used by compare_keys() Looking at the rearrangement option, and the relative lengths of ipv6 and DECnet node addresses, dn_u is a lot smaller than ip6_u and thus the obj[num|name|namel] fields could be moved into that structure. Even after doing this, dn_u would still be shorter than ip6_u, although 12 bytes longer than ip4_u (if my counting is correct). Is that an acceptable solution? Well, most of my machines dont use IPV6 nor DECNET :) [*] By which I mean, as you've already alluded to, that its set up correctly but not currently read/tested by anything yet. - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Ethernet Cheap Cryptography
On Wednesday, 18 October 2006 05:21, you wrote: Dawid Ciezarkiewicz writes: I'd be thankful for your opinions about that idea. Please forgive me any nuances that I didn't know about. * I suggest extending the documentation with some motivating examples of why someone would want to use this rather than IPsec for IP and/or in what scenarios you'd envisage someone wanting to encrypt ARP, PPPoE, ... etc. Perhaps, you can somehow mesh it with 802.1x to provide link-level encryption to augment 802.1x link-level authentication? You're right. I'll add such documentation. For now - short version: as a company dealing with wifi regularly we often come to a problem - using wifi bridges with strengths like price, CE included, easy integration, good bandwidth, distance etc. - that those devices regularly have max eth mtu 1500, not much cpu power and are often so feature-less that there are many problems with good traffic security. It enforces to use upper level encryption with internal fragmentation which is problem because of more more frames that those bridges have to handle, bigger traffic etc. We think that solution like ccrypt will be far more secure and simple - and allows to maximize bandwidth and packet per second rate. * Your implementation allows the key to be changed but not in a way that allows both sides to do so without disrupting traffic i.e. you don't have something akin to IKE phase2 re-keying. Without that then if someone can sniff the traffic long enough they are going to get a big sample of data to try and crack the keys with. Well - ccrypt allows to change keys without disrupting traffic. It works like this: first new ccrypt_rx alg:key pair is added. After that ccrypt_rx will still use old alg:key, but all unmatched frames will be challenged against new one too. Then as soon as possible ccrypt_tx should have that new alg:key pair added. When ccrypt_rx gets new frame sent by new alg:key it will not match old alg:key, but will match new one. Receiver will switch then and from now on it will use only new pair. This allows key switching without loosing any frames. It should be done quickly, since when in key transition state all invalid/spoofed frames have double cpu impact on receiver. Shouldn't be a problem because attacker should have no clue about when key is being switched. As device ccrypt_rx and tx are independent traffic encryption can use independent keys in both traffic directions. And because they use pairs of alg:key, in each change: algorithm, key and key length can be changed at once. AFAIK attacker have no way to tell where such change occurs nor what are parameters of current alg:key. The idea is to change keys regularly on both sides with userspace tools - like ssh on separate vlan, or even simpler static key rotation algorithms or something like it. This should allow secure alg:key switching with about any frequency. I hope this will make cracking keys hard enough for attacker that it will not even try. Integrity security is more difficult (and possibly weaker) part of ccrypt. * You write frames will be delivered in order, so on the other side IV can be always in sync. If any switches between the two linux boxes are running any kind of link aggregation then you can't guarantee that the frames will be delivered in order. IEEE 802.3ad requires that packets belonging to the same session travel down the same port to avoid re-ordering but implementations vary as to whether they actually guarantee it or not since most higher level protcols can survive some re-ordering. I was not aware of that. Thanks. I will add this info to documentation. There is nothing actually I can do about that in the form that ccrypt is mean to be now. * Given your desire not to change the size of the payload you have no space for MAC. This makes it easier (but by no means easy) to alter the payload in such a way that it is still decrypted and considered valid. Could you explain it more? I don't understand. You mean MAC as ... ? * For the same reason as above you don't have a sequence number. This combined with the lack of MAC weakens the defense against replay attacks i.e. where third party captures a packet and then re-sends it at a later time. The fact that IVs must be in sync for the packet to be accepted makes it harder for an attacker but since they know how the IV is calculated they know what message to look for before replaying a packet. Maybe because of previous one I don't clearly understand the mechanisms. Please - if you could explain it more - that knowledge would be very useful, and I could put it into the docs too. * A variation of the above is that the attacker doesn't care about injecting packets per se, rather they use the above to cause packet loss by causing the receiver to update its IV based on a replayed packet thereby causing the next real
[PATCH,RFC] bridge: call eth_type_trans() in br_pass_frame_up()
Hi, I've been seeing a failure to reply to incoming ARP packets on a bridge interface until after the first few packets have been transmitted over that interface, and the patch below seems to fix the issue, the 'issue' being that the incoming ARP packets are marked with PACKET_OTHERHOST, and there not being anything to set that back to PACKET_HOST even if the destination MAC address matches the bridge interface's MAC address. If this looks good, I'll prepare a proper commit message. cheers, Lennert Signed-off-by: Tom Billman [EMAIL PROTECTED] Signed-off-by: Lennert Buytenhek [EMAIL PROTECTED] --- linux-2.6.19-rc2.orig/net/bridge/br_input.c 2006-10-18 11:11:08.0 +0200 +++ linux-2.6.19-rc2/net/bridge/br_input.c 2006-10-18 11:10:08.0 +0200 @@ -32,6 +32,9 @@ indev = skb-dev; skb-dev = br-dev; + skb_push(skb, ETH_HLEN); + skb-protocol = eth_type_trans(skb, skb-dev); + NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, netif_receive_skb); } - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Ethernet Cheap Cryptography
On Wednesday, 18 October 2006 05:25, David Miller wrote: From: [EMAIL PROTECTED] (Stephen J. Bevan) Date: Tue, 17 Oct 2006 20:21:46 -0700 * You write frames will be delivered in order, so on the other side IV can be always in sync. In fact, in addition to your comments, Linux can reorder packets locally within the system even within traffic for the same link. Any technology which absolutely requires in order packet delivery isn't going to work very well. I've tried to put ccrypt handlers as close to hardware xmit and recv as possible so local reorder doesn't matter. Medium doesn't reorder frames and switches, bridges shouldn't do that neither (but as Stephen J. Bevan said this may not be always true). - 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
[IPv6] route: Fix prohibit and blackhole routing decision
Lookups resolving to ip6_blk_hole_entry must result in silently discarding the packets whereas an ip6_pkt_prohibit_entry is supposed to cause an ICMPV6_ADM_PROHIBITED message to be sent. Thanks to Kim Nordlund [EMAIL PROTECTED] for noticing this bug. Signed-off-by: Thomas Graf [EMAIL PROTECTED] Index: net-2.6/net/ipv6/route.c === --- net-2.6.orig/net/ipv6/route.c 2006-10-18 11:06:45.0 +0200 +++ net-2.6/net/ipv6/route.c2006-10-18 11:48:27.0 +0200 @@ -94,6 +94,9 @@ static int ip6_pkt_discard(struct sk_buff *skb); static int ip6_pkt_discard_out(struct sk_buff *skb); +static int ip6_pkt_prohibit(struct sk_buff *skb); +static int ip6_pkt_prohibit_out(struct sk_buff *skb); +static int ip6_pkt_blk_hole(struct sk_buff *skb); static voidip6_link_failure(struct sk_buff *skb); static voidip6_rt_update_pmtu(struct dst_entry *dst, u32 mtu); @@ -150,8 +153,8 @@ .obsolete = -1, .error = -EACCES, .metrics= { [RTAX_HOPLIMIT - 1] = 255, }, - .input = ip6_pkt_discard, - .output = ip6_pkt_discard_out, + .input = ip6_pkt_prohibit, + .output = ip6_pkt_prohibit_out, .ops= ip6_dst_ops, .path = (struct dst_entry*)ip6_prohibit_entry, } @@ -170,8 +173,8 @@ .obsolete = -1, .error = -EINVAL, .metrics= { [RTAX_HOPLIMIT - 1] = 255, }, - .input = ip6_pkt_discard, - .output = ip6_pkt_discard_out, + .input = ip6_pkt_blk_hole, + .output = ip6_pkt_blk_hole, .ops= ip6_dst_ops, .path = (struct dst_entry*)ip6_blk_hole_entry, } @@ -1743,24 +1746,46 @@ * Drop the packet on the floor */ -static int ip6_pkt_discard(struct sk_buff *skb) +static inline int ip6_pkt_drop(struct sk_buff *skb, int code) { int type = ipv6_addr_type(skb-nh.ipv6h-daddr); if (type == IPV6_ADDR_ANY || type == IPV6_ADDR_RESERVED) IP6_INC_STATS(IPSTATS_MIB_INADDRERRORS); IP6_INC_STATS(IPSTATS_MIB_OUTNOROUTES); - icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb-dev); + icmpv6_send(skb, ICMPV6_DEST_UNREACH, code, 0, skb-dev); kfree_skb(skb); return 0; } +static int ip6_pkt_discard(struct sk_buff *skb) +{ + return ip6_pkt_drop(skb, ICMPV6_NOROUTE); +} + static int ip6_pkt_discard_out(struct sk_buff *skb) { skb-dev = skb-dst-dev; return ip6_pkt_discard(skb); } +static int ip6_pkt_prohibit(struct sk_buff *skb) +{ + return ip6_pkt_drop(skb, ICMPV6_ADM_PROHIBITED); +} + +static int ip6_pkt_prohibit_out(struct sk_buff *skb) +{ + skb-dev = skb-dst-dev; + return ip6_pkt_prohibit(skb); +} + +static int ip6_pkt_blk_hole(struct sk_buff *skb) +{ + kfree_skb(skb); + return 0; +} + /* * Allocate a dst for local (unicast / anycast) address. */ - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Ethernet Cheap Cryptography
From: Dawid Ciezarkiewicz [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 11:51:46 +0200 I've tried to put ccrypt handlers as close to hardware xmit and recv as possible so local reorder doesn't matter. Medium doesn't reorder frames and switches, bridges shouldn't do that neither (but as Stephen J. Bevan said this may not be always true). You can put it all the way in netif_receive_skb() and you still can see reordering of receive packets on an SMP system. - 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: ANNOUNCE: DadWifi, a port of MadWifi to d80211
On Tue, Oct 17, 2006 at 05:14:29PM -0700, David Kimdon wrote: Hi, DadWifi is a port of MadWifi to the d80211 stack. It works now in managed and monitor mode, lightly tested. Any card supported by MadWifi should be supported by DadWifi [1]. This allows a large number of cards to now take advantage of the d80211 stack. DadWifi uses the same (binary only) hal as MadWifi and reuses much of the initialization, descriptor and interrupt processing code. Guys, why do you waste your time on doing stuff that's useless for most of us, and that people can't even legally redistribute. Please switch to openhal or the openbsd code and we all owe you a lot of beer at the next conference :) - 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] [NET] reduce sizeof(struct flow)
Hi David, David Miller schrieb: I don't like these kinds of patches because %99 of people will never ever realize the savings because distribution vendors will always, unlaterally, enable everything. People producing Linux Appliances DO compile their own kernels. And some distribution vendors are still at 2.6.8-$WHACKY_PATCHES or similiar, which is not usable for many things (e.g. IPsec, SIP behind NAT etc.). But I agree that workings towards smaller size in make allyesconfig is much better :-) Regards Ingo Oeser - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Ethernet Cheap Cryptography
On Wednesday, 18 October 2006 12:16, David Miller wrote: From: Dawid Ciezarkiewicz [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 11:51:46 +0200 I've tried to put ccrypt handlers as close to hardware xmit and recv as possible so local reorder doesn't matter. Medium doesn't reorder frames and switches, bridges shouldn't do that neither (but as Stephen J. Bevan said this may not be always true). You can put it all the way in netif_receive_skb() and you still can see reordering of receive packets on an SMP system. Thanks for pointing that out. As every frame reorder will cost only one real frame to by lost I need to investigate this issue and get more real testing in such environments. - 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
2.6.19rc2 XFRM does too large direct mapping allocations for hashes
I got this while restarting ipsec on a 2.6.19rc2 system that was up for a few days. Order 8 is really a bit big to get from the direct mapping after boot. Should the hash allocation fall back to vmalloc? -Andi Initializing XFRM netlink socket events/0: page allocation failure. order:8, mode:0xd0 Call Trace: [8024be30] __alloc_pages+0x297/0x2ae [804a3127] xfrm_hash_resize+0x0/0x27e [8024c301] __get_free_pages+0x33/0x6d [804a4a21] xfrm_hash_alloc+0x56/0x6d [804a3185] xfrm_hash_resize+0x5e/0x27e [804a3127] xfrm_hash_resize+0x0/0x27e [802369ca] run_workqueue+0x92/0xe3 [80236ab9] worker_thread+0x0/0x119 [80236ba0] worker_thread+0xe7/0x119 [80224a6e] default_wake_function+0x0/0xe [80239900] kthread+0xcb/0xf5 [8020a1c5] child_rip+0xa/0x15 [80239835] kthread+0x0/0xf5 [8020a1bb] child_rip+0x0/0x15 Mem-info: DMA per-cpu: CPU0: Hot: hi:0, btch: 1 usd: 0 Cold: hi:0, btch: 1 usd: 0 CPU1: Hot: hi:0, btch: 1 usd: 0 Cold: hi:0, btch: 1 usd: 0 DMA32 per-cpu: CPU0: Hot: hi: 186, btch: 31 usd: 168 Cold: hi: 62, btch: 15 usd: 51 CPU1: Hot: hi: 186, btch: 31 usd: 14 Cold: hi: 62, btch: 15 usd: 58 Active:293384 inactive:157186 Initializing XFRM netlink socket events/0: page allocation failure. order:8, mode:0xd0 Call Trace: [8024be30] __alloc_pages+0x297/0x2ae [804a3127] xfrm_hash_resize+0x0/0x27e [8024c301] __get_free_pages+0x33/0x6d [804a4a21] xfrm_hash_alloc+0x56/0x6d [804a3185] xfrm_hash_resize+0x5e/0x27e [804a3127] xfrm_hash_resize+0x0/0x27e [802369ca] run_workqueue+0x92/0xe3 [80236ab9] worker_thread+0x0/0x119 [80236ba0] worker_thread+0xe7/0x119 [80224a6e] default_wake_function+0x0/0xe [80239900] kthread+0xcb/0xf5 [8020a1c5] child_rip+0xa/0x15 [80239835] kthread+0x0/0xf5 [8020a1bb] child_rip+0x0/0x15 Mem-info: DMA per-cpu: CPU0: Hot: hi:0, btch: 1 usd: 0 Cold: hi:0, btch: 1 usd: 0 CPU1: Hot: hi:0, btch: 1 usd: 0 Cold: hi:0, btch: 1 usd: 0 DMA32 per-cpu: CPU0: Hot: hi: 186, btch: 31 usd: 168 Cold: hi: 62, btch: 15 usd: 51 CPU1: Hot: hi: 186, btch: 31 usd: 14 Cold: hi: 62, btch: 15 usd: 58 Active:293384 inactive:157186 dirty:94 writeback:0 unstable:0 free:10372 slab:46328 mapped:18292 pagetables:1952 DMA free:8040kB min:28kB low:32kB high:40kB active:2720kB inactive:40kB present:10396kB pages_scanned:32 all_unreclaimable? no lowmem_reserve[]: 0 2002 2002 DMA32 free:33448kB min:5708kB low:7132kB high:8560kB active:1170816kB inactive:628704kB present:2050208kB pages_scanned:152 all_unreclaimable? no lowmem_reserve[]: 0 0 0 DMA: 0*4kB 1*8kB 0*16kB 1*32kB 1*64kB 0*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 1*4096kB = 8040kB DMA32: 6862*4kB 260*8kB 41*16kB 18*32kB 10*64kB 2*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 33448kB Swap cache: add 92, delete 92, find 27/32, race 0+0 Free swap = 987988kB Total swap = 987988kB Free swap: 987988kB 524032 pages of RAM 9689 reserved pages 260692 pages shared 0 pages swap cached events/0: page allocation failure. order:8, mode:0xd0 dirty:94 writeback:0 unstable:0 free:10372 slab:46328 mapped:18292 pagetables:1952 DMA free:8040kB min:28kB low:32kB high:40kB active:2720kB inactive:40kB present:10396kB pages_scanned:32 all_unreclaimable? no lowmem_reserve[]: 0 2002 2002 DMA32 free:33448kB min:5708kB low:7132kB high:8560kB active:1170816kB inactive:628704kB present:2050208kB pages_scanned:152 all_unreclaimable? no lowmem_reserve[]: 0 0 0 DMA: 0*4kB 1*8kB 0*16kB 1*32kB 1*64kB 0*128kB 1*256kB 1*512kB 1*1024kB 1*2048kB 1*4096kB = 8040kB DMA32: 6862*4kB 260*8kB 41*16kB 18*32kB 10*64kB 2*128kB 1*256kB 1*512kB 1*1024kB 0*2048kB 0*4096kB = 33448kB Swap cache: add 92, delete 92, find 27/32, race 0+0 Free swap = 987988kB Total swap = 987988kB Free swap: 987988kB 524032 pages of RAM 9689 reserved pages 260692 pages shared 0 pages swap cached events/0: page allocation failure. order:8, mode:0xd0 ... repeated a few times with the same backtrace ... - 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] [NET] reduce sizeof(struct flow)
Hi, Its not used at the moment[*], but would be required for any kind of flow tracking. The objnum field, could be folded into the objname field I guess on the basis that objnamel == 0 means objname[0] represents the objnum, but that doesn't really buy much. Well, as I privately said to David, objnamel is used, at least on 2.6.18 tree ( net/decnet/dn_route.c function compare_keys() memcmp() will read this field and check before comparing objname[] So it is set by dn_sk_ports_copy(), and used by compare_keys() It is set by dn_sk_ports_copy() as you say, but the obj[num|name|namel] fields are not used as a key in compare_keys() at the moment, although all the other fields are used there. Since the recent bug fix to this area of the code (memcmp was comparing uninitialised padding) its easier to see what is being compared. In fact I suspect the reason that the obj fields were not put in the dn_u where they'd take up a lot less room was because the memcmp covered only dn_u and not the rest of the structure. It was a while ago that I wrote this and my memory is failing me as to the exact reason I did it like that. Looking at the rearrangement option, and the relative lengths of ipv6 and DECnet node addresses, dn_u is a lot smaller than ip6_u and thus the obj[num|name|namel] fields could be moved into that structure. Even after doing this, dn_u would still be shorter than ip6_u, although 12 bytes longer than ip4_u (if my counting is correct). Is that an acceptable solution? Well, most of my machines dont use IPV6 nor DECNET :) Its still an improvement over the current situation, even though it might be (probably is) possible to improve it further, Steve. - 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/7] d80211: add support for SIOCSIWRATE and SIOCGIWRATE
On Thu, 12 Oct 2006 15:35:59 -0700, mabbas wrote: Should I add the new field to sta_info or to ieee80211_sub_if_data. If we added to sta_info then it wont be persistent. We will loose SIOCSIWRATE restriction once we associate with new AP. Then in 3 we bitmask sta-curr_rates with ieee80211_sub_if_data::allowed_rates and this will solve the problem for IBSS as well. Fine with me. Though I'm not sure that Jouni will agree :-) On the other hand, as WE are considered obsolete now, it's more important to have a nice design than to support all WE calls in an intuitive way. But we will have to convert d80211 to cfg80211 anyway, so it will depend on the way rate limiting is implemented in cfg80211 in the end. 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/7] d80211: add support for SIOCSIWRATE and SIOCGIWRATE
On Wed, 2006-10-18 at 14:59 +0200, Jiri Benc wrote: But we will have to convert d80211 to cfg80211 anyway, so it will depend on the way rate limiting is implemented in cfg80211 in the end. I'd think it should be more the other way round with d80211/cfg80211 doing whatever makes most sense... johannes - 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
80211 questions
Hi, I'm working on adding WE (wireless extensions) support to a WLAN driver, and have recently bumped into references of nl80211, cfg80211 and d80211. My questions: - Can someone please shortly describe each term? - Other than reading the source code and searching in news-groups, is there any serious source of information regarding any of the above? Thanks! Eitan p.s: while I'm at it - any good documentation on WE itself other than wireless.20.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
Re: [PATCH] d80211: ieee80211_hw handlers should be allowed to sleep
On Sat, 7 Oct 2006 11:23:15 +0200, Ivo van Doorn wrote: --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2075,15 +2075,15 @@ void ieee80211_if_shutdown(struct net_de case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: sdata-u.sta.state = IEEE80211_DISABLED; - del_timer_sync(sdata-u.sta.timer); + cancel_delayed_work(sdata-u.sta.work); if (local-scan_work.data == sdata-dev) { local-sta_scanning = 0; cancel_delayed_work(local-scan_work); - flush_scheduled_work(); /* see comment in ieee80211_unregister_hw to * understand why this works */ local-scan_work.data = NULL; } + flush_scheduled_work(); This is racy. local-scan_work.data can be set to NULL only after flush_scheduled_work(). Other than that, the patch looks good to me. 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] [NET] reduce sizeof(struct flow)
On Wednesday 18 October 2006 14:42, Steven Whitehouse wrote: Hi, Its not used at the moment[*], but would be required for any kind of flow tracking. The objnum field, could be folded into the objname field I guess on the basis that objnamel == 0 means objname[0] represents the objnum, but that doesn't really buy much. Well, as I privately said to David, objnamel is used, at least on 2.6.18 tree ( net/decnet/dn_route.c function compare_keys() memcmp() will read this field and check before comparing objname[] So it is set by dn_sk_ports_copy(), and used by compare_keys() It is set by dn_sk_ports_copy() as you say, but the obj[num|name|namel] fields are not used as a key in compare_keys() at the moment, although all the other fields are used there. Since the recent bug fix to this area of the code (memcmp was comparing uninitialised padding) its easier to see what is being compared. Oh, I see, you are referring to 2.6.19-rc2, I was referring to 2.6.18 (what I call current linux version) In fact I suspect the reason that the obj fields were not put in the dn_u where they'd take up a lot less room was because the memcmp covered only dn_u and not the rest of the structure. It was a while ago that I wrote this and my memory is failing me as to the exact reason I did it like that. Looking at the rearrangement option, and the relative lengths of ipv6 and DECnet node addresses, dn_u is a lot smaller than ip6_u and thus the obj[num|name|namel] fields could be moved into that structure. Even after doing this, dn_u would still be shorter than ip6_u, although 12 bytes longer than ip4_u (if my counting is correct). Is that an acceptable solution? Well, most of my machines dont use IPV6 nor DECNET :) Its still an improvement over the current situation, even though it might be (probably is) possible to improve it further, OK then. Even on a distro kernel (allyesconfig), size(flow) would shrink by 20 bytes. Thank you. - 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: 80211 questions
Hi, I'm working on adding WE (wireless extensions) support to a WLAN driver, and have recently bumped into references of nl80211, cfg80211 and d80211. My questions: - Can someone please shortly describe each term? d80211: wireless stack slated to replace the current ieee80211 subsystem in the kernel, includes very advanced functionality and can drives softmac chipsets like bcm43xx. cfg80211: my proposal for the in-kernel wireless configuration interface replacing WE nl80211: tightly tied to cfg80211, this exports the cfg80211 interface over netlink to userspace There's also a compat interface so drivers can use cfg80211 but userspace can continue to use WE. - Other than reading the source code and searching in news-groups, is there any serious source of information regarding any of the above? not really, sorry. What specifically do you need? Also, what driver are you adding support for? Could it make sense to make said driver use d80211, or is it for a fullmac chipset? p.s: while I'm at it - any good documentation on WE itself other than wireless.20.h ? None as far as I know. Jean recommends reading the userspace tools source code (which from my POV shows just /how/ broken WE is). johannes - 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/7] d80211: add support for SIOCSIWRATE and SIOCGIWRATE
On Wed, 18 Oct 2006 15:02:32 +0200, Johannes Berg wrote: On Wed, 2006-10-18 at 14:59 +0200, Jiri Benc wrote: But we will have to convert d80211 to cfg80211 anyway, so it will depend on the way rate limiting is implemented in cfg80211 in the end. I'd think it should be more the other way round with d80211/cfg80211 doing whatever makes most sense... Current WE implementation of rate limiting (SIOCSIWRATE) doesn't make much sense with d80211. Hopefully we'll invent a better solution for cfg80211. Then we will probably need to put some constraints on SIOCSIWRATE emulation (like rate limiting is lost when you are disassociated) - hence the comment. 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/7] d80211: add support for SIOCSIWRATE and SIOCGIWRATE
On Wed, 2006-10-18 at 15:34 +0200, Jiri Benc wrote: Current WE implementation of rate limiting (SIOCSIWRATE) doesn't make much sense with d80211. Right. Hopefully we'll invent a better solution for cfg80211. We could do it right here and now then. I haven't understood the matter though, may I delegate it to you (plural you intended here) Then we will probably need to put some constraints on SIOCSIWRATE emulation (like rate limiting is lost when you are disassociated) - hence the comment. That's ok. johannes - 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: 80211 questions
-Original Message- From: Johannes Berg [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 18, 2006 3:30 PM To: Bar, Eitan Cc: netdev@vger.kernel.org Subject: Re: 80211 questions Hi, I'm working on adding WE (wireless extensions) support to a WLAN driver, and have recently bumped into references of nl80211, cfg80211 and d80211. My questions: - Can someone please shortly describe each term? d80211: wireless stack slated to replace the current ieee80211 subsystem in the kernel, includes very advanced functionality and can drives softmac chipsets like bcm43xx. cfg80211: my proposal for the in-kernel wireless configuration interface replacing WE nl80211: tightly tied to cfg80211, this exports the cfg80211 interface over netlink to userspace There's also a compat interface so drivers can use cfg80211 but userspace can continue to use WE. [Eitan Bar] Thanks :) - Other than reading the source code and searching in news-groups, is there any serious source of information regarding any of the above? not really, sorry. What specifically do you need? Also, what driver are you adding support for? Could it make sense to make said driver use d80211, or is it for a fullmac chipset? [Eitan Bar] I was actually looking for any kind of design document, or anything related to the concept behind it. I'm adding WE support for a Texas Instruments driver for future chipsets. The driver is, at the moment, entirely proprietary (including user-mode API). p.s: while I'm at it - any good documentation on WE itself other than wireless.20.h ? None as far as I know. Jean recommends reading the userspace tools source code (which from my POV shows just /how/ broken WE is). [Eitan Bar] I see. Can you please point out if there's any driver currently supporting cfg80211 or nl80211 for reference? (which one are you using for testing?) johannes - 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: 80211 questions
On Wed, 2006-10-18 at 15:45 +0200, Bar, Eitan wrote: [Eitan Bar] I was actually looking for any kind of design document, or anything related to the concept behind it. As for cfg80211/nl80211 it was mostly discussed here on netdev and I haven't written up anything. I'm adding WE support for a Texas Instruments driver for future chipsets. The driver is, at the moment, entirely proprietary (including user-mode API). Heh, ok. I'm just wondering whether it would make sense for you to provide a d80211 driver for that chipset instead. If you could tell me (even in private if you wish) some details about what your hardware does in firmware and what it does in the driver, I could help you make that decision. [Eitan Bar] I see. Can you please point out if there's any driver currently supporting cfg80211 or nl80211 for reference? (which one are you using for testing?) I have provided some code (very little actually) to make d80211 use cfg80211 (and you can't do much with nl80211 yet), but no driver implements it yet directly. johannes - 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: silence sparse warning: bad constant expression
On Mon, 9 Oct 2006 13:11:02 -0700, David Kimdon wrote: --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc printk(KERN_DEBUG %s: AP denied authentication (auth_alg=%d code=%d)\n, dev-name, ifsta-auth_alg, status_code); if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { - const int num_algs = 3; - u8 algs[num_algs]; + u8 algs[3]; + const int num_algs = ARRAY_SIZE(algs); Wouldn't it be better just to use ARRAY_SIZE(algs) and get rid of num_algs completely? 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
BCM5461 phy issue in 10M/Full duplex
I was wondering if anyone has had any issues when trying to force a BCM5461 phy into 10M/full duplex. I seem to be having an issue in the two managed switches I've tried this on but autoneg to 10/half. This causes a problem in that I start seeing a large number of frame errors. I believe, but need to double check, that if I leave the BCM5461 in autoneg, and foce the switch to 10M/full that the BCM5461 will autoneg at 10M/half duplex. Just wondering if anyone else has seen similar behavior with this PHY. thanks - kumar - 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: 80211 questions
On Wed, 2006-10-18 at 15:09 +0200, Bar, Eitan wrote: Hi, I'm working on adding WE (wireless extensions) support to a WLAN driver, and have recently bumped into references of nl80211, cfg80211 and d80211. My questions: - Can someone please shortly describe each term? - Other than reading the source code and searching in news-groups, is there any serious source of information regarding any of the above? If you have _any_ questions, please ask if you cannot find an answer. I and others will be quite happy to help you figure it out. Dan Thanks! Eitan p.s: while I'm at it - any good documentation on WE itself other than wireless.20.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 - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC] Ethernet Cheap Cryptography
On Wednesday, 18 October 2006 11:15, Dawid Ciezarkiewicz wrote: * Given your desire not to change the size of the payload you have no space for MAC. This makes it easier (but by no means easy) to alter the payload in such a way that it is still decrypted and considered valid. Could you explain it more? I don't understand. You mean MAC as ... ? Oh. Sorry. You mean message authentication code. Well - ccrypt have to live without it. From the start I knew that integrity will be the weakest point of ccrypt. - 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: [e1000]: flow control on by default - good idea really?
On Tue, 2006-17-10 at 14:02 -0700, Auke Kok wrote: For now, we should really report the FC status in e1000 at link up time. Jamal: this should help you out for now, I'll send something like this upstream later on. Thanks - this puts you at par with the tg3 at least. On Tue, 2006-17-10 at 14:46 -0700, David Miller wrote: From: jamal [EMAIL PROTECTED] Date: Tue, 17 Oct 2006 09:05:31 -0400 It sounds to me that ethttool needs to have this semantic fix. IOW, ethttool doesnt differentiate the two items: a) advertised parameters. b) link partner negotiated parameters. and instead #a becomes #b after negotiation. methinks this needs fixing. Dave? Jeff? The way I understand it the ethernet autonegotiation mechanisms don't really give you a way to seperate these two things. Either you negotiate the link and flow control settings, or nothing. True - but I was thinking more of the state stored in the driver either by ethtool or some other part of the driver. If i remember correctly, Donald Beckers old mii tool was able to display here's what you have configured the driver for link and flow control and these are what i advertise to link peers and here's what current negotiated link and flow control parameters with link peer That distinction doesnt exist with ethtool. Or i am missing something. cheers, jamal - 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] bcm43xx: Readd dropped assignment
On Wednesday 18 October 2006 01:12, Daniel Drake wrote: Larry Finger pointed out a problem with my ieee80211 IV/ICV stripping patch, which I forgot about. Sorry about that. The patch readds the frame_ctl assignment which was accidently dropped. Signed-off-by: Daniel Drake [EMAIL PROTECTED] Whoops. Please merge this as fast as possible, John. That's a real bug which prevents RX from working. Signed-off-by: Michael Buesch [EMAIL PROTECTED] Index: linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c === --- linux.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c +++ linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c @@ -543,6 +543,7 @@ int bcm43xx_rx(struct bcm43xx_private *b break; } + frame_ctl = le16_to_cpu(wlhdr-frame_ctl); switch (WLAN_FC_GET_TYPE(frame_ctl)) { case IEEE80211_FTYPE_MGMT: ieee80211_rx_mgt(bcm-ieee, wlhdr, stats); -- 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 3/3] d80211: silence sparse warning: bad constant expression
On Wed, Oct 18, 2006 at 03:56:07PM +0200, Jiri Benc wrote: On Mon, 9 Oct 2006 13:11:02 -0700, David Kimdon wrote: --- wireless-dev.orig/net/d80211/ieee80211_sta.c +++ wireless-dev/net/d80211/ieee80211_sta.c @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc printk(KERN_DEBUG %s: AP denied authentication (auth_alg=%d code=%d)\n, dev-name, ifsta-auth_alg, status_code); if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { - const int num_algs = 3; - u8 algs[num_algs]; + u8 algs[3]; + const int num_algs = ARRAY_SIZE(algs); Wouldn't it be better just to use ARRAY_SIZE(algs) and get rid of num_algs completely? I actually think the code reads slightly cleaner using num_algs, but don't have a strong preference. I'd be happy to make the change if removing num_algs is preferred. -David - 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: [e1000]: flow control on by default - good idea really?
jamal wrote: On Tue, 2006-17-10 at 14:02 -0700, Auke Kok wrote: For now, we should really report the FC status in e1000 at link up time. Jamal: this should help you out for now, I'll send something like this upstream later on. Thanks - this puts you at par with the tg3 at least. On Tue, 2006-17-10 at 14:46 -0700, David Miller wrote: From: jamal [EMAIL PROTECTED] Date: Tue, 17 Oct 2006 09:05:31 -0400 It sounds to me that ethttool needs to have this semantic fix. IOW, ethttool doesnt differentiate the two items: a) advertised parameters. b) link partner negotiated parameters. and instead #a becomes #b after negotiation. methinks this needs fixing. Dave? Jeff? The way I understand it the ethernet autonegotiation mechanisms don't really give you a way to seperate these two things. Either you negotiate the link and flow control settings, or nothing. True - but I was thinking more of the state stored in the driver either by ethtool or some other part of the driver. If i remember correctly, Donald Beckers old mii tool was able to display here's what you have configured the driver for link and flow control and these are what i advertise to link peers and here's what current negotiated link and flow control parameters with link peer That distinction doesnt exist with ethtool. Or i am missing something. nope, there's not even an ethtool cmd to query for that data AFAICS Auke - 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] Bound TSO defer time (resend)
On Tuesday 17 October 2006 06:18, John Heffner wrote: Stephen Hemminger wrote: On Mon, 16 Oct 2006 20:53:20 -0400 (EDT) John Heffner [EMAIL PROTECTED] wrote: This patch limits the amount of time you will defer sending a TSO segment to less than two clock ticks, or the time between two acks, whichever is longer. Okay, but doing any timing on clock ticks makes the behavior dependent on the value of HZ which doesn't seem desirable. Should this be based on RTT or a real-time values? It would be nice to use a high res clock so you don't depend on HZ, but this is still expensive on most SMP arch's as I understand it. You can always use xtime. It doesn't have better solution than jiffies though, but it gives you real time. Drawback is that there is some work towards tickless kernels and with that xtime will be more expensive again. But hopefully not by that much. -Andi - 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: silence sparse warning: bad constant expression
On Wed, 18 Oct 2006 08:12:27 -0700, David Kimdon wrote: I actually think the code reads slightly cleaner using num_algs, but don't have a strong preference. I'd be happy to make the change if removing num_algs is preferred. Don't know. But nobody except me objected for more than a week so I've applied the patch to my tree. I've also applied the following patches from you: d80211: use FCS_LEN instead of hardcoded number. d80211: remove unused Super AG definitions, purge comment (the second version of the patch) Thanks for the patches, 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: d80211: ANNOUNCE: DadWifi, a port of MadWifi to d80211
On Wed, 18 Oct 2006 11:16:05 +0100, Christoph Hellwig wrote: Guys, why do you waste your time on doing stuff that's useless for most of us, and that people can't even legally redistribute. I dislike HAL too. But I don't think this effort is useless. It's a great base for a future fully open Atheros driver - it's going to use the d80211 stack anyway, so it can reuse most of the code of this driver. It also allow us to make sure d80211 is capable of supporting Atheros chipsets. I appreciate the effort. AP mode support would be even greater thing - David, do you plan to add it? Please switch to openhal or the openbsd code and we all owe you a lot of beer at the next conference :) And what 802.11 stack would you use with it? 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] d80211: Fix TX/RX rates
On Sun, 15 Oct 2006 20:14:07 +0200, Ivo van Doorn wrote: This patch correctly initializes the force_unicast_rateidx and max_ratectrl_rateidx. This was not done previously and caused a bug in rf80211_simple where when rate_control_simple_get_rate() was called, the incorrect rate was selected from the list. Applied to my tree, thanks for the patch! 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 15/18] d80211: use FCS_LEN instead of hardcoded number.
From: David Kimdon [EMAIL PROTECTED] Signed-off-by: David Kimdon [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 22acdd71c90cc4123d3df59a07919d432847e3e7 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 86062c9..50b2b29 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -442,7 +442,7 @@ ieee80211_tx_h_fragment(struct ieee80211 hdrlen = ieee80211_get_hdrlen(tx-fc); payload_len = first-len - hdrlen; - per_fragm = frag_threshold - hdrlen - 4 /* FCS */; + per_fragm = frag_threshold - hdrlen - FCS_LEN; num_fragm = (payload_len + per_fragm - 1) / per_fragm; frags = kzalloc(num_fragm * sizeof(struct sk_buff *), GFP_ATOMIC); @@ -1062,7 +1062,7 @@ __ieee80211_tx_prepare(struct ieee80211_ control-no_ack = is_multicast_ether_addr(hdr-addr1); tx-fragmented = local-fragmentation_threshold IEEE80211_MAX_FRAG_THRESHOLD tx-u.tx.unicast - skb-len + 4 /* FCS */ local-fragmentation_threshold + skb-len + FCS_LEN local-fragmentation_threshold (!local-hw-set_frag_threshold); if (!tx-sta) control-clear_dst_mask = 1; -- 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/18] d80211: pull request
Please pull from git://git.kernel.org/pub/scm/linux/kernel/git/jbenc/dscape.git up to obtain following patches: David Kimdon: d80211: Fix overflow when creating AVS header d80211: allow wireless vlan interface to have same MAC an AP interface d80211: use FCS_LEN instead of hardcoded number. d80211: silence sparse warning: bad constant expression d80211: remove unused Super AG definitions, purge comment Elliot Schwartz: d80211: remove unused xr structure members, interface, etc. d80211: remove rate limit code Jiri Benc: d80211: fix is_ieee80211_device d80211: add missing rtnl_unlock() d80211: del sta timer on interface close d80211: rename rate_control.h to ieee80211_rate.h d80211: proper rate_control loading d80211: rename rate_control.c to rc80211_simple.c d80211: proper rate control structures freeing d80211: allow changing of the rate control algorithm d80211: rate_control: do not use atomic allocations when not necessary Jouni Malinen: d80211: retain PS frames for at least STA listen interval Modestas Vainius: d80211: Fix TX/RX rates include/net/d80211.h | 23 include/net/d80211_mgmt.h|4 - include/net/d80211_shared.h |6 - net/d80211/Makefile |3 net/d80211/hostapd_ioctl.h | 10 -- net/d80211/ieee80211.c | 245 +- net/d80211/ieee80211_i.h | 11 +- net/d80211/ieee80211_iface.c | 12 -- net/d80211/ieee80211_ioctl.c | 38 +- net/d80211/ieee80211_rate.c | 140 ++ net/d80211/ieee80211_rate.h | 161 + net/d80211/ieee80211_scan.c |4 - net/d80211/ieee80211_sta.c | 19 ++- net/d80211/ieee80211_sysfs.c | 27 +++- net/d80211/ieee80211_sysfs_sta.c |5 - net/d80211/rate_control.h| 154 net/d80211/rate_control.c| 26 ++-- net/d80211/sta_info.c| 46 --- net/d80211/sta_info.h|9 + 19 files changed, 513 insertions(+), 430 deletions(-) -- 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 16/18] d80211: silence sparse warning: bad constant expression
From: David Kimdon [EMAIL PROTECTED] Sparse does not figure out that algs[] isn't really a variable length array. The message is: net/d80211/ieee80211_sta.c:934:12: error: bad constant expression This switches algs[] to be obviously a constant array, and derives the value of num_algs algs[]. The code is correct and equivalent with or without this change. Signed-off-by: David Kimdon [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211_sta.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) 59e8ad6835a88cf25f958e9224b0d9b17ccd2d89 diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index 480e9c9..cc336bd 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -930,8 +930,8 @@ static void ieee80211_rx_mgmt_auth(struc printk(KERN_DEBUG %s: AP denied authentication (auth_alg=%d code=%d)\n, dev-name, ifsta-auth_alg, status_code); if (status_code == WLAN_STATUS_NOT_SUPPORTED_AUTH_ALG) { - const int num_algs = 3; - u8 algs[num_algs]; + u8 algs[3]; + const int num_algs = ARRAY_SIZE(algs); int i, pos; algs[0] = algs[1] = algs[2] = 0xff; if (ifsta-auth_algs IEEE80211_AUTH_ALG_OPEN) -- 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/18] d80211: retain PS frames for at least STA listen interval
From: Jouni Malinen [EMAIL PROTECTED] Start using 2 * listen_int * beacon_int as a timeout for PS buffered unicast frames if that is longer than 10 seconds. Previously, we used fixed 10 second limit regardless of the listen interval. This fixes power saving for STAs that request very long listen interval (over 10 seconds). This was reported by UNH IOL 802.11 AP Base MAC Test Suite v2.4 Test #1.3.2 Part e. While we are at it, remove the station from the TIM when the PS buffer is empty. Signed-off-by: Jouni Malinen [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/hostapd_ioctl.h |1 + net/d80211/ieee80211_ioctl.c |1 + net/d80211/sta_info.c| 24 net/d80211/sta_info.h|5 - 4 files changed, 22 insertions(+), 9 deletions(-) a1db08ff39daef9a57d50d737bdbb91f8a5e0592 diff --git a/net/d80211/hostapd_ioctl.h b/net/d80211/hostapd_ioctl.h index 73d54b7..003f371 100644 --- a/net/d80211/hostapd_ioctl.h +++ b/net/d80211/hostapd_ioctl.h @@ -189,6 +189,7 @@ struct prism2_hostapd_param { u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; + u16 listen_interval; } add_sta; struct { u32 inactive_msec; diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index 1fb2dfd..29fb230 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -300,6 +300,7 @@ static int ieee80211_ioctl_add_sta(struc sta-aid = param-u.add_sta.aid; if (sta-aid IEEE80211_MAX_AID) sta-aid = 0; + sta-listen_interval = param-u.add_sta.listen_interval; rates = 0; for (i = 0; i sizeof(param-u.add_sta.supp_rates); i++) { diff --git a/net/d80211/sta_info.c b/net/d80211/sta_info.c index c18365b..17f4b92 100644 --- a/net/d80211/sta_info.c +++ b/net/d80211/sta_info.c @@ -269,18 +269,24 @@ void sta_info_free(struct sta_info *sta, } -static inline int sta_info_buffer_expired(struct sk_buff *skb) +static inline int sta_info_buffer_expired(struct ieee80211_local *local, + struct sta_info *sta, + struct sk_buff *skb) { struct ieee80211_tx_packet_data *pkt_data; + int timeout; + if (!skb) return 0; - /* TODO: this could be improved by passing STA listen interval into -* the kernel driver and expiring frames after 2 x listen_interval x - * beacon interval */ - pkt_data = (struct ieee80211_tx_packet_data *) skb-cb; - return time_after(jiffies, pkt_data-jiffies + STA_TX_BUFFER_EXPIRE); + + /* Timeout: (2 * listen_interval * beacon_int * 1024 / 100) sec */ + timeout = (sta-listen_interval * local-conf.beacon_int * 32 / + 15625) * HZ; + if (timeout STA_TX_BUFFER_EXPIRE) + timeout = STA_TX_BUFFER_EXPIRE; + return time_after(jiffies, pkt_data-jiffies + timeout); } @@ -296,9 +302,11 @@ static void sta_info_cleanup_expire_buff for (;;) { spin_lock_irqsave(sta-ps_tx_buf.lock, flags); skb = skb_peek(sta-ps_tx_buf); - if (sta_info_buffer_expired(skb)) + if (sta_info_buffer_expired(local, sta, skb)) { skb = __skb_dequeue(sta-ps_tx_buf); - else + if (skb_queue_empty(sta-ps_tx_buf)) + sta-flags = ~WLAN_STA_TIM; + } else skb = NULL; spin_unlock_irqrestore(sta-ps_tx_buf.lock, flags); diff --git a/net/d80211/sta_info.h b/net/d80211/sta_info.h index 44a532e..821645e 100644 --- a/net/d80211/sta_info.h +++ b/net/d80211/sta_info.h @@ -108,6 +108,8 @@ #ifdef CONFIG_D80211_DEBUG_COUNTERS #endif /* CONFIG_D80211_DEBUG_COUNTERS */ int vlan_id; + + u16 listen_interval; }; @@ -121,7 +123,8 @@ #define STA_HASH(sta) (sta[5]) /* Maximum number of frames to buffer per power saving station */ #define STA_MAX_TX_BUFFER 128 -/* Buffered frame expiry time */ +/* Minimum buffered frame expiry time. If STA uses listen interval that is + * smaller than this value, the minimum value here is used instead. */ #define STA_TX_BUFFER_EXPIRE (10 * HZ) /* How often station data is cleaned up (e.g., expiration of buffered frames) -- 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 4/18] d80211: rename rate_control.h to ieee80211_rate.h
rate_control.h is not a header for rate_control.c as the name suggests. Furthermore, we want to introduce ieee80211_rate.c which implements some things defined in rate_control.h. This patch renames rate_control.h to ieee80211_rate.h. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |2 - net/d80211/ieee80211_ioctl.c |2 - net/d80211/ieee80211_rate.h | 154 ++ net/d80211/ieee80211_scan.c |2 - net/d80211/ieee80211_sta.c |2 - net/d80211/ieee80211_sysfs.c |2 - net/d80211/rate_control.c|2 - net/d80211/rate_control.h| 154 -- net/d80211/sta_info.c|2 - 9 files changed, 161 insertions(+), 161 deletions(-) create mode 100644 net/d80211/ieee80211_rate.h delete mode 100644 net/d80211/rate_control.h 3e72d14a5a66f204c66ea88e89aa8d45f3f7c2c0 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index b30bd80..b138eb0 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -25,7 +25,7 @@ #include net/d80211.h #include net/d80211_common.h #include net/d80211_mgmt.h #include ieee80211_i.h -#include rate_control.h +#include ieee80211_rate.h #include wep.h #include wpa.h #include tkip.h diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index 445adad..36759e4 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -23,7 +23,7 @@ #include net/d80211.h #include net/d80211_mgmt.h #include ieee80211_i.h #include hostapd_ioctl.h -#include rate_control.h +#include ieee80211_rate.h #include wpa.h #include aes_ccm.h diff --git a/net/d80211/ieee80211_rate.h b/net/d80211/ieee80211_rate.h new file mode 100644 index 000..e1c9e05 --- /dev/null +++ b/net/d80211/ieee80211_rate.h @@ -0,0 +1,154 @@ +/* + * Copyright 2002-2005, 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 IEEE80211_RATE_H +#define IEEE80211_RATE_H + +#include linux/netdevice.h +#include linux/skbuff.h +#include linux/types.h +#include net/d80211.h +#include ieee80211_i.h +#include sta_info.h + +#define RATE_CONTROL_NUM_DOWN 20 +#define RATE_CONTROL_NUM_UP 15 + + +struct rate_control_extra { + /* values from rate_control_get_rate() to the caller: */ + struct ieee80211_rate *probe; /* probe with this rate, or NULL for no + * probing */ + int startidx, endidx, rateidx; + struct ieee80211_rate *nonerp; + int nonerp_idx; + + /* parameters from the caller to rate_control_get_rate(): */ + int mgmt_data; /* this is data frame that is used for management + * (e.g., IEEE 802.1X EAPOL) */ + u16 ethertype; +}; + + +struct rate_control_ops { + const char *name; + void (*tx_status)(struct net_device *dev, struct sk_buff *skb, + struct ieee80211_tx_status *status); + struct ieee80211_rate * + (*get_rate)(struct net_device *dev, struct sk_buff *skb, + struct rate_control_extra *extra); + void (*rate_init)(struct ieee80211_local *local, struct sta_info *sta); + void (*clear)(void *priv); + + void * (*alloc)(struct ieee80211_local *local); + void (*free)(void *priv); + void * (*alloc_sta)(void); + void (*free_sta)(void *priv); + + int (*add_attrs)(void *priv, struct kobject *kobj); + void (*remove_attrs)(void *priv, struct kobject *kobj); + int (*add_sta_attrs)(void *priv, struct kobject *kobj); + void (*remove_sta_attrs)(void *priv, struct kobject *kobj); +}; + + +int ieee80211_rate_control_register(struct rate_control_ops *ops); +void ieee80211_rate_control_unregister(struct rate_control_ops *ops); + + +static inline void rate_control_tx_status(struct net_device *dev, + struct sk_buff *skb, + struct ieee80211_tx_status *status) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + local-rate_ctrl-tx_status(dev, skb, status); +} + + +static inline struct ieee80211_rate * +rate_control_get_rate(struct net_device *dev, struct sk_buff *skb, + struct rate_control_extra *extra) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + return local-rate_ctrl-get_rate(dev, skb, extra); +} + + +static inline void rate_control_rate_init(struct ieee80211_local *local, + struct sta_info *sta) +{ + local-rate_ctrl-rate_init(local, sta); +} + + +static inline void rate_control_clear(struct ieee80211_local *local) +{ + local-rate_ctrl-clear(local-rate_ctrl_priv); +} + + +static inline void * rate_control_alloc(struct
[PATCH 18/18] d80211: remove unused Super AG definitions, purge comment
From: David Kimdon [EMAIL PROTECTED] Remove unused Super AG structure members, enums. In struct ieee80211_tx_status the queue_length and queue_number could be useful outside the context of Super AG, so remove the comment and leave the members. Signed-off-by: David Kimdon [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- include/net/d80211.h| 14 -- include/net/d80211_shared.h |4 +--- net/d80211/hostapd_ioctl.h |4 3 files changed, 1 insertions(+), 21 deletions(-) a3cdcec1a299bcb883a7bcc73588163f245b64ae diff --git a/include/net/d80211.h b/include/net/d80211.h index 6d91e13..f29deff 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -159,12 +159,6 @@ struct ieee80211_tx_control { unsigned int requeue:1; unsigned int first_fragment:1; /* This is a first fragment of the * frame */ -/* following three flags are only used with Atheros Super A/G */ - unsigned int compress:1; - unsigned int turbo_prime_notify:1; /* notify HostAPd after frame - * transmission */ - unsigned int fast_frame:1; - unsigned int power_level:8; /* per-packet transmit power level, in dBm */ unsigned int antenna_sel:4; /* 0 = default/diversity, @@ -219,7 +213,6 @@ struct ieee80211_tx_status { int excessive_retries; int retry_count; - /* following two fields are only used with Atheros Super A/G */ int queue_length; /* information about TX queue */ int queue_number; }; @@ -265,13 +258,6 @@ struct ieee80211_conf { int antenna_def; int antenna_mode; - int atheros_super_ag_compression; - int atheros_super_ag_fast_frame; - int atheros_super_ag_burst; - int atheros_super_ag_wme_ele; - int atheros_super_ag_turbo_g; - int atheros_super_ag_turbo_prime; - /* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect; unsigned int spect_mgmt; diff --git a/include/net/d80211_shared.h b/include/net/d80211_shared.h index 11569d1..2f1bb42 100644 --- a/include/net/d80211_shared.h +++ b/include/net/d80211_shared.h @@ -19,9 +19,7 @@ enum { 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) */, - MODE_ATHEROS_PRIME = 5 /* Atheros Dynamic Turbo mode */, - MODE_ATHEROS_PRIMEG = 6 /* Atheros Dynamic Turbo mode G */, - NUM_IEEE80211_MODES = 7 + NUM_IEEE80211_MODES = 5 }; #define IEEE80211_CHAN_W_SCAN 0x0001 diff --git a/net/d80211/hostapd_ioctl.h b/net/d80211/hostapd_ioctl.h index 003f371..559d11c 100644 --- a/net/d80211/hostapd_ioctl.h +++ b/net/d80211/hostapd_ioctl.h @@ -182,10 +182,6 @@ struct prism2_hostapd_param { u16 aid; u16 capability; u8 supp_rates[32]; - /* atheros_super_ag and enc_flags are only used with -* IEEE80211_ATHEROS_SUPER_AG -*/ - u8 atheros_super_ag; u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; -- 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 10/18] d80211: Fix overflow when creating AVS header
From: David Kimdon [EMAIL PROTECTED] Fix overflow when converting timespec to microseconds. Without this patch you can get an overflow during the multiplication which can result in a negative number. hostime is define here: 4.4 hosttime The hosttime field is set to the current value of the host maintained clock variable when the frame is received. (from http://www.locustworld.com/tracker/getfile/prism2drivers/doc/capturefrm.txt) it is a u64. Signed-off-by: David Kimdon [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) 4fdbfdf950c3260f16bad12bb1a5ebeac97bee37 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index ce56fd3..6847610 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2579,7 +2579,7 @@ ieee80211_rx_mgmt(struct net_device *dev struct ieee80211_rate *rate; jiffies_to_timespec(status-hosttime, ts); - fi-hosttime = cpu_to_be64(ts.tv_sec * 100 + + fi-hosttime = cpu_to_be64((u64) ts.tv_sec * 100 + ts.tv_nsec / 1000); fi-mactime = cpu_to_be64(status-mactime); switch (status-phymode) { -- 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/18] d80211: rename rate_control.c to rc80211_simple.c
To support changing of the rate control modules on the fly we need well-defined names of the modules. Let it be rc80211_*. Rename the only one rate control module (rate_control.c) into rc80211_simple.c. The module alias for the default module is changed to rc80211_default. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/Makefile |2 net/d80211/rate_control.c | 395 --- net/d80211/rc80211_simple.c | 395 +++ 3 files changed, 396 insertions(+), 396 deletions(-) delete mode 100644 net/d80211/rate_control.c create mode 100644 net/d80211/rc80211_simple.c 4bef5903c5a0b05778d31f605668b6d8576b40d8 diff --git a/net/d80211/Makefile b/net/d80211/Makefile index 27d90e5..d5d4d41 100644 --- a/net/d80211/Makefile +++ b/net/d80211/Makefile @@ -1,4 +1,4 @@ -obj-$(CONFIG_D80211) += 80211.o rate_control.o +obj-$(CONFIG_D80211) += 80211.o rc80211_simple.o 80211-objs-$(CONFIG_D80211_LEDS) += ieee80211_led.o diff --git a/net/d80211/rate_control.c b/net/d80211/rate_control.c deleted file mode 100644 index 6703931..000 --- a/net/d80211/rate_control.c +++ /dev/null @@ -1,395 +0,0 @@ -/* - * Copyright 2002-2005, 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. - */ - -#include linux/module.h -#include linux/init.h -#include linux/netdevice.h -#include linux/types.h -#include linux/slab.h -#include linux/skbuff.h -#include linux/compiler.h - -#include net/d80211.h -#include ieee80211_i.h -#include ieee80211_rate.h - - -/* This is a minimal implementation of TX rate controlling that can be used - * as the default when no improved mechanisms are available. */ - - -#define RATE_CONTROL_EMERG_DEC 2 -#define RATE_CONTROL_INTERVAL (HZ / 20) -#define RATE_CONTROL_MIN_TX 10 - -MODULE_ALIAS(rc80211_default); - -static void rate_control_rate_inc(struct ieee80211_local *local, - struct sta_info *sta) -{ -struct ieee80211_sub_if_data *sdata; - int i = sta-txrate; - int maxrate; - -sdata = IEEE80211_DEV_TO_SUB_IF(sta-dev); - if (sdata-bss sdata-bss-force_unicast_rateidx -1) { - /* forced unicast rate - do not change STA rate */ - return; - } - - maxrate = sdata-bss ? sdata-bss-max_ratectrl_rateidx : -1; - - if (i local-num_curr_rates) - i = local-num_curr_rates - 2; - - while (i + 1 local-num_curr_rates) { - i++; - if (sta-supp_rates BIT(i) - local-curr_rates[i].flags IEEE80211_RATE_SUPPORTED - (maxrate 0 || i = maxrate)) { - sta-txrate = i; - break; - } - } -} - - -static void rate_control_rate_dec(struct ieee80211_local *local, - struct sta_info *sta) -{ -struct ieee80211_sub_if_data *sdata; - int i = sta-txrate; - -sdata = IEEE80211_DEV_TO_SUB_IF(sta-dev); - if (sdata-bss sdata-bss-force_unicast_rateidx -1) { - /* forced unicast rate - do not change STA rate */ - return; - } - - if (i local-num_curr_rates) - i = local-num_curr_rates; - - while (i 0) { - i--; - if (sta-supp_rates BIT(i) - local-curr_rates[i].flags IEEE80211_RATE_SUPPORTED) { - sta-txrate = i; - break; - } - } -} - - -static struct ieee80211_rate * -rate_control_lowest_rate(struct ieee80211_local *local) -{ - int i; - - for (i = 0; i local-num_curr_rates; i++) { - struct ieee80211_rate *rate = local-curr_rates[i]; - - if (rate-flags IEEE80211_RATE_SUPPORTED - ) - return rate; - } - - printk(KERN_DEBUG rate_control_lowest_rate - no supported rates - found\n); - return local-curr_rates[0]; -} - - -struct global_rate_control { - int dummy; -}; - -struct sta_rate_control { -unsigned long last_rate_change; -u32 tx_num_failures; -u32 tx_num_xmit; - -unsigned long avg_rate_update; -u32 tx_avg_rate_sum; -u32 tx_avg_rate_num; -}; - - -static void rate_control_simple_tx_status(struct net_device *dev, - struct sk_buff *skb, - struct ieee80211_tx_status *status) -{ - struct ieee80211_local *local = dev-ieee80211_ptr; - struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb-data; - struct sta_info *sta; - struct sta_rate_control *srctrl; - -sta = sta_info_get(local, hdr-addr1);
[PATCH 17/18] d80211: Fix TX/RX rates
From: Modestas Vainius [EMAIL PROTECTED] This patch correctly initializes the force_unicast_rateidx and max_ratectrl_rateidx. This was not done previously and caused a bug in rf80211_simple where when rate_control_simple_get_rate() was called, the incorrect rate was selected from the list. Signed-off-by: Modestas Vainius [EMAIL PROTECTED] Signed-off-by: Ivo van Doorn [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) 0fbc8104060588dab4db93f37e3cdfb86ffed062 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 50b2b29..32a1ba7 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -4414,6 +4414,8 @@ struct net_device *ieee80211_alloc_hw(si sdata-dev = mdev; sdata-master = mdev; sdata-local = local; + sdata-u.ap.force_unicast_rateidx = -1; + sdata-u.ap.max_ratectrl_rateidx = -1; ieee80211_if_sdata_init(sdata); list_add_tail(sdata-list, local-sub_if_list); -- 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 7/18] d80211: proper rate control structures freeing
Add a reference counting to the rate control algorithm structure. This prevents unloading of the rate control module when there still exists a sta entry which uses that module. To achieve this some other things need to be done in this patch as well: - The new rate_control_ref structure is introduced. It replaces the rate_ctrl and rate_ctrl_priv fields in the ieee80211_local. - Parameters for most rate control callbacks are changed. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c | 37 + net/d80211/ieee80211_i.h |3 - net/d80211/ieee80211_ioctl.c |2 - net/d80211/ieee80211_rate.c | 54 +- net/d80211/ieee80211_rate.h | 124 +- net/d80211/ieee80211_scan.c |2 - net/d80211/ieee80211_sta.c |6 +- net/d80211/ieee80211_sysfs.c |5 +- net/d80211/rc80211_simple.c | 19 -- net/d80211/sta_info.c| 14 +++-- net/d80211/sta_info.h|1 11 files changed, 158 insertions(+), 109 deletions(-) a020fc0696485e6cf460060c7fc03c1066897ba0 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 8c4a6d6..8d8149e 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -351,7 +351,8 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021 extra.startidx = 0; extra.endidx= tx-local-num_curr_rates; - tx-u.tx.rate = rate_control_get_rate(tx-dev, tx-skb, extra); + tx-u.tx.rate = rate_control_get_rate(tx-local, tx-dev, tx-skb, + extra); if (unlikely(extra.probe != NULL)) { tx-u.tx.control-rate_ctrl_probe = 1; tx-u.tx.probe_last_frag = 1; @@ -1781,7 +1782,7 @@ #endif /* CONFIG_D80211_VERBOSE_DEBUG */ memset(extra, 0, sizeof(extra)); extra.endidx = local-num_curr_rates; - rate = rate_control_get_rate(dev, skb, extra); + rate = rate_control_get_rate(local, dev, skb, extra); if (!rate) { if (net_ratelimit()) { printk(KERN_DEBUG %s: ieee80211_beacon_get: no rate @@ -4102,7 +4103,7 @@ void ieee80211_tx_status(struct net_devi return; } } else { - rate_control_tx_status(dev, skb, status); + rate_control_tx_status(local, dev, skb, status); } ieee80211_led_tx(local, 0); @@ -4304,36 +4305,30 @@ static void ieee80211_precalc_modes(stru static int rate_control_initialize(struct ieee80211_local *local) { - struct rate_control_ops *ops; + struct rate_control_ref *ref; - ops = ieee80211_rate_control_ops_get(NULL); - if (!ops) { + ref = rate_control_alloc(NULL, local); + if (!ref) { printk(KERN_WARNING %s: Failed to select rate control algorithm\n, local-mdev-name); return -1; } - local-rate_ctrl_priv = rate_control_alloc(ops, local); - if (!local-rate_ctrl_priv) { - ieee80211_rate_control_ops_put(ops); - return -1; - } - local-rate_ctrl = ops; + local-rate_ctrl = ref; printk(KERN_DEBUG %s: Selected rate control algorithm '%s'\n, local-mdev-name, - local-rate_ctrl-name); + ref-ops-name); return 0; } static void rate_control_deinitialize(struct ieee80211_local *local) { - struct rate_control_ops *ops; + struct rate_control_ref *ref; - rate_control_free(local); - ops = local-rate_ctrl; + ref = local-rate_ctrl; local-rate_ctrl = NULL; - ieee80211_rate_control_ops_put(ops); + rate_control_put(ref); } struct net_device *ieee80211_alloc_hw(size_t priv_data_len, @@ -4511,8 +4506,7 @@ int ieee80211_register_hw(struct net_dev algorithm\n, dev-name); goto fail_rate; } - result = rate_control_add_attrs(local, local-rate_ctrl_priv, - local-class_dev.kobj); + result = rate_control_add_attrs(local-ref, local-class_dev.kobj); if (result 0) { printk(KERN_DEBUG %s: Failed to register sysfs attributes for rate control\n, dev-name); @@ -4630,8 +4624,8 @@ void ieee80211_unregister_hw(struct net_ ieee80211_rx_bss_list_deinit(dev); ieee80211_clear_tx_pending(local); sta_info_stop(local); - rate_control_remove_attrs(local, local-rate_ctrl_priv, - local-class_dev.kobj); + rate_control_remove_attrs(local-ref, local-class_dev.kobj); + rate_control_deinitialize(local); ieee80211_dev_sysfs_del(local); for (i = 0; i NUM_IEEE80211_MODES; i++) { @@ -4662,7 +4656,6 @@ EXPORT_SYMBOL(ieee80211_free_hw); void ieee80211_release_hw(struct ieee80211_local
[PATCH 9/18] d80211: rate_control: do not use atomic allocations when not necessary
Allow GFP_KERNEL to be used for allocations of sta entries triggered from the user space. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211_ioctl.c |2 +- net/d80211/ieee80211_rate.h |7 --- net/d80211/ieee80211_sta.c |4 ++-- net/d80211/rc80211_simple.c |4 ++-- net/d80211/sta_info.c|8 +++- net/d80211/sta_info.h|2 +- 6 files changed, 13 insertions(+), 14 deletions(-) 034b87e99c85b243b94c6955bbdce94825dd6b1f diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index ff6718b..cded685 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -277,7 +277,7 @@ static int ieee80211_ioctl_add_sta(struc sta = sta_info_get(local, param-sta_addr); if (!sta) { - sta = sta_info_add(local, dev, param-sta_addr); + sta = sta_info_add(local, dev, param-sta_addr, GFP_KERNEL); if (!sta) return -ENOMEM; } diff --git a/net/d80211/ieee80211_rate.h b/net/d80211/ieee80211_rate.h index 60e4879..04c7465 100644 --- a/net/d80211/ieee80211_rate.h +++ b/net/d80211/ieee80211_rate.h @@ -52,7 +52,7 @@ struct rate_control_ops { void *(*alloc)(struct ieee80211_local *local); void (*free)(void *priv); - void *(*alloc_sta)(void *priv); + void *(*alloc_sta)(void *priv, gfp_t gfp); void (*free_sta)(void *priv, void *priv_sta); int (*add_attrs)(void *priv, struct kobject *kobj); @@ -112,9 +112,10 @@ static inline void rate_control_clear(st ref-ops-clear(ref-priv); } -static inline void *rate_control_alloc_sta(struct rate_control_ref *ref) +static inline void *rate_control_alloc_sta(struct rate_control_ref *ref, + gfp_t gfp) { - return ref-ops-alloc_sta(ref-priv); + return ref-ops-alloc_sta(ref-priv, gfp); } static inline void rate_control_free_sta(struct rate_control_ref *ref, diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index ed6747a..480e9c9 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -1158,7 +1158,7 @@ static void ieee80211_rx_mgmt_assoc_resp /* Add STA entry for the AP */ sta = sta_info_get(local, ifsta-bssid); if (!sta) { - sta = sta_info_add(local, dev, ifsta-bssid); + sta = sta_info_add(local, dev, ifsta-bssid, GFP_ATOMIC); if (!sta) { printk(KERN_DEBUG %s: failed to add STA entry for the AP\n, dev-name); @@ -2832,7 +2832,7 @@ struct sta_info * ieee80211_ibss_add_sta printk(KERN_DEBUG %s: Adding new IBSS station MAC_FMT (dev=%s)\n, dev-name, MAC_ARG(addr), sta_dev-name); - sta = sta_info_add(local, dev, addr); + sta = sta_info_add(local, dev, addr, GFP_ATOMIC); if (!sta) return NULL; diff --git a/net/d80211/rc80211_simple.c b/net/d80211/rc80211_simple.c index 055a167..3634d00 100644 --- a/net/d80211/rc80211_simple.c +++ b/net/d80211/rc80211_simple.c @@ -305,11 +305,11 @@ static void rate_control_simple_clear(vo } -static void * rate_control_simple_alloc_sta(void *priv) +static void * rate_control_simple_alloc_sta(void *priv, gfp_t gfp) { struct sta_rate_control *rctrl; - rctrl = kzalloc(sizeof(*rctrl), GFP_ATOMIC); + rctrl = kzalloc(sizeof(*rctrl), gfp); return rctrl; } diff --git a/net/d80211/sta_info.c b/net/d80211/sta_info.c index a177d2f..c18365b 100644 --- a/net/d80211/sta_info.c +++ b/net/d80211/sta_info.c @@ -130,16 +130,14 @@ void sta_info_release(struct kobject *ko struct sta_info * sta_info_add(struct ieee80211_local *local, - struct net_device *dev, u8 *addr) + struct net_device *dev, u8 *addr, gfp_t gfp) { struct sta_info *sta; - sta = kmalloc(sizeof(*sta), GFP_ATOMIC); + sta = kzalloc(sizeof(*sta), gfp); if (!sta) return NULL; - memset(sta, 0, sizeof(*sta)); - if (kobject_set_name(sta-kobj, MAC_FMT, MAC_ARG(addr))) { kfree(sta); return NULL; @@ -148,7 +146,7 @@ struct sta_info * sta_info_add(struct ie kobject_init(sta-kobj); sta-rate_ctrl = rate_control_get(local-rate_ctrl); - sta-rate_ctrl_priv = rate_control_alloc_sta(sta-rate_ctrl); + sta-rate_ctrl_priv = rate_control_alloc_sta(sta-rate_ctrl, gfp); if (!sta-rate_ctrl_priv) { rate_control_put(sta-rate_ctrl); kobject_put(sta-kobj); diff --git a/net/d80211/sta_info.h b/net/d80211/sta_info.h index 9bd7e0d..ed1a104 100644 --- a/net/d80211/sta_info.h +++ b/net/d80211/sta_info.h @@ -133,7 +133,7 @@ struct sta_info * sta_info_get(struct ie int sta_info_min_txrate_get(struct ieee80211_local *local); void sta_info_put(struct sta_info *sta); struct
[PATCH 1/18] d80211: fix is_ieee80211_device
The is_ieee80211_device function must ensure that the passed net_device belongs to the hardware device we are working with. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |9 + 1 files changed, 5 insertions(+), 4 deletions(-) 54bac502265add95b8ca098ccf62c1d506daeb86 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 1ef2707..3efba6a 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -1123,9 +1123,10 @@ __ieee80211_tx_prepare(struct ieee80211_ } -static int inline is_ieee80211_device(struct net_device *dev) +static int inline is_ieee80211_device(struct net_device *dev, + struct net_device *master) { - return (dev-ieee80211_ptr != NULL); + return (dev-ieee80211_ptr == master-ieee80211_ptr); } /* Device in tx-dev has a reference added; use dev_put(tx-dev) when @@ -1140,7 +1141,7 @@ static void inline ieee80211_tx_prepare( pkt_data = (struct ieee80211_tx_packet_data *)skb-cb; dev = dev_get_by_index(pkt_data-ifindex); - if (unlikely(dev !is_ieee80211_device(dev))) { + if (unlikely(dev !is_ieee80211_device(dev, mdev))) { dev_put(dev); dev = NULL; } @@ -1395,7 +1396,7 @@ static int ieee80211_master_start_xmit(s if (pkt_data-ifindex) odev = dev_get_by_index(pkt_data-ifindex); - if (unlikely(odev !is_ieee80211_device(odev))) { + if (unlikely(odev !is_ieee80211_device(odev, dev))) { dev_put(odev); odev = NULL; } -- 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 8/18] d80211: allow changing of the rate control algorithm
Allow changing of the rate control algorithm. This has some limitations: - The rate control algorithm can be set per-wiphy only. - All of network interfaces of the wiphy have to be down to change the algorithm. - All sta entries are flushed when the algorithm is succesfully changed. - The add_sta ioctl can be called only at a running interface from now. Changing of the algorithm is possible by writing a new algorithm name into /sys/class/ieee80211/phyX/rate_ctrl_alg. This will be most likely changed in the future. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c | 50 +- net/d80211/ieee80211_i.h |2 ++ net/d80211/ieee80211_ioctl.c |4 +++ net/d80211/ieee80211_sysfs.c | 18 ++- 4 files changed, 57 insertions(+), 17 deletions(-) 61a4837fa8e08fc3200b8fa026a84b4afcb674ff diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 8d8149e..ce56fd3 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -4303,22 +4303,44 @@ static void ieee80211_precalc_modes(stru } } -static int rate_control_initialize(struct ieee80211_local *local) +int ieee80211_init_rate_ctrl_alg(struct ieee80211_local *local, +const char *name) { - struct rate_control_ref *ref; + struct rate_control_ref *ref, *old; + int res; + + ASSERT_RTNL(); + if (local-open_count || netif_running(local-mdev) || + (local-apdev netif_running(local-apdev))) + return -EBUSY; - ref = rate_control_alloc(NULL, local); + ref = rate_control_alloc(name, local); if (!ref) { printk(KERN_WARNING %s: Failed to select rate control algorithm\n, local-mdev-name); - return -1; + return -ENOENT; + } + res = rate_control_add_attrs(ref, local-class_dev.kobj); + if (res 0) { + printk(KERN_DEBUG %s: Failed to register sysfs attributes + for rate control\n, local-mdev-name); + rate_control_put(ref); + return res; } + + old = local-rate_ctrl; local-rate_ctrl = ref; + if (old) { + rate_control_remove_attrs(ref, local-class_dev.kobj); + rate_control_put(old); + sta_info_flush(local, NULL); + } printk(KERN_DEBUG %s: Selected rate control algorithm '%s'\n, local-mdev-name, ref-ops-name); + return 0; } @@ -4328,6 +4350,7 @@ static void rate_control_deinitialize(st ref = local-rate_ctrl; local-rate_ctrl = NULL; + rate_control_remove_attrs(ref, local-class_dev.kobj); rate_control_put(ref); } @@ -4496,28 +4519,24 @@ int ieee80211_register_hw(struct net_dev goto fail_masterlink; } result = ieee80211_sysfs_add_netdevice(dev); - rtnl_unlock(); - if (result 0) + if (result 0) { + rtnl_unlock(); goto fail_if_sysfs; + } - result = rate_control_initialize(local); + result = ieee80211_init_rate_ctrl_alg(local, NULL); + rtnl_unlock(); if (result 0) { printk(KERN_DEBUG %s: Failed to initialize rate control algorithm\n, dev-name); goto fail_rate; } - result = rate_control_add_attrs(local-ref, local-class_dev.kobj); - if (result 0) { - printk(KERN_DEBUG %s: Failed to register sysfs attributes - for rate control\n, dev-name); - goto fail_rate_attrs; - } result = ieee80211_wep_init(local); if (result 0) { printk(KERN_DEBUG %s: Failed to initialize wep\n, dev-name); - goto fail_rate_attrs; + goto fail_wep; } /* TODO: add rtnl locking around device creation and qdisc install */ @@ -4536,7 +4555,7 @@ int ieee80211_register_hw(struct net_dev return 0; -fail_rate_attrs: +fail_wep: rate_control_deinitialize(local); fail_rate: ieee80211_sysfs_remove_netdevice(dev); @@ -4624,7 +4643,6 @@ void ieee80211_unregister_hw(struct net_ ieee80211_rx_bss_list_deinit(dev); ieee80211_clear_tx_pending(local); sta_info_stop(local); - rate_control_remove_attrs(local-ref, local-class_dev.kobj); rate_control_deinitialize(local); ieee80211_dev_sysfs_del(local); diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 9c81c48..314235b 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -583,6 +583,8 @@ int ieee80211_if_update_wds(struct net_d void ieee80211_if_setup(struct net_device *dev); void ieee80211_if_mgmt_setup(struct net_device *dev); void ieee80211_if_shutdown(struct net_device *dev); +int ieee80211_init_rate_ctrl_alg(struct
[PATCH 5/18] d80211: proper rate_control loading
Fix locking issues with loading of rate_control modules. This still doesn't allow changing of the modules on the fly. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/Makefile |1 net/d80211/ieee80211.c | 108 ++- net/d80211/ieee80211_rate.c | 92 + net/d80211/ieee80211_rate.h |8 ++- net/d80211/rate_control.c |3 + 5 files changed, 136 insertions(+), 76 deletions(-) create mode 100644 net/d80211/ieee80211_rate.c 1e55cd13b3f20ac9560270a5455d58f0cbd2acd9 diff --git a/net/d80211/Makefile b/net/d80211/Makefile index 2a2a0c6..27d90e5 100644 --- a/net/d80211/Makefile +++ b/net/d80211/Makefile @@ -12,6 +12,7 @@ obj-$(CONFIG_D80211) += 80211.o rate_con ieee80211_sta.o \ ieee80211_dev.o \ ieee80211_iface.o \ + ieee80211_rate.o \ ieee80211_sysfs.o \ ieee80211_sysfs_sta.o \ michael.o \ diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index b138eb0..8c4a6d6 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -46,16 +46,6 @@ static unsigned char eapol_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00, 0x88, 0x8e }; -struct rate_control_algs { - struct rate_control_algs *next; - struct rate_control_ops *ops; -}; - -static struct rate_control_algs *ieee80211_rate_ctrl_algs; - -static int rate_control_initialize(struct ieee80211_local *local); - - static u8 * ieee80211_get_bssid(struct ieee80211_hdr *hdr, size_t len); static int ieee80211_mgmt_start_xmit(struct sk_buff *skb, @@ -4312,6 +4302,39 @@ static void ieee80211_precalc_modes(stru } } +static int rate_control_initialize(struct ieee80211_local *local) +{ + struct rate_control_ops *ops; + + ops = ieee80211_rate_control_ops_get(NULL); + if (!ops) { + printk(KERN_WARNING %s: Failed to select rate control + algorithm\n, local-mdev-name); + return -1; + } + local-rate_ctrl_priv = rate_control_alloc(ops, local); + if (!local-rate_ctrl_priv) { + ieee80211_rate_control_ops_put(ops); + return -1; + } + local-rate_ctrl = ops; + + printk(KERN_DEBUG %s: Selected rate control + algorithm '%s'\n, local-mdev-name, + local-rate_ctrl-name); + + return 0; +} + +static void rate_control_deinitialize(struct ieee80211_local *local) +{ + struct rate_control_ops *ops; + + rate_control_free(local); + ops = local-rate_ctrl; + local-rate_ctrl = NULL; + ieee80211_rate_control_ops_put(ops); +} struct net_device *ieee80211_alloc_hw(size_t priv_data_len, void (*setup)(struct net_device *)) @@ -4520,7 +4543,7 @@ int ieee80211_register_hw(struct net_dev return 0; fail_rate_attrs: - rate_control_free(local); + rate_control_deinitialize(local); fail_rate: ieee80211_sysfs_remove_netdevice(dev); fail_if_sysfs: @@ -4639,7 +4662,7 @@ EXPORT_SYMBOL(ieee80211_free_hw); void ieee80211_release_hw(struct ieee80211_local *local) { - rate_control_free(local); + rate_control_deinitialize(local); kfree(local); } @@ -4742,67 +4765,6 @@ void * ieee80211_dev_stats(struct net_de } EXPORT_SYMBOL(ieee80211_dev_stats); -int ieee80211_rate_control_register(struct rate_control_ops *ops) -{ - struct rate_control_algs *alg; - - alg = kzalloc(sizeof(*alg), GFP_KERNEL); - if (!alg) - return -1; - - alg-next = ieee80211_rate_ctrl_algs; - alg-ops = ops; - ieee80211_rate_ctrl_algs = alg; - - return 0; -} -EXPORT_SYMBOL(ieee80211_rate_control_register); - -void ieee80211_rate_control_unregister(struct rate_control_ops *ops) -{ - struct rate_control_algs *alg, *prev; - - prev = NULL; - alg = ieee80211_rate_ctrl_algs; - while (alg) { - if (alg-ops == ops) { - if (prev) - prev-next = alg-next; - else - ieee80211_rate_ctrl_algs = alg-next; - kfree(alg); - break; - } - prev = alg; - alg = alg-next; - } -} -EXPORT_SYMBOL(ieee80211_rate_control_unregister); - -static int rate_control_initialize(struct ieee80211_local *local) -{ - struct rate_control_algs *algs; - - if (!ieee80211_rate_ctrl_algs) - request_module(ieee80211_rate_control); - - for (algs = ieee80211_rate_ctrl_algs; algs; algs = algs-next) { - local-rate_ctrl = algs-ops; - local-rate_ctrl_priv = rate_control_alloc(local); - if (local-rate_ctrl_priv) { - printk(KERN_DEBUG %s: Selected rate control - algorithm '%s'\n, local-mdev-name, -
[PATCH 3/18] d80211: del sta timer on interface close
Delete sta timer when the corresponding network interface is brought down. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c | 24 net/d80211/ieee80211_i.h |1 + net/d80211/ieee80211_iface.c | 12 +++- net/d80211/ieee80211_sta.c |3 +++ 4 files changed, 31 insertions(+), 9 deletions(-) 606451a64310c8084e9a3de07bafb8360989d004 diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 036eca1..b30bd80 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2106,6 +2106,29 @@ static struct net_device_stats *ieee8021 return (sdata-stats); } +void ieee80211_if_shutdown(struct net_device *dev) +{ + struct ieee80211_local *local = dev-ieee80211_ptr; + struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev); + + ASSERT_RTNL(); + switch (sdata-type) { + case IEEE80211_IF_TYPE_STA: + case IEEE80211_IF_TYPE_IBSS: + sdata-u.sta.state = IEEE80211_DISABLED; + del_timer_sync(sdata-u.sta.timer); + if (local-scan_work.data == sdata-dev) { + local-sta_scanning = 0; + cancel_delayed_work(local-scan_work); + flush_scheduled_work(); + /* see comment in ieee80211_unregister_hw to +* understand why this works */ + local-scan_work.data = NULL; + } + break; + } +} + static inline int identical_mac_addr_allowed(int type1, int type2) { return (type1 == IEEE80211_IF_TYPE_MNTR || @@ -2306,6 +2329,7 @@ static int ieee80211_stop(struct net_dev conf.mac_addr = dev-dev_addr; local-hw-remove_interface(sdata-master, conf); } + ieee80211_if_shutdown(dev); ieee80211_start_hard_monitor(local); diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 425fc9b..6fd208e 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -583,6 +583,7 @@ void ieee80211_tx_set_iswep(struct ieee8 int ieee80211_if_update_wds(struct net_device *dev, u8 *remote_addr); void ieee80211_if_setup(struct net_device *dev); void ieee80211_if_mgmt_setup(struct net_device *dev); +void ieee80211_if_shutdown(struct net_device *dev); /* ieee80211_ioctl.c */ int ieee80211_ioctl(struct net_device *dev, struct ifreq *rq, int cmd); diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c index 0a10c86..9a187af 100644 --- a/net/d80211/ieee80211_iface.c +++ b/net/d80211/ieee80211_iface.c @@ -242,6 +242,9 @@ #endif ieee80211_key_free(sdata-keys[i]); } + /* Shouldn't be necessary but won't hurt */ + ieee80211_if_shutdown(dev); + switch (sdata-type) { case IEEE80211_IF_TYPE_AP: { /* Remove all virtual interfaces that use this BSS @@ -286,15 +289,6 @@ #endif /* CONFIG_D80211_VERBOSE_DEBUG */ break; case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: - del_timer_sync(sdata-u.sta.timer); - if (local-scan_work.data == sdata-dev) { - local-sta_scanning = 0; - cancel_delayed_work(local-scan_work); - flush_scheduled_work(); - /* see comment in ieee80211_unregister_hw to -* understand why this works */ - local-scan_work.data = NULL; - } kfree(sdata-u.sta.extra_ie); sdata-u.sta.extra_ie = NULL; kfree(sdata-u.sta.assocreq_ies); diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index dd95ce8..159474f 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -1848,6 +1848,9 @@ void ieee80211_sta_timer(unsigned long p struct ieee80211_if_sta *ifsta; dev = (struct net_device *) ptr; + if (!netif_running(dev)) + return; + sdata = IEEE80211_DEV_TO_SUB_IF(dev); if (sdata-type != IEEE80211_IF_TYPE_STA sdata-type != IEEE80211_IF_TYPE_IBSS) { -- 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
Re: [patch] d80211: remove initialization of unused xr structure members
On Fri, 13 Oct 2006 12:34:57 -0700, David Kimdon wrote: The structure member xr_end was removed from d80211.h. John, please apply this after you pull from my tree (perhaps with a rt2x00 prefix in the subject instead of d80211?). 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: [take1 0/5] d80211 patches
On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. Thanks for the patches! At first I intended to ask you to split d80211 and drivers parts of the patches, but your way is better I think - it doesn't break git-bisect. John, if you agree with these patches, could you apply them after you pull from my tree? 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 11/18] d80211: remove unused xr structure members, interface, etc.
From: Elliot Schwartz [EMAIL PROTECTED] This is all unused. Signed-off-by: Elliot Schwartz [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- include/net/d80211.h |9 - include/net/d80211_mgmt.h|4 include/net/d80211_shared.h |4 +--- net/d80211/hostapd_ioctl.h |1 - net/d80211/ieee80211_sysfs_sta.c |5 ++--- net/d80211/sta_info.h|1 - 6 files changed, 3 insertions(+), 21 deletions(-) 6e353ac70959573dceff64137badeb170cec0709 diff --git a/include/net/d80211.h b/include/net/d80211.h index a80f48b..6d91e13 100644 --- a/include/net/d80211.h +++ b/include/net/d80211.h @@ -82,7 +82,6 @@ struct ieee80211_hw_modes { struct ieee80211_channel *channels; int num_rates; struct ieee80211_rate *rates; - int xr_end; /* only used with Atheros XR */ }; struct ieee80211_tx_queue_params { @@ -166,8 +165,6 @@ struct ieee80211_tx_control { * transmission */ unsigned int fast_frame:1; - unsigned int atheros_xr:1; /* only used with Atheros XR */ - unsigned int power_level:8; /* per-packet transmit power level, in dBm */ unsigned int antenna_sel:4; /* 0 = default/diversity, @@ -193,7 +190,6 @@ struct ieee80211_tx_control { #define RX_FLAG_MMIC_ERROR 0x1 #define RX_FLAG_DECRYPTED0x2 -#define RX_FLAG_XR_DOUBLE_CHIRP 0x4 /* Receive status. The low-level driver should provide this information * (the subset supported by hardware) to the 802.11 code with each received @@ -276,8 +272,6 @@ struct ieee80211_conf { int atheros_super_ag_turbo_g; int atheros_super_ag_turbo_prime; - int atheros_xr; - /* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect; unsigned int spect_mgmt; @@ -679,9 +673,6 @@ struct ieee80211_hw { * needed only for IBSS mode and the result of this function is used to * determine whether to reply to Probe Requests. */ int (*tx_last_beacon)(struct net_device *dev); - - /* Optional handler for XR-in-use notification. */ - int (*atheros_xr_in_use)(struct net_device *dev, int in_use); }; /* Allocate a new hardware device. This must be called once for each diff --git a/include/net/d80211_mgmt.h b/include/net/d80211_mgmt.h index eb032de..87141d4 100644 --- a/include/net/d80211_mgmt.h +++ b/include/net/d80211_mgmt.h @@ -220,8 +220,4 @@ enum ieee80211_eid { WLAN_EID_QOS_PARAMETER = 222 }; - - -#define ATHEROS_INFO_USEXR BIT(3) - #endif /* D802_11_MGMT_H */ diff --git a/include/net/d80211_shared.h b/include/net/d80211_shared.h index 9dcb424..11569d1 100644 --- a/include/net/d80211_shared.h +++ b/include/net/d80211_shared.h @@ -21,8 +21,7 @@ enum { MODE_ATHEROS_TURBOG = 4 /* Atheros Turbo mode (2x.11g at 2.4 GHz) */, MODE_ATHEROS_PRIME = 5 /* Atheros Dynamic Turbo mode */, MODE_ATHEROS_PRIMEG = 6 /* Atheros Dynamic Turbo mode G */, - MODE_ATHEROS_XR = 7 /* Atheros XR mode */, - NUM_IEEE80211_MODES = 8 + NUM_IEEE80211_MODES = 7 }; #define IEEE80211_CHAN_W_SCAN 0x0001 @@ -40,7 +39,6 @@ #define IEEE80211_RATE_OFDM 0x0020 #define IEEE80211_RATE_CCK 0x0040 #define IEEE80211_RATE_TURBO 0x0080 #define IEEE80211_RATE_MANDATORY 0x0100 -#define IEEE80211_RATE_XR 0x0200 #define IEEE80211_RATE_CCK_2 (IEEE80211_RATE_CCK | IEEE80211_RATE_PREAMBLE2) #define IEEE80211_RATE_MODULATION(f) \ diff --git a/net/d80211/hostapd_ioctl.h b/net/d80211/hostapd_ioctl.h index d302790..fbd1088 100644 --- a/net/d80211/hostapd_ioctl.h +++ b/net/d80211/hostapd_ioctl.h @@ -186,7 +186,6 @@ struct prism2_hostapd_param { * IEEE80211_ATHEROS_SUPER_AG */ u8 atheros_super_ag; - u8 atheros_xr_mode; u8 wds_flags; #define IEEE80211_STA_DYNAMIC_ENC BIT(0) u8 enc_flags; diff --git a/net/d80211/ieee80211_sysfs_sta.c b/net/d80211/ieee80211_sysfs_sta.c index 94c6dd8..d2067ef 100644 --- a/net/d80211/ieee80211_sysfs_sta.c +++ b/net/d80211/ieee80211_sysfs_sta.c @@ -77,7 +77,7 @@ STA_ATTR(wep_weak_iv_count, wep_weak_iv_ static ssize_t show_sta_flags(const struct sta_info *sta, char *buf) { - return sprintf(buf, %s%s%s%s%s%s%s%s%s%s, + return sprintf(buf, %s%s%s%s%s%s%s%s%s, sta-flags WLAN_STA_AUTH ? AUTH\n : , sta-flags WLAN_STA_ASSOC ? ASSOC\n : , sta-flags WLAN_STA_PS ? PS\n : , @@ -87,8 +87,7 @@ static ssize_t show_sta_flags(const stru sta-flags WLAN_STA_SHORT_PREAMBLE ? SHORT PREAMBLE\n : , sta-flags WLAN_STA_WME ? WME\n : , - sta-flags WLAN_STA_WDS ? WDS\n : , -
[PATCH 2/18] d80211: add missing rtnl_unlock()
Add forgotten rtnl_unlock() in the error path of ieee80211_register_hw. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/ieee80211.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) 693ca0e679ae17dd34f5392886f99ba36f68940c diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 3efba6a..036eca1 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -4449,8 +4449,10 @@ int ieee80211_register_hw(struct net_dev result = sysfs_create_link(local-class_dev.kobj, dev-class_dev.kobj, master); - if (result 0) + if (result 0) { + rtnl_unlock(); goto fail_masterlink; + } result = ieee80211_sysfs_add_netdevice(dev); rtnl_unlock(); if (result 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 12/18] d80211: remove rate limit code
From: Elliot Schwartz [EMAIL PROTECTED] Remove unused and more or less pointless rate limiting code. This would have just dropped multicast frames arbitrarily when the limit is reached which is quite useless and does not really belong to 802.11 code. Signed-off-by: Elliot Schwartz [EMAIL PROTECTED] Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/d80211/hostapd_ioctl.h |4 ++-- net/d80211/ieee80211.c | 38 -- net/d80211/ieee80211_i.h |5 - net/d80211/ieee80211_ioctl.c | 27 --- net/d80211/ieee80211_sysfs.c |2 -- 5 files changed, 2 insertions(+), 74 deletions(-) e57d91e2de0ac577bce30aa6c752627ad735bd4f diff --git a/net/d80211/hostapd_ioctl.h b/net/d80211/hostapd_ioctl.h index fbd1088..73d54b7 100644 --- a/net/d80211/hostapd_ioctl.h +++ b/net/d80211/hostapd_ioctl.h @@ -58,8 +58,8 @@ enum { PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES = 1001, PRISM2_PARAM_DROP_UNENCRYPTED = 1002, PRISM2_PARAM_PREAMBLE = 1003, - PRISM2_PARAM_RATE_LIMIT = 1004, - PRISM2_PARAM_RATE_LIMIT_BURST = 1005, + PRISM2_PARAM_RATE_LIMIT = 1004, /* no longer used */ + PRISM2_PARAM_RATE_LIMIT_BURST = 1005, /* no longer used */ PRISM2_PARAM_SHORT_SLOT_TIME = 1006, PRISM2_PARAM_TEST_MODE = 1007, PRISM2_PARAM_NEXT_MODE = 1008, diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 6847610..2614514 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -834,38 +834,6 @@ ieee80211_tx_h_misc(struct ieee80211_txr } -static void ieee80211_rate_limit(unsigned long data) -{ - struct ieee80211_local *local = (struct ieee80211_local *) data; - - if (local-rate_limit) { -local-rate_limit_bucket += local-rate_limit; -if (local-rate_limit_bucket local-rate_limit_burst) -local-rate_limit_bucket = local-rate_limit_burst; - local-rate_limit_timer.expires = jiffies + HZ; - add_timer(local-rate_limit_timer); - } -} - - -static ieee80211_txrx_result -ieee80211_tx_h_rate_limit(struct ieee80211_txrx_data *tx) -{ - - if (likely(!tx-local-rate_limit || tx-u.tx.unicast)) -return TXRX_CONTINUE; - - /* rate limit */ -if (tx-local-rate_limit_bucket) { -tx-local-rate_limit_bucket--; -return TXRX_CONTINUE; -} - - I802_DEBUG_INC(tx-local-tx_handlers_drop_rate_limit); - return TXRX_DROP; -} - - static ieee80211_txrx_result ieee80211_tx_h_check_assoc(struct ieee80211_txrx_data *tx) { @@ -4203,7 +4171,6 @@ static ieee80211_rx_handler ieee80211_rx static ieee80211_tx_handler ieee80211_tx_handlers[] = { - ieee80211_tx_h_rate_limit, ieee80211_tx_h_check_assoc, ieee80211_tx_h_ps_buf, ieee80211_tx_h_select_key, @@ -4416,9 +4383,6 @@ struct net_device *ieee80211_alloc_hw(si init_timer(local-scan.timer); /* clear it out */ spin_lock_init(local-generic_lock); - init_timer(local-rate_limit_timer); - local-rate_limit_timer.function = ieee80211_rate_limit; - local-rate_limit_timer.data = (unsigned long) local; init_timer(local-stat_timer); local-stat_timer.function = ieee80211_stat_refresh; local-stat_timer.data = (unsigned long) local; @@ -4626,8 +4590,6 @@ void ieee80211_unregister_hw(struct net_ rtnl_unlock(); - if (local-rate_limit) - del_timer_sync(local-rate_limit_timer); if (local-stat_time) del_timer_sync(local-stat_timer); if (local-scan_work.data) { diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 314235b..89666ec 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -469,10 +469,6 @@ #endif u32 stat_time; struct timer_list stat_timer; -struct timer_list rate_limit_timer; -u32 rate_limit; -u32 rate_limit_burst; -u32 rate_limit_bucket; struct proc_dir_entry *proc, *proc_sta, *proc_iface; struct work_struct sta_proc_add; @@ -492,7 +488,6 @@ #ifdef CONFIG_D80211_DEBUG_COUNTERS unsigned int tx_handlers_drop_unencrypted; unsigned int tx_handlers_drop_fragment; unsigned int tx_handlers_drop_wep; - unsigned int tx_handlers_drop_rate_limit; unsigned int tx_handlers_drop_not_assoc; unsigned int tx_handlers_drop_unauth_port; unsigned int rx_handlers_drop; diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c index cded685..1fb2dfd 100644 --- a/net/d80211/ieee80211_ioctl.c +++ b/net/d80211/ieee80211_ioctl.c @@ -2409,25 +2409,6 @@ static int ieee80211_ioctl_prism2_param( local-short_preamble = value; break; - case PRISM2_PARAM_RATE_LIMIT_BURST: - local-rate_limit_burst = value; -
Re: [patch] d80211: remove initialization of unused xr structure members
Hi, The structure member xr_end was removed from d80211.h. John, please apply this after you pull from my tree (perhaps with a rt2x00 prefix in the subject instead of d80211?). The patch itself looked good, but it doesn't fix rt2500usb and rt73usb, I will send a patch to fix the rt2x00 USB drivers shortly. 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] rt2x00: Remove xr_end references
This removes the xr_end references from rt2500usb and rt71usb. The rt2x00 pci drivers were already fixed by David Kimdon. Signed-off-by: Ivo van Doorn [EMAIL PROTECTED] --- diff --git a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c index 5d119cd..a181829 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt2500usb.c +++ b/drivers/net/wireless/d80211/rt2x00/rt2500usb.c @@ -2676,11 +2676,6 @@ static int rt2500usb_init_hw_modes(struc rt2500usb_init_hw_channels(rt2x00dev, hw-modes[0].channels); rt2500usb_init_hw_rates(rt2x00dev, hw-modes[0].rates); - /* -* xr_end is only used on Atheros cards. -*/ - hw-modes-xr_end = 0; - return ieee80211_update_hw(net_dev, hw); exit_free_channels: diff --git a/drivers/net/wireless/d80211/rt2x00/rt73usb.c b/drivers/net/wireless/d80211/rt2x00/rt73usb.c index a3b0996..12407d3 100644 --- a/drivers/net/wireless/d80211/rt2x00/rt73usb.c +++ b/drivers/net/wireless/d80211/rt2x00/rt73usb.c @@ -3037,11 +3037,6 @@ static int rt73usb_init_hw_modes(struct rt73usb_init_hw_channels(rt2x00dev, hw-modes[0].channels); rt73usb_init_hw_rates(rt2x00dev, hw-modes[0].rates); - /* -* xr_end is only used on Atheros cards. -*/ - hw-modes-xr_end = 0; - return ieee80211_update_hw(net_dev, hw); exit_free_channels: - 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] Bound TSO defer time (resend)
On Wed, 18 Oct 2006 17:37:36 +0200 Andi Kleen [EMAIL PROTECTED] wrote: On Tuesday 17 October 2006 06:18, John Heffner wrote: Stephen Hemminger wrote: On Mon, 16 Oct 2006 20:53:20 -0400 (EDT) John Heffner [EMAIL PROTECTED] wrote: This patch limits the amount of time you will defer sending a TSO segment to less than two clock ticks, or the time between two acks, whichever is longer. Okay, but doing any timing on clock ticks makes the behavior dependent on the value of HZ which doesn't seem desirable. Should this be based on RTT or a real-time values? It would be nice to use a high res clock so you don't depend on HZ, but this is still expensive on most SMP arch's as I understand it. You can always use xtime. It doesn't have better solution than jiffies though, but it gives you real time. Drawback is that there is some work towards tickless kernels and with that xtime will be more expensive again. But hopefully not by that much. -Andi Actually the thing to use now is ktime. It would then be compatiable with hrtimers. But it seems a bit of overkill in this case. -- Stephen Hemminger [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,RFC] bridge: call eth_type_trans() in br_pass_frame_up()
On Wed, 18 Oct 2006 11:14:45 +0200 Lennert Buytenhek [EMAIL PROTECTED] wrote: Hi, I've been seeing a failure to reply to incoming ARP packets on a bridge interface until after the first few packets have been transmitted over that interface, and the patch below seems to fix the issue, the 'issue' being that the incoming ARP packets are marked with PACKET_OTHERHOST, and there not being anything to set that back to PACKET_HOST even if the destination MAC address matches the bridge interface's MAC address. If this looks good, I'll prepare a proper commit message. cheers, Lennert Signed-off-by: Tom Billman [EMAIL PROTECTED] Signed-off-by: Lennert Buytenhek [EMAIL PROTECTED] --- linux-2.6.19-rc2.orig/net/bridge/br_input.c 2006-10-18 11:11:08.0 +0200 +++ linux-2.6.19-rc2/net/bridge/br_input.c2006-10-18 11:10:08.0 +0200 @@ -32,6 +32,9 @@ indev = skb-dev; skb-dev = br-dev; + skb_push(skb, ETH_HLEN); + skb-protocol = eth_type_trans(skb, skb-dev); + NF_HOOK(PF_BRIDGE, NF_BR_LOCAL_IN, skb, indev, NULL, netif_receive_skb); } No, this will cause packets coming in from other interfaces to be incorrectly marked as OTHERHOST. Think of the following: eth0: 00:11:11:0:1:2 eth1: 00:11:11:0:1:3 br0: 00:11:11:0:1:2 If packet arrives with Destination Address (DA) of 00:11:11:0:1:3 on eth1 then your change will mark it as OTHERHOST. The case you are trying to fix is an ARP packet arriving on eth1 with the DA of eth0. That implies some sort of mismatch or cycle in your topology, it is not clear if the packet should just be dropped. -- Stephen Hemminger [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
[PATCH, resent] [NET] reduce per cpu ram used for loopback stats
Sorry David, the previous attachment had a missing / in one filename [NET] reduce per cpu ram used for loopback device stats We dont need a full struct net_device_stats (currently 23 long : 184 bytes on x86_64) per possible CPU, but only two counters : bytes and packets We save few CPU cycles too in loopback_xmit() not updating 4 fields, but 2. Signed-off-by: Eric Dumazet [EMAIL PROTECTED] --- linux/drivers/net/loopback.c2006-10-18 17:28:20.0 +0200 +++ linux-ed/drivers/net/loopback.c 2006-10-18 18:26:41.0 +0200 @@ -58,7 +58,11 @@ #include linux/tcp.h #include linux/percpu.h -static DEFINE_PER_CPU(struct net_device_stats, loopback_stats); +struct pcpu_lstats { + unsigned long packets; + unsigned long bytes; +}; +static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats); #define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16) @@ -128,7 +132,7 @@ */ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *lb_stats; + struct pcpu_lstats *lb_stats; skb_orphan(skb); @@ -149,11 +153,9 @@ #endif dev-last_rx = jiffies; - lb_stats = per_cpu(loopback_stats, get_cpu()); - lb_stats-rx_bytes += skb-len; - lb_stats-tx_bytes = lb_stats-rx_bytes; - lb_stats-rx_packets++; - lb_stats-tx_packets = lb_stats-rx_packets; + lb_stats = per_cpu(pcpu_lstats, get_cpu()); + lb_stats-bytes += skb-len; + lb_stats-packets++; put_cpu(); netif_rx(skb); @@ -166,20 +168,21 @@ static struct net_device_stats *get_stats(struct net_device *dev) { struct net_device_stats *stats = loopback_stats; + unsigned long bytes = 0; + unsigned long packets = 0; int i; - memset(stats, 0, sizeof(struct net_device_stats)); - for_each_possible_cpu(i) { - struct net_device_stats *lb_stats; + const struct pcpu_lstats *lb_stats; - lb_stats = per_cpu(loopback_stats, i); - stats-rx_bytes += lb_stats-rx_bytes; - stats-tx_bytes += lb_stats-tx_bytes; - stats-rx_packets += lb_stats-rx_packets; - stats-tx_packets += lb_stats-tx_packets; + lb_stats = per_cpu(pcpu_lstats, i); + bytes += lb_stats-bytes; + packets += lb_stats-packets; } - + stats-rx_packets = packets; + stats-tx_packets = packets; + stats-rx_bytes = bytes; + stats-tx_bytes = bytes; return stats; }
Re: BCM5461 phy issue in 10M/Full duplex
Kumar Gala wrote: I was wondering if anyone has had any issues when trying to force a BCM5461 phy into 10M/full duplex. I seem to be having an issue in the two managed switches I've tried this on but autoneg to 10/half. This causes a problem in that I start seeing a large number of frame errors. I believe, but need to double check, that if I leave the BCM5461 in autoneg, and foce the switch to 10M/full that the BCM5461 will autoneg at 10M/half duplex. Indeed, if one side is hardcoded, autoneg will fail and the side trying to autoneg is required by the specs (not that I know chapter and verse to quote from the IEE stuff :( to go into half-duplex. Was 10M/Fullduplex ever standardized? If not I could see where kit might not be willing/able to autoneg to that. Just wondering if anyone else has seen similar behavior with this PHY. thanks - kumar - 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] [NET] reduce per cpu ram used for loopback stats
We dont need a full struct net_device_stats (currently 23 long : 184 bytes on x86_64) per possible CPU, but only two counters : bytes and packets We save few CPU cycles too in loopback_xmit() not updating 4 fields, but 2. Signed-off-by: Eric Dumazet [EMAIL PROTECTED] --- linux/drivers/net/loopback.c2006-10-18 17:28:20.0 +0200 +++ linux-eddrivers/net/loopback.c 2006-10-18 18:26:41.0 +0200 @@ -58,7 +58,11 @@ #include linux/tcp.h #include linux/percpu.h -static DEFINE_PER_CPU(struct net_device_stats, loopback_stats); +struct pcpu_lstats { + unsigned long packets; + unsigned long bytes; +}; +static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats); #define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16) @@ -128,7 +132,7 @@ */ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) { - struct net_device_stats *lb_stats; + struct pcpu_lstats *lb_stats; skb_orphan(skb); @@ -149,11 +153,9 @@ #endif dev-last_rx = jiffies; - lb_stats = per_cpu(loopback_stats, get_cpu()); - lb_stats-rx_bytes += skb-len; - lb_stats-tx_bytes = lb_stats-rx_bytes; - lb_stats-rx_packets++; - lb_stats-tx_packets = lb_stats-rx_packets; + lb_stats = per_cpu(pcpu_lstats, get_cpu()); + lb_stats-bytes += skb-len; + lb_stats-packets++; put_cpu(); netif_rx(skb); @@ -166,20 +168,21 @@ static struct net_device_stats *get_stats(struct net_device *dev) { struct net_device_stats *stats = loopback_stats; + unsigned long bytes = 0; + unsigned long packets = 0; int i; - memset(stats, 0, sizeof(struct net_device_stats)); - for_each_possible_cpu(i) { - struct net_device_stats *lb_stats; + const struct pcpu_lstats *lb_stats; - lb_stats = per_cpu(loopback_stats, i); - stats-rx_bytes += lb_stats-rx_bytes; - stats-tx_bytes += lb_stats-tx_bytes; - stats-rx_packets += lb_stats-rx_packets; - stats-tx_packets += lb_stats-tx_packets; + lb_stats = per_cpu(pcpu_lstats, i); + bytes += lb_stats-bytes; + packets += lb_stats-packets; } - + stats-rx_packets = packets; + stats-tx_packets = packets; + stats-rx_bytes = bytes; + stats-tx_bytes = bytes; return stats; }
Re: [take1 0/5] d80211 patches
On Wednesday 18 October 2006 19:20, David Kimdon wrote: On Wed, Oct 18, 2006 at 06:01:31PM +0200, Jiri Benc wrote: On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. Thanks for the patches! At first I intended to ask you to split d80211 and drivers parts of the patches, but your way is better I think - it doesn't break git-bisect. John, if you agree with these patches, could you apply them after you pull from my tree? hold that thought, I missed updating rt73usb.c and rt2500usb.c. New patchset on its way. Hi, That patch was send 2 hours ago by me to this list. :) [PATCH] rt2x00: Remove xr_end references That patch only fixed rt2500usb and rt73usb, so it can be applied safely after your patch to fix the rt2x00 PCI drivers. 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] d80211: ieee80211_hw handlers should be allowed to sleep
On Wednesday 18 October 2006 15:06, Jiri Benc wrote: On Sat, 7 Oct 2006 11:23:15 +0200, Ivo van Doorn wrote: --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2075,15 +2075,15 @@ void ieee80211_if_shutdown(struct net_de case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: sdata-u.sta.state = IEEE80211_DISABLED; - del_timer_sync(sdata-u.sta.timer); + cancel_delayed_work(sdata-u.sta.work); if (local-scan_work.data == sdata-dev) { local-sta_scanning = 0; cancel_delayed_work(local-scan_work); - flush_scheduled_work(); /* see comment in ieee80211_unregister_hw to * understand why this works */ local-scan_work.data = NULL; } + flush_scheduled_work(); This is racy. local-scan_work.data can be set to NULL only after flush_scheduled_work(). Would something like the patch below be better? It keeps the flush_scheduled_work() at the same location, but a second is added in case local-scan_work.data != sdata-dev Jan, was there any particular reason to move flush_cheduled_work() outside of the if-statement? Signed-off-by Ivo van Doorn [EMAIL PROTECTED] --- diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 32a1ba7..cb1180c 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2075,7 +2075,7 @@ void ieee80211_if_shutdown(struct net_de case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: sdata-u.sta.state = IEEE80211_DISABLED; - del_timer_sync(sdata-u.sta.timer); + cancel_delayed_work(sdata-u.sta.work); if (local-scan_work.data == sdata-dev) { local-sta_scanning = 0; cancel_delayed_work(local-scan_work); @@ -2083,7 +2083,8 @@ void ieee80211_if_shutdown(struct net_de /* see comment in ieee80211_unregister_hw to * understand why this works */ local-scan_work.data = NULL; - } + } else + flush_scheduled_work(); break; } } @@ -4605,8 +4606,8 @@ void ieee80211_unregister_hw(struct net_ flush_scheduled_work(); /* The scan_work is guaranteed not to be called at this * point. It is not scheduled and not running now. It can be -* scheduled again only by some sta_timer (all of them are -* stopped by now) or under rtnl lock. */ +* scheduled again only by sta_work (stopped by now) or under +* rtnl lock. */ } ieee80211_rx_bss_list_deinit(dev); diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 89666ec..5b48ce2 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -240,7 +240,7 @@ struct ieee80211_if_sta { IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED, IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED } state; - struct timer_list timer; + struct work_struct work; u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; u8 ssid[IEEE80211_MAX_SSID_LEN]; size_t ssid_len; @@ -621,7 +621,7 @@ int ieee80211_set_compression(struct iee struct net_device *dev, struct sta_info *sta); int ieee80211_init_client(struct net_device *dev); /* ieee80211_sta.c */ -void ieee80211_sta_timer(unsigned long ptr); +void ieee80211_sta_work(void *ptr); void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb, struct ieee80211_rx_status *rx_status); int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len); diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c index 9a187af..4dd480f 100644 --- a/net/d80211/ieee80211_iface.c +++ b/net/d80211/ieee80211_iface.c @@ -194,9 +194,7 @@ void ieee80211_if_set_type(struct net_de struct ieee80211_if_sta *ifsta; ifsta = sdata-u.sta; - init_timer(ifsta-timer); - ifsta-timer.data = (unsigned long) dev; - ifsta-timer.function = ieee80211_sta_timer; + INIT_WORK(ifsta-work, ieee80211_sta_work, dev); ifsta-capab = WLAN_CAPABILITY_ESS; ifsta-auth_algs = IEEE80211_AUTH_ALG_OPEN | diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index cc336bd..bf74b6b 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -457,7 +457,7 @@ static void ieee80211_authenticate(struc ieee80211_send_auth(dev, ifsta, 1, NULL, 0, 0); - mod_timer(ifsta-timer, jiffies + IEEE80211_AUTH_TIMEOUT); + schedule_delayed_work(ifsta-work, IEEE80211_AUTH_TIMEOUT); } @@ -677,7 +677,7 @@ static void
[PATCH wireless-2.6] ieee80211: don't flood log with errors
The ieee80211: Workaround malformed 802.11 frames from AP patch (see http://kernel.org/git/?p=linux/kernel/git/linville/wireless-2.6.git;a=commit;h=f09fc44d8c25f22c4d985bb93857338ed02feac6 ) fixes the problem with some buggy APs but also converts debug message into an error one. This floods the log with errors when you are near such AP (you get a message for every beacon). This patch reverts the error message back to the debug one. Signed-off-by: Jiri Benc [EMAIL PROTECTED] --- net/ieee80211/ieee80211_rx.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) --- a/net/ieee80211/ieee80211_rx.c +++ b/net/ieee80211/ieee80211_rx.c @@ -1078,12 +1078,12 @@ static int ieee80211_parse_info_param(st while (length = sizeof(*info_element)) { if (sizeof(*info_element) + info_element-len length) { - IEEE80211_ERROR(Info elem: parse failed: - info_element-len + 2 left : - info_element-len+2=%zd left=%d, id=%d.\n, - info_element-len + - sizeof(*info_element), - length, info_element-id); + IEEE80211_DEBUG_MGMT(Info elem: parse failed: +info_element-len + 2 left : +info_element-len+2=%zd left=%d, id=%d.\n, +info_element-len + +sizeof(*info_element), +length, info_element-id); /* We stop processing but don't return an error here * because some misbehaviour APs break this rule. ie. * Orinoco AP1000. */ -- 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: [take1 0/5] d80211 patches
On Wed, Oct 18, 2006 at 06:01:31PM +0200, Jiri Benc wrote: On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. Thanks for the patches! At first I intended to ask you to split d80211 and drivers parts of the patches, but your way is better I think - it doesn't break git-bisect. John, if you agree with these patches, could you apply them after you pull from my tree? hold that thought, I missed updating rt73usb.c and rt2500usb.c. New patchset on its way. 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 3/3] ethtool: dump_registers post mortem
This patch allows: ethtool -d eth0 raw on saved_regs and later ethtool -d eth0 file saved_regs Selfish motive is to be able to take register dumps from users and and decode later, possibly adding more output as needed. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- ethtool.c | 39 ++- 1 files changed, 34 insertions(+), 5 deletions(-) diff --git a/ethtool.c b/ethtool.c index b783248..7861990 100644 --- a/ethtool.c +++ b/ethtool.c @@ -29,7 +29,9 @@ #endif #include sys/types.h #include string.h #include stdlib.h +#include sys/types.h #include sys/ioctl.h +#include sys/stat.h #include stdio.h #include string.h #include errno.h @@ -251,6 +253,7 @@ static int msglvl_wanted = -1; static int phys_id_time = 0; static int gregs_changed = 0; static int gregs_dump_raw = 0; +static char *gregs_dump_file = NULL; static int geeprom_changed = 0; static int geeprom_dump_raw = 0; static int geeprom_offset = 0; @@ -268,6 +271,7 @@ typedef enum { CMDL_NONE, CMDL_BOOL, CMDL_INT, + CMDL_STR, } cmdline_type_t; struct cmdline_info { @@ -279,6 +283,7 @@ struct cmdline_info { static struct cmdline_info cmdline_gregs[] = { { raw, CMDL_BOOL, gregs_dump_raw, NULL }, + { file, CMDL_STR, gregs_dump_file, NULL }, }; static struct cmdline_info cmdline_geeprom[] = { @@ -355,20 +360,28 @@ static void parse_generic_cmdline(int ar if (i = argc) show_usage(1); p = info[idx].wanted_val; - if (info[idx].type == CMDL_BOOL) { + switch (info[idx].type) { + case CMDL_BOOL: if (!strcmp(argp[i], on)) *p = 1; else if (!strcmp(argp[i], off)) *p = 0; else show_usage(1); - } else if (info[idx].type == CMDL_INT) { - long v; - v = strtol(argp[i], NULL, 0); + break; + case CMDL_INT: { + long v = strtol(argp[i], NULL, 0); if (v 0) show_usage(1); *p = (int) v; - } else { + break; + } + case CMDL_STR: { + char **s = info[idx].wanted_val; + *s = strdup(argp[i]); + break; + } + default: show_usage(1); } } @@ -969,6 +982,22 @@ static int dump_regs(struct ethtool_drvi return 0; } + if (gregs_dump_file) { + FILE *f = fopen(gregs_dump_file, r); + struct stat st; + + if (!f || fstat(fileno(f), st) 0) { + fprintf(stderr, Can't open '%s': %s\n, + gregs_dump_file, strerror(errno)); + return -1; + } + + regs = realloc(regs, sizeof(*regs) + st.st_size); + regs-len = st.st_size; + fread(regs-data, regs-len, 1, f); + fclose(f); + } + for (i = 0; i ARRAY_SIZE(driver_list); i++) if (!strncmp(driver_list[i].name, info-driver, ETHTOOL_BUSINFO_LEN)) -- 1.4.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 2/3] ethtool: sky2 more decode
Dump even more GMAC/GPHY state Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- marvell.c | 16 1 files changed, 12 insertions(+), 4 deletions(-) diff --git a/marvell.c b/marvell.c index 244bb69..e867521 100644 --- a/marvell.c +++ b/marvell.c @@ -113,7 +113,7 @@ static void dump_fifo(const char *name, dump_timer(LED, p + 0x20); } -static void dump_gmac_fifo(const void *p) +static void dump_gmac_fifo(const char *name, const void *p) { const u32 *r = p; int i; @@ -133,6 +133,7 @@ static void dump_gmac_fifo(const void *p FIFO Read Level, }; + printf(\n%s\n, name); for (i = 0; i sizeof(regs)/sizeof(regs[0]); ++i) printf(%-32s 0x%08X\n, regs[i], r[i]); @@ -319,8 +320,6 @@ int sky2_dump_regs(struct ethtool_drvinf } dump_mac(regs-data); - dump_gmac(GMAC 1, regs-data + 0x2800); - dump_gmac_fifo(regs-data + 0xc40); printf(\nStatus BMU:\n---\n); printf(Control0x%08X\n, @@ -350,6 +349,14 @@ int sky2_dump_regs(struct ethtool_drvinf dump_timer(TX status, regs-data + 0xec0); dump_timer(ISR, regs-data + 0xed0); + printf(\nGMAC control 0x%04X\n, *(u32 *)(regs-data + 0xf00)); + printf(GPHY control 0x%04X\n, *(u32 *)(regs-data + 0xf04)); + printf(LINK control 0x%02hX\n, *(u16 *)(regs-data + 0xf10)); + + dump_gmac(GMAC 1, regs-data + 0x2800); + dump_gmac_fifo(Rx GMAC 1, regs-data + 0xc40); + dump_gmac_fifo(Tx GMAC 1, regs-data + 0xd40); + dump_queue2(Receive Queue 1, regs-data +0x400, 1); dump_queue(Sync Transmit Queue 1, regs-data +0x600, 0); dump_queue2(Async Transmit Queue 1, regs-data +0x680, 0); @@ -364,7 +371,8 @@ int sky2_dump_regs(struct ethtool_drvinf dump_ram(Sync Transmit RAMbuffer 2, regs-data+0xb00); dump_ram(Async Transmit RAMbuffer 21, regs-data+0xb80); dump_gmac(GMAC 2, regs-data + 0x3800); - dump_gmac_fifo(regs-data + 0xc40 + 128); + dump_gmac_fifo(Rx GMAC 2, regs-data + 0xc40 + 128); + dump_gmac_fifo(Tx GMAC 2, regs-data + 0xd40 + 128); } return 0; -- 1.4.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
Re: [take1 0/5] d80211 patches
On Wed, Oct 18, 2006 at 07:23:14PM +0200, Ivo van Doorn wrote: On Wednesday 18 October 2006 19:20, David Kimdon wrote: On Wed, Oct 18, 2006 at 06:01:31PM +0200, Jiri Benc wrote: On Tue, 17 Oct 2006 10:17:13 -0700, David Kimdon wrote: Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. Thanks for the patches! At first I intended to ask you to split d80211 and drivers parts of the patches, but your way is better I think - it doesn't break git-bisect. John, if you agree with these patches, could you apply them after you pull from my tree? hold that thought, I missed updating rt73usb.c and rt2500usb.c. New patchset on its way. Hi, That patch was send 2 hours ago by me to this list. :) [PATCH] rt2x00: Remove xr_end references That patch only fixed rt2500usb and rt73usb, so it can be applied safely after your patch to fix the rt2x00 PCI drivers. Sorry, to be clear, I am talking about the bitfield removal from d80211.h patches. Actually, your patch to remove the xr references from the usb drivers is what made me notice I had forgotten them from the bitfield removal patches. hmm, I have a bad subject to the first mail in my post, my posting script set the initial 0/5 message subject as 'd80211 patches', should probably be a bit more specific :-) -David - 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] net: use bitrev8
Use bitrev8 for bmac, mace, macmace, macsonic, and skfp drivers. Cc: Jeff Garzik [EMAIL PROTECTED] Cc: Paul Mackerras [EMAIL PROTECTED] Cc: Mirko Lindner [EMAIL PROTECTED] Cc: Thomas Bogendoerfer [EMAIL PROTECTED] Signed-off-by: Akinobu Mita [EMAIL PROTECTED] drivers/net/Kconfig|1 drivers/net/bmac.c | 20 ++ drivers/net/mace.c | 16 +--- drivers/net/macmace.c | 18 + drivers/net/macsonic.c |6 --- drivers/net/skfp/can.c | 83 - drivers/net/skfp/drvfbi.c | 21 --- drivers/net/skfp/fplustm.c |4 +- drivers/net/skfp/smt.c |7 +-- 9 files changed, 25 insertions(+), 151 deletions(-) Index: work-fault-inject/drivers/net/bmac.c === --- work-fault-inject.orig/drivers/net/bmac.c +++ work-fault-inject/drivers/net/bmac.c @@ -18,6 +18,7 @@ #include linux/init.h #include linux/spinlock.h #include linux/crc32.h +#include linux/bitrev.h #include asm/prom.h #include asm/dbdma.h #include asm/io.h @@ -140,7 +141,6 @@ static unsigned char *bmac_emergency_rxb + (N_RX_RING + N_TX_RING + 4) * sizeof(struct dbdma_cmd) \ + sizeof(struct sk_buff_head)) -static unsigned char bitrev(unsigned char b); static int bmac_open(struct net_device *dev); static int bmac_close(struct net_device *dev); static int bmac_transmit_packet(struct sk_buff *skb, struct net_device *dev); @@ -586,18 +586,6 @@ bmac_construct_rxbuff(struct sk_buff *sk virt_to_bus(addr), 0); } -/* Bit-reverse one byte of an ethernet hardware address. */ -static unsigned char -bitrev(unsigned char b) -{ - int d = 0, i; - - for (i = 0; i 8; ++i, b = 1) - d = (d 1) | (b 1); - return d; -} - - static void bmac_init_tx_ring(struct bmac_data *bp) { @@ -1224,8 +1212,8 @@ bmac_get_station_address(struct net_devi { reset_and_select_srom(dev); data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits); - ea[2*i] = bitrev(data 0x0ff); - ea[2*i+1] = bitrev((data 8) 0x0ff); + ea[2*i] = bitrev8(data 0x0ff); + ea[2*i+1] = bitrev8((data 8) 0x0ff); } } @@ -1315,7 +1303,7 @@ static int __devinit bmac_probe(struct m rev = addr[0] == 0 addr[1] == 0xA0; for (j = 0; j 6; ++j) - dev-dev_addr[j] = rev? bitrev(addr[j]): addr[j]; + dev-dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; /* Enable chip without interrupts for now */ bmac_enable_and_reset_chip(dev); Index: work-fault-inject/drivers/net/mace.c === --- work-fault-inject.orig/drivers/net/mace.c +++ work-fault-inject/drivers/net/mace.c @@ -15,6 +15,7 @@ #include linux/init.h #include linux/crc32.h #include linux/spinlock.h +#include linux/bitrev.h #include asm/prom.h #include asm/dbdma.h #include asm/io.h @@ -74,7 +75,6 @@ struct mace_data { #define PRIV_BYTES (sizeof(struct mace_data) \ + (N_RX_RING + NCMDS_TX * N_TX_RING + 3) * sizeof(struct dbdma_cmd)) -static int bitrev(int); static int mace_open(struct net_device *dev); static int mace_close(struct net_device *dev); static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev); @@ -96,18 +96,6 @@ static void __mace_set_address(struct ne */ static unsigned char *dummy_buf; -/* Bit-reverse one byte of an ethernet hardware address. */ -static inline int -bitrev(int b) -{ -int d = 0, i; - -for (i = 0; i 8; ++i, b = 1) - d = (d 1) | (b 1); -return d; -} - - static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_id *match) { struct device_node *mace = macio_get_of_node(mdev); @@ -173,7 +161,7 @@ static int __devinit mace_probe(struct m rev = addr[0] == 0 addr[1] == 0xA0; for (j = 0; j 6; ++j) { - dev-dev_addr[j] = rev? bitrev(addr[j]): addr[j]; + dev-dev_addr[j] = rev ? bitrev8(addr[j]): addr[j]; } mp-chipid = (in_8(mp-mace-chipid_hi) 8) | in_8(mp-mace-chipid_lo); Index: work-fault-inject/drivers/net/macmace.c === --- work-fault-inject.orig/drivers/net/macmace.c +++ work-fault-inject/drivers/net/macmace.c @@ -22,6 +22,7 @@ #include linux/delay.h #include linux/string.h #include linux/crc32.h +#include linux/bitrev.h #include asm/io.h #include asm/pgtable.h #include asm/irq.h @@ -81,19 +82,6 @@ static irqreturn_t mace_interrupt(int ir static irqreturn_t mace_dma_intr(int irq, void *dev_id); static void mace_tx_timeout(struct net_device *dev); -/* Bit-reverse one byte of an ethernet hardware address. */ - -static int bitrev(int b) -{ -
Re: [PATCH] d80211: ieee80211_hw handlers should be allowed to sleep
Ivo van Doorn wrote: On Wednesday 18 October 2006 15:06, Jiri Benc wrote: On Sat, 7 Oct 2006 11:23:15 +0200, Ivo van Doorn wrote: --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2075,15 +2075,15 @@ void ieee80211_if_shutdown(struct net_de case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: sdata-u.sta.state = IEEE80211_DISABLED; - del_timer_sync(sdata-u.sta.timer); + cancel_delayed_work(sdata-u.sta.work); if (local-scan_work.data == sdata-dev) { local-sta_scanning = 0; cancel_delayed_work(local-scan_work); - flush_scheduled_work(); /* see comment in ieee80211_unregister_hw to * understand why this works */ local-scan_work.data = NULL; } + flush_scheduled_work(); This is racy. local-scan_work.data can be set to NULL only after flush_scheduled_work(). Would something like the patch below be better? It keeps the flush_scheduled_work() at the same location, but a second is added in case local-scan_work.data != sdata-dev Jan, was there any particular reason to move flush_cheduled_work() outside of the if-statement? It is needed unconditionally now, so I moved it out without knowing about this side effect. Your approach looks good to me. Signed-off-by Ivo van Doorn [EMAIL PROTECTED] --- diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c index 32a1ba7..cb1180c 100644 --- a/net/d80211/ieee80211.c +++ b/net/d80211/ieee80211.c @@ -2075,7 +2075,7 @@ void ieee80211_if_shutdown(struct net_de case IEEE80211_IF_TYPE_STA: case IEEE80211_IF_TYPE_IBSS: sdata-u.sta.state = IEEE80211_DISABLED; - del_timer_sync(sdata-u.sta.timer); + cancel_delayed_work(sdata-u.sta.work); if (local-scan_work.data == sdata-dev) { local-sta_scanning = 0; cancel_delayed_work(local-scan_work); @@ -2083,7 +2083,8 @@ void ieee80211_if_shutdown(struct net_de /* see comment in ieee80211_unregister_hw to * understand why this works */ local-scan_work.data = NULL; - } + } else + flush_scheduled_work(); break; } } @@ -4605,8 +4606,8 @@ void ieee80211_unregister_hw(struct net_ flush_scheduled_work(); /* The scan_work is guaranteed not to be called at this * point. It is not scheduled and not running now. It can be - * scheduled again only by some sta_timer (all of them are - * stopped by now) or under rtnl lock. */ + * scheduled again only by sta_work (stopped by now) or under + * rtnl lock. */ } ieee80211_rx_bss_list_deinit(dev); diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index 89666ec..5b48ce2 100644 --- a/net/d80211/ieee80211_i.h +++ b/net/d80211/ieee80211_i.h @@ -240,7 +240,7 @@ struct ieee80211_if_sta { IEEE80211_ASSOCIATE, IEEE80211_ASSOCIATED, IEEE80211_IBSS_SEARCH, IEEE80211_IBSS_JOINED } state; - struct timer_list timer; + struct work_struct work; u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN]; u8 ssid[IEEE80211_MAX_SSID_LEN]; size_t ssid_len; @@ -621,7 +621,7 @@ int ieee80211_set_compression(struct iee struct net_device *dev, struct sta_info *sta); int ieee80211_init_client(struct net_device *dev); /* ieee80211_sta.c */ -void ieee80211_sta_timer(unsigned long ptr); +void ieee80211_sta_work(void *ptr); void ieee80211_sta_rx_mgmt(struct net_device *dev, struct sk_buff *skb, struct ieee80211_rx_status *rx_status); int ieee80211_sta_set_ssid(struct net_device *dev, char *ssid, size_t len); diff --git a/net/d80211/ieee80211_iface.c b/net/d80211/ieee80211_iface.c index 9a187af..4dd480f 100644 --- a/net/d80211/ieee80211_iface.c +++ b/net/d80211/ieee80211_iface.c @@ -194,9 +194,7 @@ void ieee80211_if_set_type(struct net_de struct ieee80211_if_sta *ifsta; ifsta = sdata-u.sta; - init_timer(ifsta-timer); - ifsta-timer.data = (unsigned long) dev; - ifsta-timer.function = ieee80211_sta_timer; + INIT_WORK(ifsta-work, ieee80211_sta_work, dev); ifsta-capab = WLAN_CAPABILITY_ESS; ifsta-auth_algs = IEEE80211_AUTH_ALG_OPEN | diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c index cc336bd..bf74b6b 100644 --- a/net/d80211/ieee80211_sta.c +++ b/net/d80211/ieee80211_sta.c @@ -457,7 +457,7 @@ static void ieee80211_authenticate(struc ieee80211_send_auth(dev, ifsta, 1, NULL, 0, 0); - mod_timer(ifsta-timer, jiffies +
[PATCH 1/3] ethtool: sky2 GMAC decode
Add decoding of GMAC bits. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- marvell.c | 28 1 files changed, 28 insertions(+), 0 deletions(-) diff --git a/marvell.c b/marvell.c index 16147a9..244bb69 100644 --- a/marvell.c +++ b/marvell.c @@ -113,6 +113,31 @@ static void dump_fifo(const char *name, dump_timer(LED, p + 0x20); } +static void dump_gmac_fifo(const void *p) +{ + const u32 *r = p; + int i; + static const char *regs[] = { + End Address, + Almost Full Thresh, + Control/Test, + FIFO Flush Mask, + FIFO Flush Threshold, + Truncation Threshold, + Upper Pause Threshold, + Lower Pause Threshold, + VLAN Tag, + FIFO Write Pointer, + FIFO Write Level, + FIFO Read Pointer, + FIFO Read Level, + }; + + for (i = 0; i sizeof(regs)/sizeof(regs[0]); ++i) + printf(%-32s 0x%08X\n, regs[i], r[i]); + +} + static void dump_mac(const u8 *r) { printf(\nMAC Addresses\n); @@ -143,6 +168,7 @@ static void dump_gma(const char *name, c static void dump_gmac(const char *name, const u8 *data) { printf(\n%s\n, name); + printf(Status 0x%04X\n, *(u16 *) data); printf(Control 0x%04X\n, *(u16 *) (data + 4)); printf(Transmit 0x%04X\n, *(u16 *) (data + 8)); @@ -294,6 +320,7 @@ int sky2_dump_regs(struct ethtool_drvinf dump_mac(regs-data); dump_gmac(GMAC 1, regs-data + 0x2800); + dump_gmac_fifo(regs-data + 0xc40); printf(\nStatus BMU:\n---\n); printf(Control0x%08X\n, @@ -337,6 +364,7 @@ int sky2_dump_regs(struct ethtool_drvinf dump_ram(Sync Transmit RAMbuffer 2, regs-data+0xb00); dump_ram(Async Transmit RAMbuffer 21, regs-data+0xb80); dump_gmac(GMAC 2, regs-data + 0x3800); + dump_gmac_fifo(regs-data + 0xc40 + 128); } return 0; -- 1.4.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
Re: 2.6.19rc2 XFRM does too large direct mapping allocations for hashes
From: Andi Kleen [EMAIL PROTECTED] Date: Wed, 18 Oct 2006 13:50:22 +0200 I got this while restarting ipsec on a 2.6.19rc2 system that was up for a few days. It's been fixed already in current GIT. The xfrm state counters weren't being maintained correctly, so they'd go negative and the hashing code thought it needed a huge hash table. :-) - 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] sky2: netpoll on dual port cards
The sky2 driver uses a single NAPI poll routine for both ports on dual ported cards (because there is a single IRQ and status ring). Netpoll makes assumptions about the relationship between network device and NAPI that aren't correct on the second port, this will cause the port to never clear work. Most systems, just have single port, so not a big issue. The easy fix is just make the second port, not netpoll capable. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- sky2.orig/drivers/net/sky2.c2006-10-18 13:25:22.0 -0700 +++ sky2/drivers/net/sky2.c 2006-10-18 13:27:06.0 -0700 @@ -3255,7 +3255,11 @@ dev-poll = sky2_poll; dev-weight = NAPI_WEIGHT; #ifdef CONFIG_NET_POLL_CONTROLLER - dev-poll_controller = sky2_netpoll; + /* Network console (only works on port 0) +* because netpoll makes assumptions about NAPI +*/ + if (port == 0) + dev-poll_controller = sky2_netpoll; #endif sky2 = netdev_priv(dev); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] netpoll: don't send packets to detached device
Netpoll shouldn't send packets to devices that have detached themselves. This can happen during shutdown or suspend. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- a/net/core/netpoll.c2006-10-18 13:41:49.0 -0700 +++ b/net/core/netpoll.c2006-10-18 13:43:44.0 -0700 @@ -273,7 +273,7 @@ int status; struct netpoll_info *npinfo; - if (!np || !np-dev || !netif_running(np-dev)) { + if (!np || !np-dev || !netif_device_present(np-dev) || !netif_running(np-dev)) { __kfree_skb(skb); return; } - 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] netpoll: netpoll_send_skb local optimization
This cleans up netpoll_send_skb: * np and np-dev are always non-null given the local callers * get device into a local variable Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- orig/net/core/netpoll.c 2006-10-18 13:44:27.0 -0700 +++ new/net/core/netpoll.c 2006-10-18 13:46:03.0 -0700 @@ -270,19 +270,19 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb) { + struct net_device *dev = np-dev; + struct netpoll_info *npinfo = dev-npinfo; int status; - struct netpoll_info *npinfo; - if (!np || !np-dev || !netif_device_present(np-dev) || !netif_running(np-dev)) { + if (!netif_device_present(dev) || !netif_running(dev)) { __kfree_skb(skb); return; } - npinfo = np-dev-npinfo; /* avoid recursion */ if (npinfo-poll_owner == smp_processor_id() || - np-dev-xmit_lock_owner == smp_processor_id()) { + dev-xmit_lock_owner == smp_processor_id()) { if (np-drop) np-drop(skb); else @@ -292,17 +292,17 @@ do { npinfo-tries--; - netif_tx_lock(np-dev); + netif_tx_lock(dev); /* * network drivers do not expect to be called if the queue is * stopped. */ status = NETDEV_TX_BUSY; - if (!netif_queue_stopped(np-dev)) - status = np-dev-hard_start_xmit(skb, np-dev); + if (!netif_queue_stopped(dev)) + status = dev-hard_start_xmit(skb, dev); - netif_tx_unlock(np-dev); + netif_tx_unlock(dev); /* success */ if(!status) { - 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] bcm43xx: Readd dropped assignment
Michael Buesch wrote: On Wednesday 18 October 2006 01:12, Daniel Drake wrote: Larry Finger pointed out a problem with my ieee80211 IV/ICV stripping patch, which I forgot about. Sorry about that. The patch readds the frame_ctl assignment which was accidently dropped. Signed-off-by: Daniel Drake [EMAIL PROTECTED] Whoops. Please merge this as fast as possible, John. That's a real bug which prevents RX from working. Signed-off-by: Michael Buesch [EMAIL PROTECTED] Signed-off-by: Larry Finger [EMAIL PROTECTED] Index: linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c === --- linux.orig/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c +++ linux/drivers/net/wireless/bcm43xx/bcm43xx_xmit.c @@ -543,6 +543,7 @@ int bcm43xx_rx(struct bcm43xx_private *b break; } + frame_ctl = le16_to_cpu(wlhdr-frame_ctl); switch (WLAN_FC_GET_TYPE(frame_ctl)) { case IEEE80211_FTYPE_MGMT: ieee80211_rx_mgt(bcm-ieee, wlhdr, stats); - To unsubscribe from this list: send the line unsubscribe netdev in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[take2 5/5] d80211: remove bitfields from ieee80211_conf
All four one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_CONF_* definitions. Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -240,12 +240,12 @@ struct ieee80211_conf { int beacon_int; - /* Bitfields, grouped together */ - - unsigned int sw_encrypt:1; - unsigned int sw_decrypt:1; - unsigned int short_slot_time:1; /* use IEEE 802.11g Short Slot Time */ - unsigned int ssid_hidden:1; /* do not broadcast the ssid */ +#define IEEE80211_CONF_SW_ENCRYPT (10) +#define IEEE80211_CONF_SW_DECRYPT (11) +#define IEEE80211_CONF_SHORT_SLOT_TIME (12) /* use IEEE 802.11g Short Slot + * Time */ +#define IEEE80211_CONF_SSID_HIDDEN (13) /* do not broadcast the ssid */ + u32 flags; /* configuration flags defined above */ u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3531,9 +3531,9 @@ static int bcm43xx_net_config(struct net bcm43xx_radio_selectchannel(bcm, conf-channel_val, 0); /* Enable/Disable ShortSlot timing. */ - if (conf-short_slot_time != bcm-short_slot) { + if (!!(conf-flags IEEE80211_CONF_SHORT_SLOT_TIME) != bcm-short_slot) { assert(phy-type == BCM43xx_PHYTYPE_G); - if (conf-short_slot_time) + if (conf-flags IEEE80211_CONF_SHORT_SLOT_TIME) bcm43xx_short_slot_timing_enable(bcm); else bcm43xx_short_slot_timing_disable(bcm); @@ -3546,7 +3546,7 @@ static int bcm43xx_net_config(struct net } /* Hide/Show the SSID (AP mode only). */ - if (conf-ssid_hidden) { + if (conf-flags IEEE80211_CONF_SSID_HIDDEN) { bcm43xx_write32(bcm, BCM43xx_MMIO_STATUS_BITFIELD, bcm43xx_read32(bcm, BCM43xx_MMIO_STATUS_BITFIELD) | BCM43xx_SBF_NO_SSID_BCAST); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -742,7 +742,8 @@ static void rt2400pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, reg[0]); value = SIFS + PLCP - + (2 * (conf-short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf-flags IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(reg[0], TXCSR1_ACK_TIMEOUT, value); @@ -2081,7 +2082,8 @@ static int rt2400pci_config(struct net_d conf-channel_val, conf-channel, conf-freq); rt2400pci_config_txpower(rt2x00dev, conf-power_level); rt2400pci_config_antenna(rt2x00dev, conf-antenna_sel); - rt2400pci_config_duration(rt2x00dev, conf-short_slot_time); + rt2400pci_config_duration(rt2x00dev, + conf-flags IEEE80211_CONF_SHORT_SLOT_TIME); rt2400pci_config_phymode(rt2x00dev, conf-phymode); /* Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2500pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2500pci.c @@ -808,7 +808,8 @@ static void rt2500pci_config_rate(struct rt2x00_register_read(rt2x00dev, TXCSR1, reg[0]); value = SIFS + PLCP - + (2 * (conf-short_slot_time ? SHORT_SLOT_TIME : SLOT_TIME)) + + (2 * ((conf-flags IEEE80211_CONF_SHORT_SLOT_TIME) ? + SHORT_SLOT_TIME : SLOT_TIME)) + preamble + get_duration(ACK_SIZE, 10); rt2x00_set_field32(reg[0], TXCSR1_ACK_TIMEOUT, value); @@ -2231,7 +2232,8 @@ static int rt2500pci_config(struct net_d conf-power_level); rt2500pci_config_txpower(rt2x00dev, conf-power_level); rt2500pci_config_antenna(rt2x00dev, conf-antenna_sel); - rt2500pci_config_duration(rt2x00dev, conf-short_slot_time); + rt2500pci_config_duration(rt2x00dev, + conf-flags
[take2 4/5] d80211: remove bitfields from ieee80211_hw
All twelve one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_HW_* definitions. Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -2014,17 +2014,9 @@ static int __devinit adm8211_probe(struc hw-version = 2; hw-name = adm8211; - hw-host_gen_beacon = 0; - hw-device_hides_wep = 0; - hw-rx_includes_fcs = 0;// however, FCS is kept in promisc mode - hw-host_broadcast_ps_buffering = 0; - hw-wep_include_iv = 1; - hw-data_nullfunc_ack = 0; - hw-no_tkip_wmm_hwaccel = 1; - hw-extra_hdr_room = 0; - hw-device_strips_mic = 0; - hw-monitor_during_oper = 0; - hw-fraglist = 0; + hw-flags = IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_NO_TKIP_WMM_HWACCEL; + // however, IEEE80211_HW_RX_INCLUDES_FCS in promisc mode + hw-channel_change_time = 1000; hw-num_modes = 1; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -437,19 +437,19 @@ struct ieee80211_hw { * configure the upper layer IEEE 802.11 module to generate beacons. * The low-level driver can use ieee80211_beacon_get() to fetch the * next beacon frame. */ - unsigned int host_gen_beacon:1; +#define IEEE80211_HW_HOST_GEN_BEACON (10) /* The device needs to be supplied with a beacon template only. */ - unsigned int host_gen_beacon_template:1; +#define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (11) /* Some devices handle decryption internally and do not * indicate whether the frame was encrypted (unencrypted frames * will be dropped by the hardware, unless specifically allowed * through) */ - unsigned int device_hides_wep:1; +#define IEEE80211_HW_DEVICE_HIDES_WEP (12) /* Whether RX frames passed to ieee80211_rx() include FCS in the end */ - unsigned int rx_includes_fcs:1; +#define IEEE80211_HW_RX_INCLUDES_FCS (13) /* Some wireless LAN chipsets buffer broadcast/multicast frames for * power saving stations in the hardware/firmware and others rely on @@ -457,18 +457,19 @@ struct ieee80211_hw { * configure the IEEE 802.11 upper layer to buffer broadcast/multicast * frames when there are power saving stations so that low-level driver * can fetch them with ieee80211_get_buffered_bc(). */ - unsigned int host_broadcast_ps_buffering:1; +#define IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING (14) - unsigned int wep_include_iv:1; - unsigned int data_nullfunc_ack:1; /* will data nullfunc frames get proper - * TX status callback */ +#define IEEE80211_HW_WEP_INCLUDE_IV (15) + + /* will data nullfunc frames get proper TX status callback */ +#define IEEE80211_HW_DATA_NULLFUNC_ACK (16) /* Force software encryption for TKIP packets if WMM is enabled. */ - unsigned int no_tkip_wmm_hwaccel:1; +#define IEEE80211_HW_NO_TKIP_WMM_HWACCEL (17) /* set if the payload needs to be padded at even boundaries after the * header */ - unsigned int extra_hdr_room:1; +#define IEEE80211_HW_EXTRA_HDR_ROOM (18) /* Some devices handle Michael MIC internally and do not include MIC in * the received packets passed up. device_strips_mic must be set @@ -476,15 +477,17 @@ struct ieee80211_hw { * be still set in the IEEE 802.11 header with this option unlike with * the device_hides_wep configuration option. */ - unsigned int device_strips_mic:1; +#define IEEE80211_HW_DEVICE_STRIPS_MIC (19) /* Device is capable of performing full monitor mode even during * normal operation. */ - unsigned int monitor_during_oper:1; +#define IEEE80211_HW_MONITOR_DURING_OPER (110) /* Set if the low-level driver supports skb fraglist (NETIF_F_FRAGLIST), * i.e. more than one skb per frame */ - unsigned int fraglist:1; +#define IEEE80211_HW_FRAGLIST (111) + + u32 flags; /* hardware flags defined above */ /* This is the time in us to change channels */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3910,9 +3910,10 @@ static int __devinit bcm43xx_init_one(st goto out; ieee-version = IEEE80211_VERSION; ieee-name =
[take2 2/5] d80211: remove bitfields from ieee80211_tx_status
Both one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TX_STATUS_* definitions. Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -209,8 +209,10 @@ struct ieee80211_tx_status { /* copied ieee80211_tx_control structure */ struct ieee80211_tx_control control; - unsigned int tx_filtered:1; - unsigned int ack:1; /* whether the TX frame was ACKed */ +#define IEEE80211_TX_STATUS_TX_FILTERED(10) +#define IEEE80211_TX_STATUS_ACK(11) /* whether the TX frame was ACKed */ + u32 flags; /* tx staus flags defined above */ + int ack_signal; /* measured signal strength of the ACK frame */ int excessive_retries; int retry_count; Index: wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c === --- wireless-dev.orig/drivers/net/wireless/d80211/adm8211/adm8211.c +++ wireless-dev/drivers/net/wireless/d80211/adm8211/adm8211.c @@ -427,12 +427,14 @@ static void adm8211_interrupt_tci(struct if (status TDES0_STATUS_ES) { stats-tx_errors++; - priv-tx_buffers[entry].tx_status.ack = 0; + priv-tx_buffers[entry].tx_status.flags = + ~IEEE80211_TX_STATUS_ACK; if (status (TDES0_STATUS_TUF | TDES0_STATUS_TRO)) stats-tx_fifo_errors++; } else - priv-tx_buffers[entry].tx_status.ack = 1; + priv-tx_buffers[entry].tx_status.flags |= + IEEE80211_TX_STATUS_ACK; pci_unmap_single(priv-pdev, priv-tx_buffers[entry].mapping, priv-tx_buffers[entry].skb-len, PCI_DMA_TODEVICE); Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c @@ -1079,7 +1079,8 @@ void bcm43xx_dma_handle_xmitstatus(struc * status of the transmission. * Some fields of txstat are already filled in dma_tx(). */ - meta-txstat.ack = !!(status-flags BCM43xx_TXSTAT_FLAG_ACK); + if (status-flags BCM43xx_TXSTAT_FLAG_ACK) + meta-txstat.flags |= IEEE80211_TX_STATUS_ACK; meta-txstat.retry_count = status-cnt2 - 1; ieee80211_tx_status_irqsafe(bcm-net_dev, meta-skb, (meta-txstat)); /* skb is freed by ieee80211_tx_status_irqsafe() */ Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c @@ -477,7 +477,8 @@ void bcm43xx_pio_handle_xmitstatus(struc queue-tx_devq_packets--; queue-tx_devq_used -= (packet-skb-len + sizeof(struct bcm43xx_txhdr)); - packet-txstat.ack = !!(status-flags BCM43xx_TXSTAT_FLAG_ACK); + if (status-flags BCM43xx_TXSTAT_FLAG_ACK) + packet-txstat.flags |= IEEE80211_TX_STATUS_ACK; packet-txstat.retry_count = status-cnt2 - 1; ieee80211_tx_status_irqsafe(bcm-net_dev, packet-skb, (packet-txstat)); Index: wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c === --- wireless-dev.orig/drivers/net/wireless/d80211/rt2x00/rt2400pci.c +++ wireless-dev/drivers/net/wireless/d80211/rt2x00/rt2400pci.c @@ -1741,10 +1741,11 @@ static void rt2400pci_txdone(void *data) ack = rt2x00_get_field32(txd-word0, TXD_W0_ACK); + entry-tx_status.flags = 0; /* -* TODO: How can te below field be set correctly? +* TODO: How can bit IEEE80211_TX_STATUS_TX_FILTERED of +* entry-tx_status.flags be set correctly? */ - entry-tx_status.tx_filtered = 0; entry-tx_status.queue_length = ring-stats.limit; entry-tx_status.queue_number = entry-tx_status.control.queue; @@ -1756,11 +1757,10 @@ static void rt2400pci_txdone(void *data) * was succesfull. */ tx_status = rt2x00_get_field32(txd-word0, TXD_W0_RESULT); - entry-tx_status.ack = 0;
[take2 3/5] d80211: remove bitfields from ieee80211_key_conf
All three one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_KEY_* definitions. The 8 bit keyidx bitfield is converted to type s8. Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c === --- wireless-dev.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c +++ wireless-dev/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c @@ -3634,8 +3634,8 @@ static int bcm43xx_net_set_key(struct ne if (err) goto out_unlock; key-hw_key_idx = index; - key-force_sw_encrypt = 0; - if (key-default_tx_key) + key-flags = ~IEEE80211_KEY_FORCE_SW_ENCRYPT; + if (key-flags IEEE80211_KEY_DEFAULT_TX_KEY) bcm-default_key_idx = index; bcm-key[index].enabled = 1; break; Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -366,13 +366,19 @@ struct ieee80211_key_conf { ieee80211_key_alg alg; int keylen; - unsigned int force_sw_encrypt:1;/* to be cleared by low-level driver */ - int keyidx:8; /* WEP key index */ - unsigned int default_tx_key:1; /* This key is the new default TX key -* (used only for broadcast keys). */ - unsigned int default_wep_only:1;/* static WEP is the only configured security -* policy; this allows some low-level drivers -* to determine when hwaccel can be used */ +#define IEEE80211_KEY_FORCE_SW_ENCRYPT (10) /* to be cleared by low-level +driver */ +#define IEEE80211_KEY_DEFAULT_TX_KEY (11) /* This key is the new default TX +key (used only for broadcast +keys). */ +#define IEEE80211_KEY_DEFAULT_WEP_ONLY (12) /* static WEP is the only +configured security policy; +this allows some low-level +drivers to determine when +hwaccel can be used */ + u8 flags; /* key configuration flags defined above */ + + s8 keyidx; /* WEP key index */ u8 key[0]; }; Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -74,10 +74,14 @@ ieee80211_key_data2conf(struct ieee80211 conf-hw_key_idx = data-hw_key_idx; conf-alg = data-alg; conf-keylen = data-keylen; - conf-force_sw_encrypt = data-force_sw_encrypt; + conf-flags = 0; + if (data-force_sw_encrypt) + conf-flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; conf-keyidx = data-keyidx; - conf-default_tx_key = data-default_tx_key; - conf-default_wep_only = local-default_wep_only; + if (data-default_tx_key) + conf-flags |= IEEE80211_KEY_DEFAULT_TX_KEY; + if (local-default_wep_only) + conf-flags |= IEEE80211_KEY_DEFAULT_WEP_ONLY; memcpy(conf-key, data-key, data-keylen); return conf; Index: wireless-dev/net/d80211/ieee80211_ioctl.c === --- wireless-dev.orig/net/d80211/ieee80211_ioctl.c +++ wireless-dev/net/d80211/ieee80211_ioctl.c @@ -326,7 +326,7 @@ static int ieee80211_ioctl_add_sta(struc memset(conf, 0, sizeof(conf)); conf.hw_key_idx = HW_KEY_IDX_INVALID; conf.alg = ALG_NULL; - conf.force_sw_encrypt = 1; + conf.flags |= IEEE80211_KEY_FORCE_SW_ENCRYPT; if (local-hw-set_key(dev, SET_KEY, sta-addr, conf, sta-aid)) { sta-key_idx_compression = HW_KEY_IDX_INVALID; @@ -496,7 +496,7 @@ int ieee80211_set_hw_encryption(struct n key-hw_key_idx = HW_KEY_IDX_INVALID; } else { key-force_sw_encrypt = - keyconf-force_sw_encrypt; + !!(keyconf-flags IEEE80211_KEY_FORCE_SW_ENCRYPT); key-hw_key_idx = keyconf-hw_key_idx; @@ -2289,7 +2289,8 @@ static void ieee80211_key_enable_hwaccel keyconf = ieee80211_key_data2conf(local, key); if (keyconf local-hw-set_key local-hw-set_key(local-mdev,
[take2 1/5] d80211: remove bitfields from ieee80211_tx_control
All one-bit bitfields have been subsumed into the new 'flags' structure member and the new IEEE80211_TXCTL_* definitions. The multiple bit members were converted to u8, s8 or u16 as appropriate. Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -141,36 +141,38 @@ struct ieee80211_tx_control { int rts_cts_rate; /* Transmit rate for RTS/CTS frame, given as the hw * specific value for the rate (from * struct ieee80211_rate) */ - /* 1 = only first attempt, 2 = one retry, .. */ - unsigned int retry_limit:8; - /* duration field for RTS/CTS frame */ - unsigned int rts_cts_duration:16; - unsigned int req_tx_status:1; /* request TX status callback for this - * frame */ - unsigned int do_not_encrypt:1; /* send this frame without encryption; - * e.g., for EAPOL frames */ - unsigned int use_rts_cts:1; /* Use RTS-CTS before sending frame. */ - unsigned int use_cts_protect:1; /* Use CTS protection for the frame -* (e.g., for combined 802.11g / -* 802.11b networks) */ -unsigned int no_ack:1; /* Tell the low level not to wait for an ack */ - unsigned int rate_ctrl_probe:1; - unsigned int clear_dst_mask:1; - unsigned int requeue:1; - unsigned int first_fragment:1; /* This is a first fragment of the -* frame */ -unsigned int power_level:8; /* per-packet transmit power level, in dBm -*/ - unsigned int antenna_sel:4; /* 0 = default/diversity, -* 1 = Ant0, 2 = Ant1 */ - int key_idx:8; /* -1 = do not encrypt, = 0 keyidx from hw-set_key() - */ - int icv_len:8; /* Length of the ICV/MIC field in octets */ - int iv_len:8; /* Length of the IV field in octets */ - unsigned int queue:4; /* hardware queue to use for this frame; - * 0 = highest, hw-queues-1 = lowest */ - unsigned int sw_retry_attempt:4; /* no. of times hw has tried to - * transmit frame (not incl. hw retries) */ + +#define IEEE80211_TXCTL_REQ_TX_STATUS (10)/* request TX status callback for + * this frame */ +#define IEEE80211_TXCTL_DO_NOT_ENCRYPT (11) /* send this frame without + * encryption; e.g., for EAPOL + * frames */ +#define IEEE80211_TXCTL_USE_RTS_CTS(12) /* use RTS-CTS before sending + * frame */ +#define IEEE80211_TXCTL_USE_CTS_PROTECT(13) /* use CTS protection for the + * frame (e.g., for combined + * 802.11g / 802.11b networks) */ +#define IEEE80211_TXCTL_NO_ACK (14) /* tell the low level not to + * wait for an ack */ +#define IEEE80211_TXCTL_RATE_CTRL_PROBE(15) +#define IEEE80211_TXCTL_CLEAR_DST_MASK (16) +#define IEEE80211_TXCTL_REQUEUE(17) +#define IEEE80211_TXCTL_FIRST_FRAGMENT (18) /* this is a first fragment of + * the frame */ + u16 flags; /* tx control flags defined + * above */ + u16 rts_cts_duration; /* duration field for RTS/CTS frame */ + u8 retry_limit; /* 1 = only first attempt, 2 = one retry, .. */ + u8 power_level; /* per-packet transmit power level, in dBm */ + u8 antenna_sel; /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ + s8 key_idx; /* -1 = do not encrypt, = 0 keyidx from +* hw-set_key() */ + u8 icv_len; /* length of the ICV/MIC field in octets */ + u8 iv_len; /* length of the IV field in octets */ + u8 queue; /* hardware queue to use for this frame; +* 0 = highest, hw-queues-1 = lowest */ + u8 sw_retry_attempt;/* number of times hw has tried to +* transmit frame (not incl. hw retries) */ int rateidx; /* internal 80211.o rateidx */ int alt_retry_rate; /* retry rate for the last retries, given as the Index: wireless-dev/net/d80211/ieee80211.c === --- wireless-dev.orig/net/d80211/ieee80211.c +++ wireless-dev/net/d80211/ieee80211.c @@ -363,7 +363,7 @@
[take2 0/5] d80211: remove bitfields from include/net/d80211.h
Continue d80211 bitfield removal. In general, compilers have difficulty generating efficient code for bitfields. This patchset removes all bitfields from include/net/d80211.h. I converted the 1 bit bitfields into a bit in a u32/u16 or u8 flags structure member. Larger bitfields I converted into their u8/u16/whatever equivalent. This should be a no-op from a functionality standpoint. All tests using gcc 4.1.2. The size of structures where bitfields were removed is identical patched and unpatched. All object text size is either slightly smaller after the patch, or unchanged (bss and data are all unchanged). With all d80211 drivers compiled in the patched vmlinux is 928 bytes smaller. Changes from take1: Update rt2500usb.c and rt73usb.c drivers based on the new structures. Changes from take0: Update the patches to apply on top of the following patches: d80211: remove unused Super AG definitions, purge comment (http://marc.theaimsgroup.com/?l=linux-netdevm=116102409931269w=2) d80211: remove initialization of unused xr structure members (http://marc.theaimsgroup.com/?l=linux-netdevm=116076811809305w=4) d80211: remove unused xr structure members, interface, etc. (http://marc.theaimsgroup.com/?l=linux-netdevm=115989929600617w=4) For key_conf_bitfields.patch change the new flags member to u8 from u32. For tx_control_bitfields.patch move the rts_cts_duration and retry_limit members in ieee80211_tx_control to allow for smaller structure size and change the flags member from u32 to u16. For tx_status_bitfields.patch, in drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c and drivers/net/wireless/d80211/bcm43xx/bcm43xx_pio.c note that ieee80211_tx_status is already zero'd, so the ack bit only needs to be set, not cleared. -- - 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] netpoll: retry memory leak
If netpoll uses up it's retries, it should drop the skb not leak memory. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] --- net/core/netpoll.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/net/core/netpoll.c b/net/core/netpoll.c index ead5920..c375fde 100644 --- a/net/core/netpoll.c +++ b/net/core/netpoll.c @@ -273,10 +273,8 @@ static void netpoll_send_skb(struct netp int status; struct netpoll_info *npinfo; - if (!np || !np-dev || !netif_running(np-dev)) { - __kfree_skb(skb); - return; - } + if (!np || !np-dev || !netif_running(np-dev)) + goto free_skb; npinfo = np-dev-npinfo; @@ -314,6 +312,8 @@ static void netpoll_send_skb(struct netp netpoll_poll(np); udelay(50); } while (npinfo-tries 0); +free_skb: + __kfree_skb(skb); } void netpoll_send_udp(struct netpoll *np, const char *msg, int len) -- 1.4.2.3 - 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 kernel doc for ieee80211_get_buffered_bc
ieee80211_beacon_get() was already described. The doc entry in question describes ieee80211_get_buffered_bc(). Signed-off-by: David Kimdon [EMAIL PROTECTED] Index: wireless-dev/include/net/d80211.h === --- wireless-dev.orig/include/net/d80211.h +++ wireless-dev/include/net/d80211.h @@ -782,7 +782,7 @@ struct sk_buff * ieee80211_beacon_get(st struct ieee80211_tx_control *control); /** - * ieee80211_beacon_get - accessing buffered broadcast and multicast frames + * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames * @dev: pointer to struct net_device as obtained from * ieee80211_alloc_hw(). * @if_id: interface ID from struct ieee80211_if_init_conf. -- - 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
netpoll causes malformed protocol message
Now that I know what this is, perhaps others should know. Linus Torvalds [EMAIL PROTECTED] wrote: Since I've been re-testing the Apple Intel Mac Mini suspend/resume due to a USB problem, I thought I might as well see if this rings any bells.. On resume, networking does actually eventually work, but it takes a while before it gets going. The dmesg for the resume shows: sky2 eth0: Link is up at 100 Mbps, full duplex, flow control both protocol is buggy, dev eth0 protocol is buggy, dev eth0 The packets created by netpoll trigger the check for bogus protocol in net/core/dev.c if it gets busy enough to actually use the netpoll tx queue. I'll whip a fix, the skb should be setup better and it shouldn't call different xmit paths for the queued/non-queued case. Follow on patch to replace the roll your own skb queue's with the already there sk_buff_head routines. Given the normal case is lots of small writes, probably better to just have a character queue to cause coalescing. The netpoll code is a step child it looks like and ignores using standard code when it should. - 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: [Madwifi-devel] d80211: ANNOUNCE: DadWifi, a port of MadWifi to d80211
Christoph Hellwig wrote: Guys, why do you waste your time on doing stuff that's useless for most of us, and that people can't even legally redistribute. Well that may be your opinion, but it's certainly not mine. We had just discussed starting an in-house project to port the HAL to the d80211 stack when David made his announcement. The reason? While we'd obviously prefer that the HAL didn't exist, if it's going to exist we would far rather that it had a common 80211 stack on top of it, so that we can easily switch to other chipsets and retain the same featureset. Reducing the number of 80211 stacks in use in Linux is a great thing. Please switch to openhal or the openbsd code and we all owe you a lot of beer at the next conference :) I'll be very happy to provide beer for any devicescape employee I meet, simply based on the initial release of dadwifi. Cheers -- Matt Brown [EMAIL PROTECTED] Mob +64 21 611 544 www.mattb.net.nz signature.asc Description: OpenPGP digital signature
[patch] Add ethtool -i interface to Prism54
Attached is a small patch that will add support for ethtool -i to the prism54 driver. ethtool -i queries the specified ethernet device for associated driver information. This helps tools like Fedora's system-config-network to provide GUI management of network devices. I learned how to write this patch by reading the ipw2100 driver code. Thanks for considering to take it. Kai --- linux-2.6.16/drivers/net/wireless/prism54/islpci_dev.h.preke 2006-03-20 06:53:29.0 +0100 +++ linux-2.6.16/drivers/net/wireless/prism54/islpci_dev.h 2006-04-12 15:12:30.0 +0200 @@ -210,4 +210,8 @@ int islpci_free_memory(islpci_private *); struct net_device *islpci_setup(struct pci_dev *); + +#define DRV_NAME prism54 +#define DRV_VERSION1.2 + #endif /* _ISLPCI_DEV_H */ --- linux-2.6.16/drivers/net/wireless/prism54/islpci_dev.c.preke 2006-04-12 14:56:12.0 +0200 +++ linux-2.6.16/drivers/net/wireless/prism54/islpci_dev.c 2006-04-13 01:39:27.0 +0200 @@ -22,6 +22,7 @@ #include linux/module.h #include linux/netdevice.h +#include linux/ethtool.h #include linux/pci.h #include linux/etherdevice.h #include linux/delay.h @@ -788,6 +789,17 @@ } #endif +static void islpci_ethtool_get_drvinfo(struct net_device *dev, + struct ethtool_drvinfo *info) +{ + strcpy(info-driver, DRV_NAME); + strcpy(info-version, DRV_VERSION); +} + +static struct ethtool_ops islpci_ethtool_ops = { + .get_drvinfo = islpci_ethtool_get_drvinfo, +}; + struct net_device * islpci_setup(struct pci_dev *pdev) { @@ -814,6 +826,7 @@ ndev-do_ioctl = prism54_ioctl; ndev-wireless_handlers = (struct iw_handler_def *) prism54_handler_def; + ndev-ethtool_ops = islpci_ethtool_ops; ndev-hard_start_xmit = islpci_eth_transmit; /* ndev-set_multicast_list = islpci_set_multicast_list; */ --- linux-2.6.16/drivers/net/wireless/prism54/islpci_hotplug.c.preke 2006-04-12 14:56:22.0 +0200 +++ linux-2.6.16/drivers/net/wireless/prism54/islpci_hotplug.c 2006-04-12 15:14:16.0 +0200 @@ -28,9 +28,6 @@ #include islpci_mgt.h/* for pc_debug */ #include isl_oid.h -#define DRV_NAME prism54 -#define DRV_VERSION1.2 - MODULE_AUTHOR([Intersil] R.Bastings and W.Termorshuizen, The prism54.org Development Team [EMAIL PROTECTED]); MODULE_DESCRIPTION(The Prism54 802.11 Wireless LAN adapter); MODULE_LICENSE(GPL);
[PATCH 1/7] I/OAT: Push pending transactions to hardware more frequently
Every 20 descriptors turns out to be to few append commands with newer/faster CPUs. Pushing every 4 still cuts down on MMIO writes to an acceptable level without letting the DMA engine run out of work. Signed-off-by: Chris Leech [EMAIL PROTECTED] --- drivers/dma/ioatdma.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/dma/ioatdma.c b/drivers/dma/ioatdma.c index 0358419..f3b34b5 100644 --- a/drivers/dma/ioatdma.c +++ b/drivers/dma/ioatdma.c @@ -310,7 +310,7 @@ static dma_cookie_t do_ioat_dma_memcpy(s list_splice_init(new_chain, ioat_chan-used_desc.prev); ioat_chan-pending += desc_count; - if (ioat_chan-pending = 20) { + if (ioat_chan-pending = 4) { append = 1; ioat_chan-pending = 0; } @@ -818,7 +818,7 @@ static void __devexit ioat_remove(struct } /* MODULE API */ -MODULE_VERSION(1.7); +MODULE_VERSION(1.9); MODULE_LICENSE(GPL); MODULE_AUTHOR(Intel Corporation); - 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