Re:[PATCH]Fix BUG of ip_rt_send_redirect()

2006-12-05 Thread Li Yewang
Herbert Xu [EMAIL PROTECTED] wrote:

 
I think there are two problems here:
 
1)The first time we hit the check rate_last is zero. We should simply
proceed with the redirect rather than treating this as a jiffies value.
 
2)When a dst is so old that the jiffies have wrapped around.  I'm
not sure whether this is worth solving as it should be extremely rare
unless your HZ is sufficiently large and you're on a 32-bit platform.
 
One solution would be to periodically reset the rate_last fields to
their original states.  Perhaps we can combine that with the GC.


Mr Herbert Xu:

According to your advice, I have made another patch for the redirect
bug.

This patch does not think of the jiffies wraparound any more.
Because if the router sends a redirect packet for the first time,
the redirect route cache entry will be created in the route cache.
If this entry is used frequently(This should be extremely rare), 
the rate_last will be update to the current jiffies when it sends 
the redirect packet. So we don't concern about the jiffies wraparound.
If this entry does not be used for a long time, the GC will remove 
it from route cache. Next time if we want to use this entry, 
the redirect entry will be created in the route cache again, and the
rate_last will be initialized to 0. So we don't care of the jiffies
wraparound too.


Following is my patch:

Signed-off-by: Li Yewang [EMAIL PROTECTED]

--- linux-2.6.19/net/ipv4/route.c.org 2006-12-05 10:47:02.402147160
+0800
+++ linux-2.6.19/net/ipv4/route.c 2006-12-05 10:48:26.339386760 +0800
@@ -1327,7 +1327,8 @@ void ip_rt_send_redirect(struct sk_buff 
  /* Check for load limit; set rate_last to the latest sent
   * redirect.
   */
- if (time_after(jiffies,
+ if (rt-u.dst.rate_last == 0 ||
+ time_after(jiffies,
  (rt-u.dst.rate_last +
(ip_rt_redirect_load  rt-u.dst.rate_tokens {
   icmp_send(skb, ICMP_REDIRECT, ICMP_REDIR_HOST, rt-rt_gateway);


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: dm-crypt changes in git-net tree

2006-12-05 Thread Herbert Xu
On Mon, Dec 04, 2006 at 10:59:07PM -0800, Andrew Morton wrote:
 
 On x86_64:
 
 drivers/md/dm-crypt.c: In function 'crypt_iv_benbi_ctr':
 drivers/md/dm-crypt.c:235: warning: cast to pointer from integer of different 
 size
 drivers/md/dm-crypt.c: In function 'crypt_iv_benbi_gen':
 drivers/md/dm-crypt.c:248: warning: cast from pointer to integer of different 
 size
 drivers/md/dm-crypt.c:248: warning: cast from pointer to integer of different 
 size
 drivers/md/dm-crypt.c:248: warning: cast from pointer to integer of different 
 size

Yeah that isn't pretty.  I've changed it like this.

[CRYPTO] dm-crypt: Make iv_gen_private a union

Rather than stuffing integers into pointers with casts, let's use
a union.

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

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmVHI~} [EMAIL PROTECTED]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 2c7aaac..9b3b126 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -86,7 +86,10 @@ struct crypt_config {
 */
struct crypt_iv_operations *iv_gen_ops;
char *iv_mode;
-   struct crypto_cipher *iv_gen_private;
+   union {
+   struct crypto_cipher *essiv_tfm;
+   int benbi_shift;
+   } iv_gen_private;
sector_t iv_offset;
unsigned int iv_size;
 
@@ -195,21 +198,21 @@ static int crypt_iv_essiv_ctr(struct cry
}
kfree(salt);
 
-   cc-iv_gen_private = essiv_tfm;
+   cc-iv_gen_private.essiv_tfm = essiv_tfm;
return 0;
 }
 
 static void crypt_iv_essiv_dtr(struct crypt_config *cc)
 {
-   crypto_free_cipher(cc-iv_gen_private);
-   cc-iv_gen_private = NULL;
+   crypto_free_cipher(cc-iv_gen_private.essiv_tfm);
+   cc-iv_gen_private.essiv_tfm = NULL;
 }
 
 static int crypt_iv_essiv_gen(struct crypt_config *cc, u8 *iv, sector_t sector)
 {
memset(iv, 0, cc-iv_size);
*(u64 *)iv = cpu_to_le64(sector);
-   crypto_cipher_encrypt_one(cc-iv_gen_private, iv, iv);
+   crypto_cipher_encrypt_one(cc-iv_gen_private.essiv_tfm, iv, iv);
return 0;
 }
 
@@ -232,21 +235,23 @@ static int crypt_iv_benbi_ctr(struct cry
return -EINVAL;
}
 
-   cc-iv_gen_private = (void *)(9 - log);
+   cc-iv_gen_private.benbi_shift = 9 - log;
 
return 0;
 }
 
 static void crypt_iv_benbi_dtr(struct crypt_config *cc)
 {
-   cc-iv_gen_private = NULL;
 }
 
 static int crypt_iv_benbi_gen(struct crypt_config *cc, u8 *iv, sector_t sector)
 {
+   __be64 val;
+
memset(iv, 0, cc-iv_size - sizeof(u64)); /* rest is cleared below */
-   put_unaligned(cpu_to_be64(((u64)sector  (u32)cc-iv_gen_private) + 1),
- (__be64 *)(iv + cc-iv_size - sizeof(u64)));
+
+   val = cpu_to_be64(((u64)sector  cc-iv_gen_private.benbi_shift) + 1);
+   put_unaligned(val, (__be64 *)(iv + cc-iv_size - sizeof(u64)));
 
return 0;
 }
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: NETDEV-BCM43XX BUG - Failure to associate AP with latest devscape git pull..

2006-12-05 Thread Johannes Berg
On Mon, 2006-12-04 at 13:17 -0500, Robert Martin wrote:

 03:00.0 0280: 14e4:4311 (rev 01)

4311 is pci-e though, iirc. Linux just shows pci-e like pci devices.


Capabilities: [d0] Express Legacy Endpoint IRQ 0
Device: Supported: MaxPayload 128 bytes, PhantFunc 0, 
 ExtTag+
Device: Latency L0s 4us, L1 unlimited
Device: AtnBtn- AtnInd- PwrInd-
Device: Errors: Correctable- Non-Fatal- Fatal- Unsupported-
Device: RlxdOrd- ExtTag- PhantFunc- AuxPwr- NoSnoop-
Device: MaxPayload 128 bytes, MaxReadReq 128 bytes
Link: Supported Speed 2.5Gb/s, Width x1, ASPM L0s, Port 0
Link: Latency L0s 4us, L1 64us
Link: ASPM Disabled RCB 64 bytes CommClk- ExtSynch-
Link: Speed 2.5Gb/s, Width x1
Capabilities: [100] Advanced Error Reporting
Capabilities: [13c] Virtual Channel

looks like pci-e capabilities to me..

johannes


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


[PATCH 2.6.20] [IPV6]: Repair IPv6 Fragments

2006-12-05 Thread YOSHIFUJI Hideaki / 吉藤英明
Hello.

The commit [IPV6]: Use kmemdup (commit-id:
af879cc704372ef762584e916129d19ffb39e844) broke IPv6 fragments.

Bug was spotted by Yasuyuki Kozakai [EMAIL PROTECTED].

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

-- 
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
index e05ecbb..e9212c7 100644
--- a/net/ipv6/ip6_output.c
+++ b/net/ipv6/ip6_output.c
@@ -624,13 +624,13 @@ static int ip6_fragment(struct sk_buff *skb, int 
(*output)(struct sk_buff *))
skb_shinfo(skb)-frag_list = NULL;
/* BUILD HEADER */
 
+   *prevhdr = NEXTHDR_FRAGMENT;
tmp_hdr = kmemdup(skb-nh.raw, hlen, GFP_ATOMIC);
if (!tmp_hdr) {
IP6_INC_STATS(ip6_dst_idev(skb-dst), 
IPSTATS_MIB_FRAGFAILS);
return -ENOMEM;
}
 
-   *prevhdr = NEXTHDR_FRAGMENT;
__skb_pull(skb, hlen);
fh = (struct frag_hdr*)__skb_push(skb, sizeof(struct frag_hdr));
skb-nh.raw = __skb_push(skb, hlen);

-- 
YOSHIFUJI Hideaki @ USAGI Project  [EMAIL PROTECTED]
GPG-FP  : 9022 65EB 1ECF 3AD1 0BDF  80D8 4807 F894 E062 0EEA
-
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


TCP dynamic system

2006-12-05 Thread Sebastian Krahmer

Hi,

Does anyone know a good book on the nature of TCP? Means,
how does all the algorithms (Nagle, ...) delayed, quick, opt-ack,
winodw-size, MSS etc. affect the thruput and so on? Something
that explains (hopefully as good as TCP Illustrated) which parameters
cause what effects. There are some papers which describe this or
that single topic but not a whole view.
I am not subscribed to the list, so please take me into Cc or
answer off-list :-)

thx,
Sebastian

-- 
~
~ perl self.pl
~ $_='print\$_=\47$_\47;eval';eval
~ [EMAIL PROTECTED] - SuSE Security Team
~

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


[PATCH 1/2] [IPV6] RAW: Don't release unlocked sock.

2006-12-05 Thread Masahide NAKAMURA
When user builds IPv6 header and send it through raw socket, kernel
tries to release unlocked sock. (Kernel log shows
BUG: bad unlock balance detected with enabled debug option.)

The lock is held only for non-hdrincl sock in this function
then this patch fix to do nothing about lock for hdrincl one.

Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 net/ipv6/raw.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index d6dedc4..aa1d420 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -855,7 +855,8 @@ back_from_confirm:
}
 done:
dst_release(dst);
-   release_sock(sk);
+   if (!inet-hdrincl)
+   release_sock(sk);
 out:   
fl6_sock_release(flowlabel);
return err0?err:len;
-- 
1.4.2

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


[PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.

2006-12-05 Thread Masahide NAKAMURA
Add checksum default defines for mobility header(MH).
As the result kernel's behavior is to handle MH checksum
as default.

Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 net/ipv6/raw.c |   15 +--
 1 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index aa1d420..389fa32 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -1095,10 +1095,21 @@ static void rawv6_close(struct sock *sk,
 
 static int rawv6_init_sk(struct sock *sk)
 {
-   if (inet_sk(sk)-num == IPPROTO_ICMPV6) {
-   struct raw6_sock *rp = raw6_sk(sk);
+   struct raw6_sock *rp = raw6_sk(sk);
+
+   switch (inet_sk(sk)-num) {
+   case IPPROTO_ICMPV6:
rp-checksum = 1;
rp-offset   = 2;
+   break;
+#ifdef CONFIG_IPV6_MIP6
+   case IPPROTO_MH:
+   rp-checksum = 1;
+   rp-offset   = 4;
+   break;
+#endif
+   default:
+   break;
}
return(0);
 }
-- 
1.4.2

-
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/7] iproute2: 2.6.19 updates and Mobile IPv6 support for ip command

2006-12-05 Thread Masahide NAKAMURA
Hello,

These are iproute2 updates:

o Kernel header updates for 2.6.19
o libnetlink header updates to fit with 2.6.19 kernel
o Mobile IPv6 xfrm support for ip command

Since I could not build with the define nor find it on the kernel tree,
It also contains a patch which disable FIB_RULE_INVERT.

Please review and apply them.

Thanks,

-- 
Masahide NAKAMURA
-
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/7] Add missing macros which was removed from kernel header.

2006-12-05 Thread Masahide NAKAMURA
{IFA,IFLA,NDA,NDTA}_{RTA,PAYLOAD} macro is removed from kernel
header since linux-2.6.19 because it is not used by kernel code.

Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 include/libnetlink.h |   35 +++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/include/libnetlink.h b/include/libnetlink.h
index 63cc3c8..9de3a0b 100644
--- a/include/libnetlink.h
+++ b/include/libnetlink.h
@@ -4,6 +4,9 @@ #define __LIBNETLINK_H__ 1
 #include asm/types.h
 #include linux/netlink.h
 #include linux/rtnetlink.h
+#include linux/if_link.h
+#include linux/if_addr.h
+#include linux/neighbour.h
 
 struct rtnl_handle
 {
@@ -53,5 +56,37 @@ extern int rtnl_from_file(FILE *, rtnl_f
 #define NLMSG_TAIL(nmsg) \
((struct rtattr *) (((void *) (nmsg)) + NLMSG_ALIGN((nmsg)-nlmsg_len)))
 
+#ifndef IFA_RTA
+#define IFA_RTA(r) \
+   ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifaddrmsg
+#endif
+#ifndef IFA_PAYLOAD
+#define IFA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ifaddrmsg))
+#endif
+
+#ifndef IFLA_RTA
+#define IFLA_RTA(r) \
+   ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ifinfomsg
+#endif
+#ifndef IFLA_PAYLOAD
+#define IFLA_PAYLOAD(n)NLMSG_PAYLOAD(n,sizeof(struct ifinfomsg))
+#endif
+
+#ifndef NDA_RTA
+#define NDA_RTA(r) \
+   ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndmsg
+#endif
+#ifndef NDA_PAYLOAD
+#define NDA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndmsg))
+#endif
+
+#ifndef NDTA_RTA
+#define NDTA_RTA(r) \
+   ((struct rtattr*)(((char*)(r)) + NLMSG_ALIGN(sizeof(struct ndtmsg
+#endif
+#ifndef NDTA_PAYLOAD
+#define NDTA_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct ndtmsg))
+#endif
+
 #endif /* __LIBNETLINK_H__ */
 
-- 
1.4.2

-
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/7] [IP] XFRM: Mobility header support.

2006-12-05 Thread Masahide NAKAMURA
Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 ip/ipxfrm.c |9 +
 ip/xfrm.h   |3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 7c9fd0b..9c8b4bd 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -483,6 +483,14 @@ void xfrm_selector_print(struct xfrm_sel
if (sel-dport_mask)
fprintf(fp, code %u , ntohs(sel-dport));
break;
+   case IPPROTO_MH:
+   if (sel-sport_mask)
+   fprintf(fp, type %u , ntohs(sel-sport));
+   if (sel-dport_mask) {
+   if (show_stats  0)
+   fprintf(fp, (dport) 0x%.4x , sel-dport);
+   }
+   break;
}
 
if (sel-ifindex  0) {
@@ -,6 +1119,7 @@ static int xfrm_selector_upspec_parse(st
switch (sel-proto) {
case IPPROTO_ICMP:
case IPPROTO_ICMPV6:
+   case IPPROTO_MH:
break;
default:
fprintf(stderr, \type\ and \code\ are invalid with 
proto=%s\n, strxf_proto(sel-proto));
diff --git a/ip/xfrm.h b/ip/xfrm.h
index d33ff94..03db37b 100644
--- a/ip/xfrm.h
+++ b/ip/xfrm.h
@@ -35,6 +35,9 @@ #endif
 #ifndef IPPPROTO_DCCP
 # define IPPROTO_DCCP  33
 #endif
+#ifndef IPPROTO_MH
+# define IPPROTO_MH135
+#endif
 
 #define XFRMS_RTA(x)  ((struct rtattr*)(((char*)(x)) + 
NLMSG_ALIGN(sizeof(struct xfrm_usersa_info
 #define XFRMS_PAYLOAD(n) NLMSG_PAYLOAD(n,sizeof(struct xfrm_usersa_info))
-- 
1.4.2

-
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/7] [IP] XFRM: support report message by monitor.

2006-12-05 Thread Masahide NAKAMURA
Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 ip/xfrm.h |2 ++
 ip/xfrm_monitor.c |   52 
 2 files changed, 54 insertions(+), 0 deletions(-)

diff --git a/ip/xfrm.h b/ip/xfrm.h
index 51ffa4b..d33ff94 100644
--- a/ip/xfrm.h
+++ b/ip/xfrm.h
@@ -52,6 +52,8 @@ #define XFRMACQ_RTA(x)((struct rtattr*)
 #define XFRMEXP_RTA(x) ((struct rtattr*)(((char*)(x)) + 
NLMSG_ALIGN(sizeof(struct xfrm_user_expire
 #define XFRMPEXP_RTA(x)((struct rtattr*)(((char*)(x)) + 
NLMSG_ALIGN(sizeof(struct xfrm_user_polexpire
 
+#define XFRMREP_RTA(x) ((struct rtattr*)(((char*)(x)) + 
NLMSG_ALIGN(sizeof(struct xfrm_user_report
+
 #define XFRM_FLAG_PRINT(fp, flags, f, s) \
do { \
if (flags  f) { \
diff --git a/ip/xfrm_monitor.c b/ip/xfrm_monitor.c
index baa4610..b4fda02 100644
--- a/ip/xfrm_monitor.c
+++ b/ip/xfrm_monitor.c
@@ -108,6 +108,48 @@ static int xfrm_acquire_print(const stru
return 0;
 }
 
+static int xfrm_report_print(const struct sockaddr_nl *who,
+struct nlmsghdr *n, void *arg)
+{
+   FILE *fp = (FILE*)arg;
+   struct xfrm_user_report *xrep = NLMSG_DATA(n);
+   int len = n-nlmsg_len;
+   struct rtattr * tb[XFRMA_MAX+1];
+   __u16 family;
+
+   if (n-nlmsg_type != XFRM_MSG_REPORT) {
+   fprintf(stderr, Not a report: %08x %08x %08x\n,
+   n-nlmsg_len, n-nlmsg_type, n-nlmsg_flags);
+   return 0;
+   }
+
+   len -= NLMSG_LENGTH(sizeof(*xrep));
+   if (len  0) {
+   fprintf(stderr, BUG: wrong nlmsg len %d\n, len);
+   return -1;
+   }
+
+   family = xrep-sel.family;
+   if (family == AF_UNSPEC)
+   family = preferred_family;
+
+   fprintf(fp, report );
+
+   fprintf(fp, proto %s , strxf_xfrmproto(xrep-proto));
+   fprintf(fp, %s, _SL_);
+
+   xfrm_selector_print(xrep-sel, family, fp,   sel );
+
+   parse_rtattr(tb, XFRMA_MAX, XFRMREP_RTA(xrep), len);
+
+   xfrm_xfrma_print(tb, family, fp,   );
+
+   if (oneline)
+   fprintf(fp, \n);
+
+   return 0;
+}
+
 static int xfrm_accept_msg(const struct sockaddr_nl *who,
   struct nlmsghdr *n, void *arg)
 {
@@ -144,6 +186,10 @@ static int xfrm_accept_msg(const struct 
fprintf(fp, Flushed policy\n);
return 0;
}
+   if (n-nlmsg_type == XFRM_MSG_REPORT) {
+   xfrm_report_print(who, n, arg);
+   return 0;
+   }
if (n-nlmsg_type != NLMSG_ERROR  n-nlmsg_type != NLMSG_NOOP 
n-nlmsg_type != NLMSG_DONE) {
fprintf(fp, Unknown message: %08d 0x%08x 0x%08x\n,
@@ -162,6 +208,7 @@ int do_xfrm_monitor(int argc, char **arg
int lexpire=0;
int lpolicy=0;
int lsa=0;
+   int lreport=0;
 
rtnl_close(rth);
 
@@ -181,6 +228,9 @@ int do_xfrm_monitor(int argc, char **arg
} else if (matches(*argv, policy) == 0) {
lpolicy=1;
groups = 0;
+   } else if (matches(*argv, report) == 0) {
+   lreport=1;
+   groups = 0;
} else if (matches(*argv, help) == 0) {
usage();
} else {
@@ -198,6 +248,8 @@ int do_xfrm_monitor(int argc, char **arg
groups |= XFRMGRP_SA;
if (lpolicy)
groups |= XFRMGRP_POLICY;
+   if (lreport)
+   groups |= XFRMGRP_REPORT;
 
if (file) {
FILE *fp;
-- 
1.4.2

-
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/7] [IP] XFRM: sub policy support.

2006-12-05 Thread Masahide NAKAMURA
Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 ip/ipxfrm.c  |   27 ++
 ip/xfrm.h|4 +
 ip/xfrm_policy.c |  150 --
 3 files changed, 164 insertions(+), 17 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 4bcd2f3..79fc133 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -709,6 +709,7 @@ void xfrm_policy_info_print(struct xfrm_
const char *title)
 {
char buf[STRBUF_SIZE];
+   __u8 ptype = XFRM_POLICY_TYPE_MAIN;
 
memset(buf, '\0', sizeof(buf));
 
@@ -752,6 +753,32 @@ void xfrm_policy_info_print(struct xfrm_
if (show_stats)
fprintf(fp, index %u , xpinfo-index);
fprintf(fp, priority %u , xpinfo-priority);
+
+   fprintf(fp, ptype );
+
+   if (tb[XFRMA_POLICY_TYPE]) {
+   struct xfrm_userpolicy_type *upt;
+
+   if (RTA_PAYLOAD(tb[XFRMA_POLICY_TYPE])  sizeof(*upt))
+   fprintf(fp, (ERROR truncated));
+
+   upt = (struct xfrm_userpolicy_type 
*)RTA_DATA(tb[XFRMA_POLICY_TYPE]);
+   ptype = upt-type;
+   }
+
+   switch (ptype) {
+   case XFRM_POLICY_TYPE_MAIN:
+   fprintf(fp, main);
+   break;
+   case XFRM_POLICY_TYPE_SUB:
+   fprintf(fp, sub);
+   break;
+   default:
+   fprintf(fp, %u, ptype);
+   break;
+   }
+   fprintf(fp,  );
+
if (show_stats  0) {
fprintf(fp, share %s , strxf_share(xpinfo-share));
fprintf(fp, flag 0x%s, strxf_mask8(xpinfo-flags));
diff --git a/ip/xfrm.h b/ip/xfrm.h
index 4833b36..7a53e59 100644
--- a/ip/xfrm.h
+++ b/ip/xfrm.h
@@ -92,6 +92,10 @@ struct xfrm_filter {
__u32 index_mask;
__u8 action_mask;
__u32 priority_mask;
+
+   __u8 ptype;
+   __u8 ptype_mask;
+
 };
 #define XFRM_FILTER_MASK_FULL (~0)
 
diff --git a/ip/xfrm_policy.c b/ip/xfrm_policy.c
index abca713..6be7bfd 100644
--- a/ip/xfrm_policy.c
+++ b/ip/xfrm_policy.c
@@ -53,12 +53,14 @@ static void usage(void) __attribute__((n
 
 static void usage(void)
 {
-   fprintf(stderr, Usage: ip xfrm policy { add | update } dir DIR 
SELECTOR [ index INDEX ] \n);
+   fprintf(stderr, Usage: ip xfrm policy { add | update } dir DIR 
SELECTOR [ index INDEX ] [ ptype PTYPE ]\n);
fprintf(stderr, [ action ACTION ] [ priority PRIORITY ] [ 
LIMIT-LIST ] [ TMPL-LIST ]\n);
-   fprintf(stderr, Usage: ip xfrm policy { delete | get } dir DIR [ 
SELECTOR | index INDEX ]\n);
+   fprintf(stderr, Usage: ip xfrm policy { delete | get } dir DIR [ 
SELECTOR | index INDEX ] [ ptype PTYPE ]\n);
fprintf(stderr, Usage: ip xfrm policy { deleteall | list } [ dir DIR ] 
[ SELECTOR ]\n);
fprintf(stderr, [ index INDEX ] [ action ACTION ] [ priority 
PRIORITY ]\n);
-   fprintf(stderr, Usage: ip xfrm policy flush\n);
+   fprintf(stderr, Usage: ip xfrm policy flush [ ptype PTYPE ]\n);
+
+   fprintf(stderr, PTYPE := [ main | sub ](default=main)\n);
fprintf(stderr, DIR := [ in | out | fwd ]\n);
 
fprintf(stderr, SELECTOR := src ADDR[/PLEN] dst ADDR[/PLEN] [ UPSPEC ] 
[ dev DEV ]\n);
@@ -114,6 +116,24 @@ static int xfrm_policy_dir_parse(__u8 *d
return 0;
 }
 
+static int xfrm_policy_ptype_parse(__u8 *ptype, int *argcp, char ***argvp)
+{
+   int argc = *argcp;
+   char **argv = *argvp;
+
+   if (strcmp(*argv, main) == 0)
+   *ptype = XFRM_POLICY_TYPE_MAIN;
+   else if (strcmp(*argv, sub) == 0)
+   *ptype = XFRM_POLICY_TYPE_SUB;
+   else
+   invarg(\PTYPE\ is invalid, *argv);
+
+   *argcp = argc;
+   *argvp = argv;
+
+   return 0;
+}
+
 static int xfrm_tmpl_parse(struct xfrm_user_tmpl *tmpl,
   int *argcp, char ***argvp)
 {
@@ -174,10 +194,13 @@ static int xfrm_policy_modify(int cmd, u
} req;
char *dirp = NULL;
char *selp = NULL;
+   char *ptypep = NULL;
+   struct xfrm_userpolicy_type upt;
char tmpls_buf[XFRM_TMPLS_BUF_SIZE];
int tmpls_len = 0;
 
memset(req, 0, sizeof(req));
+   memset(upt, 0, sizeof(upt));
memset(tmpls_buf, 0, sizeof(tmpls_buf));
 
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(req.xpinfo));
@@ -208,6 +231,16 @@ static int xfrm_policy_modify(int cmd, u
 
filter.index_mask = XFRM_FILTER_MASK_FULL;
 
+   } else if (strcmp(*argv, ptype) == 0) {
+   if (ptypep)
+   duparg(ptype, *argv);
+   ptypep = *argv;
+
+   NEXT_ARG();
+   xfrm_policy_ptype_parse(upt.type, argc, argv);
+
+   filter.dir_mask = XFRM_FILTER_MASK_FULL;
+
} else if (strcmp(*argv, action) == 0) {
NEXT_ARG();
if 

[PATCH 5/7] [IP] XFRM: Mobile IPv6 route optimization support.

2006-12-05 Thread Masahide NAKAMURA
To support Mobile IPv6 RO, the following extension is included:
o Use XFRM_MODE_XXX macro instead of magic number
o New attribute option for all state: source address for
  deleting or getting message
o New attribute options for RO: care-of address, last-used timestamp
  and wild-receive flag

Note:
Flush command like `ip xfrm state flush` is to remove all XFRM state.
It has been effected for IPsec SAD but with this patch it flushes both
IPsec SAD and Mobile IPv6 RO states.
To make only IPsec SA flush, it is recommanded to specify each XFRM
protocol like below:
 `ip x s f proto esp ; ip x s f proto ah ; ip x s f proto comp`

Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 ip/ipxfrm.c  |   84 ++
 ip/xfrm.h|2 +
 ip/xfrm_policy.c |7 ++--
 ip/xfrm_state.c  |  107 --
 4 files changed, 169 insertions(+), 31 deletions(-)

diff --git a/ip/ipxfrm.c b/ip/ipxfrm.c
index 79fc133..7c9fd0b 100644
--- a/ip/ipxfrm.c
+++ b/ip/ipxfrm.c
@@ -94,6 +94,19 @@ int xfrm_addr_match(xfrm_address_t *x1, 
return 0;
 }
 
+int xfrm_xfrmproto_is_ipsec(__u8 proto)
+{
+   return (proto ==  IPPROTO_ESP ||
+   proto ==  IPPROTO_AH  ||
+   proto ==  IPPROTO_COMP);
+}
+
+int xfrm_xfrmproto_is_ro(__u8 proto)
+{
+   return (proto ==  IPPROTO_ROUTING ||
+   proto ==  IPPROTO_DSTOPTS);
+}
+
 struct typeent {
const char *t_name;
int t_type;
@@ -101,6 +114,7 @@ struct typeent {
 
 static const struct typeent xfrmproto_types[]= {
{ esp, IPPROTO_ESP }, { ah, IPPROTO_AH }, { comp, IPPROTO_COMP },
+   { route2, IPPROTO_ROUTING }, { hao, IPPROTO_DSTOPTS },
{ NULL, -1 }
 };
 
@@ -276,13 +290,19 @@ void xfrm_id_info_print(xfrm_address_t *
 
fprintf(fp, mode );
switch (mode) {
-   case 0:
+   case XFRM_MODE_TRANSPORT:
fprintf(fp, transport);
break;
-   case 1:
+   case XFRM_MODE_TUNNEL:
fprintf(fp, tunnel);
break;
-   case 4:
+   case XFRM_MODE_ROUTEOPTIMIZATION:
+   fprintf(fp, ro);
+   break;
+   case XFRM_MODE_IN_TRIGGER:
+   fprintf(fp, in_trigger);
+   break;
+   case XFRM_MODE_BEET:
fprintf(fp, beet);
break;
default:
@@ -643,6 +663,48 @@ void xfrm_xfrma_print(struct rtattr *tb[
xfrm_tmpl_print((struct xfrm_user_tmpl *) RTA_DATA(rta),
RTA_PAYLOAD(rta), family, fp, prefix);
}
+
+   if (tb[XFRMA_COADDR]) {
+   char abuf[256];
+   xfrm_address_t *coa;
+
+   if (prefix)
+   fprintf(fp, prefix);
+   fprintf(fp, coa );
+
+   coa = (xfrm_address_t *)RTA_DATA(tb[XFRMA_COADDR]);
+
+   if (RTA_PAYLOAD(tb[XFRMA_COADDR])  sizeof(*coa)) {
+   fprintf(fp, (ERROR truncated));
+   fprintf(fp, %s, _SL_);
+   return;
+   }
+
+   memset(abuf, '\0', sizeof(abuf));
+   fprintf(fp, %s,
+   rt_addr_n2a(family, sizeof(*coa), coa, 
+   abuf, sizeof(abuf)));
+   fprintf(fp, %s, _SL_);
+   }
+
+   if (tb[XFRMA_LASTUSED]) {
+   __u64 lastused;
+
+   if (prefix)
+   fprintf(fp, prefix);
+   fprintf(fp, lastused );
+
+   if (RTA_PAYLOAD(tb[XFRMA_LASTUSED])  sizeof(lastused)) {
+   fprintf(fp, (ERROR truncated));
+   fprintf(fp, %s, _SL_);
+   return;
+   }
+
+   lastused = *(__u64 *)RTA_DATA(tb[XFRMA_LASTUSED]);
+
+   fprintf(fp, %s, strxf_time(lastused));
+   fprintf(fp, %s, _SL_);
+   }
 }
 
 static int xfrm_selector_iszero(struct xfrm_selector *s)
@@ -659,12 +721,13 @@ void xfrm_state_info_print(struct xfrm_u
const char *title)
 {
char buf[STRBUF_SIZE];
+   int force_spi = xfrm_xfrmproto_is_ipsec(xsinfo-id.proto);
 
memset(buf, '\0', sizeof(buf));
 
xfrm_id_info_print(xsinfo-saddr, xsinfo-id, xsinfo-mode,
-  xsinfo-reqid, xsinfo-family, 1, fp, prefix,
-  title);
+  xsinfo-reqid, xsinfo-family, force_spi, fp,
+  prefix, title);
 
if (prefix)
STRBUF_CAT(buf, prefix);
@@ -680,6 +743,7 @@ void xfrm_state_info_print(struct xfrm_u
fprintf(fp, flag );
XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_NOECN, noecn);
XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_DECAP_DSCP, decap-dscp);
+   XFRM_FLAG_PRINT(fp, flags, XFRM_STATE_WILDRECV, wildrecv);
if (flags)
  

[PATCH 3/7] [IP] RULE: Add ifdef to FIB_RULE_INVERT since it is missing.

2006-12-05 Thread Masahide NAKAMURA
Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
---
 ip/iprule.c |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/ip/iprule.c b/ip/iprule.c
index c584b18..1da64b8 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -83,8 +83,10 @@ int print_rule(const struct sockaddr_nl 
else
fprintf(fp, 0:\t);
 
+#ifdef FIB_RULE_INVERT
if (r-rtm_flags  FIB_RULE_INVERT)
fprintf(fp, not );
+#endif
 
if (tb[RTA_SRC]) {
if (r-rtm_src_len != host_len) {
@@ -224,7 +226,9 @@ static int iprule_modify(int cmd, int ar
 
while (argc  0) {
if (strcmp(*argv, not) == 0) {
+#ifdef FIB_RULE_INVERT
req.r.rtm_flags |= FIB_RULE_INVERT;
+#endif
} else if (strcmp(*argv, from) == 0) {
inet_prefix dst;
NEXT_ARG();
-- 
1.4.2

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


Re: [PATCH 1/5] ipw2100: Make ipw2100 depends on known working platforms

2006-12-05 Thread Christoph Hellwig
On Tue, Dec 05, 2006 at 02:40:52PM +0800, Zhu Yi wrote:
 
 [ Resubmit, if you still don't like it, I'll drop. ]
 
 ipw2100 driver doesn't support big endian by now.
 
 Signed-off-by: Karol Lewandowski [EMAIL PROTECTED]
 Signed-off-by: Zhu Yi [EMAIL PROTECTED]
 
 ---
 
  drivers/net/wireless/Kconfig |2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)
 
 d664c6332284edba4278a1f3b18b453ef4d39faf
 diff --git a/drivers/net/wireless/Kconfig b/drivers/net/wireless/Kconfig
 index aefa4cb..c2495c5 100644
 --- a/drivers/net/wireless/Kconfig
 +++ b/drivers/net/wireless/Kconfig
 @@ -146,7 +146,7 @@ comment Wireless 802.11b ISA/PCI cards 
  
  config IPW2100
   tristate Intel PRO/Wireless 2100 Network Connection
 - depends on NET_RADIO  PCI
 + depends on NET_RADIO  PCI  (X86 || X86_64 || IA64 || BROKEN)

Once again, there's a lot more little endian than just you employers
hardware.  And once again the right thing for a maintained driver is
to fix the endianess bugs.  We should probably just mark it broken for
every platform given that intel doesn't care (And neither cares about
offers to fix endianess bugs if they send hardware..)

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


Re: [PATCH 1/7] Sync with 2.6.19 kernel header about include/linux.

2006-12-05 Thread Thomas Graf
* Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 19:15
 diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
 index 8270aac..4418c8d 100644
 --- a/include/linux/fib_rules.h
 +++ b/include/linux/fib_rules.h
 @@ -6,7 +6,6 @@ #include linux/rtnetlink.h
  
  /* rule is permanent, and cannot be deleted */
  #define FIB_RULE_PERMANENT   1
 -#define FIB_RULE_INVERT  2

  struct fib_rule_hdr
  {
 @@ -35,7 +34,7 @@ enum
   FRA_UNUSED3,
   FRA_UNUSED4,
   FRA_UNUSED5,
 - FRA_FWMARK, /* mark */
 + FRA_FWMARK, /* netfilter mark */
   FRA_FLOW,   /* flow/class id */
   FRA_UNUSED6,
   FRA_UNUSED7,

Why are you reverting this?
-
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/7] [IP] RULE: Add ifdef to FIB_RULE_INVERT since it is missing.

2006-12-05 Thread Thomas Graf
* Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 19:15
 Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
 ---
  ip/iprule.c |4 
  1 files changed, 4 insertions(+), 0 deletions(-)
 
 diff --git a/ip/iprule.c b/ip/iprule.c
 index c584b18..1da64b8 100644
 --- a/ip/iprule.c
 +++ b/ip/iprule.c
 @@ -83,8 +83,10 @@ int print_rule(const struct sockaddr_nl 
   else
   fprintf(fp, 0:\t);
  
 +#ifdef FIB_RULE_INVERT
   if (r-rtm_flags  FIB_RULE_INVERT)
   fprintf(fp, not );
 +#endif
  
   if (tb[RTA_SRC]) {
   if (r-rtm_src_len != host_len) {
 @@ -224,7 +226,9 @@ static int iprule_modify(int cmd, int ar
  
   while (argc  0) {
   if (strcmp(*argv, not) == 0) {
 +#ifdef FIB_RULE_INVERT
   req.r.rtm_flags |= FIB_RULE_INVERT;
 +#endif
   } else if (strcmp(*argv, from) == 0) {
   inet_prefix dst;
   NEXT_ARG();

It's missing because you removed it.
-
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/2] [IPV6] RAW: Add checksum default defines for mobility header.

2006-12-05 Thread YOSHIFUJI Hideaki / 吉藤英明
In article [EMAIL PROTECTED] (at Tue,  5 Dec 2006 19:03:27 +0900), Masahide 
NAKAMURA [EMAIL PROTECTED] says:

 Add checksum default defines for mobility header(MH).
 As the result kernel's behavior is to handle MH checksum
 as default.

I'd like to hold this on.  I need to check RFC.

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


Re: [PATCH 1/7] Sync with 2.6.19 kernel header about include/linux.

2006-12-05 Thread Masahide NAKAMURA

Thomas Graf wrote:

* Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 19:15

diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
index 8270aac..4418c8d 100644
--- a/include/linux/fib_rules.h
+++ b/include/linux/fib_rules.h
@@ -6,7 +6,6 @@ #include linux/rtnetlink.h
 
 /* rule is permanent, and cannot be deleted */

 #define FIB_RULE_PERMANENT 1
-#define FIB_RULE_INVERT2

 struct fib_rule_hdr
 {
@@ -35,7 +34,7 @@ enum
FRA_UNUSED3,
FRA_UNUSED4,
FRA_UNUSED5,
-   FRA_FWMARK, /* mark */
+   FRA_FWMARK, /* netfilter mark */
FRA_FLOW,   /* flow/class id */
FRA_UNUSED6,
FRA_UNUSED7,


Why are you reverting this?


I just update the header about include/linux without thinking.
Should I have to update them except fib_rules.h?

Anyway, I'll fix [PATCH 1/7] and send it again.

Thanks,


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


Re: [PATCH 1/7] Sync with 2.6.19 kernel header about include/linux.

2006-12-05 Thread Thomas Graf
* Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 20:44
 Thomas Graf wrote:
 * Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 19:15
 diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h
 index 8270aac..4418c8d 100644
 --- a/include/linux/fib_rules.h
 +++ b/include/linux/fib_rules.h
 @@ -6,7 +6,6 @@ #include linux/rtnetlink.h
  
  /* rule is permanent, and cannot be deleted */
  #define FIB_RULE_PERMANENT 1
 -#define FIB_RULE_INVERT2
 
  struct fib_rule_hdr
  {
 @@ -35,7 +34,7 @@ enum
 FRA_UNUSED3,
 FRA_UNUSED4,
 FRA_UNUSED5,
 -   FRA_FWMARK, /* mark */
 +   FRA_FWMARK, /* netfilter mark */
 FRA_FLOW,   /* flow/class id */
 FRA_UNUSED6,
 FRA_UNUSED7,
 
 Why are you reverting this?
 
 I just update the header about include/linux without thinking.
 Should I have to update them except fib_rules.h?

The iproute2 git tree already contains patches for the
2.6.20 release.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 1/7] Sync with 2.6.19 kernel header about include/linux.

2006-12-05 Thread Masahide NAKAMURA

Thomas Graf wrote:

Why are you reverting this?

I just update the header about include/linux without thinking.
Should I have to update them except fib_rules.h?


The iproute2 git tree already contains patches for the
2.6.20 release.


OK, thanks. Can you know another patch which is already
updated to newer version except fib_fules.h, iprule.c?

Regards,

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


[PATCH 2.6.19 1/4] AT91RM9200 Ethernet: Remove 'at91_dev' and use netdev_priv()

2006-12-05 Thread Andrew Victor
Remove the global 'at91_dev' variable.
Use netdev_priv() instead of casting dev-priv directly.

Signed-off-by: Andrew Victor [EMAIL PROTECTED]


diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c 
linux-2.6.19-final/drivers/net/arm/at91_ether.c
--- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.cTue Dec  5 
10:13:03 2006
+++ linux-2.6.19-final/drivers/net/arm/at91_ether.c Tue Dec  5 10:41:45 2006
@@ -41,8 +41,6 @@
 #define DRV_NAME   at91_ether
 #define DRV_VERSION1.0
 
-static struct net_device *at91_dev;
-
 static struct timer_list check_timer;
 #define LINK_POLL_INTERVAL (HZ)
 
@@ -146,7 +144,7 @@
  */
 static void update_linkspeed(struct net_device *dev, int silent)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned int bmsr, bmcr, lpa, mac_cfg;
unsigned int speed, duplex;
 
@@ -199,7 +197,7 @@
 static irqreturn_t at91ether_phy_interrupt(int irq, void *dev_id)
 {
struct net_device *dev = (struct net_device *) dev_id;
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned int phy;
 
/*
@@ -242,7 +240,7 @@
  */
 static void enable_phyirq(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned int dsintr, irq_number;
int status;
 
@@ -294,7 +292,7 @@
  */
 static void disable_phyirq(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned int dsintr;
unsigned int irq_number;
 
@@ -340,7 +338,7 @@
 #if 0
 static void reset_phy(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned int bmcr;
 
spin_lock_irq(lp-lock);
@@ -590,7 +588,7 @@
 
 static int at91ether_get_settings(struct net_device *dev, struct ethtool_cmd 
*cmd)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
int ret;
 
spin_lock_irq(lp-lock);
@@ -611,7 +609,7 @@
 
 static int at91ether_set_settings(struct net_device *dev, struct ethtool_cmd 
*cmd)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
int ret;
 
spin_lock_irq(lp-lock);
@@ -627,7 +625,7 @@
 
 static int at91ether_nwayreset(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
int ret;
 
spin_lock_irq(lp-lock);
@@ -658,7 +656,7 @@
 
 static int at91ether_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
int res;
 
if (!netif_running(dev))
@@ -680,7 +678,7 @@
  */
 static void at91ether_start(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
struct recv_desc_bufs *dlist, *dlist_phys;
int i;
unsigned long ctl;
@@ -712,7 +710,7 @@
  */
 static int at91ether_open(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned long ctl;
 
if (!is_valid_ether_addr(dev-dev_addr))
@@ -752,7 +750,7 @@
  */
 static int at91ether_close(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
unsigned long ctl;
 
/* Disable Receiver and Transmitter */
@@ -779,7 +777,7 @@
  */
 static int at91ether_tx(struct sk_buff *skb, struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
 
if (at91_emac_read(AT91_EMAC_TSR)  AT91_EMAC_TSR_BNQ) {
netif_stop_queue(dev);
@@ -811,7 +809,7 @@
  */
 static struct net_device_stats *at91ether_stats(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
int ale, lenerr, seqe, lcol, ecol;
 
if (netif_running(dev)) {
@@ -847,7 +845,7 @@
  */
 static void at91ether_rx(struct net_device *dev)
 {
-   struct at91_private *lp = (struct at91_private *) dev-priv;
+   struct at91_private *lp = netdev_priv(dev);
struct recv_desc_bufs *dlist;
unsigned char *p_recv;
struct sk_buff *skb;
@@ -891,7 +889,7 @@
 static irqreturn_t at91ether_interrupt(int irq, void *dev_id)
 {
struct net_device *dev = 

[PATCH 2.6.19 2/4] AT91RM9200 Ethernet: Move check_timer variable and use mod_timer()

2006-12-05 Thread Andrew Victor
Move the global 'check_timer' variable into the private data structure.
Also now use mod_timer().

Signed-off-by: Andrew Victor [EMAIL PROTECTED]


diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c 
linux-2.6.19-final/drivers/net/arm/at91_ether.c
--- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.cTue Dec  5 
11:42:55 2006
+++ linux-2.6.19-final/drivers/net/arm/at91_ether.c Tue Dec  5 11:50:49 2006
@@ -41,7 +41,6 @@
 #define DRV_NAME   at91_ether
 #define DRV_VERSION1.0
 
-static struct timer_list check_timer;
 #define LINK_POLL_INTERVAL (HZ)
 
 /* . */
@@ -250,8 +249,7 @@
 * PHY doesn't have an IRQ pin (RTL8201, DP83847, AC101L),
 * or board does not have it connected.
 */
-   check_timer.expires = jiffies + LINK_POLL_INTERVAL;
-   add_timer(check_timer);
+   mod_timer(lp-check_timer, jiffies + LINK_POLL_INTERVAL);
return;
}
 
@@ -298,7 +296,7 @@
 
irq_number = lp-board_data.phy_irq_pin;
if (!irq_number) {
-   del_timer_sync(check_timer);
+   del_timer_sync(lp-check_timer);
return;
}
 
@@ -360,13 +358,13 @@
 static void at91ether_check_link(unsigned long dev_id)
 {
struct net_device *dev = (struct net_device *) dev_id;
+   struct at91_private *lp = netdev_priv(dev);
 
enable_mdi();
update_linkspeed(dev, 1);
disable_mdi();
 
-   check_timer.expires = jiffies + LINK_POLL_INTERVAL;
-   add_timer(check_timer);
+   mod_timer(lp-check_timer, jiffies + LINK_POLL_INTERVAL);
 }
 
 /* . ADDRESS MANAGEMENT  */
@@ -1030,9 +1028,9 @@
 
/* If board has no PHY IRQ, use a timer to poll the PHY */
if (!lp-board_data.phy_irq_pin) {
-   init_timer(check_timer);
-   check_timer.data = (unsigned long)dev;
-   check_timer.function = at91ether_check_link;
+   init_timer(lp-check_timer);
+   lp-check_timer.data = (unsigned long)dev;
+   lp-check_timer.function = at91ether_check_link;
}
 
/* Display ethernet banner */
diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.h 
linux-2.6.19-final/drivers/net/arm/at91_ether.h
--- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.hTue Dec  5 
10:09:13 2006
+++ linux-2.6.19-final/drivers/net/arm/at91_ether.h Tue Dec  5 11:50:22 2006
@@ -87,6 +87,7 @@
spinlock_t lock;/* lock for MDI interface */
short phy_media;/* media interface type */
unsigned short phy_address; /* 5-bit MDI address of PHY 
(0..31) */
+   struct timer_list check_timer;  /* Poll link status */
 
/* Transmit */
struct sk_buff *skb;/* holds skb until xmit 
interrupt completes */



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


[PATCH 2.6.19 3/4] AT91RM9200 Ethernet: Add netpoll / netconsole support

2006-12-05 Thread Andrew Victor
Adds netpoll / netconsole support.

Original patch from Bill Gatliff.


Signed-off-by: Andrew Victor [EMAIL PROTECTED]


diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c 
linux-2.6.19-final/drivers/net/arm/at91_ether.c
--- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.cTue Dec  5 
14:09:01 2006
+++ linux-2.6.19-final/drivers/net/arm/at91_ether.c Tue Dec  5 11:56:55 2006
@@ -923,6 +923,17 @@
return IRQ_HANDLED;
 }
 
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void at91ether_poll_controller(struct net_device *dev)
+{
+   unsigned long flags;
+
+   local_irq_save(flags);
+   at91ether_interrupt(dev-irq, dev);
+   local_irq_restore(flags);
+}
+#endif
+
 /*
  * Initialize the ethernet interface
  */
@@ -972,6 +983,9 @@
dev-set_mac_address = set_mac_address;
dev-ethtool_ops = at91ether_ethtool_ops;
dev-do_ioctl = at91ether_ioctl;
+#ifdef CONFIG_NET_POLL_CONTROLLER
+   dev-poll_controller = at91ether_poll_controller;
+#endif
 
SET_NETDEV_DEV(dev, pdev-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 2.6.19 4/4] AT91RM9200 Ethernet: Use dev_alloc_skb()

2006-12-05 Thread Andrew Victor
Use dev_alloc_skb() instead of alloc_skb().

It is also not necessary to adjust skb-len manually since that's
already done by skb_put().


Signed-off-by: Andrew Victor [EMAIL PROTECTED]


diff -urN linux-2.6.19-final.orig/drivers/net/arm/at91_ether.c 
linux-2.6.19-final/drivers/net/arm/at91_ether.c
--- linux-2.6.19-final.orig/drivers/net/arm/at91_ether.cTue Dec  5 
14:12:53 2006
+++ linux-2.6.19-final/drivers/net/arm/at91_ether.c Tue Dec  5 14:13:38 2006
@@ -853,14 +853,13 @@
while (dlist-descriptors[lp-rxBuffIndex].addr  EMAC_DESC_DONE) {
p_recv = dlist-recv_buf[lp-rxBuffIndex];
pktlen = dlist-descriptors[lp-rxBuffIndex].size  0x7ff;  
/* Length of frame including FCS */
-   skb = alloc_skb(pktlen + 2, GFP_ATOMIC);
+   skb = dev_alloc_skb(pktlen + 2);
if (skb != NULL) {
skb_reserve(skb, 2);
memcpy(skb_put(skb, pktlen), p_recv, pktlen);
 
skb-dev = dev;
skb-protocol = eth_type_trans(skb, dev);
-   skb-len = pktlen;
dev-last_rx = jiffies;
lp-stats.rx_bytes += pktlen;
netif_rx(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: [Madwifi-devel] ar5k and Atheros AR5005G

2006-12-05 Thread Michael Renzmann
Hi all.

 To make things easier for development I'd like to suggest a few madwif
 ibranches created:

 * madwifi-1152-openhal: based on madwifi-1152, patched with my patch,
 added openhal, old hal removed. Working free solution. Should exist
 just as a reference and to allow users to checkout a working free
 alternative in the mean time.

 * madwifi-dadwifi-openal: based on the latest dadwifi with the
 openhal, old hal removed. As dadwifi gets updated you can pull updates
 to this branch. As the openhal advances you can make updates to the
 openhal here.

I've set up the suggested branches, with slight changing to the proposed
names:

* http://svn.madwifi.org/branches/madwifi-old-openhal (based on r1142)
* http://svn.madwifi.org/branches/dadwifi-openhal (based on r1827)

Neither of them has received any modifications yet, they are basically
copies of the mentioned revisions. I'm currently lacking the time to
import Nick's work into the madwifi-old-openhal branch, for example - it
would be nice if someone else could work on that.

The MadWifi project happily provides any interested party access to the
resources we have at hands - including (but not limited to) r/w access to
the repository, an account for our Trac (used to manage tickets for bugs,
patches, ...), e-mail,  Let me know if you need something in that
regard and I'll try to get it done. We'd love to support these efforts
where possible.

Bye, Mike

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


Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.

2006-12-05 Thread Brian Haley

YOSHIFUJI Hideaki /  wrote:

Add checksum default defines for mobility header(MH).
As the result kernel's behavior is to handle MH checksum
as default.


I'd like to hold this on.  I need to check RFC.


That looks correct according to 3775.

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


Re: [Madwifi-devel] ar5k and Atheros AR5005G

2006-12-05 Thread Luis R. Rodriguez

On 12/5/06, Michael Renzmann [EMAIL PROTECTED] wrote:
openhal here.


I've set up the suggested branches, with slight changing to the proposed
names:

* http://svn.madwifi.org/branches/madwifi-old-openhal (based on r1142)
* http://svn.madwifi.org/branches/dadwifi-openhal (based on r1827)

Neither of them has received any modifications yet, they are basically
copies of the mentioned revisions. I'm currently lacking the time to
import Nick's work into the madwifi-old-openhal branch, for example - it
would be nice if someone else could work on that.


CC'ing Reyk Foeter.

Committed Nick's port of ar5k (openal) to both branches, both now have
the openhal. Please note (very important):

We are basing our openhal on OpenBSD's ar5k. Because of this and since
the GPL does not allow us to commit changes on the GPL version back to
the BSD version please sumbit your non-linux enhancements to the HAL
to Reyk Floeter [EMAIL PROTECTED] and CC madwifi-devel.

We have an openhal.org which we can start to use, should Reyk want, to
use as the master tree of the ar5k to make sure any enhancements on
the HAL go to both BSD and Linux. The licensing on the master tree
should be kept BSD as Reyk wants it to be. This way Linux or BSD
contributions can go into one tree and later revisions can be added to
dadwifi/openbsd with their own specific BSD'isms and Linux'isms. Keep
in mind the Linux port will remain dual licensed BSD/GPL. Let me know
what you think Reyk.

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


Re: [PATCH 1/1] myri10ge: write as 2 32-byte blocks in myri10ge_submit_8rx

2006-12-05 Thread Brice Goglin
Jeff Garzik wrote:
 Brice Goglin wrote:
 In the myri10ge_submit_8rx() routine, write the 64 byte request block as
 2 32-byte blocks so that it is handled by the hardware pio write handler
 if write-combining is enabled.

 Signed-off-by: Brice Goglin [EMAIL PROTECTED]
 ---
  drivers/net/myri10ge/myri10ge.c |4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

 ACK, can you resend due to patch collision in #upstream?

Ok, I wasn't aware of the annotation fixes from Al Viro. Maybe I should
add a MAINTAINER entry so that I could get CC'ed more often when changes
are done in myri10ge ?

Anyway, I will resent an updated patch as a reply to this mail soon.

Brice

-
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/2] [IPV6] RAW: Add checksum default defines for mobility header.

2006-12-05 Thread YOSHIFUJI Hideaki / 吉藤英明
In article [EMAIL PROTECTED] (at Tue, 05 Dec 2006 10:04:14 -0500), Brian 
Haley [EMAIL PROTECTED] says:

 YOSHIFUJI Hideaki wrote:
  Add checksum default defines for mobility header(MH).
  As the result kernel's behavior is to handle MH checksum
  as default.
  
  I'd like to hold this on.  I need to check RFC.
 
 That looks correct according to 3775.

I'm thinking about difference RFC.

--yoshfuji
-
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/1] myri10ge: write as 2 32-byte blocks in myri10ge_submit_8rx

2006-12-05 Thread Brice Goglin
In the myri10ge_submit_8rx() routine, write the 64 byte request block as
2 32-byte blocks so that it is handled by the hardware pio write handler
if write-combining is enabled.

Signed-off-by: Brice Goglin [EMAIL PROTECTED]
---
 drivers/net/myri10ge/myri10ge.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: netdev-2.6/drivers/net/myri10ge/myri10ge.c
===
--- netdev-2.6.orig/drivers/net/myri10ge/myri10ge.c 2006-12-05 
16:29:14.0 +0100
+++ netdev-2.6/drivers/net/myri10ge/myri10ge.c  2006-12-05 16:30:08.0 
+0100
@@ -795,7 +795,9 @@
 
low = src-addr_low;
src-addr_low = htonl(DMA_32BIT_MASK);
-   myri10ge_pio_copy(dst, src, 8 * sizeof(*src));
+   myri10ge_pio_copy(dst, src, 4 * sizeof(*src));
+   mb();
+   myri10ge_pio_copy(dst + 4, src + 4, 4 * sizeof(*src));
mb();
src-addr_low = low;
put_be32(low, dst-addr_low);


-
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] ar5k and Atheros AR5005G

2006-12-05 Thread Stephen Hemminger
On Tue, 5 Dec 2006 10:15:33 -0500
Luis R. Rodriguez [EMAIL PROTECTED] wrote:

 On 12/5/06, Michael Renzmann [EMAIL PROTECTED] wrote:
  openhal here.
 
  I've set up the suggested branches, with slight changing to the proposed
  names:
 
  * http://svn.madwifi.org/branches/madwifi-old-openhal (based on r1142)
  * http://svn.madwifi.org/branches/dadwifi-openhal (based on r1827)
 
  Neither of them has received any modifications yet, they are basically
  copies of the mentioned revisions. I'm currently lacking the time to
  import Nick's work into the madwifi-old-openhal branch, for example - it
  would be nice if someone else could work on that.
 
 CC'ing Reyk Foeter.
 
 Committed Nick's port of ar5k (openal) to both branches, both now have
 the openhal. Please note (very important):
 
 We are basing our openhal on OpenBSD's ar5k. Because of this and since
 the GPL does not allow us to commit changes on the GPL version back to
 the BSD version please sumbit your non-linux enhancements to the HAL
 to Reyk Floeter [EMAIL PROTECTED] and CC madwifi-devel.
 
 We have an openhal.org which we can start to use, should Reyk want, to
 use as the master tree of the ar5k to make sure any enhancements on
 the HAL go to both BSD and Linux. The licensing on the master tree
 should be kept BSD as Reyk wants it to be. This way Linux or BSD
 contributions can go into one tree and later revisions can be added to
 dadwifi/openbsd with their own specific BSD'isms and Linux'isms. Keep
 in mind the Linux port will remain dual licensed BSD/GPL. Let me know
 what you think Reyk.
 
   Luis

All the more reason to merge the HAL in and make it disappear

-- 
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] Netlink: add a pointer to the Generic Netlink wiki page

2006-12-05 Thread paul . moore
From: Paul Moore [EMAIL PROTECTED]

Add a pointer to the OSDL wiki page on Generic Netlink.

Signed-off-by: Paul Moore [EMAIL PROTECTED]
---
 Documentation/networking/00-INDEX|2 ++
 Documentation/networking/generic_netlink.txt |3 +++
 2 files changed, 5 insertions(+)

Index: net-2.6.20_netlink-doc/Documentation/networking/00-INDEX
===
--- net-2.6.20_netlink-doc.orig/Documentation/networking/00-INDEX
+++ net-2.6.20_netlink-doc/Documentation/networking/00-INDEX
@@ -58,6 +58,8 @@ fore200e.txt
- FORE Systems PCA-200E/SBA-200E ATM NIC driver info.
 framerelay.txt
- info on using Frame Relay/Data Link Connection Identifier (DLCI).
+generic_netlink.txt
+   - info on Generic Netlink
 ip-sysctl.txt
- /proc/sys/net/ipv4/* variables
 ip_dynaddr.txt
Index: net-2.6.20_netlink-doc/Documentation/networking/generic_netlink.txt
===
--- /dev/null
+++ net-2.6.20_netlink-doc/Documentation/networking/generic_netlink.txt
@@ -0,0 +1,3 @@
+A wiki document on how to use Generic Netlink can be found here:
+
+ * http://linux-net.osdl.org/index.php/Generic_Netlink_HOWTO

--
paul moore
linux security @ hp

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


Re: [PATCH 1/7] Sync with 2.6.19 kernel header about include/linux.

2006-12-05 Thread Stephen Hemminger
On Tue, 05 Dec 2006 21:27:08 +0900
Masahide NAKAMURA [EMAIL PROTECTED] wrote:

 Thomas Graf wrote:
  Why are you reverting this?
  I just update the header about include/linux without thinking.
  Should I have to update them except fib_rules.h?
  
  The iproute2 git tree already contains patches for the
  2.6.20 release.
 
 OK, thanks. Can you know another patch which is already
 updated to newer version except fib_fules.h, iprule.c?
 
 Regards,
 

Rather than apply your patch I am just rerunning my header extract
script against latest 2.6.19-git7 tree

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


generic LRO in the net core stack?

2006-12-05 Thread Brice Goglin
Hi,

About 2 month ago, I sent a patchset to implement software LRO in
myri10ge. People replied that it might be time to implement something
generic in the net core stack instead since it was the second driver to
do so. We completely agree with this. But, I haven't heard back from
this idea since then, so I was wondering whether somebody is actually
working on it.

If not, I'd like to get our LRO code merged anyway since our driver have
been missing this important feature for a very long time already. We
would drop it later when something generic will be available.

FYI, our myri10ge LRO patch is not intrusive in the driver. It would be
very easy to revert since it only adds lines but does not modify or
remove any single one (see
http://www.mail-archive.com/netdev@vger.kernel.org/msg23133.html).

thanks,
Brice

-
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/7] [IP] RULE: Add ifdef to FIB_RULE_INVERT since it is missing.

2006-12-05 Thread Stephen Hemminger
On Tue, 5 Dec 2006 11:42:31 +0100
Thomas Graf [EMAIL PROTECTED] wrote:

 * Masahide NAKAMURA [EMAIL PROTECTED] 2006-12-05 19:15
  Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]
  ---
   ip/iprule.c |4 
   1 files changed, 4 insertions(+), 0 deletions(-)
  
  diff --git a/ip/iprule.c b/ip/iprule.c
  index c584b18..1da64b8 100644
  --- a/ip/iprule.c
  +++ b/ip/iprule.c
  @@ -83,8 +83,10 @@ int print_rule(const struct sockaddr_nl 
  else
  fprintf(fp, 0:\t);
   
  +#ifdef FIB_RULE_INVERT
  if (r-rtm_flags  FIB_RULE_INVERT)
  fprintf(fp, not );
  +#endif
   
  if (tb[RTA_SRC]) {
  if (r-rtm_src_len != host_len) {
  @@ -224,7 +226,9 @@ static int iprule_modify(int cmd, int ar
   
  while (argc  0) {
  if (strcmp(*argv, not) == 0) {
  +#ifdef FIB_RULE_INVERT
  req.r.rtm_flags |= FIB_RULE_INVERT;
  +#endif
  } else if (strcmp(*argv, from) == 0) {
  inet_prefix dst;
  NEXT_ARG();
 
 It's missing because you removed it.

Not applied, FIB_RULE_INVERT stays

-- 
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 7/7] [IP] XFRM: Mobility header support.

2006-12-05 Thread Stephen Hemminger
All 4 XFRM patches applied
-
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


iproute2 update

2006-12-05 Thread Stephen Hemminger
I am about to push out a new version, so if you have any more patches pending
the window is about to close.

Please retest with current git tree

-- 
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] allow ip_tables.h to be used from userspace

2006-12-05 Thread Stephen Hemminger
The xtables version of ip_tables.h was no longer usable (in sanitized form)
by iproute2 and other applications because sparse annotations had crept
in.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 include/linux/netfilter_ipv4/ip_tables.h |4 ++--
 net/ipv4/netfilter/ip_tables.c   |4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/linux/netfilter_ipv4/ip_tables.h 
b/include/linux/netfilter_ipv4/ip_tables.h
index 4f06dad..0640c6c 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -21,8 +21,8 @@ #include linux/types.h
 #include linux/in.h
 #include linux/ip.h
 #include linux/skbuff.h
-#endif
 #include linux/compiler.h
+#endif
 #include linux/netfilter_ipv4.h
 
 #include linux/netfilter/x_tables.h
@@ -194,7 +194,7 @@ struct ipt_replace
/* Number of counters (must be equal to current number of entries). */
unsigned int num_counters;
/* The old entries' counters. */
-   struct xt_counters __user *counters;
+   struct xt_counters *counters;
 
/* The entries (hang off end: not really an array). */
struct ipt_entry entries[0];
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
index 8a45543..e75d467 100644
--- a/net/ipv4/netfilter/ip_tables.c
+++ b/net/ipv4/netfilter/ip_tables.c
@@ -1238,8 +1238,8 @@ do_replace(void __user *user, unsigned i
duprintf(ip_tables: Translated table\n);
 
ret = __do_replace(tmp.name, tmp.valid_hooks,
- newinfo, tmp.num_counters,
- tmp.counters);
+  newinfo, tmp.num_counters,
+  (void __user *) tmp.counters);
if (ret)
goto free_newinfo_untrans;
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: [PATCH] allow ip_tables.h to be used from userspace

2006-12-05 Thread Patrick McHardy
Stephen Hemminger wrote:
 The xtables version of ip_tables.h was no longer usable (in sanitized form)
 by iproute2 and other applications because sparse annotations had crept
 in.
 
 @@ -194,7 +194,7 @@ struct ipt_replace
   /* Number of counters (must be equal to current number of entries). */
   unsigned int num_counters;
   /* The old entries' counters. */
 - struct xt_counters __user *counters;
 + struct xt_counters *counters;

# Eliminate the contents of (and inclusions of) compiler.h


HDRSED  := sed  -e s/ inline / __inline__ /g \
-e s/[[:space:]]__user[[:space:]]\+/ /g \
-e s/(__user[[:space:]]\+/ (/g \

I think this regex should be fixed instead to get rid of it
while sanitizing (Makefile.headersinst).

-
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: iproute2 update

2006-12-05 Thread Patrick McHardy
Stephen Hemminger wrote:
 I am about to push out a new version, so if you have any more patches pending
 the window is about to close.

I still have this one I would like to get in.

[IPROUTE]: Add support for routing rule fwmark masks

Needs kernel = 2.6.19.

Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

---
commit ba314583323f1e1af4ef093d16eea9baed2c
tree 23ef86c81e53c94d3f8d67d5395bcc3183d39e4b
parent 288384f22ffafd2d7d888ee45d8dfcf26d3f2b1c
author Patrick McHardy [EMAIL PROTECTED] Tue, 05 Dec 2006 19:41:36 +0100
committer Patrick McHardy [EMAIL PROTECTED] Tue, 05 Dec 2006 19:41:36 +0100

 include/linux/rtnetlink.h |1 +
 ip/iprule.c   |   25 +
 man/man8/ip.8 |2 +-
 3 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1ee3a56..c02470c 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -264,6 +264,7 @@ enum rtattr_type_t
RTA_SESSION,
RTA_MP_ALGO,
RTA_TABLE,
+   RTA_FWMASK,
__RTA_MAX
 };
 
diff --git a/ip/iprule.c b/ip/iprule.c
index c584b18..2a4d126 100644
--- a/ip/iprule.c
+++ b/ip/iprule.c
@@ -37,7 +37,7 @@ static void usage(void) __attribute__((n
 static void usage(void)
 {
fprintf(stderr, Usage: ip rule [ list | add | del | flush ] SELECTOR 
ACTION\n);
-   fprintf(stderr, SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ 
tos TOS ] [ fwmark FWMARK ]\n);
+   fprintf(stderr, SELECTOR := [ not ] [ from PREFIX ] [ to PREFIX ] [ 
tos TOS ] [ fwmark FWMARK[/MASK] ]\n);
fprintf(stderr, [ dev STRING ] [ pref NUMBER ]\n);
fprintf(stderr, ACTION := [ table TABLE_ID ]\n);
fprintf(stderr,   [ prohibit | reject | unreachable ]\n);
@@ -129,8 +129,17 @@ int print_rule(const struct sockaddr_nl 
SPRINT_BUF(b1);
fprintf(fp, tos %s , rtnl_dsfield_n2a(r-rtm_tos, b1, 
sizeof(b1)));
}
-   if (tb[RTA_PROTOINFO]) {
-   fprintf(fp, fwmark %#x , 
*(__u32*)RTA_DATA(tb[RTA_PROTOINFO]));
+   if (tb[RTA_PROTOINFO] || tb[RTA_FWMASK]) {
+   __u32 mark = 0, mask = 0;
+
+   if (tb[RTA_PROTOINFO])
+   mark = *(__u32*)RTA_DATA(tb[RTA_PROTOINFO]);
+
+   if (tb[RTA_FWMASK] 
+   (mask = *(__u32*)RTA_DATA(tb[RTA_FWMASK])) != 0x)
+   fprintf(fp, fwmark 0x%x/0x%x , mark, mask);
+   else 
+   fprintf(fp, fwmark 0x%x , mark);
}
 
if (tb[RTA_IIF]) {
@@ -252,11 +261,19 @@ static int iprule_modify(int cmd, int ar
invarg(TOS value is invalid\n, *argv);
req.r.rtm_tos = tos;
} else if (strcmp(*argv, fwmark) == 0) {
-   __u32 fwmark;
+   char *slash;
+   __u32 fwmark, fwmask;
NEXT_ARG();
+   if ((slash = strchr(*argv, '/')) != NULL)
+   *slash = '\0';
if (get_u32(fwmark, *argv, 0))
invarg(fwmark value is invalid\n, *argv);
addattr32(req.n, sizeof(req), RTA_PROTOINFO, fwmark);
+   if (slash) {
+   if (get_u32(fwmask, slash+1, 0))
+   invarg(fwmask value is invalid\n, 
slash+1);
+   addattr32(req.n, sizeof(req), RTA_FWMASK, 
fwmask);
+   }
} else if (matches(*argv, realms) == 0) {
__u32 realm;
NEXT_ARG();
diff --git a/man/man8/ip.8 b/man/man8/ip.8
index 12da6d5..a9132da 100644
--- a/man/man8/ip.8
+++ b/man/man8/ip.8
@@ -223,7 +223,7 @@ throw  |  unreachable  |  prohibit 
 .B  tos
 .IR TOS  ] [ 
 .B  fwmark
-.IR FWMARK  ] [ 
+.IR FWMARK[/MASK]  ] [ 
 .B  dev
 .IR STRING  ] [ 
 .B  pref


Re: [PATCH] allow ip_tables.h to be used from userspace

2006-12-05 Thread Stephen Hemminger
On Tue, 05 Dec 2006 19:38:21 +0100
Patrick McHardy [EMAIL PROTECTED] wrote:

 Stephen Hemminger wrote:
  The xtables version of ip_tables.h was no longer usable (in sanitized form)
  by iproute2 and other applications because sparse annotations had crept
  in.
  
  @@ -194,7 +194,7 @@ struct ipt_replace
  /* Number of counters (must be equal to current number of entries). */
  unsigned int num_counters;
  /* The old entries' counters. */
  -   struct xt_counters __user *counters;
  +   struct xt_counters *counters;
 
 # Eliminate the contents of (and inclusions of) compiler.h
 
 
 HDRSED  := sed  -e s/ inline / __inline__ /g \
 -e s/[[:space:]]__user[[:space:]]\+/ /g \
 -e s/(__user[[:space:]]\+/ (/g \
 
 I think this regex should be fixed instead to get rid of it
 while sanitizing (Makefile.headersinst).
 

But ip_tables.h should still put include of compiler.h inside #ifdef __KERNEL__

-- 
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] allow ip_tables.h to be used from userspace

2006-12-05 Thread Patrick McHardy
Stephen Hemminger wrote:
 On Tue, 05 Dec 2006 19:38:21 +0100
 Patrick McHardy [EMAIL PROTECTED] wrote:
 
 
I think this regex should be fixed instead to get rid of it
while sanitizing (Makefile.headersinst).

 
 But ip_tables.h should still put include of compiler.h inside #ifdef 
 __KERNEL__

Actually that should also get stripped away by the regex.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 1/2] qla3xxx: Add support for Qlogic 4032 chip.

2006-12-05 Thread Ron Mercer
Signed-off-by: Ron Mercer [EMAIL PROTECTED]
---
 drivers/net/qla3xxx.c |  375 +
 drivers/net/qla3xxx.h |   92 +++-
 2 files changed, 392 insertions(+), 75 deletions(-)

diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index ec640f6..c39f20d 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -22,6 +22,7 @@ #include linux/interrupt.h
 #include linux/errno.h
 #include linux/ioport.h
 #include linux/ip.h
+#include linux/in.h
 #include linux/if_arp.h
 #include linux/if_ether.h
 #include linux/netdevice.h
@@ -63,6 +64,7 @@ MODULE_PARM_DESC(msi, Turn on Message S
 
 static struct pci_device_id ql3xxx_pci_tbl[] __devinitdata = {
{PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QL3022_DEVICE_ID)},
+   {PCI_DEVICE(PCI_VENDOR_ID_QLOGIC, QL3032_DEVICE_ID)},
/* required last entry */
{0,}
 };
@@ -1466,6 +1468,10 @@ static int ql_mii_setup(struct ql3_adapt
 2)  7))
return -1;
 
+   if (qdev-device_id == QL3032_DEVICE_ID)
+   ql_write_page0_reg(qdev, 
+   port_regs-macMIIMgmtControlReg, 0x0f0);
+
/* Divide 125MHz clock by 28 to meet PHY timing requirements */
reg = MAC_MII_CONTROL_CLK_SEL_DIV28;
 
@@ -1697,18 +1703,43 @@ static void ql_process_mac_tx_intr(struc
   struct ob_mac_iocb_rsp *mac_rsp)
 {
struct ql_tx_buf_cb *tx_cb;
+   int i;
 
tx_cb = qdev-tx_buf[mac_rsp-transaction_id];
+
pci_unmap_single(qdev-pdev,
-pci_unmap_addr(tx_cb, mapaddr),
-pci_unmap_len(tx_cb, maplen), PCI_DMA_TODEVICE);
-   dev_kfree_skb_irq(tx_cb-skb);
+pci_unmap_addr(tx_cb-map[0], mapaddr),
+pci_unmap_len(tx_cb-map[0], maplen),
+PCI_DMA_TODEVICE);
+   tx_cb-seg_count--;
+   if (tx_cb-seg_count) {
+   for (i = 1; i  tx_cb-seg_count; i++) {
+   pci_unmap_page(qdev-pdev,
+  pci_unmap_addr(tx_cb-map[i],
+ mapaddr),
+  pci_unmap_len(tx_cb-map[i], maplen),
+  PCI_DMA_TODEVICE);
+   }
+   }
qdev-stats.tx_packets++;
qdev-stats.tx_bytes += tx_cb-skb-len;
+   dev_kfree_skb_irq(tx_cb-skb);
tx_cb-skb = NULL;
atomic_inc(qdev-tx_count);
 }
 
+/*
+ * The difference between 3022 and 3032 for inbound completions:
+ * 3022 uses two buffers per completion.  The first buffer contains 
+ * (some) header info, the second the remainder of the headers plus 
+ * the data.  For this chip we reserve some space at the top of the 
+ * receive buffer so that the header info in buffer one can be 
+ * prepended to the buffer two.  Buffer two is the sent up while 
+ * buffer one is returned to the hardware to be reused.
+ * 3032 receives all of it's data and headers in one buffer for a 
+ * simpler process.  3032 also supports checksum verification as
+ * can be seen in ql_process_macip_rx_intr().
+ */
 static void ql_process_mac_rx_intr(struct ql3_adapter *qdev,
   struct ib_mac_iocb_rsp *ib_mac_rsp_ptr)
 {
@@ -1731,14 +1762,17 @@ static void ql_process_mac_rx_intr(struc
qdev-last_rsp_offset = qdev-small_buf_phy_addr_low + offset;
qdev-small_buf_release_cnt++;
 
-   /* start of first buffer */
-   lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr);
-   lrg_buf_cb1 = qdev-lrg_buf[qdev-lrg_buf_index];
-   qdev-lrg_buf_release_cnt++;
-   if (++qdev-lrg_buf_index == NUM_LARGE_BUFFERS)
-   qdev-lrg_buf_index = 0;
-   curr_ial_ptr++; /* 64-bit pointers require two incs. */
-   curr_ial_ptr++;
+   if (qdev-device_id == QL3022_DEVICE_ID) {
+   /* start of first buffer (3022 only) */
+   lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr);
+   lrg_buf_cb1 = qdev-lrg_buf[qdev-lrg_buf_index];
+   qdev-lrg_buf_release_cnt++;
+   if (++qdev-lrg_buf_index == NUM_LARGE_BUFFERS) {
+   qdev-lrg_buf_index = 0;
+   }
+   curr_ial_ptr++; /* 64-bit pointers require two incs. */
+   curr_ial_ptr++;
+   }
 
/* start of second buffer */
lrg_buf_phy_addr_low = le32_to_cpu(*curr_ial_ptr);
@@ -1769,7 +1803,8 @@ static void ql_process_mac_rx_intr(struc
qdev-ndev-last_rx = jiffies;
lrg_buf_cb2-skb = NULL;
 
-   ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb1);
+   if (qdev-device_id == QL3022_DEVICE_ID)
+   ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb1);
ql_release_to_lrg_buf_free_list(qdev, lrg_buf_cb2);
 }
 
@@ -1781,7 +1816,7 @@ static void ql_process_macip_rx_intr(str
struct ql_rcv_buf_cb 

[PATCH 2/2] qla3xxx: Change version to v2.03.00-k2.

2006-12-05 Thread Ron Mercer
Signed-off-by: Ron Mercer [EMAIL PROTECTED]
---
 drivers/net/qla3xxx.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/qla3xxx.c b/drivers/net/qla3xxx.c
index c39f20d..ae65602 100644
--- a/drivers/net/qla3xxx.c
+++ b/drivers/net/qla3xxx.c
@@ -39,7 +39,7 @@ #include qla3xxx.h
 
 #define DRV_NAME   qla3xxx
 #define DRV_STRING QLogic ISP3XXX Network Driver
-#define DRV_VERSIONv2.02.00-k36
+#define DRV_VERSIONv2.03.00-k2
 #define PFXDRV_NAME  
 
 static const char ql3xxx_driver_name[] = DRV_NAME;
-- 
1.4.2.rc2-dirty

-
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] ar5k and Atheros AR5005G

2006-12-05 Thread Luis R. Rodriguez

On 12/5/06, Stephen Hemminger [EMAIL PROTECTED] wrote:

On Tue, 5 Dec 2006 10:15:33 -0500
Luis R. Rodriguez [EMAIL PROTECTED] wrote:

 On 12/5/06, Michael Renzmann [EMAIL PROTECTED] wrote:
  openhal here.
 
  I've set up the suggested branches, with slight changing to the proposed
  names:
 
  * http://svn.madwifi.org/branches/madwifi-old-openhal (based on r1142)
  * http://svn.madwifi.org/branches/dadwifi-openhal (based on r1827)
 
  Neither of them has received any modifications yet, they are basically
  copies of the mentioned revisions. I'm currently lacking the time to
  import Nick's work into the madwifi-old-openhal branch, for example - it
  would be nice if someone else could work on that.

 CC'ing Reyk Foeter.

 Committed Nick's port of ar5k (openal) to both branches, both now have
 the openhal. Please note (very important):

 We are basing our openhal on OpenBSD's ar5k. Because of this and since
 the GPL does not allow us to commit changes on the GPL version back to
 the BSD version please sumbit your non-linux enhancements to the HAL
 to Reyk Floeter [EMAIL PROTECTED] and CC madwifi-devel.

 We have an openhal.org which we can start to use, should Reyk want, to
 use as the master tree of the ar5k to make sure any enhancements on
 the HAL go to both BSD and Linux. The licensing on the master tree
 should be kept BSD as Reyk wants it to be. This way Linux or BSD
 contributions can go into one tree and later revisions can be added to
 dadwifi/openbsd with their own specific BSD'isms and Linux'isms. Keep
 in mind the Linux port will remain dual licensed BSD/GPL. Let me know
 what you think Reyk.

   Luis

All the more reason to merge the HAL in and make it disappear


Agreed in the long term -- but this should not happen immediately as
otherwise we'd only get a completely free driver by the time this
hardware is outdated and reached its end of life. For now I'd say lets
stick to dadwifi+openhal effort, analyze net80211 from the ground up
and port to devicescape any features we are currently lacking. I can
help work on this fulltime.

 Luis
-
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] chelsio 10G (T1/T2)

2006-12-05 Thread Stephen Hemminger
On Tue, 5 Dec 2006 10:53:10 -0800
Felix Marti [EMAIL PROTECTED] wrote:

 T1's and T2's implementation of MSI has a bug. I believe to remember
 that it 
 
 works with some chipsets but we should disable MSI by default.


Is this really the platform bug, if so it should be handled by the pci quirks
already. Or is this a Chelsio hardware bug?
-
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: sparse warnings

2006-12-05 Thread Stephen Hemminger
Get rid of sparse warnings in sky2 driver because of mixed enum
usage.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/sky2.c |   18 --
 drivers/net/sky2.h |   53 +---
 2 files changed, 29 insertions(+), 42 deletions(-)

diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 842abd9..ae91571 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -522,7 +522,7 @@ static void sky2_phy_init(struct sky2_hw
/* set Tx LED (LED_TX) to blink mode on Rx OR Tx activity */
ledctrl |= PHY_M_LED_BLINK_RT(BLINK_84MS) | PHY_M_LEDC_TX_CTRL;
/* turn off the Rx LED (LED_RX) */
-   ledover |= PHY_M_LED_MO_RX(MO_LED_OFF);
+   ledover = ~PHY_M_LED_MO_RX;
}
 
if (hw-chip_id == CHIP_ID_YUKON_EC_U  hw-chip_rev == 
CHIP_REV_YU_EC_A1) {
@@ -545,7 +545,7 @@ static void sky2_phy_init(struct sky2_hw
 
if (sky2-autoneg == AUTONEG_DISABLE || sky2-speed == 
SPEED_100) {
/* turn on 100 Mbps LED (LED_LINK100) */
-   ledover |= PHY_M_LED_MO_100(MO_LED_ON);
+   ledover |= PHY_M_LED_MO_100;
}
 
if (ledover)
@@ -2917,18 +2917,8 @@ static void sky2_led(struct sky2_hw *hw,
 
default:
gm_phy_write(hw, port, PHY_MARV_LED_CTRL, 0);
-   gm_phy_write(hw, port, PHY_MARV_LED_OVER,
-on ? PHY_M_LED_MO_DUP(MO_LED_ON) |
-PHY_M_LED_MO_10(MO_LED_ON) |
-PHY_M_LED_MO_100(MO_LED_ON) |
-PHY_M_LED_MO_1000(MO_LED_ON) |
-PHY_M_LED_MO_RX(MO_LED_ON)
-: PHY_M_LED_MO_DUP(MO_LED_OFF) |
-PHY_M_LED_MO_10(MO_LED_OFF) |
-PHY_M_LED_MO_100(MO_LED_OFF) |
-PHY_M_LED_MO_1000(MO_LED_OFF) |
-PHY_M_LED_MO_RX(MO_LED_OFF));
-
+   gm_phy_write(hw, port, PHY_MARV_LED_OVER, 
+on ? PHY_M_LED_ALL : 0);
}
 }
 
diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
index 7760545..713d2c5 100644
--- a/drivers/net/sky2.h
+++ b/drivers/net/sky2.h
@@ -608,7 +608,7 @@ enum {
PHY_ADDR_MARV   = 0,
 };
 
-#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs))
+#define RB_ADDR(offs, queue) ((u16) B16_RAM_REGS + (queue) + (offs))
 
 
 enum {
@@ -1060,7 +1060,7 @@ enum {
PHY_M_PC_EN_DET_PLUS= 38, /* Energy Detect Plus (Mode 2) */
 };
 
-#define PHY_M_PC_MDI_XMODE(x)  (((x)5)  PHY_M_PC_MDIX_MSK)
+#define PHY_M_PC_MDI_XMODE(x)  (((u16)(x)5)  PHY_M_PC_MDIX_MSK)
 
 enum {
PHY_M_PC_MAN_MDI= 0, /* 00 = Manual MDI configuration */
@@ -1156,13 +1156,13 @@ enum {
PHY_M_EC_TX_TIM_CT  = 11, /* RGMII Tx Timing Control */
PHY_M_EC_TRANS_DIS  = 10, /* Transmitter Disable (88E only) */};
 
-#define PHY_M_EC_M_DSC(x)  ((x)10  PHY_M_EC_M_DSC_MSK)
+#define PHY_M_EC_M_DSC(x)  ((u16)(x)10  PHY_M_EC_M_DSC_MSK)
/* 00=1x; 01=2x; 10=3x; 11=4x */
-#define PHY_M_EC_S_DSC(x)  ((x)8  PHY_M_EC_S_DSC_MSK)
+#define PHY_M_EC_S_DSC(x)  ((u16)(x)8  PHY_M_EC_S_DSC_MSK)
/* 00=dis; 01=1x; 10=2x; 11=3x */
-#define PHY_M_EC_DSC_2(x)  ((x)9  PHY_M_EC_M_DSC_MSK2)
+#define PHY_M_EC_DSC_2(x)  ((u16)(x)9  PHY_M_EC_M_DSC_MSK2)
/* 000=1x; 001=2x; 010=3x; 011=4x */
-#define PHY_M_EC_MAC_S(x)  ((x)4  PHY_M_EC_MAC_S_MSK)
+#define PHY_M_EC_MAC_S(x)  ((u16)(x)4  PHY_M_EC_MAC_S_MSK)
/* 01X=0; 110=2.5; 111=25 (MHz) */
 
 /* for Yukon-2 Gigabit Ethernet PHY (88E1112 only) */
@@ -1173,7 +1173,7 @@ enum {
 };
 /* !!! Errata in spec. (1 = disable) */
 
-#define PHY_M_PC_DSC(x)(((x)12)  PHY_M_PC_DSC_MSK)
+#define PHY_M_PC_DSC(x)(((u16)(x)12)  
PHY_M_PC_DSC_MSK)

/* 100=5x; 101=6x; 110=7x; 111=8x */
 enum {
MAC_TX_CLK_0_MHZ= 2,
@@ -1203,7 +1203,7 @@ enum {
PHY_M_LEDC_TX_C_MSB = 10, /* Tx Control (MSB, 88E only) */
 };
 
-#define PHY_M_LED_PULS_DUR(x)  (((x)12)  PHY_M_LEDC_PULS_MSK)
+#define PHY_M_LED_PULS_DUR(x)  (((u16)(x)12)  PHY_M_LEDC_PULS_MSK)
 
 /*  PHY_MARV_PHY_STAT (page 3)16 bit r/w   Polarity Control Reg. */
 enum {
@@ -1233,7 +1233,7 @@ enum {
PULS_1300MS = 7,/* 1.3 s to 2.7 s */
 };
 
-#define PHY_M_LED_BLINK_RT(x)  (((x)8)  PHY_M_LEDC_BL_R_MSK)
+#define PHY_M_LED_BLINK_RT(x)  (((u16)(x)8)  PHY_M_LEDC_BL_R_MSK)
 
 enum {
BLINK_42MS  = 0,/* 42 ms */
@@ -1243,21 +1243,18 @@ enum {
BLINK_670MS = 4,/* 670 ms */
 };
 
-/*  PHY_MARV_LED_OVER  

[PATCH] skge: fix sparse warnings

2006-12-05 Thread Stephen Hemminger
Fix sparse warnings from using enum as part of arithmetic
expression, and comment indentation fixes

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/skge.h |  150 ++--
 1 files changed, 75 insertions(+), 75 deletions(-)

diff --git a/drivers/net/skge.h b/drivers/net/skge.h
index 537c0aa..bc79f9e 100644
--- a/drivers/net/skge.h
+++ b/drivers/net/skge.h
@@ -389,10 +389,10 @@ #define SK_RI_TO_53   36  /* RAM interface
 /* Packet Arbiter Registers */
 /* B3_PA_CTRL  16 bit  Packet Arbiter Ctrl Register */
 enum {
-   PA_CLR_TO_TX2   = 113,/* Clear IRQ Packet Timeout TX2 */
-   PA_CLR_TO_TX1   = 112,/* Clear IRQ Packet Timeout TX1 */
-   PA_CLR_TO_RX2   = 111,/* Clear IRQ Packet Timeout RX2 */
-   PA_CLR_TO_RX1   = 110,/* Clear IRQ Packet Timeout RX1 */
+   PA_CLR_TO_TX2   = 113,/* Clear IRQ Packet Timeout TX2 */
+   PA_CLR_TO_TX1   = 112,/* Clear IRQ Packet Timeout TX1 */
+   PA_CLR_TO_RX2   = 111,/* Clear IRQ Packet Timeout RX2 */
+   PA_CLR_TO_RX1   = 110,/* Clear IRQ Packet Timeout RX1 */
PA_ENA_TO_TX2   = 19, /* Enable  Timeout Timer TX2 */
PA_DIS_TO_TX2   = 18, /* Disable Timeout Timer TX2 */
PA_ENA_TO_TX1   = 17, /* Enable  Timeout Timer TX1 */
@@ -481,14 +481,14 @@ #define Q_ADDR(reg, offs) (B8_Q_REGS + (
 /* RAM Buffer Register Offsets */
 enum {
 
-   RB_START= 0x00,/* 32 bitRAM Buffer Start Address */
+   RB_START= 0x00,/* 32 bitRAM Buffer Start Address */
RB_END  = 0x04,/* 32 bitRAM Buffer End Address */
RB_WP   = 0x08,/* 32 bitRAM Buffer Write Pointer */
RB_RP   = 0x0c,/* 32 bitRAM Buffer Read Pointer */
-   RB_RX_UTPP  = 0x10,/* 32 bitRx Upper Threshold, Pause 
Packet */
-   RB_RX_LTPP  = 0x14,/* 32 bitRx Lower Threshold, Pause 
Packet */
-   RB_RX_UTHP  = 0x18,/* 32 bitRx Upper Threshold, High Prio */
-   RB_RX_LTHP  = 0x1c,/* 32 bitRx Lower Threshold, High Prio */
+   RB_RX_UTPP= 0x10,/* 32 bit  Rx Upper Threshold, Pause Packet */
+   RB_RX_LTPP= 0x14,/* 32 bit  Rx Lower Threshold, Pause Packet */
+   RB_RX_UTHP= 0x18,/* 32 bit  Rx Upper Threshold, High Prio */
+   RB_RX_LTHP= 0x1c,/* 32 bit  Rx Lower Threshold, High Prio */
/* 0x10 - 0x1f: reserved at Tx RAM Buffer Registers */
RB_PC   = 0x20,/* 32 bitRAM Buffer Packet Counter */
RB_LEV  = 0x24,/* 32 bitRAM Buffer Level Register */
@@ -532,7 +532,7 @@ enum {
PHY_ADDR_MARV   = 0,
 };
 
-#define RB_ADDR(offs, queue) (B16_RAM_REGS + (queue) + (offs))
+#define RB_ADDR(offs, queue) ((u16)B16_RAM_REGS + (u16)(queue) + (offs))
 
 /* Receive MAC FIFO, Receive LED, and Link_Sync regs (GENESIS only) */
 enum {
@@ -578,15 +578,15 @@ enum {
MFF_DIS_TIST= 12, /* Disable Time Stamp Gener */
MFF_CLR_INTIST  = 11, /* Clear IRQ No Time Stamp */
MFF_CLR_INSTAT  = 10, /* Clear IRQ No Status */
-#define MFF_RX_CTRL_DEF MFF_ENA_TIM_PAT
+   MFF_RX_CTRL_DEF = MFF_ENA_TIM_PAT,
 };
 
 /* TX_MFF_CTRL116 bit  Transmit MAC FIFO Control Reg 1 */
 enum {
-   MFF_CLR_PERR= 115,/* Clear Parity Error IRQ */
-   /* Bit 14:  
reserved */
-   MFF_ENA_PKT_REC = 113,/* Enable  Packet Recovery */
-   MFF_DIS_PKT_REC = 112,/* Disable Packet Recovery */
+   MFF_CLR_PERR= 115, /* Clear Parity Error IRQ */
+
+   MFF_ENA_PKT_REC = 113, /* Enable  Packet Recovery */
+   MFF_DIS_PKT_REC = 112, /* Disable Packet Recovery */
 
MFF_ENA_W4E = 17, /* Enable  Wait for Empty */
MFF_DIS_W4E = 16, /* Disable Wait for Empty */
@@ -595,9 +595,10 @@ enum {
MFF_DIS_LOOPB   = 12, /* Disable Loopback */
MFF_CLR_MAC_RST = 11, /* Clear XMAC Reset */
MFF_SET_MAC_RST = 10, /* Set   XMAC Reset */
+
+   MFF_TX_CTRL_DEF  = MFF_ENA_PKT_REC | (u16) MFF_ENA_TIM_PAT | 
MFF_ENA_FLUSH,
 };
 
-#define MFF_TX_CTRL_DEF(MFF_ENA_PKT_REC | MFF_ENA_TIM_PAT | 
MFF_ENA_FLUSH)
 
 /* RX_MFF_TST2  8 bit  Receive MAC FIFO Test Register 2 */
 /* TX_MFF_TST2  8 bit  Transmit MAC FIFO Test Register 2 */
@@ -1304,8 +1305,8 @@ enum {
 
 /* special defines for FIBER (88E1011S only) */
 enum {
-   PHY_M_AN_ASP_X  = 18, /* Asymmetric Pause */
-   PHY_M_AN_PC_X   = 17, /* MAC Pause implemented */
+   PHY_M_AN_ASP_X  = 18, /* Asymmetric Pause */
+   PHY_M_AN_PC_X   = 17, /* MAC Pause implemented */
PHY_M_AN_1000X_AHD  = 16, /* Advertise 1Base-X Half Duplex */
PHY_M_AN_1000X_AFD  = 15, /* Advertise 1Base-X Full Duplex */
 };
@@ -1320,7 +1321,7 @@ enum {
 
 /*  PHY_MARV_1000T_CTRL16 bit r/w  1000Base-T Control Reg 

[PATCH] netxen: sparse warning and ioctl bug fixes

2006-12-05 Thread Stephen Hemminger
Fix sparse warnings and get rid of casts that hide misuse
of __user pointers.  There were two real bugs here:
  * ioctl was copying uninitialized stack om NETXEN_NIC_NAME
  * ioctl was dereferencing a user pointer
in nettxen_nic_cmd_clear_stats.

IMHO the ioctl usage in this driver is going to be more maintenance
burden than useful. and should be removed.

Signed-off-by: Stephen Hemminger [EMAIL PROTECTED]
---
 drivers/net/netxen/netxen_nic.h   |5 +
 drivers/net/netxen/netxen_nic_hdr.h   |  128 +
 drivers/net/netxen/netxen_nic_init.c  |   38 +-
 drivers/net/netxen/netxen_nic_ioctl.h |2 -
 drivers/net/netxen/netxen_nic_main.c  |   34 +++--
 5 files changed, 99 insertions(+), 108 deletions(-)

diff --git a/drivers/net/netxen/netxen_nic.h b/drivers/net/netxen/netxen_nic.h
index d925053..f66ebe3 100644
--- a/drivers/net/netxen/netxen_nic.h
+++ b/drivers/net/netxen/netxen_nic.h
@@ -916,9 +916,8 @@ void netxen_tso_check(struct netxen_adap
  struct cmd_desc_type0 *desc, struct sk_buff *skb);
 int netxen_nic_hw_resources(struct netxen_adapter *adapter);
 void netxen_nic_clear_stats(struct netxen_adapter *adapter);
-int
-netxen_nic_do_ioctl(struct netxen_adapter *adapter, void *u_data,
-   struct netxen_port *port);
+int netxen_nic_do_ioctl(struct netxen_adapter *adapter, void __user *u_data,
+   struct netxen_port *port);
 int netxen_nic_rx_has_work(struct netxen_adapter *adapter);
 int netxen_nic_tx_has_work(struct netxen_adapter *adapter);
 void netxen_watchdog_task(unsigned long v);
diff --git a/drivers/net/netxen/netxen_nic_hdr.h 
b/drivers/net/netxen/netxen_nic_hdr.h
index 72c6ec4..2461afc 100644
--- a/drivers/net/netxen/netxen_nic_hdr.h
+++ b/drivers/net/netxen/netxen_nic_hdr.h
@@ -228,139 +228,139 @@ enum {
 /*  This field defines CRB adr [31:20] of the agents */
 
 #define NETXEN_HW_CRB_HUB_AGT_ADR_MN   \
-   ((NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_MN_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_MN_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_PH   \
-   ((NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_PH_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_PH_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_MS   \
-   ((NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_MS_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H0_CH_HUB_ADR  7) | NETXEN_HW_MS_CRB_AGT_ADR)
 
 #define NETXEN_HW_CRB_HUB_AGT_ADR_PS   \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_PS_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_PS_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_SS   \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SS_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SS_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_RPMX3\
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX3_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX3_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_QMS  \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_QMS_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_QMS_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_SQS0 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS0_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS0_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_SQS1 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS1_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS1_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_SQS2 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS2_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS2_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_SQS3 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS3_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_SQGS3_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_C2C0 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_C2C0_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_C2C0_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_C2C1 \
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_C2C1_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_C2C1_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_RPMX2\
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX2_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX2_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_RPMX4\
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX4_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX4_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_RPMX7\
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX7_CRB_AGT_ADR)
+   (((u32)NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX7_CRB_AGT_ADR)
 #define NETXEN_HW_CRB_HUB_AGT_ADR_RPMX9\
-   ((NETXEN_HW_H1_CH_HUB_ADR  7) | NETXEN_HW_RPMX9_CRB_AGT_ADR)
+   

Re: [RFC patch] driver for the Opencores Ethernet Controller

2006-12-05 Thread Dan Nicolaescu
Stephen Hemminger [EMAIL PROTECTED] writes:


   Indentation. See Documentation style.
   What about IRQF_SHARED?

Not sure, maybe I should make this another driver parameter. On my
platform is not shared...
   
   The trouble with devices, is that some poor sop clones the hardware to
   another board and your assumption is no longer valid.

Tt's a parameter now.

   
+static int oeth_start_xmit(struct sk_buff *skb, struct net_device 
*dev)
+{
+   struct oeth_private *cep = netdev_priv(dev);
+   volatile struct oeth_bd *bdp;
+   unsigned long flags;
+   u32 len_status;
+
+   spin_lock_irqsave(cep-lock, flags);
+
+   if (cep-tx_full) {
+   /* All transmit buffers are full.  Bail out. */
+   printk(%s: tx queue full!.\n, dev-name);
+   print_queue(cep-tx_bd_base, cep-tx_next, 
OETH_TXBD_NUM);
+   spin_unlock_irqrestore(cep-lock, flags);
+   return 1;
   return NETDEV_TX_BUSY.
  
   you forgot to call stop_queue

Fixed.

What should I return in the case below: 

if (skb-len  OETH_TX_BUFF_SIZE) {
printk(%s: tx frame too long!.\n, dev-name);
spin_unlock_irqrestore(cep-lock, flags);
return 1;
}
   
   Drop the skb with dev_kfree_skb_irq() and return NETDEV_TX_OK.
   You should net_ratelimit() the message also if you don't want the
   machine to hang if you ever get a buggy application.
 
Done.

+
+   /* Copy data to TX buffer. */
+   memcpy_hton ((unsigned char *)bdp-addr, skb-data,  skb-len);
   
   Use skb_copy_and_csum_dev and you get checksum offload for free.

Wouldn't that just add (a bit of) overhead? It performs the memcpy, but 
it also
checks if the HW is capable of doing the checksum (which it is)... 
Incidentally the memcpy_hton is just memcpy now.
   
   The cost of copy and checksum is the same as copy on all most hardware.

Unfortunately on my platform is not.

   And does your hardware do IPV6 etc?

No. 

+   cep-stats.rx_dropped++;
+   }
+   else {
+   skb-dev = dev;
+   OEDRX((printk(RX in ETH buf\n)));
+   OEDRX((oeth_print_packet((u32*)bdp-addr, 
pkt_len)));
+
+   memcpy_ntoh(skb_put(skb, pkt_len), (unsigned 
char *)bdp-addr, pkt_len);
   
   
   Copying packet in IRQ routine causes long latencies.

Any suggestions on how else to do this?
   
   You can use NAPI (see 8139too.c) it has similar issues

I implemented NAPI. New version attached. 

Is there anything else that I should do?

+#if CONFIG_MII
+static int check_if_running(struct net_device *dev)
+{
+   if (!netif_running(dev))
+   return -EINVAL;
+   return 0;
+}
   
   Bogus wrapper.

OK. BTW this is present in 3 more files: hamachi.c, starfire.c and
sundance.c 
   
   Send the Bunk after it.

Sorry, I don't know what that means...

 Kconfig|5 
 open_eth.c |  753 +
 open_eth.h |  132 ++
 3 files changed, 890 insertions(+)

--- /dev/null   2006-09-20 11:38:04.545479250 -0700
+++ drivers/net/open_eth.c  2006-12-05 11:50:57.977895000 -0800
@@ -0,0 +1,753 @@
+/*
+ * Ethernet driver for Open Ethernet Controller (www.opencores.org).
+ *  Copyright (c) 2002 Simon Srot ([EMAIL PROTECTED])
+ *  Copyright (c) 2006 Tensilica Inc.
+ * 
+ * Based on:
+ *
+ * Ethernet driver for Motorola MPC8xx.
+ *  Copyright (c) 1997 Dan Malek ([EMAIL PROTECTED])
+ *
+ * mcen302.c: A Linux network driver for Mototrola 68EN302 MCU
+ *
+ *  Copyright (C) 1999 Aplio S.A. Written by Vadim Lebedev
+ *
+ * 
+ *  The Open Ethernet Controller is just a MAC, it needs to be
+ *  combined with a PHY and buffer memory in order to create an
+ *  ethernet device. Thus some of the hardware parameters are device
+ *  specific. They need to be defined in asm/hardware.h. Example:
+ * 
+ * The IRQ for the device:
+ * #define OETH_IRQ1
+ *
+ * The flag to be passed to request_irq:
+ * #define OETH_REQUEST_IRQ_FLAG   0
+ * 
+ * The address where the MAC registers are mapped:
+ * #define OETH_BASE_ADDR  0xFD03
+ *
+ * The address where the MAC RX/TX buffers are mapped:
+ * #define OETH_SRAM_BUFF_BASE 0xFD80
+ * 
+ * Sizes for a RX or TX buffer:
+ * #define OETH_RX_BUFF_SIZE   2048
+ * #define OETH_TX_BUFF_SIZE   2048
+ * The number of RX and TX buffers:
+ * #define OETH_RXBD_NUM   16
+ * #define OETH_TXBD_NUM   16
+ * The PHY ID (needed if MII is enabled):
+ * #define OETH_PHY_ID 0
+ * 
+ * Code to perform the device specific initialization (REGS is a
+ *  

Re: dm-crypt changes in git-net tree

2006-12-05 Thread David Miller
From: Herbert Xu [EMAIL PROTECTED]
Date: Tue, 5 Dec 2006 19:40:41 +1100

 [CRYPTO] dm-crypt: Make iv_gen_private a union
 
 Rather than stuffing integers into pointers with casts, let's use
 a union.
 
 Signed-off-by: Herbert Xu [EMAIL PROTECTED]

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


Re: [PATCH 2/2] [IPV6] RAW: Add checksum default defines for mobility header.

2006-12-05 Thread David Miller
From: YOSHIFUJI Hideaki [EMAIL PROTECTED]
Date: Tue, 05 Dec 2006 20:02:42 +0900 (JST)

 In article [EMAIL PROTECTED] (at Tue,  5 Dec 2006 19:03:27 +0900), Masahide 
 NAKAMURA [EMAIL PROTECTED] says:
 
  Add checksum default defines for mobility header(MH).
  As the result kernel's behavior is to handle MH checksum
  as default.
 
 I'd like to hold this on.  I need to check RFC.

Ok.
-
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] Netlink: add a pointer to the Generic Netlink wiki page

2006-12-05 Thread David Miller
From: [EMAIL PROTECTED]
Date: Tue, 05 Dec 2006 12:26:10 -0500

 From: Paul Moore [EMAIL PROTECTED]
 
 Add a pointer to the OSDL wiki page on Generic Netlink.
 
 Signed-off-by: Paul Moore [EMAIL PROTECTED]

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


Re: [PATCH 1/2] [IPV6] RAW: Don't release unlocked sock.

2006-12-05 Thread David Miller
From: Masahide NAKAMURA [EMAIL PROTECTED]
Date: Tue,  5 Dec 2006 19:03:14 +0900

 When user builds IPv6 header and send it through raw socket, kernel
 tries to release unlocked sock. (Kernel log shows
 BUG: bad unlock balance detected with enabled debug option.)
 
 The lock is held only for non-hdrincl sock in this function
 then this patch fix to do nothing about lock for hdrincl one.
 
 Signed-off-by: Masahide NAKAMURA [EMAIL PROTECTED]

Patch applied, thank you very much.
-
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 patch] driver for the Opencores Ethernet Controller

2006-12-05 Thread Dan Nicolaescu
Lennert Buytenhek [EMAIL PROTECTED] writes:

   On Mon, Dec 04, 2006 at 10:27:52AM -0800, Dan Nicolaescu wrote:
   
  The Opencores Ethernet Controller is Verilog code that can be used to
  implement an Ethernet device in hardware. It needs to be coupled with
  a PHY and some buffer memory. Because of that devices that implement
  this controller can be very different. The code here tries to support
  that by having some parameters that need to be defined at compile
  time.
 
 Considering this, why don't you make it a platform driver?

I didn't know about platform drivers before your mail. I guess I
could convert it to that if that is the right thing to do. 
   
   I definitely think so.  Check the ep93xx_eth driver for an example.
   
   
(It might be an overkill given that the device is kind of simple and
embedded people prefer small code...)
   
   ..until someone decides that he wants to build a design with two of
   these ethernet cores instead of just one, at which point the entire
   Let's use #defines for everything plan breaks down badly.

Sure.  If changing the code to implement a platform driver is required
in order to get it accepted, then I'll do that. If it's not required,
the platform driver code can be added later as an incremental patch.



-
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: [NET_SCHED]: cls_fw: fix NULL pointer dereference

2006-12-05 Thread David Miller
From: Patrick McHardy [EMAIL PROTECTED]
Date: Mon, 04 Dec 2006 16:34:46 +0100

 [NET_SCHED]: cls_fw: fix NULL pointer dereference
 
 When the first fw classifier is initialized, there is a small window
 between the -init() and -change() calls, during which the classifier
 is active but not entirely set up and tp-root is still NULL (-init()
 does nothing).
 
 When a packet is queued during this window a NULL pointer dereference
 occurs in fw_classify() when trying to dereference head-mask;
 
 Signed-off-by: Patrick McHardy [EMAIL PROTECTED]

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


Re: [PATCH 2.6.20] [IPV6]: Repair IPv6 Fragments

2006-12-05 Thread David Miller
From: YOSHIFUJI Hideaki [EMAIL PROTECTED]
Date: Tue, 05 Dec 2006 18:28:28 +0900 (JST)

 Hello.
 
 The commit [IPV6]: Use kmemdup (commit-id:
 af879cc704372ef762584e916129d19ffb39e844) broke IPv6 fragments.
 
 Bug was spotted by Yasuyuki Kozakai [EMAIL PROTECTED].
 
 Signed-off-by: YOSHIFUJI Hideaki [EMAIL PROTECTED]

Thank you for catching and fixing this bug, patch applied.
-
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/10] cxgb3 - main source file

2006-12-05 Thread Divy Le Ray

Stephen,

Thanks for the review. Please see my replies inline.

Stephen Hemminger wrote:


O
  

+ * If we have multiple receive queues per port serviced by NAPI we need one
+ * netdevice per queue as NAPI operates on netdevices.  We already have one
+ * netdevice, namely the one associated with the interface, so we use dummy
+ * ones for any additional queues.  Note that these netdevices exist purely
+ * so that NAPI has something to work with, they do not represent network
+ * ports and are not registered.
+ */
+static int init_dummy_netdevs(struct adapter *adap)
+{
+   int i, j, dummy_idx = 0;
+   struct net_device *nd;
+
+   for_each_port(adap, i) {
+   const struct port_info *pi = adap-port[i];
+
+   for (j = 0; j  pi-nqsets - 1; j++) {
+   if (!adap-dummy_netdev[dummy_idx]) {
+   nd = alloc_netdev(0, , ether_setup);
+   if (!nd)
+   goto free_all;
+
+   nd-priv = adap;
+   nd-weight = 64;
+   set_bit(__LINK_STATE_START, nd-state);
+   adap-dummy_netdev[dummy_idx] = nd;
+   }
+   strcpy(adap-dummy_netdev[dummy_idx]-name,
+  pi-dev-name);
+   dummy_idx++;
+   }
+   }
+   return 0;
+
+free_all:
+   while (--dummy_idx = 0) {
+   free_netdev(adap-dummy_netdev[dummy_idx]);
+   adap-dummy_netdev[dummy_idx] = NULL;
+   }
+   return -ENOMEM;
+}




I understand this, but it seems more trouble than it is worth
and adds longterm maintance burden to NAPI and receive management code.

You would be better off doing your own scheduling in a tasklet.

  
This code is directly inspired from the backlog_dev mechanism in 
net/core/dev.c.
NAPI provides fairness between adapters. Using our own scheduling would 
conflict with this.


  

+   case SIOCCHIOCTL:
+   return cxgb_extension_ioctl(dev, req-ifr_data);




Adding a chelsio specific ioctl value isn't going to get accepted.
You need to use SIOCDEVPRIVATE, and figure out how to do 32bit/64bit
ioctl compatibility for it.
  

SIOCCHIOCTL is defined as SIOCDEVPRIVATE in cxgb3_ioctl.h.
  

+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void cxgb_netpoll(struct net_device *dev)
+{
+   unsigned long flags;
+   struct adapter *adapter = dev-priv;
+   struct sge_qset *qs = dev2qset(dev);
+
+   local_irq_save(flags);
+   t3_intr_handler(adapter, qs-rspq.polling) (adapter-pdev-irq,
+   adapter);
+   local_irq_restore(flags);
+}
+#endif



IRQ's are always disabled when netpoll is called.
  

Okay, will fix.
  

+   for (i = 0; i  ai-nports; ++i) {
+   struct net_device *netdev;
+
+   netdev = alloc_etherdev(adapter ? 0 : sizeof(*adapter));
+   if (!netdev) {
+   err = -ENOMEM;
+   goto out_free_dev;
+   }
+
+   if (!adapter) {
+   adapter = netdev-priv;
+
+   adapter-pdev = pdev;
+   adapter-port[0].dev = netdev;   // so we don't 
leak it
+
+   adapter-regs = ioremap_nocache(mmio_start, mmio_len);
+   if (!adapter-regs) {
+   CH_ERR(%s: cannot map device registers\n,
+  pci_name(pdev));
+   err = -ENOMEM;
+   goto out_free_dev;
+   }
+
+   adapter-name = pci_name(pdev);
+   adapter-msg_enable = dflt_msg_enable;
+   adapter-mmio_len = mmio_len;
+   INIT_LIST_HEAD(adapter-adapter_list);
+   mutex_init(adapter-mdio_lock);
+   spin_lock_init(adapter-work_lock);
+   spin_lock_init(adapter-stats_lock);
+
+   INIT_WORK(adapter-ext_intr_handler_task,
+ ext_intr_task, adapter);
+   INIT_WORK(adapter-adap_check_task, t3_adap_check_task,
+ adapter);
+
+   pci_set_drvdata(pdev, netdev);
+   }




It looks like you are repeating the same method of doing multi-port that you
did on cxgb2. It was wrong then, and it is wrong now:

DON'T
use if_port to distinguish port. if_port is legacy field see IF_PORT_XXX
allocate adapter as part of 1st interface
set dev-priv differently on each port
don't use array in adapter structure for each port
DO
allocate adapter separately
use netdev_priv() for per port data
use port-adapter for adapter 

Re: [RFC] rfkill - Add support for input key to control wireless radio

2006-12-05 Thread Christoph Hellwig
 +/*
 + * Function called by the key driver when the rfkill structure
 + * needs to be registered.
 + */
 +int rfkill_register_key(struct rfkill *rfkill, int init_status)
 +{
 + struct rfkill_type *type = master-type[rfkill-key_type];
 + struct rfkill_key *key;
 + int status;
 +
 + if (!rfkill)
 + return -EINVAL; 
 +
 + if (rfkill-key_type = KEY_TYPE_MAX)
 + return -EINVAL;
 +
 + /*
 +  * Increase module use count to prevent this
 +  * module to be unloaded while there are still
 +  * registered keys.
 +  */
 + if (!try_module_get(THIS_MODULE))
 + return -EBUSY;

This is obviously broken.  Please add a struct module *owner;
field to struct rfkill instead.

-
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 v2 04/13] Connection Manager

2006-12-05 Thread Brice Goglin
Steve Wise wrote:
 There is no SW TCP stack in this driver.  The HW supports RDMA over
 TCP/IP/10GbE in HW and this is required for zero-copy RDMA over Ethernet
 (aka iWARP).  The device is a 10 GbE device, not Infiniband.

Then, I wonder why the driver goes in drivers/infiniband/ :)

Is there really no way to only keep the actual hw infiniband there, move
iwarp/rdma drivers in drivers/net/something/ and the core stuff in
net/something/ ?

Brice

-
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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 08:07 +0300, Evgeniy Polyakov wrote:
 On Mon, Dec 04, 2006 at 07:45:52AM -0800, Roland Dreier ([EMAIL PROTECTED]) 
 wrote:
This and a lot of other changes in this driver definitely says you
implement your own stack of protocols on top of infiniband hardware.
  
  ...but I do know this driver is for 10-gig ethernet HW.
 
 It is for iwarp/rdma from description.
 If it is 10ge, then why does it parse incomping packet headers and
 implements initial tcp state machine?
 

Its not implementing the TCP state machine at all. Its implementing the
MPA state machine (see the iWARP internet drafts).  These packets are
TCP payload.  MPA is used to negotiate RDMA mode on a TCP connection.
This entails an exchange of 2 messages on the TCP connection.  Once this
is exchanged and both side agree, the connection is bound to an RDMA QP
and the connection moved into RDMA mode.  From that point on, all IO is
done via the post_send() and post_recv().


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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Mon, 2006-12-04 at 21:13 -0800, Roland Dreier wrote:
   It is for iwarp/rdma from description.
 
 Yes, iWARP on top of 10G ethernet.
 
   If it is 10ge, then why does it parse incomping packet headers and
   implements initial tcp state machine?
 
 To establish connections to run RDMA over, I guess.  iWARP is RDMA
 over TCP.
 

The driver uses messages exchanged to and from the HW via the Ethernet
driver to setup TCP connections.  No TCP processing is done in the host.
The hardware does all the TCP processing.


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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 08:13 +0300, Evgeniy Polyakov wrote:
 On Mon, Dec 04, 2006 at 10:20:51AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
 This and a lot of other changes in this driver definitely says you
 implement your own stack of protocols on top of infiniband hardware.
   
   ...but I do know this driver is for 10-gig ethernet HW.
   
  
  There is no SW TCP stack in this driver.  The HW supports RDMA over
  TCP/IP/10GbE in HW and this is required for zero-copy RDMA over Ethernet
  (aka iWARP).  The device is a 10 GbE device, not Infiniband.  The
  Ethernet driver, upon which the rdma driver depends, acts both like a
  traditional Ethernet NIC for the Linux stack as well as a TCP offload
  device for the RDMA driver allowing establishment of RDMA connections.
  The Connection Manager (patch 04/13) sends/receives messages from the
  Ethernet driver that sets up HW TCP connections for doing RDMA.  While
  this is indeed implementing TCP offload, it is _not_ integrating it with
  the sockets layer nor the linux stack and offloading sockets
  connections.  Its only supporting offload connections for the RDMA
  driver to do iWARP.   The Ammasso device is another example of this
  (drivers/infiniband/hw/amso1100).  Deep iSCSI adapters are another
  example of this.
 
 So what will happen when application will create a socket, bind it to
 that NIC, and then try to establish a TCP connection? How NIC will
 decide that received packets are from socket but not for internal TCP
 state machine handled by that device?

The HW knows which TCP connections are offloaded by virtue of the fact
that they were setup via the RDMA subsystem.  Any other TCP traffic (and
all other non TCP traffic) gets passed to the host stack.

 
 As a side note, does all iwarp devices _require_ to have very
 limited TCP engine implemented it in its hardware, or it is possible
 to work with external SW stack?

It is possible, but not very interesting.

One could implement an all-software iWARP stack.  The iWARP protocols
are just TCP payload and _could_ be implemented in user mode on top of a
socket.  However, this isn't very interesting:  the goal of iWARP (and
RDMA for that matter) is to allow direct placement of data into user
memory with 0 copies done by the host CPU.  low latency.

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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Mon, 2006-12-04 at 21:27 -0800, Roland Dreier wrote:
   So will each new NIC implement some parts of TCP stack in theirs drivers?
 
 I hope not.  The driver we merged (amso1100) did it completely in FW,
 with a separate MAC and IP interface for the RDMA connections.  I
 think we better understand the Chelsio driver pretty well and think it
 over carefully before we merge it.
 

Chelsio doesn't implement TCP stack in the driver.  Just like Ammasso,
it sends messages to the HW to setup connections.  It differs from
Ammasso in at least 2 ways:

1) Ammasso does the MPA negotiations in FW/HW.  Chelsio does it in the
RDMA driver.  So there is code in the Chelsio driver to handle MPA
startup negotiation (the exchange of 2 packets over the TCP connection
while its still in streaming more).  BTW: This code _could_ be moved
into the core IWCM if we find it could be used by other rnic devices
(don't know yet).

2) Ammasso implments a 100% deep adapter.  It does ARP, routing, IP,
TCP, and IWARP protocols all in firmware/hw.  It had 2 mac addresses
simulating 2 ethernet ports.  One exclusively for RDMA connections, and
one for host stack traffic.  Chelsio implements a shallower adapter that
only does TCP in HW.  ARP, for instance, is handled by the native stack
and the rdma driver uses netevents to maintain arp tables in the HW for
use by the offloaded TCP connections.

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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 09:02:05AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
 This and a lot of other changes in this driver definitely says you
 implement your own stack of protocols on top of infiniband hardware.
   
   ...but I do know this driver is for 10-gig ethernet HW.
  
  It is for iwarp/rdma from description.
  If it is 10ge, then why does it parse incomping packet headers and
  implements initial tcp state machine?
  
 
 Its not implementing the TCP state machine at all. Its implementing the
 MPA state machine (see the iWARP internet drafts).  These packets are
 TCP payload.  MPA is used to negotiate RDMA mode on a TCP connection.
 This entails an exchange of 2 messages on the TCP connection.  Once this
 is exchanged and both side agree, the connection is bound to an RDMA QP
 and the connection moved into RDMA mode.  From that point on, all IO is
 done via the post_send() and post_recv().

And why does rdma require window scaling, keep alive, nagle and other
interesting options from TCP spec?

This really looks like initial implementation of TCP in hardware - you
setup flags like doing the same using setsockopt() and then hardware
manages the flow like network stack manages TCP state machine changes.

According to draft-culley-iwarp-mpa-03.txt this layer can do a lot of
things with valid TCP flow like

   5.  The TCP sender puts the FPDUs into the TCP stream.  If the TCP
   Sender is MPA-aware, it segments the TCP stream in such a way
   that a TCP Segment boundary is also the boundary of an FPDU.  
   TCP then passes each segment to the IP layer for transmission.

Phrases like MPA-aware TCP rises a lot of questions - briefly saying
that hardware (even if it is called ethernet driver) can create and work
with own TCP flows potentially modified in the way it likes which is seen 
in driver. Likely such flows will not be seen by upper layers like OS 
network stack according to hardware descriptions.

Is it correct?

 Steve. 

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 09:14:36AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
 Chelsio doesn't implement TCP stack in the driver.  Just like Ammasso,
 it sends messages to the HW to setup connections.  It differs from
 Ammasso in at least 2 ways:
 
 1) Ammasso does the MPA negotiations in FW/HW.  Chelsio does it in the
 RDMA driver.  So there is code in the Chelsio driver to handle MPA
 startup negotiation (the exchange of 2 packets over the TCP connection
 while its still in streaming more).  BTW: This code _could_ be moved
 into the core IWCM if we find it could be used by other rnic devices
 (don't know yet).
 
 2) Ammasso implments a 100% deep adapter.  It does ARP, routing, IP,
 TCP, and IWARP protocols all in firmware/hw.  It had 2 mac addresses
 simulating 2 ethernet ports.  One exclusively for RDMA connections, and
 one for host stack traffic.  Chelsio implements a shallower adapter that
 only does TCP in HW.  ARP, for instance, is handled by the native stack
 and the rdma driver uses netevents to maintain arp tables in the HW for
 use by the offloaded TCP connections.

So breifly saying - there is TCP stack implementation (including ARP and
routing and other parts) in hardware/firmware/driver which is guaranteed
to not be visible to host other than in form of high-level dataflow.
Am I right here?

 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

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 18:19 +0300, Evgeniy Polyakov wrote:
 On Tue, Dec 05, 2006 at 09:02:05AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
  This and a lot of other changes in this driver definitely says you
  implement your own stack of protocols on top of infiniband hardware.

...but I do know this driver is for 10-gig ethernet HW.
   
   It is for iwarp/rdma from description.
   If it is 10ge, then why does it parse incomping packet headers and
   implements initial tcp state machine?
   
  
  Its not implementing the TCP state machine at all. Its implementing the
  MPA state machine (see the iWARP internet drafts).  These packets are
  TCP payload.  MPA is used to negotiate RDMA mode on a TCP connection.
  This entails an exchange of 2 messages on the TCP connection.  Once this
  is exchanged and both side agree, the connection is bound to an RDMA QP
  and the connection moved into RDMA mode.  From that point on, all IO is
  done via the post_send() and post_recv().
 
 And why does rdma require window scaling, keep alive, nagle and other
 interesting options from TCP spec?
 

The connection setup messages sent to the hardware need to have these
parameters so the TCP engine on the HW knows how to do connection
options, windows, etc.

 This really looks like initial implementation of TCP in hardware - you
 setup flags like doing the same using setsockopt() and then hardware
 manages the flow like network stack manages TCP state machine changes.
 
 According to draft-culley-iwarp-mpa-03.txt this layer can do a lot of
 things with valid TCP flow like
 
5.  The TCP sender puts the FPDUs into the TCP stream.  If the TCP
Sender is MPA-aware, it segments the TCP stream in such a way
that a TCP Segment boundary is also the boundary of an FPDU.  
TCP then passes each segment to the IP layer for transmission.
 
 Phrases like MPA-aware TCP rises a lot of questions - briefly saying
 that hardware (even if it is called ethernet driver) can create and work
 with own TCP flows potentially modified in the way it likes which is seen 
 in driver. Likely such flows will not be seen by upper layers like OS 
 network stack according to hardware descriptions.
 
 Is it correct?
 

I don't quite get your point about the driver aspect of this?

The HW manages the iWARP connection including data flow.  It adheres to
the MPA, RDDP, and RDMAP protocol specification IDs from the IETF.  The
HW manages how data gets pushed out in the RDMA stream.   The RDMA
Driver just requests a TCP connection and does the MPA exchange.  Then
tells the hardware to move the connection into RDMA mode.  From that
point on, the driver simply suffles IO work requests from the consumer
application to the hardware and handles asynchronous events while the
connection is up and running.

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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 18:27 +0300, Evgeniy Polyakov wrote:
 On Tue, Dec 05, 2006 at 09:14:36AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
  Chelsio doesn't implement TCP stack in the driver.  Just like Ammasso,
  it sends messages to the HW to setup connections.  It differs from
  Ammasso in at least 2 ways:
  
  1) Ammasso does the MPA negotiations in FW/HW.  Chelsio does it in the
  RDMA driver.  So there is code in the Chelsio driver to handle MPA
  startup negotiation (the exchange of 2 packets over the TCP connection
  while its still in streaming more).  BTW: This code _could_ be moved
  into the core IWCM if we find it could be used by other rnic devices
  (don't know yet).
  
  2) Ammasso implments a 100% deep adapter.  It does ARP, routing, IP,
  TCP, and IWARP protocols all in firmware/hw.  It had 2 mac addresses
  simulating 2 ethernet ports.  One exclusively for RDMA connections, and
  one for host stack traffic.  Chelsio implements a shallower adapter that
  only does TCP in HW.  ARP, for instance, is handled by the native stack
  and the rdma driver uses netevents to maintain arp tables in the HW for
  use by the offloaded TCP connections.
 
 So breifly saying - there is TCP stack implementation (including ARP and
 routing and other parts) in hardware/firmware/driver which is guaranteed
 to not be visible to host other than in form of high-level dataflow.
 Am I right here?

For Ammasso, yes.  

-
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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 09:39:58AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
  Phrases like MPA-aware TCP rises a lot of questions - briefly saying
  that hardware (even if it is called ethernet driver) can create and work
  with own TCP flows potentially modified in the way it likes which is seen 
  in driver. Likely such flows will not be seen by upper layers like OS 
  network stack according to hardware descriptions.
  
  Is it correct?
  
 
 I don't quite get your point about the driver aspect of this?
 
 The HW manages the iWARP connection including data flow.  It adheres to
 the MPA, RDDP, and RDMAP protocol specification IDs from the IETF.  The
 HW manages how data gets pushed out in the RDMA stream.   The RDMA
 Driver just requests a TCP connection and does the MPA exchange.  Then
 tells the hardware to move the connection into RDMA mode.  From that
 point on, the driver simply suffles IO work requests from the consumer
 application to the hardware and handles asynchronous events while the
 connection is up and running.

My main concern about this is the fact, that protocol handling is
splitted into SF and HW parts, and actually until negotiation is
completed those parts are completely unrelated to each other, so
requested TCP connection can leak into main stack and main stack can
send some packets which can be considered as MPA negotiation.

 Steve.

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 11:45 +0100, Brice Goglin wrote:
 Steve Wise wrote:
  There is no SW TCP stack in this driver.  The HW supports RDMA over
  TCP/IP/10GbE in HW and this is required for zero-copy RDMA over Ethernet
  (aka iWARP).  The device is a 10 GbE device, not Infiniband.
 
 Then, I wonder why the driver goes in drivers/infiniband/ :)

drivers/infiniband support both IB and IWARP transports.

 Is there really no way to only keep the actual hw infiniband there, move
 iwarp/rdma drivers in drivers/net/something/ and the core stuff in
 net/something/ ?
 

Sure, this _could_ be done, but what I think you're missing is that
applications use the interface exported by drivers/infiniband over both
IB -and- IWARP transports.  The application can be written to not care
which transport is used.   Examples of apps that can run over both
transports using the same common interface: 

user mode: MVAPICH2, OMPI, IMPI, HPMPI, 
kernel mode: NFS-RDMA, iSER.  

Note that the include directory used by drivers/infiniband is now
include/rdma.  Perhaps drivers/infiniband should be renamed to
drivers/rdma as well at some point...



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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 18:59 +0300, Evgeniy Polyakov wrote:
 On Tue, Dec 05, 2006 at 09:39:58AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
   Phrases like MPA-aware TCP rises a lot of questions - briefly saying
   that hardware (even if it is called ethernet driver) can create and work
   with own TCP flows potentially modified in the way it likes which is seen 
   in driver. Likely such flows will not be seen by upper layers like OS 
   network stack according to hardware descriptions.
   
   Is it correct?
   
  
  I don't quite get your point about the driver aspect of this?
  
  The HW manages the iWARP connection including data flow.  It adheres to
  the MPA, RDDP, and RDMAP protocol specification IDs from the IETF.  The
  HW manages how data gets pushed out in the RDMA stream.   The RDMA
  Driver just requests a TCP connection and does the MPA exchange.  Then
  tells the hardware to move the connection into RDMA mode.  From that
  point on, the driver simply suffles IO work requests from the consumer
  application to the hardware and handles asynchronous events while the
  connection is up and running.
 
 My main concern about this is the fact, that protocol handling is
 splitted into SF and HW parts, and actually until negotiation is
 completed those parts are completely unrelated to each other, so
 requested TCP connection can leak into main stack and main stack can
 send some packets which can be considered as MPA negotiation.
 

Ah.  Data from an offloaded connection cannot leak into the main stack
nor vice-verse.  We can take an active RDMA connection establishment as
an example if you want:  Once the message is sent to the HW to setup a
TCP connection from addr/port a.b to addr/port c.d, then packets on
that connection (that 4-tuple) will always be delivered to the RDMA
driver, not the native stack.  If the the packet received after the
connection is setup is -not- an MPA reply (in this example), then the
connection is aborted.  Once the connection is aborted.  So no leaking
can happen.





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


Re: [openib-general] [PATCH v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 10:12 -0600, Steve Wise wrote:
 On Tue, 2006-12-05 at 18:59 +0300, Evgeniy Polyakov wrote:
  On Tue, Dec 05, 2006 at 09:39:58AM -0600, Steve Wise ([EMAIL PROTECTED]) 
  wrote:
Phrases like MPA-aware TCP rises a lot of questions - briefly saying
that hardware (even if it is called ethernet driver) can create and work
with own TCP flows potentially modified in the way it likes which is 
seen 
in driver. Likely such flows will not be seen by upper layers like OS 
network stack according to hardware descriptions.

Is it correct?

   
   I don't quite get your point about the driver aspect of this?
   
   The HW manages the iWARP connection including data flow.  It adheres to
   the MPA, RDDP, and RDMAP protocol specification IDs from the IETF.  The
   HW manages how data gets pushed out in the RDMA stream.   The RDMA
   Driver just requests a TCP connection and does the MPA exchange.  Then
   tells the hardware to move the connection into RDMA mode.  From that
   point on, the driver simply suffles IO work requests from the consumer
   application to the hardware and handles asynchronous events while the
   connection is up and running.
  
  My main concern about this is the fact, that protocol handling is
  splitted into SF and HW parts, and actually until negotiation is
  completed those parts are completely unrelated to each other, so
  requested TCP connection can leak into main stack and main stack can
  send some packets which can be considered as MPA negotiation.
  
 
 Ah.  Data from an offloaded connection cannot leak into the main stack
 nor vice-verse.  We can take an active RDMA connection establishment as
 an example if you want:  Once the message is sent to the HW to setup a
 TCP connection from addr/port a.b to addr/port c.d, then packets on
 that connection (that 4-tuple) will always be delivered to the RDMA
 driver, not the native stack.  If the the packet received after the
 connection is setup is -not- an MPA reply (in this example), then the
 connection is aborted.  Once the connection is aborted.  
   ^ the 4 tuple can
then be reused for rdma or native stack tcp connections.



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


Re: [openib-general] [PATCH v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 10:02 -0600, Steve Wise wrote:
 On Tue, 2006-12-05 at 11:45 +0100, Brice Goglin wrote:
  Steve Wise wrote:
   There is no SW TCP stack in this driver.  The HW supports RDMA over
   TCP/IP/10GbE in HW and this is required for zero-copy RDMA over Ethernet
   (aka iWARP).  The device is a 10 GbE device, not Infiniband.
  
  Then, I wonder why the driver goes in drivers/infiniband/ :)
 
 drivers/infiniband support both IB and IWARP transports.
 
  Is there really no way to only keep the actual hw infiniband there, move
  iwarp/rdma drivers in drivers/net/something/ and the core stuff in
  net/something/ ?
  
 
 Sure, this _could_ be done, but what I think you're missing is that
 applications use the interface exported by drivers/infiniband over both
 IB -and- IWARP transports.  The application can be written to not care
 which transport is used.   Examples of apps that can run over both
 transports using the same common interface: 
 
 user mode: MVAPICH2, OMPI, IMPI, HPMPI, 
 kernel mode: NFS-RDMA, iSER.  
 
 Note that the include directory used by drivers/infiniband is now
 include/rdma.  Perhaps drivers/infiniband should be renamed to
 drivers/rdma as well at some point...


By the way, FYI:  The Chelsio T3 device support is split into 2 driver
modules: the Ethernet driver and the RDMA driver.  The Ethernet driver
lives in drivers/net/cxgb3 while the RDMA driver lives in
drivers/infiniband/hw/cxgb3.  The Ethernet driver can be used
stand-alone as a 10GbE high-performance NIC driver.  The RDMA driver has
a config-time dependency on the Ethernet driver.

The 2nd version of the Ethernet driver was posted yesterday.  See:

http://www.spinics.net/lists/netdev/msg20464.html



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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 10:12:42AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
 Ah.  Data from an offloaded connection cannot leak into the main stack
 nor vice-verse.  We can take an active RDMA connection establishment as
 an example if you want:  Once the message is sent to the HW to setup a
 TCP connection from addr/port a.b to addr/port c.d, then packets on
 that connection (that 4-tuple) will always be delivered to the RDMA
 driver, not the native stack.  If the the packet received after the
 connection is setup is -not- an MPA reply (in this example), then the
 connection is aborted.  Once the connection is aborted.  So no leaking
 can happen.
 
And if there were a dataflow between addr/port a.b to addr/port c.d
already, it will either terminated?

Considering the following sequence:
handlers-t3c_handlers-sched()-work_queue-work_handlers()-for
example CPL_PASS_ACCEPT_REQ-pass_accept_req() - it just parses incoming
skb and sets port/addr/route and other fields to be used as a base for rdma
connection. What if it just a usual network packet from kernelspace or 
userspace with the same payload as should be sent by remote rdma system?

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 19:31 +0300, Evgeniy Polyakov wrote:
 On Tue, Dec 05, 2006 at 10:12:42AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
  Ah.  Data from an offloaded connection cannot leak into the main stack
  nor vice-verse.  We can take an active RDMA connection establishment as
  an example if you want:  Once the message is sent to the HW to setup a
  TCP connection from addr/port a.b to addr/port c.d, then packets on
  that connection (that 4-tuple) will always be delivered to the RDMA
  driver, not the native stack.  If the the packet received after the
  connection is setup is -not- an MPA reply (in this example), then the
  connection is aborted.  Once the connection is aborted.  So no leaking
  can happen.
  
 And if there were a dataflow between addr/port a.b to addr/port c.d
 already, it will either terminated?
 
 Considering the following sequence:
 handlers-t3c_handlers-sched()-work_queue-work_handlers()-for
 example CPL_PASS_ACCEPT_REQ-pass_accept_req() - it just parses incoming
 skb and sets port/addr/route and other fields to be used as a base for rdma
 connection. What if it just a usual network packet from kernelspace or 
 userspace with the same payload as should be sent by remote rdma system?
 

That skb isn't a network packet.  Its a CPL_PASS_ACCEPT_REQ message (see
struct cpl_pass_accept_req in the Ethernet driver t3_cpl.h).  If the
RDMA driver hadn't registered to listen on that addr/port, it would
never get this skb.  Once a connection is established, the MPA messages
(and any TCP payload data) is delivered to the RDMA driver in the form
of skb's containing struct cpl_rx_data.  So these skbs aren't just TCP
packets at all.  They either control messages or TCP payload. Either way
they are encapsulated in CPL message structures.

Does this make sense?



-
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 v2 04/13] Connection Manager

2006-12-05 Thread Roland Dreier
  Is there really no way to only keep the actual hw infiniband there, move
  iwarp/rdma drivers in drivers/net/something/ and the core stuff in
  net/something/ ?

It's definitely possible, but rearranging the source tree hasn't been
a high priority (for me at least).

 - R.
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 10:47:25AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
  And if there were a dataflow between addr/port a.b to addr/port c.d
  already, it will either terminated?
  
  Considering the following sequence:
  handlers-t3c_handlers-sched()-work_queue-work_handlers()-for
  example CPL_PASS_ACCEPT_REQ-pass_accept_req() - it just parses incoming
  skb and sets port/addr/route and other fields to be used as a base for rdma
  connection. What if it just a usual network packet from kernelspace or 
  userspace with the same payload as should be sent by remote rdma system?
  
 
 That skb isn't a network packet.  Its a CPL_PASS_ACCEPT_REQ message (see
 struct cpl_pass_accept_req in the Ethernet driver t3_cpl.h).  If the
 RDMA driver hadn't registered to listen on that addr/port, it would
 never get this skb.  Once a connection is established, the MPA messages
 (and any TCP payload data) is delivered to the RDMA driver in the form
 of skb's containing struct cpl_rx_data.  So these skbs aren't just TCP
 packets at all.  They either control messages or TCP payload. Either way
 they are encapsulated in CPL message structures.
 
 Does this make sense?
 
Almost - except the case about where those skbs are coming from?
It looks like they are obtained from network, since it is ethernet
driver, and if they match some set of rules, they are considered as valid 
MPA negotiation protocol.

If it is correct, it means that any packet in the network can be
potentially 'stolen' by rdma hardware, although it was part of the usual
dataflow. 
If that packets are not from ethernet network, but from different
low-level, then there is a question (besides why this driver is called
ethernet if it manages different hardware) about how connection over
that different media is being setup and since packets contain perfectly
valid IP addresses and ports.

And, btw, not related question - does postponing the whole skb multiplexing 
to work queue result in lower latency and/or higher speed?
Since there are a lot of tricks introduced to minimize gap between
interrupt/napi polling and protocol processing, so such huge postponing
with the whole context switch looks strange.

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 08:26:49PM +0300, Evgeniy Polyakov ([EMAIL PROTECTED]) 
wrote:
 On Tue, Dec 05, 2006 at 10:47:25AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
   And if there were a dataflow between addr/port a.b to addr/port c.d
   already, it will either terminated?
   
   Considering the following sequence:
   handlers-t3c_handlers-sched()-work_queue-work_handlers()-for
   example CPL_PASS_ACCEPT_REQ-pass_accept_req() - it just parses incoming
   skb and sets port/addr/route and other fields to be used as a base for 
   rdma
   connection. What if it just a usual network packet from kernelspace or 
   userspace with the same payload as should be sent by remote rdma system?
   
  
  That skb isn't a network packet.  Its a CPL_PASS_ACCEPT_REQ message (see
  struct cpl_pass_accept_req in the Ethernet driver t3_cpl.h).  If the
  RDMA driver hadn't registered to listen on that addr/port, it would
  never get this skb.  Once a connection is established, the MPA messages
  (and any TCP payload data) is delivered to the RDMA driver in the form
  of skb's containing struct cpl_rx_data.  So these skbs aren't just TCP
  packets at all.  They either control messages or TCP payload. Either way
  they are encapsulated in CPL message structures.
  
  Does this make sense?
  
 Almost - except the case about where those skbs are coming from?
 It looks like they are obtained from network, since it is ethernet
 driver, and if they match some set of rules, they are considered as valid 
 MPA negotiation protocol.
 
 If it is correct, it means that any packet in the network can be
 potentially 'stolen' by rdma hardware, although it was part of the usual
 dataflow. 
 If that packets are not from ethernet network, but from different
 low-level, then there is a question (besides why this driver is called
 ethernet if it manages different hardware) about how connection over
 that different media is being setup and since packets contain perfectly
 valid IP addresses and ports.

It looks like I've answered myself - it is _not_ ethernet driver, but
rdma one, and although it gets all data through skbs from ethernet
driver, the latter gets them not from ethernet network.
And thus addresses and ports and all other information can not be mixed
between the two.

-- 
Evgeniy Polyakov
-
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 v2 04/13] Connection Manager

2006-12-05 Thread Steve Wise
On Tue, 2006-12-05 at 20:26 +0300, Evgeniy Polyakov wrote:
 On Tue, Dec 05, 2006 at 10:47:25AM -0600, Steve Wise ([EMAIL PROTECTED]) 
 wrote:
   And if there were a dataflow between addr/port a.b to addr/port c.d
   already, it will either terminated?
   
   Considering the following sequence:
   handlers-t3c_handlers-sched()-work_queue-work_handlers()-for
   example CPL_PASS_ACCEPT_REQ-pass_accept_req() - it just parses incoming
   skb and sets port/addr/route and other fields to be used as a base for 
   rdma
   connection. What if it just a usual network packet from kernelspace or 
   userspace with the same payload as should be sent by remote rdma system?
   
  
  That skb isn't a network packet.  Its a CPL_PASS_ACCEPT_REQ message (see
  struct cpl_pass_accept_req in the Ethernet driver t3_cpl.h).  If the
  RDMA driver hadn't registered to listen on that addr/port, it would
  never get this skb.  Once a connection is established, the MPA messages
  (and any TCP payload data) is delivered to the RDMA driver in the form
  of skb's containing struct cpl_rx_data.  So these skbs aren't just TCP
  packets at all.  They either control messages or TCP payload. Either way
  they are encapsulated in CPL message structures.
  
  Does this make sense?
  
 Almost - except the case about where those skbs are coming from?
 It looks like they are obtained from network, since it is ethernet
 driver, and if they match some set of rules, they are considered as valid 
 MPA negotiation protocol.

They come from the Ethernet driver, but that driver manages multiple HW
queues and these packets come from an offload queue, not the NIC queue.
So the HW demultiplexes.

Perhaps Divy or Felix from Chelsio can expand on how the Ethernet driver
manages this?

 
 If it is correct, it means that any packet in the network can be
 potentially 'stolen' by rdma hardware, although it was part of the usual
 dataflow. 
 If that packets are not from ethernet network, but from different
 low-level, then there is a question (besides why this driver is called
 ethernet if it manages different hardware) about how connection over
 that different media is being setup and since packets contain perfectly
 valid IP addresses and ports.

The HW has different queues for offload vs native Ethernet frames.  I'm
not an expert on the Ethernet driver, so you'll have to consult that
code and ask questions of Divy and/or Felix.

 And, btw, not related question - does postponing the whole skb multiplexing 
 to work queue result in lower latency and/or higher speed?
 Since there are a lot of tricks introduced to minimize gap between
 interrupt/napi polling and protocol processing, so such huge postponing
 with the whole context switch looks strange.
 

Neither.   The work queue makes the RDMA driver's life easier because it
has context to allocate skbs, for instance.  Note all the work queue
stuff is done _only_ for RDMA connection setup and teardown.  Once the
connection is in RDMA mode, there's no work queues at all for IO, and CQ
notifications happen in interrupt context.  RDMA operations are
submitted to the hardware via iwch_post_send().  Completion notification
is done in the interrupt context via iwch_ev_dispatch().  And completion
entries reaped by the consumer application via iwch_poll_cq().


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 v2 04/13] Connection Manager

2006-12-05 Thread Evgeniy Polyakov
On Tue, Dec 05, 2006 at 11:51:40AM -0600, Steve Wise ([EMAIL PROTECTED]) wrote:
  Almost - except the case about where those skbs are coming from?
  It looks like they are obtained from network, since it is ethernet
  driver, and if they match some set of rules, they are considered as valid 
  MPA negotiation protocol.
 
 They come from the Ethernet driver, but that driver manages multiple HW
 queues and these packets come from an offload queue, not the NIC queue.
 So the HW demultiplexes.

Ok, thanks for explaination.

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


Re: [PATCH] Add Broadcom PHY support

2006-12-05 Thread Andy Fleming


On Dec 5, 2006, at 00:03, Benjamin Herrenschmidt wrote:



I believe that this fiber enabling can be done by defining  
config_init in the phy_driver struct.


struct phy_driver {
snip
/* Called to initialize the PHY,
 * including after a reset */
int (*config_init)(struct phy_device *phydev);
snip
};


Well... I don't know for sure... thing is, enabling the fiber mode  
is a
rather platform specific thing. So it's the MAC driver that knows  
wether

it wants it on a PHY and should call into the driver.

It's difficult to abstract all possible PHY config options tho... some
MACs might want to enable low power, some don't because they have  
issues

with it, that sort of thing, though.

Not sure what the best solution is at this point... Maybe an ascii
string to pass the PHY driver is the most flexible, though a bit  
yucky,

or we try to have a list of all the possible configuration options in
phy.h and people just add new ones that they need as they add support
for them...

Sounds grossly like an in-kernel ioctl tho...



Each phy_device structure now has a dev_flags field that can be  
modified by the controller's code upon connecting.  The PHY driver  
can then check that field for PHY-specific, platform-specific  
interactions.  For instance, on the newer CDS, there's a Marvell PHY  
which requires configurable resistance changes to work in RGMII  
mode.  So there's a flag for that.  Basically, each PHY driver  
specifies its own flags, and the platform code is currently  
responsible for setting those flags appropriately.  A string might be  
more flexible, but I'm operating on the hope that there shouldn't be  
too many of these.


For Fiber mode, or other such changes, we might want to add another  
field, like the interface field, to describe standard external  
interfaces.  The call to phy_connect() is beginning to get a bit  
long, though.


Andy
-
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] rfkill - Add support for input key to control wireless radio

2006-12-05 Thread Ivo van Doorn
On Tuesday 05 December 2006 11:32, Christoph Hellwig wrote:
  +/*
  + * Function called by the key driver when the rfkill structure
  + * needs to be registered.
  + */
  +int rfkill_register_key(struct rfkill *rfkill, int init_status)
  +{
  +   struct rfkill_type *type = master-type[rfkill-key_type];
  +   struct rfkill_key *key;
  +   int status;
  +
  +   if (!rfkill)
  +   return -EINVAL; 
  +
  +   if (rfkill-key_type = KEY_TYPE_MAX)
  +   return -EINVAL;
  +
  +   /*
  +* Increase module use count to prevent this
  +* module to be unloaded while there are still
  +* registered keys.
  +*/
  +   if (!try_module_get(THIS_MODULE))
  +   return -EBUSY;
 
 This is obviously broken.  Please add a struct module *owner;
 field to struct rfkill instead.

Thanks, will fix this asap.

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: [RFC] rfkill - Add support for input key to control wireless radio

2006-12-05 Thread Ivo van Doorn
[snip]
 
  +/*
  + * Function called by the key driver to report the new status
  + * of the key.
  + */
  +void rfkill_report_event(struct rfkill *rfkill, int new_status)
  +{
  +   mutex_lock(master-mutex);
  +
  +   if (rfkill_check_key(rfkill-key, new_status))
  +   schedule_work(master-toggle_work);
  +
  +   mutex_unlock(master-mutex);
  +}
  +EXPORT_SYMBOL_GPL(rfkill_report_event);
 
 Please use kernel-doc notation for non-static functions.
 See Documentation/kernel-doc-nano-HOWTO.txt for more info.

All kernel-doc notations were placed in the rfkill.h header.
I'll move them to the rfkill.c file.


[snip]

  + * @rfkill: rfkill structure to be deregistered
  + * @init_status: initial status of the key at the time this function is 
  called
  + *
  + * This function should be called by the key driver when the rfkill 
  structure
  + * needs to be registered. Immediately from registration the key driver
  + * should be able to receive calls through the poll, enable_radio and
  + * disable_radio handlers if those were registered.
  + */
  +int rfkill_register_key(struct rfkill *rfkill, int init_status);
  +
  +/**
  + * rfkill_deregister_key - Deregister a previously registered rfkill 
  structre.
 
 structure

Thanks for the pointers. I'll fix them asap.

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


2.6.19-rc6-mm2: Network device naming starts at 1 instead of 0

2006-12-05 Thread Auke Kok

[resend]

Quick note: I loaded up 2.6.19-rc6-mm2 on a platform here and noticed that the 
onboard
e1000 NIC was enumerated to eth1 instead of eth0. on 2.6.18.5 and any other 
kernel I
used before, it was properly named eth0 after startup. eth0 itself is 
completely missing
(-ENODEV).

I'll try to see if I can point out the culprit, but perhaps this rings a bell 
to anyone.

Cheers,

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: 2.6.19-rc6-mm2: Network device naming starts at 1 instead of 0

2006-12-05 Thread Rafael J. Wysocki
On Tuesday, 5 December 2006 23:07, Auke Kok wrote:
 [resend]
 
 Quick note: I loaded up 2.6.19-rc6-mm2 on a platform here and noticed that 
 the onboard
 e1000 NIC was enumerated to eth1 instead of eth0. on 2.6.18.5 and any other 
 kernel I
 used before, it was properly named eth0 after startup. eth0 itself is 
 completely missing
 (-ENODEV).
 
 I'll try to see if I can point out the culprit, but perhaps this rings a bell 
 to anyone.

Please try to revert

gregkh-driver-driver-core-fixes-sysfs_create_link-retval-checks-in-core.c.patch

I had some similar problems that went away after I had reverted it.

Greetings,
Rafael


-- 
If you don't have the time to read,
you don't have the time or the tools to write.
- Stephen King
-
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] zd1211rw-d80211: check IEEE80211_TXCTL_USE_CTS_PROTECT

2006-12-05 Thread Michael Wu
zd1211rw-d80211: check IEEE80211_TXCTL_USE_CTS_PROTECT

This makes zd1211 check for IEEE80211_TXCTL_USE_CTS_PROTECT and set things
appropriately in the hardware TX header.

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

 drivers/net/wireless/d80211/zd1211rw/zd_mac.c |   14 +-
 1 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/drivers/net/wireless/d80211/zd1211rw/zd_mac.c 
b/drivers/net/wireless/d80211/zd1211rw/zd_mac.c
index dde972d..a76fa6a 100644
--- a/drivers/net/wireless/d80211/zd1211rw/zd_mac.c
+++ b/drivers/net/wireless/d80211/zd1211rw/zd_mac.c
@@ -248,15 +248,11 @@ static void cs_set_control(struct zd_mac
if ((fctl  IEEE80211_FCTL_STYPE) == IEEE80211_STYPE_PSPOLL)
cs-control |= ZD_CS_PS_POLL_FRAME;
 
-   if (flags  IEEE80211_TXCTL_USE_RTS_CTS) {
-   /* FIXME: check the logic */
-   if (ZD_CS_TYPE(cs-modulation) == ZD_CS_OFDM) {
-   /* 802.11g */
-   cs-control |= ZD_CS_SELF_CTS;
-   } else { /* 802.11b */
-   cs-control |= ZD_CS_RTS;
-   }
-   }
+   if (flags  IEEE80211_TXCTL_USE_RTS_CTS)
+   cs-control |= ZD_CS_RTS;
+
+   if (flags  IEEE80211_TXCTL_USE_CTS_PROTECT)
+   cs-control |= ZD_CS_SELF_CTS;
 
/* FIXME: Management frame? */
 }


pgpBccSMwivY3.pgp
Description: PGP signature


[PATCH 0/7] chelsio: lightweight review

2006-12-05 Thread Francois Romieu
The serie applies against netdev-2.6#upstream-linus or linux-2.6#master

Patches have been compiled. No further test.

It is available as:

git://electric-eye.fr.zoreil.com/home/romieu/linux-2.6.git#chelsio

Former 'chelsio' branch is archived as 'chelsio-20061206'.


Distance from 'master' (e62438630ca37539c8cc1553710bbfaa3cf960a7)
-

c021b7a9f2dcb8867f513983c42049b46bc97999
e9c87a1d5674c56a33288177913b27911cefc7a3
b335493ac99e2a4c716e597d6a11108fc670db90
4cf12df7a8e19339038f4e7952abf85554733916
89e9d8ea4fbd032872e0a96b3f455b9de912b1f6
3c086dfee287469d5ee7b860eaec9be56b4ef0ef
9b59cb170afa01d1dd86383c5178b9c306dbd275

Diffstat


 drivers/net/chelsio/common.h|2 
 drivers/net/chelsio/cpl5_cmd.h  |   18 ++--
 drivers/net/chelsio/cxgb2.c |  161 ++---
 drivers/net/chelsio/elmer0.h|   40 +
 drivers/net/chelsio/espi.c  |   44 +-
 drivers/net/chelsio/fpga_defs.h |6 +
 drivers/net/chelsio/gmac.h  |   11 ++
 drivers/net/chelsio/ixf1010.c   |   13 ++-
 drivers/net/chelsio/mv88e1xxx.c |   27 +++---
 drivers/net/chelsio/my3126.c|   16 ++--
 drivers/net/chelsio/pm3393.c|8 +-
 drivers/net/chelsio/sge.c   |  172 ++-
 drivers/net/chelsio/subr.c  |   89 ++--
 drivers/net/chelsio/tp.c|   62 +++---
 drivers/net/chelsio/vsc7326.c   |   75 -
 drivers/net/chelsio/vsc8244.c   |   41 +
 16 files changed, 388 insertions(+), 397 deletions(-)

Shortlog


Francois Romieu:
  chelsio: move return, break and continue statements on their own line
  chelsio: the return statement is not a function
  chelsio: spaces, tabs and friends
  chelsio: use netdev_priv
  chelsio: useless curly braces
  chelsio: useless test in cxgb2::remove_one
  chelsio: misc cleanups in sge

Patch
-

See following messages.

-- 
Ueimor
-
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/7] chelsio: spaces, tabs and friends

2006-12-05 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/common.h|2 +-
 drivers/net/chelsio/cpl5_cmd.h  |   18 +++---
 drivers/net/chelsio/cxgb2.c |   64 +++---
 drivers/net/chelsio/elmer0.h|   40 +++---
 drivers/net/chelsio/espi.c  |   41 +++---
 drivers/net/chelsio/fpga_defs.h |6 +-
 drivers/net/chelsio/gmac.h  |   11 +++-
 drivers/net/chelsio/ixf1010.c   |4 +-
 drivers/net/chelsio/mv88e1xxx.c |   17 +++
 drivers/net/chelsio/pm3393.c|8 ++--
 drivers/net/chelsio/sge.c   |  115 ---
 drivers/net/chelsio/subr.c  |   83 ++--
 drivers/net/chelsio/tp.c|   62 ++---
 drivers/net/chelsio/vsc7326.c   |   57 ++--
 drivers/net/chelsio/vsc8244.c   |   38 ++---
 15 files changed, 283 insertions(+), 283 deletions(-)

diff --git a/drivers/net/chelsio/common.h b/drivers/net/chelsio/common.h
index b265941..7000c52 100644
--- a/drivers/net/chelsio/common.h
+++ b/drivers/net/chelsio/common.h
@@ -324,7 +324,7 @@ struct board_info {
unsigned char   mdio_phybaseaddr;
struct gmac*gmac;
struct gphy*gphy;
-   struct mdio_ops*mdio_ops;
+   struct mdio_ops*mdio_ops;
const char *desc;
 };
 
diff --git a/drivers/net/chelsio/cpl5_cmd.h b/drivers/net/chelsio/cpl5_cmd.h
index 35f565b..e36d45b 100644
--- a/drivers/net/chelsio/cpl5_cmd.h
+++ b/drivers/net/chelsio/cpl5_cmd.h
@@ -103,7 +103,7 @@ enum CPL_opcode {
CPL_MIGRATE_C2T_RPL   = 0xDD,
CPL_ERROR = 0xD7,
 
-/* internal: driver - TOM */
+   /* internal: driver - TOM */
CPL_MSS_CHANGE= 0xE1
 };
 
@@ -159,8 +159,8 @@ enum {// TX_PKT_LSO ethe
 };
 
 union opcode_tid {
-u32 opcode_tid;
-u8 opcode;
+   u32 opcode_tid;
+   u8 opcode;
 };
 
 #define S_OPCODE 24
@@ -234,7 +234,7 @@ struct cpl_pass_accept_req {
u32 local_ip;
u32 peer_ip;
u32 tos_tid;
-struct tcp_options tcp_options;
+   struct tcp_options tcp_options;
u8  dst_mac[6];
u16 vlan_tag;
u8  src_mac[6];
@@ -250,12 +250,12 @@ struct cpl_pass_accept_rpl {
u32 peer_ip;
u32 opt0h;
union {
-   u32 opt0l;
-   struct {
-   u8 rsvd[3];
-   u8 status;
+   u32 opt0l;
+   struct {
+   u8 rsvd[3];
+   u8 status;
+   };
};
-};
 };
 
 struct cpl_act_open_req {
diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 53bec67..cb639d4 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -69,14 +69,14 @@ static inline void cancel_mac_stats_upda
cancel_delayed_work(ap-stats_update_task);
 }
 
-#define MAX_CMDQ_ENTRIES 16384
-#define MAX_CMDQ1_ENTRIES 1024
-#define MAX_RX_BUFFERS 16384
-#define MAX_RX_JUMBO_BUFFERS 16384
+#define MAX_CMDQ_ENTRIES   16384
+#define MAX_CMDQ1_ENTRIES  1024
+#define MAX_RX_BUFFERS 16384
+#define MAX_RX_JUMBO_BUFFERS   16384
 #define MAX_TX_BUFFERS_HIGH16384U
 #define MAX_TX_BUFFERS_LOW 1536U
 #define MAX_TX_BUFFERS 1460U
-#define MIN_FL_ENTRIES 32
+#define MIN_FL_ENTRIES 32
 
 #define DFLT_MSG_ENABLE (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK | \
 NETIF_MSG_TIMER | NETIF_MSG_IFDOWN | NETIF_MSG_IFUP |\
@@ -143,7 +143,7 @@ static void link_report(struct port_info
case SPEED_100:   s = 100Mbps; break;
}
 
-   printk(KERN_INFO %s: link up, %s, %s-duplex\n,
+   printk(KERN_INFO %s: link up, %s, %s-duplex\n,
   p-dev-name, s,
   p-link_config.duplex == DUPLEX_FULL ? full : half);
}
@@ -234,7 +234,7 @@ static int cxgb_up(struct adapter *adapt
 
t1_sge_start(adapter-sge);
t1_interrupts_enable(adapter);
- out_err:
+out_err:
return err;
 }
 
@@ -750,7 +750,7 @@ static int set_sge_param(struct net_devi
return -EINVAL;
 
if (adapter-flags  FULL_INIT_DONE)
-   return -EBUSY;
+   return -EBUSY;
 
adapter-params.sge.freelQ_size[!jumbo_fl] = e-rx_pending;
adapter-params.sge.freelQ_size[jumbo_fl] = e-rx_jumbo_pending;
@@ -776,7 +776,7 @@ static int set_coalesce(struct net_devic
} else {
adapter-params.sge.rx_coalesce_usecs = c-rx_coalesce_usecs;
}
-   adapter-params.sge.coalesce_enable = c-use_adaptive_rx_coalesce;
+   adapter-params.sge.coalesce_enable = c-use_adaptive_rx_coalesce;
adapter-params.sge.sample_interval_usecs = c-rate_sample_interval;
t1_sge_set_coalesce_params(adapter-sge, adapter-params.sge);
return 0;
@@ -794,9 +794,9 @@ static int get_coalesce(struct net_devic
 
 static int 

[PATCH 4/7] chelsio: use netdev_priv

2006-12-05 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/cxgb2.c |   60 +-
 drivers/net/chelsio/sge.c   |4 +-
 2 files changed, 32 insertions(+), 32 deletions(-)

diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index cb639d4..15be058 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -120,7 +120,7 @@ static const char pci_speed[][4] = {
  */
 static void t1_set_rxmode(struct net_device *dev)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct cmac *mac = adapter-port[dev-if_port].mac;
struct t1_rx_mode rm;
 
@@ -253,7 +253,7 @@ static void cxgb_down(struct adapter *ad
 static int cxgb_open(struct net_device *dev)
 {
int err;
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
int other_ports = adapter-open_device_map  PORT_MASK;
 
if (!adapter-open_device_map  (err = cxgb_up(adapter))  0)
@@ -270,7 +270,7 @@ static int cxgb_open(struct net_device *
 
 static int cxgb_close(struct net_device *dev)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
struct cmac *mac = p-mac;
 
@@ -295,7 +295,7 @@ static int cxgb_close(struct net_device
 
 static struct net_device_stats *t1_get_stats(struct net_device *dev)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
struct net_device_stats *ns = p-netstats;
const struct cmac_statistics *pstats;
@@ -343,14 +343,14 @@ static struct net_device_stats *t1_get_s
 
 static u32 get_msglevel(struct net_device *dev)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
 
return adapter-msg_enable;
 }
 
 static void set_msglevel(struct net_device *dev, u32 val)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
 
adapter-msg_enable = val;
 }
@@ -428,7 +428,7 @@ static int get_regs_len(struct net_devic
 
 static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
 
strcpy(info-driver, DRV_NAME);
strcpy(info-version, DRV_VERSION);
@@ -450,7 +450,7 @@ static void get_strings(struct net_devic
 static void get_stats(struct net_device *dev, struct ethtool_stats *stats,
  u64 *data)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct cmac *mac = adapter-port[dev-if_port].mac;
const struct cmac_statistics *s;
const struct sge_intr_counts *t;
@@ -538,7 +538,7 @@ static inline void reg_block_dump(struct
 static void get_regs(struct net_device *dev, struct ethtool_regs *regs,
 void *buf)
 {
-   struct adapter *ap = dev-priv;
+   struct adapter *ap = netdev_priv(dev);
 
/*
 * Version scheme: bits 0..9: chip version, bits 10..15: chip revision
@@ -560,7 +560,7 @@ static void get_regs(struct net_device *
 
 static int get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
 
cmd-supported = p-link_config.supported;
@@ -620,7 +620,7 @@ static int speed_duplex_to_caps(int spee
 
 static int set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
struct link_config *lc = p-link_config;
 
@@ -655,7 +655,7 @@ static int set_settings(struct net_devic
 static void get_pauseparam(struct net_device *dev,
   struct ethtool_pauseparam *epause)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
 
epause-autoneg = (p-link_config.requested_fc  PAUSE_AUTONEG) != 0;
@@ -666,7 +666,7 @@ static void get_pauseparam(struct net_de
 static int set_pauseparam(struct net_device *dev,
  struct ethtool_pauseparam *epause)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
struct port_info *p = adapter-port[dev-if_port];
struct link_config *lc = p-link_config;
 
@@ -695,14 +695,14 @@ static int set_pauseparam(struct net_dev
 
 static u32 get_rx_csum(struct net_device *dev)
 {
-   struct adapter *adapter = dev-priv;
+   struct adapter *adapter = netdev_priv(dev);
 
return (adapter-flags  

[PATCH 1/7] chelsio: move return, break and continue statements on their own line

2006-12-05 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/espi.c  |3 ++-
 drivers/net/chelsio/ixf1010.c   |9 ++---
 drivers/net/chelsio/mv88e1xxx.c |6 --
 drivers/net/chelsio/subr.c  |6 --
 drivers/net/chelsio/vsc7326.c   |3 ++-
 drivers/net/chelsio/vsc8244.c   |3 ++-
 6 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c
index 4192f0f..44d2603 100644
--- a/drivers/net/chelsio/espi.c
+++ b/drivers/net/chelsio/espi.c
@@ -301,7 +301,8 @@ void t1_espi_set_misc_ctrl(adapter_t *ad
 {
struct peespi *espi = adapter-espi;
 
-   if (!is_T2(adapter)) return;
+   if (!is_T2(adapter))
+   return;
spin_lock(espi-lock);
espi-misc_ctrl = (val  ~MON_MASK) |
  (espi-misc_ctrl  MON_MASK);
diff --git a/drivers/net/chelsio/ixf1010.c b/drivers/net/chelsio/ixf1010.c
index 5b8f144..91a5bf7 100644
--- a/drivers/net/chelsio/ixf1010.c
+++ b/drivers/net/chelsio/ixf1010.c
@@ -273,7 +273,8 @@ static int mac_set_rx_mode(struct cmac *
 static int mac_set_mtu(struct cmac *mac, int mtu)
 {
/* MAX_FRAME_SIZE inludes header + FCS, mtu doesn't */
-   if (mtu  (MAX_FRAME_SIZE - 14 - 4)) return -EINVAL;
+   if (mtu  (MAX_FRAME_SIZE - 14 - 4))
+   return -EINVAL;
t1_tpi_write(mac-adapter, MACREG(mac, REG_MAX_FRAME_SIZE),
 mtu + 14 + 4);
return 0;
@@ -460,10 +461,12 @@ static struct cmac *ixf1010_mac_create(a
struct cmac *mac;
u32 val;
 
-   if (index  9) return NULL;
+   if (index  9)
+   return NULL;
 
mac = kzalloc(sizeof(*mac) + sizeof(cmac_instance), GFP_KERNEL);
-   if (!mac) return NULL;
+   if (!mac)
+   return NULL;
 
mac-ops = ixf1010_ops;
mac-instance = (cmac_instance *)(mac + 1);
diff --git a/drivers/net/chelsio/mv88e1xxx.c b/drivers/net/chelsio/mv88e1xxx.c
index 28ac93f..75fac85 100644
--- a/drivers/net/chelsio/mv88e1xxx.c
+++ b/drivers/net/chelsio/mv88e1xxx.c
@@ -308,7 +308,8 @@ static int mv88e1xxx_interrupt_handler(s
MV88E1XXX_INTERRUPT_STATUS_REGISTER,
cause);
cause = INTR_ENABLE_MASK;
-   if (!cause) break;
+   if (!cause)
+   break;
 
if (cause  MV88E1XXX_INTR_LINK_CHNG) {
(void) simple_mdio_read(cphy,
@@ -360,7 +361,8 @@ static struct cphy *mv88e1xxx_phy_create
 {
struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
 
-   if (!cphy) return NULL;
+   if (!cphy)
+   return NULL;
 
cphy_init(cphy, adapter, phy_addr, mv88e1xxx_ops, mdio_ops);
 
diff --git a/drivers/net/chelsio/subr.c b/drivers/net/chelsio/subr.c
index 22ed9a3..38dbaf2 100644
--- a/drivers/net/chelsio/subr.c
+++ b/drivers/net/chelsio/subr.c
@@ -612,7 +612,8 @@ int t1_elmer0_ext_intr_handler(adapter_t
 int i, port_bit;
for_each_port(adapter, i) {
port_bit = i + 1;
-   if (!(cause  (1  port_bit))) continue;
+   if (!(cause  (1  port_bit)))
+   continue;
 
phy = adapter-port[i].phy;
phy_cause = phy-ops-interrupt_handler(phy);
@@ -688,7 +689,8 @@ int t1_elmer0_ext_intr_handler(adapter_t
 
for_each_port(adapter, i) {
port_bit = i ? i + 1 : 0;
-   if (!(cause  (1  port_bit))) continue;
+   if (!(cause  (1  port_bit)))
+   continue;
 
phy = adapter-port[i].phy;
phy_cause = phy-ops-interrupt_handler(phy);
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c
index 85dc3b1..3355441 100644
--- a/drivers/net/chelsio/vsc7326.c
+++ b/drivers/net/chelsio/vsc7326.c
@@ -686,7 +686,8 @@ static struct cmac *vsc7326_mac_create(a
int i;
 
mac = kzalloc(sizeof(*mac) + sizeof(cmac_instance), GFP_KERNEL);
-   if (!mac) return NULL;
+   if (!mac)
+   return NULL;
 
mac-ops = vsc7326_ops;
mac-instance = (cmac_instance *)(mac + 1);
diff --git a/drivers/net/chelsio/vsc8244.c b/drivers/net/chelsio/vsc8244.c
index c493e78..f947cf6 100644
--- a/drivers/net/chelsio/vsc8244.c
+++ b/drivers/net/chelsio/vsc8244.c
@@ -347,7 +347,8 @@ static struct cphy* vsc8244_phy_create(a
 {
struct cphy *cphy = kzalloc(sizeof(*cphy), GFP_KERNEL);
 
-   if (!cphy) return NULL;
+   if (!cphy)
+   return NULL;
 
cphy_init(cphy, adapter, phy_addr, vsc8244_ops, mdio_ops);
 
-- 
1.4.4.1

-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More 

[PATCH 2/7] chelsio: the return statement is not a function

2006-12-05 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/my3126.c  |   16 
 drivers/net/chelsio/vsc7326.c |   12 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/net/chelsio/my3126.c b/drivers/net/chelsio/my3126.c
index 0b90014..67f8a4a 100644
--- a/drivers/net/chelsio/my3126.c
+++ b/drivers/net/chelsio/my3126.c
@@ -10,25 +10,25 @@ static int my3126_reset(struct cphy *cph
 * This can be done through registers.  It is not required since
 * a full chip reset is used.
 */
-   return (0);
+   return 0;
 }
 
 static int my3126_interrupt_enable(struct cphy *cphy)
 {
schedule_delayed_work(cphy-phy_update, HZ/30);
t1_tpi_read(cphy-adapter, A_ELMER0_GPO, cphy-elmer_gpo);
-   return (0);
+   return 0;
 }
 
 static int my3126_interrupt_disable(struct cphy *cphy)
 {
cancel_rearming_delayed_work(cphy-phy_update);
-   return (0);
+   return 0;
 }
 
 static int my3126_interrupt_clear(struct cphy *cphy)
 {
-   return (0);
+   return 0;
 }
 
 #define OFFSET(REG_ADDR)(REG_ADDR  2)
@@ -100,7 +100,7 @@ static void my3216_poll(void *arg)
 
 static int my3126_set_loopback(struct cphy *cphy, int on)
 {
-   return (0);
+   return 0;
 }
 
 /* To check the activity LED */
@@ -144,7 +144,7 @@ static int my3126_get_link_status(struct
if (fc)
*fc = PAUSE_RX | PAUSE_TX;
 
-   return (0);
+   return 0;
 }
 
 static void my3126_destroy(struct cphy *cphy)
@@ -174,7 +174,7 @@ static struct cphy *my3126_phy_create(ad
INIT_WORK(cphy-phy_update, my3216_poll, cphy);
cphy-bmsr = 0;
 
-   return (cphy);
+   return cphy;
 }
 
 /* Chip Reset */
@@ -195,7 +195,7 @@ static int my3126_phy_reset(adapter_t *
val |= 0x8000;
t1_tpi_write(adapter, A_ELMER0_GPO, val);
udelay(100);
-   return (0);
+   return 0;
 }
 
 struct gphy t1_my3126_ops = {
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c
index 3355441..8c4a31e 100644
--- a/drivers/net/chelsio/vsc7326.c
+++ b/drivers/net/chelsio/vsc7326.c
@@ -256,7 +256,7 @@ static int bist_rd(adapter_t *adapter, i
else if((result  (18)) != 0x0)
CH_ERR(bist read error: 0x%x\n, result);
 
-   return(result  0xff);
+   return (result  0xff);
 }
 
 static int bist_wr(adapter_t *adapter, int moduleid, int address, int value)
@@ -286,7 +286,7 @@ static int bist_wr(adapter_t *adapter, i
else if((result  (126)) != 0x0)
CH_ERR(bist write error: 0x%x\n, result);
 
-   return(0);
+   return 0;
 }
 
 static int run_bist(adapter_t *adapter, int moduleid)
@@ -295,7 +295,7 @@ static int run_bist(adapter_t *adapter,
(void) bist_wr(adapter,moduleid, 0x00, 0x02);
(void) bist_wr(adapter,moduleid, 0x01, 0x01);
 
-   return(0);
+   return 0;
 }
 
 static int check_bist(adapter_t *adapter, int moduleid)
@@ -309,14 +309,14 @@ static int check_bist(adapter_t *adapter
if ((result  3) != 0x3)
CH_ERR(Result: 0x%x  BIST error in ram %d, column: 0x%04x\n,
result, moduleid, column);
-   return(0);
+   return 0;
 }
 
 static int enable_mem(adapter_t *adapter, int moduleid)
 {
/*enable mem*/
(void) bist_wr(adapter,moduleid, 0x00, 0x00);
-   return(0);
+   return 0;
 }
 
 static int run_bist_all(adapter_t *adapter)
@@ -358,7 +358,7 @@ static int run_bist_all(adapter_t *adapt
udelay(300);
vsc_write(adapter, REG_MEM_BIST, 0x0);
mdelay(10);
-   return(0);
+   return 0;
 }
 
 static int mac_intr_handler(struct cmac *mac)
-- 
1.4.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 6/7] chelsio: useless test in cxgb2::remove_one

2006-12-05 Thread Francois Romieu
pci_get_drvadata() is necessarily distinct from NULL if
cxgb2::init_one succeeded. cxgb2::remove_one is solely
issued through the PCI device callback.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/cxgb2.c |   32 
 1 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index dc74fa2..2d5922a 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -1392,26 +1392,26 @@ static inline void t1_sw_reset(struct pc
 static void __devexit remove_one(struct pci_dev *pdev)
 {
struct net_device *dev = pci_get_drvdata(pdev);
+   struct adapter *adapter = netdev_priv(dev);
+   int i;
 
-   if (dev) {
-   int i;
-   struct adapter *adapter = netdev_priv(dev);
-
-   for_each_port(adapter, i)
-   if (test_bit(i, adapter-registered_device_map))
-   unregister_netdev(adapter-port[i].dev);
+   for_each_port(adapter, i) {
+   if (test_bit(i, adapter-registered_device_map))
+   unregister_netdev(adapter-port[i].dev);
+   }
 
-   t1_free_sw_modules(adapter);
-   iounmap(adapter-regs);
-   while (--i = 0)
-   if (adapter-port[i].dev)
-   free_netdev(adapter-port[i].dev);
+   t1_free_sw_modules(adapter);
+   iounmap(adapter-regs);
 
-   pci_release_regions(pdev);
-   pci_disable_device(pdev);
-   pci_set_drvdata(pdev, NULL);
-   t1_sw_reset(pdev);
+   while (--i = 0) {
+   if (adapter-port[i].dev)
+   free_netdev(adapter-port[i].dev);
}
+
+   pci_release_regions(pdev);
+   pci_disable_device(pdev);
+   pci_set_drvdata(pdev, NULL);
+   t1_sw_reset(pdev);
 }
 
 static struct pci_driver driver = {
-- 
1.4.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 7/7] chelsio: misc cleanups in sge

2006-12-05 Thread Francois Romieu
- duplicated code in sge::free_cmdQ_buffers ;
- NET_IP_ALIGN is already defined in (included) linux/skbuff.h ;
- pci_alloc_consistent() returns void * ;
- pci_alloc_consistent() returns a zeroed chunk of memory ;
- early return in restart_tx_queues.

Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/sge.c |   54 +++-
 1 files changed, 19 insertions(+), 35 deletions(-)

diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index f8b40b2..095aba2 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -85,10 +85,6 @@
  */
 #define TX_RECLAIM_PERIOD (HZ / 4)
 
-#ifndef NET_IP_ALIGN
-# define NET_IP_ALIGN 2
-#endif
-
 #define M_CMD_LEN   0x7fff
 #define V_CMD_LEN(v)(v)
 #define G_CMD_LEN(v)((v)  M_CMD_LEN)
@@ -575,11 +571,10 @@ static int alloc_rx_resources(struct sge
q-size = p-freelQ_size[i];
q-dma_offset = sge-rx_pkt_pad ? 0 : NET_IP_ALIGN;
size = sizeof(struct freelQ_e) * q-size;
-   q-entries = (struct freelQ_e *)
- pci_alloc_consistent(pdev, size, q-dma_addr);
+   q-entries = pci_alloc_consistent(pdev, size, q-dma_addr);
if (!q-entries)
goto err_no_mem;
-   memset(q-entries, 0, size);
+
size = sizeof(struct freelQ_ce) * q-size;
q-centries = kzalloc(size, GFP_KERNEL);
if (!q-centries)
@@ -613,11 +608,10 @@ static int alloc_rx_resources(struct sge
sge-respQ.size = SGE_RESPQ_E_N;
sge-respQ.credits = 0;
size = sizeof(struct respQ_e) * sge-respQ.size;
-   sge-respQ.entries = (struct respQ_e *)
+   sge-respQ.entries =
pci_alloc_consistent(pdev, size, sge-respQ.dma_addr);
if (!sge-respQ.entries)
goto err_no_mem;
-   memset(sge-respQ.entries, 0, size);
return 0;
 
 err_no_mem:
@@ -637,20 +631,12 @@ static void free_cmdQ_buffers(struct sge
q-in_use -= n;
ce = q-centries[cidx];
while (n--) {
-   if (q-sop) {
-   if (likely(pci_unmap_len(ce, dma_len))) {
-   pci_unmap_single(pdev,
-pci_unmap_addr(ce, dma_addr),
-pci_unmap_len(ce, dma_len),
-PCI_DMA_TODEVICE);
+   if (likely(pci_unmap_len(ce, dma_len))) {
+   pci_unmap_single(pdev, pci_unmap_addr(ce, dma_addr),
+pci_unmap_len(ce, dma_len),
+PCI_DMA_TODEVICE);
+   if (q-sop)
q-sop = 0;
-   }
-   } else {
-   if (likely(pci_unmap_len(ce, dma_len))) {
-   pci_unmap_page(pdev, pci_unmap_addr(ce, 
dma_addr),
-  pci_unmap_len(ce, dma_len),
-  PCI_DMA_TODEVICE);
-   }
}
if (ce-skb) {
dev_kfree_skb_any(ce-skb);
@@ -711,11 +697,10 @@ static int alloc_tx_resources(struct sge
q-stop_thres = 0;
spin_lock_init(q-lock);
size = sizeof(struct cmdQ_e) * q-size;
-   q-entries = (struct cmdQ_e *)
- pci_alloc_consistent(pdev, size, q-dma_addr);
+   q-entries = pci_alloc_consistent(pdev, size, q-dma_addr);
if (!q-entries)
goto err_no_mem;
-   memset(q-entries, 0, size);
+
size = sizeof(struct cmdQ_ce) * q-size;
q-centries = kzalloc(size, GFP_KERNEL);
if (!q-centries)
@@ -1443,19 +1428,18 @@ static inline int enough_free_Tx_descs(c
 static void restart_tx_queues(struct sge *sge)
 {
struct adapter *adap = sge-adapter;
+   int i;
 
-   if (enough_free_Tx_descs(sge-cmdQ[0])) {
-   int i;
+   if (!enough_free_Tx_descs(sge-cmdQ[0]))
+   return;
 
-   for_each_port(adap, i) {
-   struct net_device *nd = adap-port[i].dev;
+   for_each_port(adap, i) {
+   struct net_device *nd = adap-port[i].dev;
 
-   if (test_and_clear_bit(nd-if_port,
-  sge-stopped_tx_queues) 
-   netif_running(nd)) {
-   sge-stats.cmdQ_restarted[2]++;
-   netif_wake_queue(nd);
-   }
+   if (test_and_clear_bit(nd-if_port, sge-stopped_tx_queues) 
+   netif_running(nd)) {
+   sge-stats.cmdQ_restarted[2]++;
+   

[PATCH 5/7] chelsio: useless curly braces

2006-12-05 Thread Francois Romieu
Signed-off-by: Francois Romieu [EMAIL PROTECTED]
---
 drivers/net/chelsio/cxgb2.c |9 -
 drivers/net/chelsio/mv88e1xxx.c |4 ++--
 drivers/net/chelsio/sge.c   |3 +--
 drivers/net/chelsio/vsc7326.c   |3 +--
 4 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
index 15be058..dc74fa2 100644
--- a/drivers/net/chelsio/cxgb2.c
+++ b/drivers/net/chelsio/cxgb2.c
@@ -771,11 +771,11 @@ static int set_coalesce(struct net_devic
if (adapter-open_device_map == 0)
adapter-params.sge.polling = c-use_adaptive_rx_coalesce;
 
-   if (adapter-params.sge.polling) {
+   if (adapter-params.sge.polling)
adapter-params.sge.rx_coalesce_usecs = 0;
-   } else {
+   else
adapter-params.sge.rx_coalesce_usecs = c-rx_coalesce_usecs;
-   }
+
adapter-params.sge.coalesce_enable = c-use_adaptive_rx_coalesce;
adapter-params.sge.sample_interval_usecs = c-rate_sample_interval;
t1_sge_set_coalesce_params(adapter-sge, adapter-params.sge);
@@ -1299,9 +1299,8 @@ static int t1_clock(struct adapter *adap
if (!t1_is_T1B(adapter))
return -ENODEV; /* Can't re-clock this chip. */
 
-   if (mode  2) {
+   if (mode  2)
return 0;   /* show current mode. */
-   }
 
if ((adapter-t1powersave  1) == (mode  1))
return -EALREADY;   /* ASIC already running in mode. */
diff --git a/drivers/net/chelsio/mv88e1xxx.c b/drivers/net/chelsio/mv88e1xxx.c
index c7c5854..5867e3b 100644
--- a/drivers/net/chelsio/mv88e1xxx.c
+++ b/drivers/net/chelsio/mv88e1xxx.c
@@ -312,9 +312,9 @@ static int mv88e1xxx_interrupt_handler(s
(void) simple_mdio_read(cphy,
MV88E1XXX_SPECIFIC_STATUS_REGISTER, status);
 
-   if (status  MV88E1XXX_INTR_LINK_CHNG) {
+   if (status  MV88E1XXX_INTR_LINK_CHNG)
cphy-state |= PHY_LINK_UP;
-   } else {
+   else {
cphy-state = ~PHY_LINK_UP;
if (cphy-state  PHY_AUTONEG_EN)
cphy-state = ~PHY_AUTONEG_RDY;
diff --git a/drivers/net/chelsio/sge.c b/drivers/net/chelsio/sge.c
index f61d671..f8b40b2 100644
--- a/drivers/net/chelsio/sge.c
+++ b/drivers/net/chelsio/sge.c
@@ -2211,9 +2211,8 @@ struct sge * __devinit t1_sge_create(str
if (adapter-params.nports  1) {
tx_sched_init(sge);
sge-espibug_timer.function = espibug_workaround_t204;
-   } else {
+   } else
sge-espibug_timer.function = espibug_workaround;
-   }
sge-espibug_timer.data = (unsigned long)sge-adapter;
 
sge-espibug_timeout = 1;
diff --git a/drivers/net/chelsio/vsc7326.c b/drivers/net/chelsio/vsc7326.c
index bdd25c0..31a67f5 100644
--- a/drivers/net/chelsio/vsc7326.c
+++ b/drivers/net/chelsio/vsc7326.c
@@ -226,9 +226,8 @@ static void run_table(adapter_t *adapter
if (ib[i].addr == INITBLOCK_SLEEP) {
udelay( ib[i].data );
CH_ERR(sleep %d us\n,ib[i].data);
-   } else {
+   } else
vsc_write( adapter, ib[i].addr, ib[i].data );
-   }
}
 }
 
-- 
1.4.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: [PATCH 4/7] chelsio: use netdev_priv

2006-12-05 Thread Stephen Hemminger
On Wed, 6 Dec 2006 01:16:52 +0100
Francois Romieu [EMAIL PROTECTED] wrote:

 Signed-off-by: Francois Romieu [EMAIL PROTECTED]
 ---
  drivers/net/chelsio/cxgb2.c |   60 +-
  drivers/net/chelsio/sge.c   |4 +-
  2 files changed, 32 insertions(+), 32 deletions(-)
 
 diff --git a/drivers/net/chelsio/cxgb2.c b/drivers/net/chelsio/cxgb2.c
 index cb639d4..15be058 100644
 --- a/drivers/net/chelsio/cxgb2.c
 +++ b/drivers/net/chelsio/cxgb2.c
 @@ -120,7 +120,7 @@ static const char pci_speed[][4] = {
   */
  static void t1_set_rxmode(struct net_device *dev)
  {
 - struct adapter *adapter = dev-priv;
 + struct adapter *adapter = netdev_priv(dev);
   struct cmac *mac = adapter-port[dev-if_port].mac;
   struct t1_rx_mode rm;
 

NAK for this driver. dev-priv points to a different location for each port on
dual port board.  To use netdev_priv() requires more serious surgery..


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


Re: [PATCH 4/7] chelsio: use netdev_priv

2006-12-05 Thread Francois Romieu
Stephen Hemminger [EMAIL PROTECTED] :
[...]
 NAK for this driver. dev-priv points to a different location for each port on
 dual port board.  To use netdev_priv() requires more serious surgery..Q

Ok, it's removed from the branch. Patch #6 has been modified.

Should I wait for someone to pick-up #1..#3 before resending #5..#7 ?

-- 
Ueimor
-
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 wireless-2.6-git] prism54: WPA/RSN support for fullmac cards

2006-12-05 Thread John W. Linville
On Sun, Nov 26, 2006 at 11:47:49AM +0100, [EMAIL PROTECTED] wrote:
 On Sunday, 26. November 2006 06:27, you wrote:
 
  Sorry, still need the second ifup to bring the card up after plugging
  it in. ping -f looks good however, I will try to stress it more and will
  report if I see anything wrong.
 
 Well, some docs about the chips and firmware would be very handy... 
 has anyone access to conexant's library?

FYI...after latest round of merges, that patch that I've been carrying
in the pending branch of wireless-2.6 no longer applies.

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


Please pull 'upstream' branch of wireless-2.6

2006-12-05 Thread John W. Linville
The following changes since commit e62438630ca37539c8cc1553710bbfaa3cf960a7:
  Matthew Wilcox:
Centralise definitions of sector_t and blkcnt_t

are found in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git 
upstream

Daniel Drake:
  zd1211rw: zd_mac_rx isn't always called in IRQ context
  zd1211rw: Fill enc_capa in GIWRANGE handler

Maxime Austruy:
  softmac: fix unbalanced mutex_lock/unlock in ieee80211softmac_wx_set_mlme

Ulrich Kunitz:
  zd1211rw: Support for multicast addresses
  softmac: Fixed handling of deassociation from AP

Yan Burman:
  hostap: replace kmalloc+memset with kzalloc
  prism54: replace kmalloc+memset with kzalloc
  ipw2200: replace kmalloc+memset with kcalloc

Zhu Yi:
  ipw2200: Add IEEE80211_RADIOTAP_TSFT for promiscuous mode
  ipw2200: Update version stamp to 1.2.0
  ipw2200: Fix a typo
  ipw2200: Fix debug output endian issue

 drivers/net/wireless/hostap/hostap_ap.c|4 --
 drivers/net/wireless/hostap/hostap_cs.c|3 -
 drivers/net/wireless/hostap/hostap_download.c  |4 --
 drivers/net/wireless/hostap/hostap_hw.c|   12 +
 drivers/net/wireless/hostap/hostap_info.c  |3 -
 drivers/net/wireless/hostap/hostap_ioctl.c |   12 +
 drivers/net/wireless/hostap/hostap_pci.c   |3 -
 drivers/net/wireless/hostap/hostap_plx.c   |3 -
 drivers/net/wireless/ipw2100.c |2 -
 drivers/net/wireless/ipw2200.c |   24 +++
 drivers/net/wireless/prism54/isl_ioctl.c   |9 +---
 drivers/net/wireless/prism54/oid_mgt.c |4 --
 drivers/net/wireless/zd1211rw/zd_chip.c|   13 ++
 drivers/net/wireless/zd1211rw/zd_chip.h|   43 +++
 drivers/net/wireless/zd1211rw/zd_mac.c |   53 ++--
 drivers/net/wireless/zd1211rw/zd_mac.h |3 +
 drivers/net/wireless/zd1211rw/zd_netdev.c  |2 -
 net/ieee80211/softmac/ieee80211softmac_assoc.c |   14 +-
 net/ieee80211/softmac/ieee80211softmac_auth.c  |2 +
 net/ieee80211/softmac/ieee80211softmac_priv.h  |2 +
 net/ieee80211/softmac/ieee80211softmac_wx.c|3 +
 21 files changed, 158 insertions(+), 60 deletions(-)

diff --git a/drivers/net/wireless/hostap/hostap_ap.c 
b/drivers/net/wireless/hostap/hostap_ap.c
index ba13125..798a855 100644
--- a/drivers/net/wireless/hostap/hostap_ap.c
+++ b/drivers/net/wireless/hostap/hostap_ap.c
@@ -1099,15 +1099,13 @@ static struct sta_info * ap_add_sta(stru
 {
struct sta_info *sta;
 
-   sta = (struct sta_info *)
-   kmalloc(sizeof(struct sta_info), GFP_ATOMIC);
+   sta = kzalloc(sizeof(struct sta_info), GFP_ATOMIC);
if (sta == NULL) {
PDEBUG(DEBUG_AP, AP: kmalloc failed\n);
return NULL;
}
 
/* initialize STA info data */
-   memset(sta, 0, sizeof(struct sta_info));
sta-local = ap-local;
skb_queue_head_init(sta-tx_buf);
memcpy(sta-addr, addr, ETH_ALEN);
diff --git a/drivers/net/wireless/hostap/hostap_cs.c 
b/drivers/net/wireless/hostap/hostap_cs.c
index f63909e..ef470e6 100644
--- a/drivers/net/wireless/hostap/hostap_cs.c
+++ b/drivers/net/wireless/hostap/hostap_cs.c
@@ -566,12 +566,11 @@ static int prism2_config(struct pcmcia_d
PDEBUG(DEBUG_FLOW, prism2_config()\n);
 
parse = kmalloc(sizeof(cisparse_t), GFP_KERNEL);
-   hw_priv = kmalloc(sizeof(*hw_priv), GFP_KERNEL);
+   hw_priv = kzalloc(sizeof(*hw_priv), GFP_KERNEL);
if (parse == NULL || hw_priv == NULL) {
ret = -ENOMEM;
goto failed;
}
-   memset(hw_priv, 0, sizeof(*hw_priv));
 
tuple.DesiredTuple = CISTPL_CONFIG;
tuple.Attributes = 0;
diff --git a/drivers/net/wireless/hostap/hostap_download.c 
b/drivers/net/wireless/hostap/hostap_download.c
index ab26b52..24fc387 100644
--- a/drivers/net/wireless/hostap/hostap_download.c
+++ b/drivers/net/wireless/hostap/hostap_download.c
@@ -685,14 +685,12 @@ static int prism2_download(local_info_t 
goto out;
}
 
-   dl = kmalloc(sizeof(*dl) + param-num_areas *
+   dl = kzalloc(sizeof(*dl) + param-num_areas *
 sizeof(struct prism2_download_data_area), GFP_KERNEL);
if (dl == NULL) {
ret = -ENOMEM;
goto out;
}
-   memset(dl, 0, sizeof(*dl) + param-num_areas *
-  sizeof(struct prism2_download_data_area));
dl-dl_cmd = param-dl_cmd;
dl-start_addr = param-start_addr;
dl-num_areas = param-num_areas;
diff --git a/drivers/net/wireless/hostap/hostap_hw.c 
b/drivers/net/wireless/hostap/hostap_hw.c
index ed00ebb..9c50336 100644
--- a/drivers/net/wireless/hostap/hostap_hw.c
+++ b/drivers/net/wireless/hostap/hostap_hw.c
@@ -347,14 +347,12 @@ static int hfa384x_cmd(struct net_device
if 

[PATCH] netfilter: fix non-ANSI func. decl.

2006-12-05 Thread Randy Dunlap
From: Randy Dunlap [EMAIL PROTECTED]

Fix non-ANSI function declaration:
net/netfilter/nf_conntrack_core.c:1096:25: warning: non-ANSI function 
declaration of function 'nf_conntrack_flush'

Signed-off-by: Randy Dunlap [EMAIL PROTECTED]
---
 net/netfilter/nf_conntrack_core.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.19-git7.orig/net/netfilter/nf_conntrack_core.c
+++ linux-2.6.19-git7/net/netfilter/nf_conntrack_core.c
@@ -1093,7 +1093,7 @@ static void free_conntrack_hash(struct l
   get_order(sizeof(struct list_head) * size));
 }
 
-void nf_conntrack_flush()
+void nf_conntrack_flush(void)
 {
nf_ct_iterate_cleanup(kill_all, NULL);
 }


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


  1   2   >