[patch 1/1] net-zerocopy: use vm_insert_pages() for tcp rcv zerocopy

2020-06-07 Thread akpm
From: Arjun Roy 
Subject: net-zerocopy: use vm_insert_pages() for tcp rcv zerocopy

Use vm_insert_pages() for tcp receive zerocopy.  Spin lock cycles (as
reported by perf) drop from a couple of percentage points to a fraction of
a percent.  This results in a roughly 6% increase in efficiency, measured
roughly as zerocopy receive count divided by CPU utilization.

The intention of this patchset is to reduce atomic ops for tcp zerocopy
receives, which normally hits the same spinlock multiple times
consecutively.

[a...@linux-foundation.org: suppress gcc-7.2.0 warning]
Link: http://lkml.kernel.org/r/20200128025958.43490-3-arjunroy.k...@gmail.com
Signed-off-by: Arjun Roy 
Signed-off-by: Eric Dumazet 
Signed-off-by: Soheil Hassas Yeganeh 
Cc: David Miller 
Cc: Matthew Wilcox 
Cc: Jason Gunthorpe 
Cc: Stephen Rothwell 
Signed-off-by: Andrew Morton 
---

 net/ipv4/tcp.c |   70 ++-
 1 file changed, 63 insertions(+), 7 deletions(-)

--- a/net/ipv4/tcp.c~net-zerocopy-use-vm_insert_pages-for-tcp-rcv-zerocopy
+++ a/net/ipv4/tcp.c
@@ -1742,14 +1742,48 @@ int tcp_mmap(struct file *file, struct s
 }
 EXPORT_SYMBOL(tcp_mmap);
 
+static int tcp_zerocopy_vm_insert_batch(struct vm_area_struct *vma,
+   struct page **pages,
+   unsigned long pages_to_map,
+   unsigned long *insert_addr,
+   u32 *length_with_pending,
+   u32 *seq,
+   struct tcp_zerocopy_receive *zc)
+{
+   unsigned long pages_remaining = pages_to_map;
+   int bytes_mapped;
+   int ret;
+
+   ret = vm_insert_pages(vma, *insert_addr, pages, &pages_remaining);
+   bytes_mapped = PAGE_SIZE * (pages_to_map - pages_remaining);
+   /* Even if vm_insert_pages fails, it may have partially succeeded in
+* mapping (some but not all of the pages).
+*/
+   *seq += bytes_mapped;
+   *insert_addr += bytes_mapped;
+   if (ret) {
+   /* But if vm_insert_pages did fail, we have to unroll some state
+* we speculatively touched before.
+*/
+   const int bytes_not_mapped = PAGE_SIZE * pages_remaining;
+   *length_with_pending -= bytes_not_mapped;
+   zc->recv_skip_hint += bytes_not_mapped;
+   }
+   return ret;
+}
+
 static int tcp_zerocopy_receive(struct sock *sk,
struct tcp_zerocopy_receive *zc)
 {
unsigned long address = (unsigned long)zc->address;
u32 length = 0, seq, offset, zap_len;
+   #define PAGE_BATCH_SIZE 8
+   struct page *pages[PAGE_BATCH_SIZE];
const skb_frag_t *frags = NULL;
struct vm_area_struct *vma;
struct sk_buff *skb = NULL;
+   unsigned long pg_idx = 0;
+   unsigned long curr_addr;
struct tcp_sock *tp;
int inq;
int ret;
@@ -1762,6 +1796,8 @@ static int tcp_zerocopy_receive(struct s
 
sock_rps_record_flow(sk);
 
+   tp = tcp_sk(sk);
+
down_read(¤t->mm->mmap_sem);
 
vma = find_vma(current->mm, address);
@@ -1771,7 +1807,6 @@ static int tcp_zerocopy_receive(struct s
}
zc->length = min_t(unsigned long, zc->length, vma->vm_end - address);
 
-   tp = tcp_sk(sk);
seq = tp->copied_seq;
inq = tcp_inq(sk);
zc->length = min_t(u32, zc->length, inq);
@@ -1783,8 +1818,20 @@ static int tcp_zerocopy_receive(struct s
zc->recv_skip_hint = zc->length;
}
ret = 0;
+   curr_addr = address;
while (length + PAGE_SIZE <= zc->length) {
if (zc->recv_skip_hint < PAGE_SIZE) {
+   /* If we're here, finish the current batch. */
+   if (pg_idx) {
+   ret = tcp_zerocopy_vm_insert_batch(vma, pages,
+  pg_idx,
+  &curr_addr,
+  &length,
+  &seq, zc);
+   if (ret)
+   goto out;
+   pg_idx = 0;
+   }
if (skb) {
if (zc->recv_skip_hint > 0)
break;
@@ -1793,7 +1840,6 @@ static int tcp_zerocopy_receive(struct s
} else {
skb = tcp_recv_skb(sk, seq, &offset);
}
-
zc->recv_skip_hint = skb->len - offset;
offset -= skb_headlen(skb);
if ((int)offset < 0 || skb_has_frag_list(skb))
@@ -1817,14 +1863,24 @@

[patch 1/1] drivers/net/ethernet/qlogic/qed/qed_rdma.h: fix typo

2018-11-15 Thread akpm
From: Andrew Morton 
Subject: drivers/net/ethernet/qlogic/qed/qed_rdma.h: fix typo

Add missing semicolon.

Fixes: 291d57f67d244973 ("qed: Fix rdma_info structure allocation")
Cc: Michal Kalderon 
Cc: Denis Bolotin 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 drivers/net/ethernet/qlogic/qed/qed_rdma.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- 
a/drivers/net/ethernet/qlogic/qed/qed_rdma.h~drivers-net-ethernet-qlogic-qed-qed_rdmah-fix-typo
+++ a/drivers/net/ethernet/qlogic/qed/qed_rdma.h
@@ -183,7 +183,7 @@ void qed_rdma_info_free(struct qed_hwfn
 static inline void qed_rdma_dpm_conf(struct qed_hwfn *p_hwfn, struct qed_ptt 
*p_ptt) {}
 static inline void qed_rdma_dpm_bar(struct qed_hwfn *p_hwfn,
struct qed_ptt *p_ptt) {}
-static inline int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) {return -EINVAL}
+static inline int qed_rdma_info_alloc(struct qed_hwfn *p_hwfn) {return 
-EINVAL;}
 static inline void qed_rdma_info_free(struct qed_hwfn *p_hwfn) {}
 #endif
 
_


[patch 1/1] net/netfilter/x_tables.c: make allocation less aggressive

2018-01-30 Thread akpm
From: Michal Hocko 
Subject: net/netfilter/x_tables.c: make allocation less aggressive

syzbot has noticed that xt_alloc_table_info can allocate a lot of memory. 
This is an admin only interface but an admin in a namespace is sufficient
as well.  eacd86ca3b03 ("net/netfilter/x_tables.c: use kvmalloc() in
xt_alloc_table_info()") has changed the opencoded kmalloc->vmalloc
fallback into kvmalloc.  It has dropped __GFP_NORETRY on the way because
vmalloc has simply never fully supported __GFP_NORETRY semantic.  This is
still the case because e.g.  page tables backing the vmalloc area are
hardcoded GFP_KERNEL.

Revert back to __GFP_NORETRY as a poors man defence against excessively
large allocation request here.  We will not rule out the OOM killer
completely but __GFP_NORETRY should at least stop the large request in
most cases.

[a...@linux-foundation.org: coding-style fixes]
Fixes: eacd86ca3b03 ("net/netfilter/x_tables.c: use kvmalloc() in 
xt_alloc_tableLink: 
http://lkml.kernel.org/r/20180130140104.ge21...@dhcp22.suse.cz
Signed-off-by: Michal Hocko 
Acked-by: Florian Westphal 
Reviewed-by: Andrew Morton 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 net/netfilter/x_tables.c |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -puN 
net/netfilter/x_tables.c~net-netfilter-x_tablesc-make-allocation-less-aggressive
 net/netfilter/x_tables.c
--- 
a/net/netfilter/x_tables.c~net-netfilter-x_tablesc-make-allocation-less-aggressive
+++ a/net/netfilter/x_tables.c
@@ -1008,7 +1008,12 @@ struct xt_table_info *xt_alloc_table_inf
if ((size >> PAGE_SHIFT) + 2 > totalram_pages)
return NULL;
 
-   info = kvmalloc(sz, GFP_KERNEL);
+   /* __GFP_NORETRY is not fully supported by kvmalloc but it should
+* work reasonably well if sz is too large and bail out rather
+* than shoot all processes down before realizing there is nothing
+* more to reclaim.
+*/
+   info = kvmalloc(sz, GFP_KERNEL | __GFP_NORETRY);
if (!info)
return NULL;
 
_


[patch 1/1] net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues

2018-01-18 Thread akpm
From: Andrew Morton 
Subject: net/sched/sch_prio.c: work around gcc-4.4.4 union initializer issues

gcc-4.4.4 has problems witn anon union initializers.  Work around this.

net/sched/sch_prio.c: In function 'prio_dump_offload':
net/sched/sch_prio.c:260: error: unknown field 'stats' specified in initializer
net/sched/sch_prio.c:260: warning: initialization makes integer from pointer 
without a cast
net/sched/sch_prio.c:261: error: unknown field 'stats' specified in initializer
net/sched/sch_prio.c:261: warning: initialization makes integer from pointer 
without a cast

Fixes: 7fdb61b44c0c95 ("net: sch: prio: Add offload ability to PRIO qdisc")
Cc: Nogah Frankel 
Cc: Yuval Mintz 
Cc: Jiri Pirko 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 net/sched/sch_prio.c |   10 +++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff -puN 
net/sched/sch_prio.c~net-sched-sch_prioc-work-around-gcc-444-union-initializer-issues
 net/sched/sch_prio.c
--- 
a/net/sched/sch_prio.c~net-sched-sch_prioc-work-around-gcc-444-union-initializer-issues
+++ a/net/sched/sch_prio.c
@@ -254,11 +254,15 @@ static int prio_dump_offload(struct Qdis
 {
struct net_device *dev = qdisc_dev(sch);
struct tc_prio_qopt_offload hw_stats = {
+   .command = TC_PRIO_STATS,
.handle = sch->handle,
.parent = sch->parent,
-   .command = TC_PRIO_STATS,
-   .stats.bstats = &sch->bstats,
-   .stats.qstats = &sch->qstats,
+   {
+   .stats = {
+   .bstats = &sch->bstats,
+   .qstats = &sch->qstats,
+   },
+   },
};
int err;
 
_


[patch 1/1] net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue

2018-01-12 Thread akpm
From: Andrew Morton 
Subject: net/ipv6/route.c: work around gcc-4.4.4 anon union initializer issue

gcc-4.4.4 has problems with initializers of anonymous union fields.

net/ipv6/route.c: In function 'rt6_sync_up':
net/ipv6/route.c:3586: error: unknown field 'nh_flags' specified in initializer
net/ipv6/route.c:3586: warning: missing braces around initializer
net/ipv6/route.c:3586: warning: (near initialization for 'arg.')
net/ipv6/route.c: In function 'rt6_sync_down_dev':
net/ipv6/route.c:3695: error: unknown field 'event' specified in initializer
net/ipv6/route.c:3695: warning: missing braces around initializer
net/ipv6/route.c:3695: warning: (near initialization for 'arg.')

Fixes: 2127d95aef6c ("ipv6: Clear nexthop flags upon netdev up")
Cc: Ido Schimmel 
Cc: David Ahern 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 net/ipv6/route.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
net/ipv6/route.c~net-ipv6-routec-work-around-gcc-444-anon-union-initializer-issue
 net/ipv6/route.c
--- 
a/net/ipv6/route.c~net-ipv6-routec-work-around-gcc-444-anon-union-initializer-issue
+++ a/net/ipv6/route.c
@@ -3583,7 +3583,7 @@ void rt6_sync_up(struct net_device *dev,
 {
struct arg_netdev_event arg = {
.dev = dev,
-   .nh_flags = nh_flags,
+   { .nh_flags = nh_flags, },
};
 
if (nh_flags & RTNH_F_DEAD && netif_carrier_ok(dev))
@@ -3692,7 +3692,7 @@ void rt6_sync_down_dev(struct net_device
 {
struct arg_netdev_event arg = {
.dev = dev,
-   .event = event,
+   { .event = event, },
};
 
fib6_clean_all(dev_net(dev), fib6_ifdown, &arg);
_


[patch 1/1] net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue

2017-11-10 Thread akpm
From: Andrew Morton 
Subject: net/sched/sch_red.c: work around gcc-4.4.4 anon union initializer issue

gcc-4.4.4 (at lest) has issues with initializers and anonymous unions:

net/sched/sch_red.c: In function 'red_dump_offload':
net/sched/sch_red.c:282: error: unknown field 'stats' specified in initializer
net/sched/sch_red.c:282: warning: initialization makes integer from pointer 
without a cast
net/sched/sch_red.c:283: error: unknown field 'stats' specified in initializer
net/sched/sch_red.c:283: warning: initialization makes integer from pointer 
without a cast
net/sched/sch_red.c: In function 'red_dump_stats':
net/sched/sch_red.c:352: error: unknown field 'xstats' specified in initializer
net/sched/sch_red.c:352: warning: initialization makes integer from pointer 
without a cast

Work around this.

Fixes: 602f3baf2218 ("net_sch: red: Add offload ability to RED qdisc")
Cc: Nogah Frankel 
Cc: Jiri Pirko 
Cc: Simon Horman 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 net/sched/sch_red.c |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

diff -puN 
net/sched/sch_red.c~net-sched-sch_redc-work-around-gcc-444-anon-union-initializer-issue
 net/sched/sch_red.c
--- 
a/net/sched/sch_red.c~net-sched-sch_redc-work-around-gcc-444-anon-union-initializer-issue
+++ a/net/sched/sch_red.c
@@ -276,11 +276,13 @@ static int red_dump_offload(struct Qdisc
 {
struct net_device *dev = qdisc_dev(sch);
struct tc_red_qopt_offload hw_stats = {
+   .command = TC_RED_STATS,
.handle = sch->handle,
.parent = sch->parent,
-   .command = TC_RED_STATS,
-   .stats.bstats = &sch->bstats,
-   .stats.qstats = &sch->qstats,
+   {
+   .stats.bstats = &sch->bstats,
+   .stats.qstats = &sch->qstats,
+   },
};
int err;
 
@@ -346,10 +348,12 @@ static int red_dump_stats(struct Qdisc *
if (tc_can_offload(dev) &&  dev->netdev_ops->ndo_setup_tc) {
struct red_stats hw_stats = {0};
struct tc_red_qopt_offload hw_stats_request = {
+   .command = TC_RED_XSTATS,
.handle = sch->handle,
.parent = sch->parent,
-   .command = TC_RED_XSTATS,
-   .xstats = &hw_stats,
+   {
+   .xstats = &hw_stats,
+   },
};
if (!dev->netdev_ops->ndo_setup_tc(dev,
   TC_SETUP_QDISC_RED,
_


[patch 2/2] drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c: fix build with gcc-4.4.4

2017-03-31 Thread akpm
From: Andrew Morton 
Subject: drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c: fix build with 
gcc-4.4.4

drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c: In function 
'mlx5e_set_rxfh':
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1067: error: unknown field 
'rss' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1067: warning: missing 
braces around initializer
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1067: warning: (near 
initialization for 'rrp.')
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1068: error: unknown field 
'rss' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1069: warning: excess 
elements in struct initializer
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c:1069: warning: (near 
initialization for 'rrp')

gcc-4.4.4 has issues with anonymous union initializers.  Work around this.

Cc: Saeed Mahameed 
Cc: Tariq Toukan 
Signed-off-by: Andrew Morton 
---

 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c~drivers-net-ethernet-mellanox-mlx5-core-en_ethtoolc-fix-build-with-gcc-444
 drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
--- 
a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c~drivers-net-ethernet-mellanox-mlx5-core-en_ethtoolc-fix-build-with-gcc-444
+++ a/drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
@@ -1064,8 +1064,12 @@ static int mlx5e_set_rxfh(struct net_dev
u32 rqtn = priv->indir_rqt.rqtn;
struct mlx5e_redirect_rqt_param rrp = {
.is_rss = true,
-   .rss.hfunc = priv->channels.params.rss_hfunc,
-   .rss.channels  = &priv->channels
+   {
+   .rss = {
+   .hfunc = 
priv->channels.params.rss_hfunc,
+   .channels  = &priv->channels,
+   },
+   },
};
 
mlx5e_redirect_rqt(priv, rqtn, MLX5E_INDIR_RQT_SIZE, 
rrp);
_


[patch 1/2] drivers/net/ethernet/mellanox/mlx5/core/en_main.c: fix build with gcc-4.4.4

2017-03-31 Thread akpm
From: Andrew Morton 
Subject: drivers/net/ethernet/mellanox/mlx5/core/en_main.c: fix build with 
gcc-4.4.4

drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 
'mlx5e_redirect_rqts':
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2210: error: unknown field 
'rqn' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2211: warning: missing braces 
around initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2211: warning: (near 
initialization for 'direct_rrp.')
drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 
'mlx5e_redirect_rqts_to_channels':
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2227: error: unknown field 
'rss' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2227: warning: missing braces 
around initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2227: warning: (near 
initialization for 'rrp.')
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2227: warning: initialization 
makes integer from pointer without a cast
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2228: error: unknown field 
'rss' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2229: warning: excess 
elements in struct initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2229: warning: (near 
initialization for 'rrp')
drivers/net/ethernet/mellanox/mlx5/core/en_main.c: In function 
'mlx5e_redirect_rqts_to_drop':
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2238: error: unknown field 
'rqn' specified in initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2239: warning: missing braces 
around initializer
drivers/net/ethernet/mellanox/mlx5/core/en_main.c:2239: warning: (near 
initialization for 'drop_rrp.')

gcc-4.4.4 has issues with anonymous union initializers.  Work around this.

Cc: Saeed Mahameed 
Cc: Tariq Toukan 
Signed-off-by: Andrew Morton 
---

 drivers/net/ethernet/mellanox/mlx5/core/en_main.c |   16 +---
 1 file changed, 12 insertions(+), 4 deletions(-)

diff -puN 
drivers/net/ethernet/mellanox/mlx5/core/en_main.c~drivers-net-ethernet-mellanox-mlx5-core-en_mainc-fix-build-with-gcc-444
 drivers/net/ethernet/mellanox/mlx5/core/en_main.c
--- 
a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c~drivers-net-ethernet-mellanox-mlx5-core-en_mainc-fix-build-with-gcc-444
+++ a/drivers/net/ethernet/mellanox/mlx5/core/en_main.c
@@ -2207,7 +2207,9 @@ static void mlx5e_redirect_rqts(struct m
for (ix = 0; ix < priv->profile->max_nch(priv->mdev); ix++) {
struct mlx5e_redirect_rqt_param direct_rrp = {
.is_rss = false,
-   .rqn= mlx5e_get_direct_rqn(priv, ix, rrp)
+   {
+   .rqn= mlx5e_get_direct_rqn(priv, ix, rrp)
+   },
};
 
/* Direct RQ Tables */
@@ -2224,8 +2226,12 @@ static void mlx5e_redirect_rqts_to_chann
 {
struct mlx5e_redirect_rqt_param rrp = {
.is_rss= true,
-   .rss.channels  = chs,
-   .rss.hfunc = chs->params.rss_hfunc
+   {
+   .rss = {
+   .channels  = chs,
+   .hfunc = chs->params.rss_hfunc,
+   }
+   },
};
 
mlx5e_redirect_rqts(priv, rrp);
@@ -2235,7 +2241,9 @@ static void mlx5e_redirect_rqts_to_drop(
 {
struct mlx5e_redirect_rqt_param drop_rrp = {
.is_rss = false,
-   .rqn = priv->drop_rq.rqn
+   {
+   .rqn = priv->drop_rq.rqn,
+   },
};
 
mlx5e_redirect_rqts(priv, drop_rrp);
_


[patch 1/1] kernel/trace/bpf_trace.c: work around gcc-4.4.4 anon union initialization bug

2016-07-18 Thread akpm
From: Andrew Morton 
Subject: kernel/trace/bpf_trace.c: work around gcc-4.4.4 anon union 
initialization bug

kernel/trace/bpf_trace.c: In function 'bpf_event_output':
kernel/trace/bpf_trace.c:312: error: unknown field 'next' specified in 
initializer
kernel/trace/bpf_trace.c:312: warning: missing braces around initializer
kernel/trace/bpf_trace.c:312: warning: (near initialization for 
'raw.frag.')

Fixes: 555c8a8623a3a87 ("bpf: avoid stack copy and use skb ctx for event 
output")
Acked-by: Daniel Borkmann 
Cc: Alexei Starovoitov 
Cc: David S. Miller 
Signed-off-by: Andrew Morton 
---

 kernel/trace/bpf_trace.c |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff -puN 
kernel/trace/bpf_trace.c~kernel-trace-bpf_tracec-work-around-gcc-444-anon-union-initialization-bug
 kernel/trace/bpf_trace.c
--- 
a/kernel/trace/bpf_trace.c~kernel-trace-bpf_tracec-work-around-gcc-444-anon-union-initialization-bug
+++ a/kernel/trace/bpf_trace.c
@@ -309,7 +309,9 @@ u64 bpf_event_output(struct bpf_map *map
};
struct perf_raw_record raw = {
.frag = {
-   .next   = ctx_size ? &frag : NULL,
+   {
+   .next   = ctx_size ? &frag : NULL,
+   },
.size   = meta_size,
.data   = meta,
},
_


[patch 4/7] bnx2.c section fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/bnx2.c:67: error: version causes a section type conflict

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/bnx2.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/bnx2.c~bnx2c-section-fix drivers/net/bnx2.c
--- a/drivers/net/bnx2.c~bnx2c-section-fix
+++ a/drivers/net/bnx2.c
@@ -64,7 +64,7 @@
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (5*HZ)
 
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
"Broadcom NetXtreme II Gigabit Ethernet Driver " DRV_MODULE_NAME " v" 
DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
 MODULE_AUTHOR("Michael Chan <[EMAIL PROTECTED]>");
@@ -90,7 +90,7 @@ typedef enum {
 } board_t;
 
 /* indexed by board_t, above */
-static const struct {
+static struct {
char *name;
 } board_info[] __devinitdata = {
{ "Broadcom NetXtreme II BCM5706 1000Base-T" },
_
--
To unsubscribe from this list: send 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] bnx2x section fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/bnx2x.c:73: error: version causes a section type conflict

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/bnx2x.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/bnx2x.c~bnx2x-section-fix drivers/net/bnx2x.c
--- a/drivers/net/bnx2x.c~bnx2x-section-fix
+++ a/drivers/net/bnx2x.c
@@ -70,7 +70,7 @@
 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT (5*HZ)
 
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
"Broadcom NetXtreme II 577xx 10Gigabit Ethernet Driver "
DRV_MODULE_NAME " " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
@@ -107,7 +107,7 @@ enum bnx2x_board_type {
 };
 
 /* indexed by board_t, above */
-static const struct {
+static struct {
char *name;
 } board_info[] __devinitdata = {
{ "Broadcom NetXtreme II BCM57710 XGb" }
_
--
To unsubscribe from this list: send 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] starfire secton fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/starfire.c:219: error: version causes a section type conflict

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/starfire.c~starfire-secton-fix drivers/net/starfire.c
--- a/drivers/net/starfire.c~starfire-secton-fix
+++ a/drivers/net/starfire.c
@@ -216,7 +216,7 @@ do { \
 
 
 /* These identify the driver base version and may not be removed. */
-static const char version[] __devinitdata =
+static char version[] =
 KERN_INFO "starfire.c:v1.03 7/26/2000  Written by Donald Becker <[EMAIL 
PROTECTED]>\n"
 KERN_INFO " (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " 
DRV_RELDATE ")\n";
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 5/7] via-velocity section fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/via-velocity.c:443: error: chip_info_table causes a section type 
conflict

on this one I had to remove the __devinitdata too.  Don't know why.

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/via-velocity.c~via-velocity-section-fix 
drivers/net/via-velocity.c
--- a/drivers/net/via-velocity.c~via-velocity-section-fix
+++ a/drivers/net/via-velocity.c
@@ -440,7 +440,7 @@ static void velocity_unregister_notifier
  * Internal board variants. At the moment we have only one
  */
 
-static const struct velocity_info_tbl chip_info_table[] __devinitdata = {
+static struct velocity_info_tbl chip_info_table[] = {
{CHIP_TYPE_VT6110, "VIA Networking Velocity Family Gigabit Ethernet 
Adapter", 1, 0x00FFUL},
{ }
 };
_
--
To unsubscribe from this list: send 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/7] typhoon section fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/typhoon.c:137: error: version causes a section type conflict

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/typhoon.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/typhoon.c~typhoon-section-fix drivers/net/typhoon.c
--- a/drivers/net/typhoon.c~typhoon-section-fix
+++ a/drivers/net/typhoon.c
@@ -134,7 +134,7 @@ static const int multicast_filter_limit 
 #include "typhoon.h"
 #include "typhoon-firmware.h"
 
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
 "typhoon.c: version " DRV_MODULE_VERSION " (" DRV_MODULE_RELDATE ")\n";
 
 MODULE_AUTHOR("David Dillow <[EMAIL PROTECTED]>");
@@ -178,7 +178,7 @@ enum typhoon_cards {
 };
 
 /* directly indexed by enum typhoon_cards, above */
-static const struct typhoon_card_info typhoon_card_info[] __devinitdata = {
+static struct typhoon_card_info typhoon_card_info[] __devinitdata = {
{ "3Com Typhoon (3C990-TX)",
TYPHOON_CRYPTO_NONE},
{ "3Com Typhoon (3CR990-TX-95)",
_
--
To unsubscribe from this list: send 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] natsemi section fix

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

gcc-3.4.4 on powerpc:

drivers/net/natsemi.c:245: error: natsemi_pci_info causes a section type 
conflict

Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/natsemi.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/net/natsemi.c~natsemi-section-fix drivers/net/natsemi.c
--- a/drivers/net/natsemi.c~natsemi-section-fix
+++ a/drivers/net/natsemi.c
@@ -127,7 +127,7 @@ static int full_duplex[MAX_UNITS];
 #define NATSEMI_RX_LIMIT   2046/* maximum supported by hardware */
 
 /* These identify the driver base version and may not be removed. */
-static const char version[] __devinitdata =
+static char version[] __devinitdata =
   KERN_INFO DRV_NAME " dp8381x driver, version "
   DRV_VERSION ", " DRV_RELDATE "\n"
   KERN_INFO "  originally by Donald Becker <[EMAIL PROTECTED]>\n"
@@ -238,7 +238,7 @@ enum {
 };
 
 /* array of board data directly indexed by pci_tbl[x].driver_data */
-static const struct {
+static struct {
const char *name;
unsigned long flags;
unsigned int eeprom_size;
@@ -247,7 +247,7 @@ static const struct {
{ "NatSemi DP8381[56]", 0, 24 },
 };
 
-static const struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
+static struct pci_device_id natsemi_pci_tbl[] __devinitdata = {
{ PCI_VENDOR_ID_NS, 0x0020, 0x12d9, 0x000c, 0, 0, 0 },
{ PCI_VENDOR_ID_NS, 0x0020, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 1 },
{ } /* terminate list */
_
--
To unsubscribe from this list: send 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] pppol2tp: fix printk warnings

2008-02-08 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

drivers/net/pppol2tp.c: In function `pppol2tp_seq_tunnel_show':
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 4)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 5)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 6)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 7)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 8)
drivers/net/pppol2tp.c:2295: warning: long long unsigned int format, __u64 arg 
(arg 9)
drivers/net/pppol2tp.c: In function `pppol2tp_seq_session_show':
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 5)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 6)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 7)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 8)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 9)
drivers/net/pppol2tp.c:2328: warning: long long unsigned int format, __u64 arg 
(arg 10)

Not all platforms implement u64 with unsigned long long.  eg: powerpc.

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

 drivers/net/pppol2tp.c |   22 --
 1 file changed, 12 insertions(+), 10 deletions(-)

diff -puN drivers/net/pppol2tp.c~pppol2tp-fix-printk-warnings 
drivers/net/pppol2tp.c
--- a/drivers/net/pppol2tp.c~pppol2tp-fix-printk-warnings
+++ a/drivers/net/pppol2tp.c
@@ -2289,10 +2289,12 @@ static void pppol2tp_seq_tunnel_show(str
   atomic_read(&tunnel->ref_count) - 1);
seq_printf(m, " %08x %llu/%llu/%llu %llu/%llu/%llu\n",
   tunnel->debug,
-  tunnel->stats.tx_packets, tunnel->stats.tx_bytes,
-  tunnel->stats.tx_errors,
-  tunnel->stats.rx_packets, tunnel->stats.rx_bytes,
-  tunnel->stats.rx_errors);
+  (unsigned long long)tunnel->stats.tx_packets,
+  (unsigned long long)tunnel->stats.tx_bytes,
+  (unsigned long long)tunnel->stats.tx_errors,
+  (unsigned long long)tunnel->stats.rx_packets,
+  (unsigned long long)tunnel->stats.rx_bytes,
+  (unsigned long long)tunnel->stats.rx_errors);
 }
 
 static void pppol2tp_seq_session_show(struct seq_file *m, void *v)
@@ -2320,12 +2322,12 @@ static void pppol2tp_seq_session_show(st
   jiffies_to_msecs(session->reorder_timeout));
seq_printf(m, "   %hu/%hu %llu/%llu/%llu %llu/%llu/%llu\n",
   session->nr, session->ns,
-  session->stats.tx_packets,
-  session->stats.tx_bytes,
-  session->stats.tx_errors,
-  session->stats.rx_packets,
-  session->stats.rx_bytes,
-  session->stats.rx_errors);
+  (unsigned long long)session->stats.tx_packets,
+  (unsigned long long)session->stats.tx_bytes,
+  (unsigned long long)session->stats.tx_errors,
+  (unsigned long long)session->stats.rx_packets,
+  (unsigned long long)session->stats.rx_bytes,
+  (unsigned long long)session->stats.rx_errors);
 }
 
 static int pppol2tp_seq_show(struct seq_file *m, void *v)
_
--
To unsubscribe from this list: send 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] drivers/bluetooth/btsdio.c: fix double-free

2008-02-04 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch fixes a double-free spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/btsdio.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN drivers/bluetooth/btsdio.c~drivers-bluetooth-btsdioc-fix-double-free 
drivers/bluetooth/btsdio.c
--- a/drivers/bluetooth/btsdio.c~drivers-bluetooth-btsdioc-fix-double-free
+++ a/drivers/bluetooth/btsdio.c
@@ -162,10 +162,8 @@ static int btsdio_rx_packet(struct btsdi
bt_cb(skb)->pkt_type = hdr[3];
 
err = hci_recv_frame(skb);
-   if (err < 0) {
-   kfree(skb);
+   if (err < 0)
return err;
-   }
 
sdio_writeb(data->func, 0x00, REG_PC_RRT, 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


[patch 6/7] hci_ldisc: fix null pointer deref

2008-02-04 Thread akpm
From: David Newall <[EMAIL PROTECTED]>

Arjan:

  With the help of kerneloops.org I've spotted a nice little interaction
  between the TTY layer and the bluetooth code, however the tty layer is not
  something I'm all too familiar with so I rather ask than brute-force fix the
  code incorrectly.

  The raw details are at:
  http://www.kerneloops.org/search.php?search=uart_flush_buffer

  What happens is that, on closing the bluetooth tty, the tty layer goes
  into the release_dev() function, which first does a bunch of stuff, then
  sets the file->private_data to NULL, does some more stuff and then calls the
  ldisc close function.  Which in this case, is hci_uart_tty_close().

  Now, hci_uart_tty_close() calls hci_uart_close() which clears some
  internal bit, and then calls hci_uart_flush()...  which calls back to the
  tty layers' uart_flush_buffer() function.  (in drivers/bluetooth/hci_tty.c
  around line 194) Which then WARN_ON()'s because that's not allowed/supposed
  to be called this late in the shutdown of the port

  Should the bluetooth driver even call this flush function at all??

David:

  This seems to be what happens: Hci_uart_close() flushes using
  hci_uart_flush().  Subsequently, in hci_dev_do_close(), (one step in
  hci_unregister_dev()), hci_uart_flush() is called again.  The comment in
  uart_flush_buffer(), relating to the WARN_ON(), indicates you can't flush
  after the port is closed; which sounds reasonable.  I think hci_uart_close()
  should set hdev->flush to NULL before returning.  Hci_dev_do_close() does
  check for this.  The code path is rather involved and I'm not entirely clear
  of all steps, but I think that's what should be done.

akpm:

  No idea.  trollmerge.

Cc: Arjan van de Ven <[EMAIL PROTECTED]>
Cc: Alan Cox <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/hci_ldisc.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/bluetooth/hci_ldisc.c~hci_ldisc-fix-null-pointer-deref 
drivers/bluetooth/hci_ldisc.c
--- a/drivers/bluetooth/hci_ldisc.c~hci_ldisc-fix-null-pointer-deref
+++ a/drivers/bluetooth/hci_ldisc.c
@@ -208,6 +208,7 @@ static int hci_uart_close(struct hci_dev
return 0;
 
hci_uart_flush(hdev);
+   hdev->flush = NULL;
return 0;
 }
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 3/7] drivers/bluetooth/bpa10x.c: fix memleak

2008-02-04 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch fixea a memleak spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/bpa10x.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/bluetooth/bpa10x.c~drivers-bluetooth-bpa10xc-fix-memleak 
drivers/bluetooth/bpa10x.c
--- a/drivers/bluetooth/bpa10x.c~drivers-bluetooth-bpa10xc-fix-memleak
+++ a/drivers/bluetooth/bpa10x.c
@@ -423,6 +423,7 @@ static int bpa10x_send_frame(struct sk_b
break;
 
default:
+   usb_free_urb(urb);
return -EILSEQ;
}
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 5/7] bluetooth: blacklist another Broadcom BCM2035 device

2008-02-04 Thread akpm
From: Andy Shevchenko <[EMAIL PROTECTED]>

This device is recognized as bluetooth, but still not works.

Signed-off-by: Andy Shevchenko <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/hci_usb.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/bluetooth/hci_usb.c~bluetooth-blacklist-another-broadcom-bcm2035-device 
drivers/bluetooth/hci_usb.c
--- 
a/drivers/bluetooth/hci_usb.c~bluetooth-blacklist-another-broadcom-bcm2035-device
+++ a/drivers/bluetooth/hci_usb.c
@@ -111,6 +111,7 @@ static struct usb_device_id blacklist_id
{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
 
/* Broadcom BCM2035 */
+   { USB_DEVICE(0x0a5c, 0x2035), .driver_info = HCI_RESET | 
HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | 
HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
 
_
--
To unsubscribe from this list: send 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/7] bluetooth: hidp_process_hid_control remove unnecessary parameter dealing

2008-02-04 Thread akpm
From: Dave Young <[EMAIL PROTECTED]>

According to the bluetooth HID spec v1.0 chapter 7.4.2

"This code requests a major state change in a BT-HID device.  A HID_CONTROL
request does not generate a HANDSHAKE response."

"A HID_CONTROL packet with a parameter of VIRTUAL_CABLE_UNPLUG is the only
HID_CONTROL packet a device can send to a host.  A host will ignore all other
packets."

So in the hidp_precess_hid_control function, we just need to deal with the
UNLUG packet.

Signed-off-by: Dave Young <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bluetooth/hidp/core.c |   19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)

diff -puN 
net/bluetooth/hidp/core.c~bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing
 net/bluetooth/hidp/core.c
--- 
a/net/bluetooth/hidp/core.c~bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing
+++ a/net/bluetooth/hidp/core.c
@@ -369,30 +369,13 @@ static inline void hidp_process_hid_cont
 {
BT_DBG("session %p param 0x%02x", session, param);
 
-   switch (param) {
-   case HIDP_CTRL_NOP:
-   break;
-
-   case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG:
+   if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
/* Flush the transmit queues */
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);
 
/* Kill session thread */
atomic_inc(&session->terminate);
-   break;
-
-   case HIDP_CTRL_HARD_RESET:
-   case HIDP_CTRL_SOFT_RESET:
-   case HIDP_CTRL_SUSPEND:
-   case HIDP_CTRL_EXIT_SUSPEND:
-   /* FIXME: We have to parse these and return no error */
-   break;
-
-   default:
-   __hidp_send_ctrl_message(session,
-   HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, 
NULL, 0);
-   break;
}
 }
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 7/7] rfcomm tty: destroy before tty_close()

2008-02-04 Thread akpm
From: Dave Young <[EMAIL PROTECTED]>

rfcomm dev could be deleted in tty_hangup, so we must not call
rfcomm_dev_del again to prevent from destroying rfcomm dev before tty
close.

Signed-off-by: Dave Young <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bluetooth/rfcomm/tty.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff -puN net/bluetooth/rfcomm/tty.c~rfcomm-tty-destroy-before-tty_close 
net/bluetooth/rfcomm/tty.c
--- a/net/bluetooth/rfcomm/tty.c~rfcomm-tty-destroy-before-tty_close
+++ a/net/bluetooth/rfcomm/tty.c
@@ -429,7 +429,8 @@ static int rfcomm_release_dev(void __use
if (dev->tty)
tty_vhangup(dev->tty);
 
-   rfcomm_dev_del(dev);
+   if (!test_bit(RFCOMM_RELEASE_ONHUP, &dev->flags))
+   rfcomm_dev_del(dev);
rfcomm_dev_put(dev);
return 0;
 }
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/7] bluetooth: uninlining

2008-02-04 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

Remove all those inlines which were either a) unneeded or b) increased code
size.

  textdata bss dec hex filename
before:   6997  74   870791ba7 net/bluetooth/hidp/core.o
after:6492  74   8657419ae net/bluetooth/hidp/core.o

Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bluetooth/hidp/core.c |   30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)

diff -puN net/bluetooth/hidp/core.c~bluetooth-uninlining 
net/bluetooth/hidp/core.c
--- a/net/bluetooth/hidp/core.c~bluetooth-uninlining
+++ a/net/bluetooth/hidp/core.c
@@ -135,8 +135,8 @@ static void __hidp_copy_session(struct h
}
 }
 
-static inline int hidp_queue_event(struct hidp_session *session, struct 
input_dev *dev,
-   unsigned int type, unsigned int code, 
int value)
+static int hidp_queue_event(struct hidp_session *session, struct input_dev 
*dev,
+   unsigned int type, unsigned int code, int value)
 {
unsigned char newleds;
struct sk_buff *skb;
@@ -243,7 +243,8 @@ static void hidp_input_report(struct hid
input_sync(dev);
 }
 
-static inline int hidp_queue_report(struct hidp_session *session, unsigned 
char *data, int size)
+static int hidp_queue_report(struct hidp_session *session,
+   unsigned char *data, int size)
 {
struct sk_buff *skb;
 
@@ -287,7 +288,7 @@ static void hidp_idle_timeout(unsigned l
hidp_schedule(session);
 }
 
-static inline void hidp_set_timer(struct hidp_session *session)
+static void hidp_set_timer(struct hidp_session *session)
 {
if (session->idle_to > 0)
mod_timer(&session->timer, jiffies + HZ * session->idle_to);
@@ -332,7 +333,8 @@ static inline int hidp_send_ctrl_message
return err;
 }
 
-static inline void hidp_process_handshake(struct hidp_session *session, 
unsigned char param)
+static void hidp_process_handshake(struct hidp_session *session,
+   unsigned char param)
 {
BT_DBG("session %p param 0x%02x", session, param);
 
@@ -365,7 +367,8 @@ static inline void hidp_process_handshak
}
 }
 
-static inline void hidp_process_hid_control(struct hidp_session *session, 
unsigned char param)
+static void hidp_process_hid_control(struct hidp_session *session,
+   unsigned char param)
 {
BT_DBG("session %p param 0x%02x", session, param);
 
@@ -379,7 +382,8 @@ static inline void hidp_process_hid_cont
}
 }
 
-static inline void hidp_process_data(struct hidp_session *session, struct 
sk_buff *skb, unsigned char param)
+static void hidp_process_data(struct hidp_session *session, struct sk_buff 
*skb,
+   unsigned char param)
 {
BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, 
param);
 
@@ -406,7 +410,8 @@ static inline void hidp_process_data(str
}
 }
 
-static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct 
sk_buff *skb)
+static void hidp_recv_ctrl_frame(struct hidp_session *session,
+   struct sk_buff *skb)
 {
unsigned char hdr, type, param;
 
@@ -440,7 +445,8 @@ static inline void hidp_recv_ctrl_frame(
kfree_skb(skb);
 }
 
-static inline void hidp_recv_intr_frame(struct hidp_session *session, struct 
sk_buff *skb)
+static void hidp_recv_intr_frame(struct hidp_session *session,
+   struct sk_buff *skb)
 {
unsigned char hdr;
 
@@ -608,7 +614,8 @@ static struct device *hidp_get_device(st
return conn ? &conn->dev : NULL;
 }
 
-static inline int hidp_setup_input(struct hidp_session *session, struct 
hidp_connadd_req *req)
+static int hidp_setup_input(struct hidp_session *session,
+   struct hidp_connadd_req *req)
 {
struct input_dev *input = session->input;
int i;
@@ -685,7 +692,8 @@ static void hidp_setup_quirks(struct hid
hid->quirks = hidp_blacklist[n].quirks;
 }
 
-static inline void hidp_setup_hid(struct hidp_session *session, struct 
hidp_connadd_req *req)
+static void hidp_setup_hid(struct hidp_session *session,
+   struct hidp_connadd_req *req)
 {
struct hid_device *hid = session->hid;
struct hid_report *report;
_
--
To unsubscribe from this list: send 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/4] mv643xx_eth: fix byte order when checksum offload is enabled

2008-02-04 Thread akpm
From: Byron Bradley <[EMAIL PROTECTED]>

The Marvell Orion system on chips have an integrated mv643xx MAC.  On these
little endian ARM devices mv643xx will oops when checksum offload is
enabled.  Swapping the byte order of the protocol and checksum solves this
problem.

Signed-off-by: Byron Bradley <[EMAIL PROTECTED]>
Cc: Dale Farnsworth <[EMAIL PROTECTED]>
Cc: Manish Lachwani <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Al Viro <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/mv643xx_eth.c |   11 ---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff -puN 
drivers/net/mv643xx_eth.c~mv643xx_eth-fix-byte-order-when-checksum-offload-is-enabled
 drivers/net/mv643xx_eth.c
--- 
a/drivers/net/mv643xx_eth.c~mv643xx_eth-fix-byte-order-when-checksum-offload-is-enabled
+++ a/drivers/net/mv643xx_eth.c
@@ -1652,6 +1652,11 @@ static void eth_tx_fill_frag_descs(struc
}
 }
 
+static inline __be16 sum16_as_be(__sum16 sum)
+{
+   return (__force __be16)sum;
+}
+
 /**
  * eth_tx_submit_descs_for_skb - submit data from an skb to the tx hw
  *
@@ -1689,7 +1694,7 @@ static void eth_tx_submit_descs_for_skb(
desc->buf_ptr = dma_map_single(NULL, skb->data, length, DMA_TO_DEVICE);
 
if (skb->ip_summed == CHECKSUM_PARTIAL) {
-   BUG_ON(skb->protocol != ETH_P_IP);
+   BUG_ON(skb->protocol != htons(ETH_P_IP));
 
cmd_sts |= ETH_GEN_TCP_UDP_CHECKSUM |
   ETH_GEN_IP_V_4_CHECKSUM  |
@@ -1698,10 +1703,10 @@ static void eth_tx_submit_descs_for_skb(
switch (ip_hdr(skb)->protocol) {
case IPPROTO_UDP:
cmd_sts |= ETH_UDP_FRAME;
-   desc->l4i_chk = udp_hdr(skb)->check;
+   desc->l4i_chk = ntohs(sum16_as_be(udp_hdr(skb)->check));
break;
case IPPROTO_TCP:
-   desc->l4i_chk = tcp_hdr(skb)->check;
+   desc->l4i_chk = ntohs(sum16_as_be(tcp_hdr(skb)->check));
break;
default:
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 4/4] drivers/net/tlan.c: compilation warning fix

2008-02-04 Thread akpm
From: Leonardo Potenza <[EMAIL PROTECTED]>

Add a check for the pci_register_driver() return value.  Removed unused
variable pad_allocated.

The aim of this patch is to remove the following warning messages:
drivers/net/tlan.c: In function 'tlan_probe':
drivers/net/tlan.c:486: warning: ignoring return value of 
'pci_register_driver', declared with attribute warn_unused_result

Signed-off-by: Leonardo Potenza <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tlan.c |   25 ++---
 1 file changed, 18 insertions(+), 7 deletions(-)

diff -puN drivers/net/tlan.c~drivers-net-tlanc-compilation-warning-fix 
drivers/net/tlan.c
--- a/drivers/net/tlan.c~drivers-net-tlanc-compilation-warning-fix
+++ a/drivers/net/tlan.c
@@ -465,7 +465,7 @@ static struct pci_driver tlan_driver = {
 
 static int __init tlan_probe(void)
 {
-   static int  pad_allocated;
+   int rc = -ENODEV;
 
printk(KERN_INFO "%s", tlan_banner);
 
@@ -473,17 +473,22 @@ static int __init tlan_probe(void)
 
if (TLanPadBuffer == NULL) {
printk(KERN_ERR "TLAN: Could not allocate memory for pad 
buffer.\n");
-   return -ENOMEM;
+   rc = -ENOMEM;
+   goto err_out;
}
 
memset(TLanPadBuffer, 0, TLAN_MIN_FRAME_SIZE);
-   pad_allocated = 1;
 
TLAN_DBG(TLAN_DEBUG_PROBE, "Starting PCI Probe\n");
 
/* Use new style PCI probing. Now the kernel will
   do most of this for us */
-   pci_register_driver(&tlan_driver);
+   rc = pci_register_driver(&tlan_driver);
+
+   if (rc != 0) {
+   printk(KERN_ERR "TLAN: Could not register pci driver.\n");
+   goto err_out_pci_free;
+   }
 
TLAN_DBG(TLAN_DEBUG_PROBE, "Starting EISA Probe\n");
TLan_EisaProbe();
@@ -493,11 +498,17 @@ static int __init tlan_probe(void)
 tlan_have_pci, tlan_have_eisa);
 
if (TLanDevicesInstalled == 0) {
-   pci_unregister_driver(&tlan_driver);
-   pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, 
TLanPadBufferDMA);
-   return -ENODEV;
+   rc = -ENODEV;
+   goto  err_out_pci_unreg;
}
return 0;
+
+err_out_pci_unreg:
+   pci_unregister_driver(&tlan_driver);
+err_out_pci_free:
+   pci_free_consistent(NULL, TLAN_MIN_FRAME_SIZE, TLanPadBuffer, 
TLanPadBufferDMA);
+err_out:
+   return rc;
 }
 
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/4] forcedeth: fix MAC address detection on network card (regression in 2.6.23)

2008-02-04 Thread akpm
From: Michael Pyne <[EMAIL PROTECTED]>

Partially revert a change to mac address detection introduced to the forcedeth
driver.  The change was intended to correct mac address detection for newer
nVidia chipsets where the mac address was stored in reverse order.  One of
those chipsets appears to still have the mac address in reverse order (or at
least, it does on my system).

The change that broke mac address detection for my card was commit
ef756b3e56c68a4d76d9d7b9a73fa8f4f739180f "forcedeth: mac address correct"

My network card is an nVidia built-in Ethernet card, output from lspci as
follows (with text and numeric ids):
$ lspci | grep Ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
$ lspci -n | grep 07.0
00:07.0 0680: 10de:03ef (rev a2)

The vendor id is, of course, nVidia.  The device id corresponds to the
NVIDIA_NVENET_19 entry.

The included patch fixes the MAC address detection on my system.
Interestingly, the MAC address appears to be in the range reserved for my
motherboard manufacturer (Gigabyte) and not nVidia.

Signed-off-by: Michael J. Pyne <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>

On Wed, 21 Nov 2007 15:34:52 -0800
"Ayaz Abdulla" <[EMAIL PROTECTED]> wrote:

> The solution is to get the OEM to update their BIOS (instead of
> integrating this patch) since the MCP61 specs indicate that the MAC
> Address should be in correct order from BIOS.
> 
> By changing the feature DEV_HAS_CORRECT_MACADDR to all MCP61 boards, it
> could cause it to break on other OEM systems who have implemented it
> correctly.
> 

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
 drivers/net/forcedeth.c
--- 
a/drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
+++ a/drivers/net/forcedeth.c
@@ -5554,7 +5554,7 @@ static struct pci_device_id pci_tbl[] = 
},
{   /* MCP61 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_19),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
},
{   /* MCP65 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_20),
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 1/4] forcedeth: power down phy when interface is down

2008-02-04 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled.  This mirrors the behavior of
other drivers including e1000 and tg3.

Without the patch, ifconfig down leaves the physical link up, which confuses
datacenter users who expect the link lights both on the NIC and the switch to
go out when they bring an interface down.

Furthermore, even though the phy is powered on, autonegotiation stops working,
so a normally gigabit link might suddenly become 100 Mbit half-duplex when the
interface goes down, and become gigabit when it comes up again.

Ayaz said:

  I would not include this patch until further testing is performed.  NVIDIA
  MCP chips use 3rd party PHY vendors.  By powering down the phy, it could
  have adverse affects on certain phys.

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1324,9 +1324,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-   /* restart auto negotiation */
+   /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4803,6 +4803,10 @@ static int nv_open(struct net_device *de
 
dprintk(KERN_DEBUG "nv_open: begin\n");
 
+   /* power up phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4985,6 +4989,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + 
NvRegPacketFilterFlags);
nv_start_rx(dev);
+   } else {
+   /* power down phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
 
/* FIXME: power down nic */
_
--
To unsubscribe from this list: send 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] hamradio: fix dmascc section mismatch

2008-02-04 Thread akpm
From: Randy Dunlap <[EMAIL PROTECTED]>

hw[] is used in both init and exit functions so it cannot be initdata (section
mismatch is when CONFIG_MODULES=n and CONFIG_DMASCC=y).

WARNING: vmlinux.o(.exit.text+0xba7): Section mismatch: reference to 
.init.data: (between 'dmascc_exit' and 'sixpack_exit_driver')

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
Cc: Klaus Kudielka <[EMAIL PROTECTED]>
Cc: Sam Ravnborg <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/hamradio/dmascc.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/hamradio/dmascc.c~hamradio-fix-dmascc-section-mismatch 
drivers/net/hamradio/dmascc.c
--- a/drivers/net/hamradio/dmascc.c~hamradio-fix-dmascc-section-mismatch
+++ a/drivers/net/hamradio/dmascc.c
@@ -262,8 +262,8 @@ static void tm_isr(struct scc_priv *priv
 
 static int io[MAX_NUM_DEVS] __initdata = { 0, };
 
-/* Beware! hw[] is also used in cleanup_module(). */
-static struct scc_hardware hw[NUM_TYPES] __initdata_or_module = HARDWARE;
+/* Beware! hw[] is also used in dmascc_exit(). */
+static struct scc_hardware hw[NUM_TYPES] = HARDWARE;
 
 
 /* Global variables */
_
--
To unsubscribe from this list: send 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] tun: impossible to deassert IFF_ONE_QUEUE or IFF_NO_PI

2008-02-04 Thread akpm
From: "Nathaniel Filardo" <[EMAIL PROTECTED]>

Taken from http://bugzilla.kernel.org/show_bug.cgi?id=9806

The TUN/TAP driver only permits one-way transitions of IFF_NO_PI or
IFF_ONE_QUEUE during the lifetime of a tap/tun interface.  Note that
tun_set_iff contains

 541 if (ifr->ifr_flags & IFF_NO_PI)
 542 tun->flags |= TUN_NO_PI;
 543 
 544 if (ifr->ifr_flags & IFF_ONE_QUEUE)
 545 tun->flags |= TUN_ONE_QUEUE;

This is easily fixed by adding else branches which clear these bits.

Steps to reproduce:

This is easily reproduced by setting an interface persistant using tunctl then
attempting to open it as IFF_TAP or IFF_TUN, without asserting the IFF_NO_PI
flag.  The ioctl() will succeed and the ifr.flags word is not modified, but the
interface remains in IFF_NO_PI mode (as it was set by tunctl).

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Acked-by: Maxim Krasnyansky <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tun.c |4 
 1 file changed, 4 insertions(+)

diff -puN 
drivers/net/tun.c~tun-dev-impossible-to-deassert-iff_one_queue-or-iff_no_pi 
drivers/net/tun.c
--- 
a/drivers/net/tun.c~tun-dev-impossible-to-deassert-iff_one_queue-or-iff_no_pi
+++ a/drivers/net/tun.c
@@ -529,9 +529,13 @@ static int tun_set_iff(struct file *file
 
if (ifr->ifr_flags & IFF_NO_PI)
tun->flags |= TUN_NO_PI;
+   else
+   tun->flags &= ~TUN_NO_PI;
 
if (ifr->ifr_flags & IFF_ONE_QUEUE)
tun->flags |= TUN_ONE_QUEUE;
+   else
+   tun->flags &= ~TUN_ONE_QUEUE;
 
file->private_data = tun;
tun->attached = 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 07/10] e100: free IRQ to remove warning when rebooting

2007-12-13 Thread akpm
From: Ian Wienand <[EMAIL PROTECTED]>

When rebooting today I got

Will now restart.
ACPI: PCI interrupt for device :00:03.0 disabled
GSI 20 (level, low) -> CPU 1 (0x0100) vector 53 unregistered
Destroying IRQ53 without calling free_irq
WARNING: at 
/home/insecure/ianw/programs/git-kernel/linux-2.6/kernel/irq/chip.c:76 
dynamic_irq_cleanup()

Call Trace:
 [] show_stack+0x40/0xa0
sp=e0407c927b40 bsp=e0407c920eb8
 [] dump_stack+0x30/0x60
sp=e0407c927d10 bsp=e0407c920ea0
 [] dynamic_irq_cleanup+0x160/0x1e0
sp=e0407c927d10 bsp=e0407c920e70
 [] destroy_and_reserve_irq+0x30/0xc0
sp=e0407c927d10 bsp=e0407c920e40
 [] iosapic_unregister_intr+0x5b0/0x5e0
sp=e0407c927d10 bsp=e0407c920dd8
 [] acpi_unregister_gsi+0x30/0x60
sp=e0407c927d10 bsp=e0407c920db8
 [] acpi_pci_irq_disable+0x140/0x160
sp=e0407c927d10 bsp=e0407c920d88
 [] pcibios_disable_device+0xa0/0xc0
sp=e0407c927d20 bsp=e0407c920d68
 [] pci_disable_device+0x130/0x160
sp=e0407c927d20 bsp=e0407c920d38
 [] e100_shutdown+0x1c0/0x220
sp=e0407c927d30 bsp=e0407c920d08
 [] pci_device_shutdown+0x80/0xc0
sp=e0407c927d30 bsp=e0407c920ce8
 [] device_shutdown+0xf0/0x180
sp=e0407c927d30 bsp=e0407c920cc8
 [] kernel_restart+0x60/0x120
sp=e0407c927d30 bsp=e0407c920ca8
 [] sys_reboot+0x3b0/0x480
sp=e0407c927d30 bsp=e0407c920c30
 [] ia64_ret_from_syscall+0x0/0x20
sp=e0407c927e30 bsp=e0407c920c30
 [] ia64_ivt+0x00010620/0x400
sp=e0407c928000 bsp=e0407c920c30
Restarting system.

I think the solution might be to free the IRQ before the pci_device_shutdown

Signed-off-by: Ian Wienand <[EMAIL PROTECTED]>
Cc: Jesse Brandeburg <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/e100.c~e100-free-irq-to-remove-warning-when-rebooting 
drivers/net/e100.c
--- a/drivers/net/e100.c~e100-free-irq-to-remove-warning-when-rebooting
+++ a/drivers/net/e100.c
@@ -2852,6 +2852,7 @@ static void e100_shutdown(struct pci_dev
pci_enable_wake(pdev, PCI_D3cold, 0);
}
 
+   free_irq(pdev->irq, netdev);
pci_disable_device(pdev);
pci_set_power_state(pdev, PCI_D3hot);
 }
_
--
To unsubscribe from this list: send 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 09/10] bnx2x depends on ZLIB_INFLATE

2007-12-13 Thread akpm
From: Lee Schermerhorn <[EMAIL PROTECTED]>

The bnx2x module depends on the zlib_inflate functions.  The build will
fail if ZLIB_INFLATE has not been selected manually or by building another
module that automatically selects it.

Modify BNX2X config option to 'select ZLIB_INFLATE' like BNX2
and others.  This seems to fix it.

Signed-off-by: Lee Schermerhorn <[EMAIL PROTECTED]>
Acked-by: Eliezer Tamir <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/net/Kconfig~bnx2x-depends-on-zlib_inflate drivers/net/Kconfig
--- a/drivers/net/Kconfig~bnx2x-depends-on-zlib_inflate
+++ a/drivers/net/Kconfig
@@ -2607,6 +2607,7 @@ config TEHUTI
 config BNX2X
tristate "Broadcom NetXtremeII 10Gb support"
depends on PCI
+   select ZLIB_INFLATE
help
  This driver supports Broadcom NetXtremeII 10 gigabit Ethernet cards.
  To compile this driver as a module, choose M here: the module
_
--
To unsubscribe from this list: send 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 05/10] pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop

2007-12-13 Thread akpm
From: "Robert P. J. Day" <[EMAIL PROTECTED]>

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Dominik Brodowski <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/pcmcia/pcnet_cs.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/pcmcia/pcnet_cs.c~pcmcia-net-use-roundup_pow_of_two-macro-instead-of-grotesque-loop
 drivers/net/pcmcia/pcnet_cs.c
--- 
a/drivers/net/pcmcia/pcnet_cs.c~pcmcia-net-use-roundup_pow_of_two-macro-instead-of-grotesque-loop
+++ a/drivers/net/pcmcia/pcnet_cs.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "../8390.h"
 
 #include 
@@ -1484,8 +1485,7 @@ static int setup_shmem_window(struct pcm
window_size = 32 * 1024;
 
 /* Make sure it's a power of two.  */
-while ((window_size & (window_size - 1)) != 0)
-   window_size += window_size & ~(window_size - 1);
+window_size = roundup_pow_of_two(window_size);
 
 /* Allocate a memory window */
 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
_
--
To unsubscribe from this list: send 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 06/10] Net: ibm_newemac, remove SPIN_LOCK_UNLOCKED

2007-12-13 Thread akpm
From: Jiri Slaby <[EMAIL PROTECTED]>

SPIN_LOCK_UNLOCKED is deprecated, use DEFINE_SPINLOCK instead

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/ibm_newemac/debug.c~net-ibm_newemac-remove-spin_lock_unlocked 
drivers/net/ibm_newemac/debug.c
--- a/drivers/net/ibm_newemac/debug.c~net-ibm_newemac-remove-spin_lock_unlocked
+++ a/drivers/net/ibm_newemac/debug.c
@@ -21,7 +21,7 @@
 
 #include "core.h"
 
-static spinlock_t emac_dbg_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(emac_dbg_lock);
 
 static void emac_desc_dump(struct emac_instance *p)
 {
_
--
To unsubscribe from this list: send 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 08/10] net: smc911x: shut up compiler warnings

2007-12-13 Thread akpm
From: Paul Mundt <[EMAIL PROTECTED]>

Trivial fix to shut up gcc.

Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/smc911x.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/net/smc911x.h~net-smc911x-shut-up-compiler-warnings 
drivers/net/smc911x.h
--- a/drivers/net/smc911x.h~net-smc911x-shut-up-compiler-warnings
+++ a/drivers/net/smc911x.h
@@ -76,7 +76,7 @@
 
 
 
-#if SMC_USE_PXA_DMA
+#ifdef SMC_USE_PXA_DMA
 #define SMC_USE_DMA
 
 /*
_
--
To unsubscribe from this list: send 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 04/10] ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes

2007-12-13 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Emil Medve <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Kumar Gala <[EMAIL PROTECTED]>
Cc: Li Yang <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
 drivers/net/ucc_geth.c
--- 
a/drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
+++ a/drivers/net/ucc_geth.c
@@ -3447,7 +3447,7 @@ static int ucc_geth_rx(struct ucc_geth_p
u16 length, howmany = 0;
u32 bd_status;
u8 *bdBuffer;
-   struct net_device * dev;
+   struct net_device *dev;
 
ugeth_vdbg("%s: IN", __FUNCTION__);
 
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/10] PLIP driver: convert killed_timer_sem to completion

2007-12-13 Thread akpm
From: Matthias Kaehlcke <[EMAIL PROTECTED]>

PLIP driver: convert the semaphore killed_timer_sem to a completion

Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/plip.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff -puN drivers/net/plip.c~plip-driver-convert-killed_timer_sem-to-completion 
drivers/net/plip.c
--- a/drivers/net/plip.c~plip-driver-convert-killed_timer_sem-to-completion
+++ a/drivers/net/plip.c
@@ -106,6 +106,7 @@ static const char version[] = "NET3 PLIP
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -114,7 +115,6 @@ static const char version[] = "NET3 PLIP
 #include 
 #include 
 #include 
-#include 
 
 /* Maximum number of devices to support. */
 #define PLIP_MAX  8
@@ -221,7 +221,7 @@ struct net_local {
int should_relinquish;
spinlock_t lock;
atomic_t kill_timer;
-   struct semaphore killed_timer_sem;
+   struct completion killed_timer_cmp;
 };
 
 static inline void enable_parport_interrupts (struct net_device *dev)
@@ -385,7 +385,7 @@ plip_timer_bh(struct work_struct *work)
schedule_delayed_work(&nl->timer, 1);
}
else {
-   up (&nl->killed_timer_sem);
+   complete(&nl->killed_timer_cmp);
}
 }
 
@@ -1112,9 +1112,9 @@ plip_close(struct net_device *dev)
 
if (dev->irq == -1)
{
-   init_MUTEX_LOCKED (&nl->killed_timer_sem);
+   init_completion(&nl->killed_timer_cmp);
atomic_set (&nl->kill_timer, 1);
-   down (&nl->killed_timer_sem);
+   wait_for_completion(&nl->killed_timer_cmp);
}
 
 #ifdef NOTDEF
_
--
To unsubscribe from this list: send 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 03/10] forcedeth: fix MAC address detection on network card (regression in 2.6.23)

2007-12-13 Thread akpm
From: Michael Pyne <[EMAIL PROTECTED]>

Partially revert a change to mac address detection introduced to the forcedeth
driver.  The change was intended to correct mac address detection for newer
nVidia chipsets where the mac address was stored in reverse order.  One of
those chipsets appears to still have the mac address in reverse order (or at
least, it does on my system).

The change that broke mac address detection for my card was commit
ef756b3e56c68a4d76d9d7b9a73fa8f4f739180f "forcedeth: mac address correct"

My network card is an nVidia built-in Ethernet card, output from lspci as
follows (with text and numeric ids):
$ lspci | grep Ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
$ lspci -n | grep 07.0
00:07.0 0680: 10de:03ef (rev a2)

The vendor id is, of course, nVidia.  The device id corresponds to the
NVIDIA_NVENET_19 entry.

The included patch fixes the MAC address detection on my system.
Interestingly, the MAC address appears to be in the range reserved for my
motherboard manufacturer (Gigabyte) and not nVidia.

Signed-off-by: Michael J. Pyne <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>

On Wed, 21 Nov 2007 15:34:52 -0800
"Ayaz Abdulla" <[EMAIL PROTECTED]> wrote:

> The solution is to get the OEM to update their BIOS (instead of
> integrating this patch) since the MCP61 specs indicate that the MAC
> Address should be in correct order from BIOS.
> 
> By changing the feature DEV_HAS_CORRECT_MACADDR to all MCP61 boards, it
> could cause it to break on other OEM systems who have implemented it
> correctly.
> 

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
 drivers/net/forcedeth.c
--- 
a/drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
+++ a/drivers/net/forcedeth.c
@@ -5551,7 +5551,7 @@ static struct pci_device_id pci_tbl[] = 
},
{   /* MCP61 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_19),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
},
{   /* MCP65 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_20),
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 01/10] e1000e: make E1000E default to the same kconfig setting as E1000

2007-12-13 Thread akpm
From: Randy Dunlap <[EMAIL PROTECTED]>

Make E1000E default to the same kconfig setting as E1000.  So people's
machiens don't stop working when they use oldconfig.

Signed-off-by: Randy Dunlap <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/Kconfig |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/net/Kconfig~e1000e-make-e1000e-default-to-the-same-kconfig-setting-as-e1000
 drivers/net/Kconfig
--- 
a/drivers/net/Kconfig~e1000e-make-e1000e-default-to-the-same-kconfig-setting-as-e1000
+++ a/drivers/net/Kconfig
@@ -1986,6 +1986,7 @@ config E1000_DISABLE_PACKET_SPLIT
 config E1000E
tristate "Intel(R) PRO/1000 PCI-Express Gigabit Ethernet support"
depends on PCI
+   default E1000
---help---
  This driver supports the PCI-Express Intel(R) PRO/1000 gigabit
  ethernet family of adapters. For PCI or PCI-X e1000 adapters,
_
--
To unsubscribe from this list: send 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/4] tipc: fix semaphore handling

2007-12-13 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

As noted by Kevin, tipc's release() does down_interruptible() and ignores the
return value.  So if signal_pending() we'll end up doing up() on a non-downed
semaphore.  Fix.

Cc: Kevin Winchester <[EMAIL PROTECTED]>
Cc: Per Liden <[EMAIL PROTECTED]>
Cc: Jon Maloy <[EMAIL PROTECTED]>
Cc: Allan Stephens <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/tipc/socket.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN net/tipc/socket.c~tipc-fix-semaphore-handling net/tipc/socket.c
--- a/net/tipc/socket.c~tipc-fix-semaphore-handling
+++ a/net/tipc/socket.c
@@ -253,7 +253,7 @@ static int release(struct socket *sock)
dbg("sock_delete: %x\n",tsock);
if (!tsock)
return 0;
-   down_interruptible(&tsock->sem);
+   down(&tsock->sem);
if (!sock->sk) {
up(&tsock->sem);
return 0;
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 02/10] forcedeth: power down phy when interface is down

2007-12-13 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled.  This mirrors the behavior of
other drivers including e1000 and tg3.

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1312,9 +1312,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-   /* restart auto negotiation */
+   /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4798,6 +4798,10 @@ static int nv_open(struct net_device *de
 
dprintk(KERN_DEBUG "nv_open: begin\n");
 
+   /* power up phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4980,6 +4984,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + 
NvRegPacketFilterFlags);
nv_start_rx(dev);
+   } else {
+   /* power down phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
 
/* FIXME: power down nic */
_
--
To unsubscribe from this list: send 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/4] Updates to nfsroot documentation

2007-12-13 Thread akpm
From: Amos Waterland <[EMAIL PROTECTED]>

The difference between ip=off and ip=::off has been a cause of much
confusion.  Document how each behaves, and do not contradict ourselves by
saying that "off" is the default when in fact "any" is the default and is
descibed as being so lower in the file.

Signed-off-by: Amos Waterland <[EMAIL PROTECTED]>
Cc: Simon Horman <[EMAIL PROTECTED]>
Cc: Andi Kleen <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 Documentation/nfsroot.txt |   12 +---
 net/ipv4/ipconfig.c   |   20 +---
 2 files changed, 10 insertions(+), 22 deletions(-)

diff -puN Documentation/nfsroot.txt~updates-to-nfsroot-documentation-take-3 
Documentation/nfsroot.txt
--- a/Documentation/nfsroot.txt~updates-to-nfsroot-documentation-take-3
+++ a/Documentation/nfsroot.txt
@@ -92,8 +92,14 @@ ip=::: parameter can appear alone as the value to the `ip'
-  parameter (without all the ':' characters before) in which case auto-
-  configuration is used.
+  parameter (without all the ':' characters before).  If the value is
+  "ip=off" or "ip=none", no autoconfiguration will take place, otherwise
+  autoconfiguration will take place.  The most common way to use this
+  is "ip=dhcp".
+
+  Note that "ip=off" is not the same thing as "ip=::off", because in
+  the latter autoconfiguration will take place if any of DHCP, BOOTP or RARP
+  are compiled in the kernel.
 
 IP address of the client.
 
@@ -142,7 +148,7 @@ ip=:::http://vger.kernel.org/majordomo-info.html


[patch 4/4] PPP synchronous tty: convert dead_sem to completion

2007-12-13 Thread akpm
From: Matthias Kaehlcke <[EMAIL PROTECTED]>

PPP synchronous tty channel driver: convert the semaphore dead_sem to a
completion

Signed-off-by: Matthias Kaehlcke <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ppp_synctty.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff -puN 
drivers/net/ppp_synctty.c~ppp-synchronous-tty-convert-dead_sem-to-completion 
drivers/net/ppp_synctty.c
--- 
a/drivers/net/ppp_synctty.c~ppp-synchronous-tty-convert-dead_sem-to-completion
+++ a/drivers/net/ppp_synctty.c
@@ -42,9 +42,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 
 #define PPP_VERSION"2.4.2"
 
@@ -70,7 +70,7 @@ struct syncppp {
struct tasklet_struct tsk;
 
atomic_trefcnt;
-   struct semaphore dead_sem;
+   struct completion dead_cmp;
struct ppp_channel chan;/* interface to generic ppp layer */
 };
 
@@ -195,7 +195,7 @@ static struct syncppp *sp_get(struct tty
 static void sp_put(struct syncppp *ap)
 {
if (atomic_dec_and_test(&ap->refcnt))
-   up(&ap->dead_sem);
+   complete(&ap->dead_cmp);
 }
 
 /*
@@ -225,7 +225,7 @@ ppp_sync_open(struct tty_struct *tty)
tasklet_init(&ap->tsk, ppp_sync_process, (unsigned long) ap);
 
atomic_set(&ap->refcnt, 1);
-   init_MUTEX_LOCKED(&ap->dead_sem);
+   init_completion(&ap->dead_cmp);
 
ap->chan.private = ap;
ap->chan.ops = &sync_ops;
@@ -273,7 +273,7 @@ ppp_sync_close(struct tty_struct *tty)
 * by the time it returns.
 */
if (!atomic_dec_and_test(&ap->refcnt))
-   down(&ap->dead_sem);
+   wait_for_completion(&ap->dead_cmp);
tasklet_kill(&ap->tsk);
 
ppp_unregister_channel(&ap->chan);
_
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/4] net: use mutex_is_locked() for ASSERT_RTNL()

2007-12-13 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

ASSERT_RTNL() uses mutex_trylock(), but it's better to use mutex_is_locked().

Make that change, and remove rtnl_trylock() altogether.

(not tested yet!)

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/cxgb3/cxgb3_main.c |3 +--
 include/linux/rtnetlink.h  |5 ++---
 net/core/rtnetlink.c   |7 ---
 3 files changed, 7 insertions(+), 8 deletions(-)

diff -puN 
drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl 
drivers/net/cxgb3/cxgb3_main.c
--- a/drivers/net/cxgb3/cxgb3_main.c~net-use-mutex_is_locked-for-assert_rtnl
+++ a/drivers/net/cxgb3/cxgb3_main.c
@@ -2191,7 +2191,7 @@ static void check_t3b2_mac(struct adapte
 {
int i;
 
-   if (!rtnl_trylock())/* synchronize with ifdown */
+   if (rtnl_is_locked())   /* synchronize with ifdown */
return;
 
for_each_port(adapter, i) {
@@ -2219,7 +2219,6 @@ static void check_t3b2_mac(struct adapte
p->mac.stats.num_resets++;
}
}
-   rtnl_unlock();
 }
 
 
diff -puN include/linux/rtnetlink.h~net-use-mutex_is_locked-for-assert_rtnl 
include/linux/rtnetlink.h
--- a/include/linux/rtnetlink.h~net-use-mutex_is_locked-for-assert_rtnl
+++ a/include/linux/rtnetlink.h
@@ -751,14 +751,13 @@ extern void rtmsg_ifinfo(int type, struc
 /* RTNL is used as a global lock for all changes to network configuration  */
 extern void rtnl_lock(void);
 extern void rtnl_unlock(void);
-extern int rtnl_trylock(void);
+extern int rtnl_is_locked(void);
 
 extern void rtnetlink_init(void);
 extern void __rtnl_unlock(void);
 
 #define ASSERT_RTNL() do { \
-   if (unlikely(rtnl_trylock())) { \
-   rtnl_unlock(); \
+   if (unlikely(!rtnl_is_locked())) { \
printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \
   __FILE__,  __LINE__); \
dump_stack(); \
diff -puN net/core/rtnetlink.c~net-use-mutex_is_locked-for-assert_rtnl 
net/core/rtnetlink.c
--- a/net/core/rtnetlink.c~net-use-mutex_is_locked-for-assert_rtnl
+++ a/net/core/rtnetlink.c
@@ -77,9 +77,10 @@ void rtnl_unlock(void)
netdev_run_todo();
 }
 
-int rtnl_trylock(void)
+/* Return non-zero if rtnl_mutex is presently held */
+int rtnl_is_locked(void)
 {
-   return mutex_trylock(&rtnl_mutex);
+   return mutex_is_locked(&rtnl_mutex);
 }
 
 int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len)
@@ -1424,7 +1425,7 @@ EXPORT_SYMBOL(rtattr_parse);
 EXPORT_SYMBOL(__rtattr_parse_nested_compat);
 EXPORT_SYMBOL(rtnetlink_put_metrics);
 EXPORT_SYMBOL(rtnl_lock);
-EXPORT_SYMBOL(rtnl_trylock);
+EXPORT_SYMBOL(rtnl_is_locked);
 EXPORT_SYMBOL(rtnl_unlock);
 EXPORT_SYMBOL(rtnl_unicast);
 EXPORT_SYMBOL(rtnl_notify);
_
--
To unsubscribe from this list: send 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/8] forcedeth: power down phy when interface is down

2007-11-21 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled.  This mirrors the behavior of
other drivers including e1000 and tg3.

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1312,9 +1312,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-   /* restart auto negotiation */
+   /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4798,6 +4798,10 @@ static int nv_open(struct net_device *de
 
dprintk(KERN_DEBUG "nv_open: begin\n");
 
+   /* power up phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4980,6 +4984,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + 
NvRegPacketFilterFlags);
nv_start_rx(dev);
+   } else {
+   /* power down phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
 
/* FIXME: power down nic */
_
-
To unsubscribe from this list: send 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/5] drivers/bluetooth/btsdio.c: fix double-free

2007-11-21 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch fixes a double-free spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/btsdio.c |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff -puN drivers/bluetooth/btsdio.c~drivers-bluetooth-btsdioc-fix-double-free 
drivers/bluetooth/btsdio.c
--- a/drivers/bluetooth/btsdio.c~drivers-bluetooth-btsdioc-fix-double-free
+++ a/drivers/bluetooth/btsdio.c
@@ -162,10 +162,8 @@ static int btsdio_rx_packet(struct btsdi
bt_cb(skb)->pkt_type = hdr[3];
 
err = hci_recv_frame(skb);
-   if (err < 0) {
-   kfree(skb);
+   if (err < 0)
return err;
-   }
 
sdio_writeb(data->func, 0x00, REG_PC_RRT, 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


[patch 3/5] drivers/bluetooth/bpa10x.c: fix memleak

2007-11-21 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch fixea a memleak spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/bpa10x.c |1 +
 1 file changed, 1 insertion(+)

diff -puN drivers/bluetooth/bpa10x.c~drivers-bluetooth-bpa10xc-fix-memleak 
drivers/bluetooth/bpa10x.c
--- a/drivers/bluetooth/bpa10x.c~drivers-bluetooth-bpa10xc-fix-memleak
+++ a/drivers/bluetooth/bpa10x.c
@@ -423,6 +423,7 @@ static int bpa10x_send_frame(struct sk_b
break;
 
default:
+   usb_free_urb(urb);
return -EILSEQ;
}
 
_
-
To unsubscribe from this list: send 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/5] bluetooth: hidp_process_hid_control remove unnecessary parameter dealing

2007-11-21 Thread akpm
From: Dave Young <[EMAIL PROTECTED]>

According to the bluetooth HID spec v1.0 chapter 7.4.2

"This code requests a major state change in a BT-HID device.  A HID_CONTROL
request does not generate a HANDSHAKE response."

"A HID_CONTROL packet with a parameter of VIRTUAL_CABLE_UNPLUG is the only
HID_CONTROL packet a device can send to a host.  A host will ignore all other
packets."

So in the hidp_precess_hid_control function, we just need to deal with the
UNLUG packet.

Signed-off-by: Dave Young <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bluetooth/hidp/core.c |   19 +--
 1 file changed, 1 insertion(+), 18 deletions(-)

diff -puN 
net/bluetooth/hidp/core.c~bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing
 net/bluetooth/hidp/core.c
--- 
a/net/bluetooth/hidp/core.c~bluetooth-hidp_process_hid_control-remove-unnecessary-parameter-dealing
+++ a/net/bluetooth/hidp/core.c
@@ -369,30 +369,13 @@ static inline void hidp_process_hid_cont
 {
BT_DBG("session %p param 0x%02x", session, param);
 
-   switch (param) {
-   case HIDP_CTRL_NOP:
-   break;
-
-   case HIDP_CTRL_VIRTUAL_CABLE_UNPLUG:
+   if (param == HIDP_CTRL_VIRTUAL_CABLE_UNPLUG) {
/* Flush the transmit queues */
skb_queue_purge(&session->ctrl_transmit);
skb_queue_purge(&session->intr_transmit);
 
/* Kill session thread */
atomic_inc(&session->terminate);
-   break;
-
-   case HIDP_CTRL_HARD_RESET:
-   case HIDP_CTRL_SOFT_RESET:
-   case HIDP_CTRL_SUSPEND:
-   case HIDP_CTRL_EXIT_SUSPEND:
-   /* FIXME: We have to parse these and return no error */
-   break;
-
-   default:
-   __hidp_send_ctrl_message(session,
-   HIDP_TRANS_HANDSHAKE | HIDP_HSHK_ERR_INVALID_PARAMETER, 
NULL, 0);
-   break;
}
 }
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 5/5] bluetooth: blacklist another Broadcom BCM2035 device

2007-11-21 Thread akpm
From: Andy Shevchenko <[EMAIL PROTECTED]>

This device is recognized as bluetooth, but still not works.

Signed-off-by: Andy Shevchenko <[EMAIL PROTECTED]>
Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/bluetooth/hci_usb.c |1 +
 1 file changed, 1 insertion(+)

diff -puN 
drivers/bluetooth/hci_usb.c~bluetooth-blacklist-another-broadcom-bcm2035-device 
drivers/bluetooth/hci_usb.c
--- 
a/drivers/bluetooth/hci_usb.c~bluetooth-blacklist-another-broadcom-bcm2035-device
+++ a/drivers/bluetooth/hci_usb.c
@@ -111,6 +111,7 @@ static struct usb_device_id blacklist_id
{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
 
/* Broadcom BCM2035 */
+   { USB_DEVICE(0x0a5c, 0x2035), .driver_info = HCI_RESET | 
HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | 
HCI_WRONG_SCO_MTU },
{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
 
_
-
To unsubscribe from this list: send 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/8] Net: ibm_newemac, remove SPIN_LOCK_UNLOCKED

2007-11-21 Thread akpm
From: Jiri Slaby <[EMAIL PROTECTED]>

SPIN_LOCK_UNLOCKED is deprecated, use DEFINE_SPINLOCK instead

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/ibm_newemac/debug.c~net-ibm_newemac-remove-spin_lock_unlocked 
drivers/net/ibm_newemac/debug.c
--- a/drivers/net/ibm_newemac/debug.c~net-ibm_newemac-remove-spin_lock_unlocked
+++ a/drivers/net/ibm_newemac/debug.c
@@ -21,7 +21,7 @@
 
 #include "core.h"
 
-static spinlock_t emac_dbg_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(emac_dbg_lock);
 
 static void emac_desc_dump(struct emac_instance *p)
 {
_
-
To unsubscribe from this list: send 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/8] forcedeth: new mcp79 device ids

2007-11-21 Thread akpm
From: Ayaz Abdulla <[EMAIL PROTECTED]>

Add new device ids and features for mcp79 devices into the forcedeth driver.

Signed-off-by: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Manfred Spraul <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   16 
 include/linux/pci_ids.h |4 
 2 files changed, 20 insertions(+)

diff -puN drivers/net/forcedeth.c~forcedeth-new-mcp79-device-ids 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-new-mcp79-device-ids
+++ a/drivers/net/forcedeth.c
@@ -5621,6 +5621,22 @@ static struct pci_device_id pci_tbl[] = 
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_35),
.driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
},
+   {   /* MCP79 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_36),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP79 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_37),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP79 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_38),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
+   {   /* MCP79 Ethernet Controller */
+   PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_39),
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_CHECKSUM|DEV_HAS_HIGH_DMA|DEV_HAS_MSI|DEV_HAS_POWER_CNTRL|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
+   },
{0,},
 };
 
diff -puN include/linux/pci_ids.h~forcedeth-new-mcp79-device-ids 
include/linux/pci_ids.h
--- a/include/linux/pci_ids.h~forcedeth-new-mcp79-device-ids
+++ a/include/linux/pci_ids.h
@@ -1237,6 +1237,10 @@
 #define PCI_DEVICE_ID_NVIDIA_NVENET_33  0x0761
 #define PCI_DEVICE_ID_NVIDIA_NVENET_34  0x0762
 #define PCI_DEVICE_ID_NVIDIA_NVENET_35  0x0763
+#define PCI_DEVICE_ID_NVIDIA_NVENET_36  0x0AB0
+#define PCI_DEVICE_ID_NVIDIA_NVENET_37  0x0AB1
+#define PCI_DEVICE_ID_NVIDIA_NVENET_38  0x0AB2
+#define PCI_DEVICE_ID_NVIDIA_NVENET_39  0x0AB3
 
 #define PCI_VENDOR_ID_IMS  0x10e0
 #define PCI_DEVICE_ID_IMS_TT1280x9128
_
-
To unsubscribe from this list: send 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/5] bluetooth: uninlining

2007-11-21 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

Remove all those inlines which were either a) unneeded or b) increased code
size.

  textdata bss dec hex filename
before:   6997  74   870791ba7 net/bluetooth/hidp/core.o
after:6492  74   8657419ae net/bluetooth/hidp/core.o

Cc: Marcel Holtmann <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/bluetooth/hidp/core.c |   30 +++---
 1 file changed, 19 insertions(+), 11 deletions(-)

diff -puN net/bluetooth/hidp/core.c~bluetooth-uninlining 
net/bluetooth/hidp/core.c
--- a/net/bluetooth/hidp/core.c~bluetooth-uninlining
+++ a/net/bluetooth/hidp/core.c
@@ -135,8 +135,8 @@ static void __hidp_copy_session(struct h
}
 }
 
-static inline int hidp_queue_event(struct hidp_session *session, struct 
input_dev *dev,
-   unsigned int type, unsigned int code, 
int value)
+static int hidp_queue_event(struct hidp_session *session, struct input_dev 
*dev,
+   unsigned int type, unsigned int code, int value)
 {
unsigned char newleds;
struct sk_buff *skb;
@@ -243,7 +243,8 @@ static void hidp_input_report(struct hid
input_sync(dev);
 }
 
-static inline int hidp_queue_report(struct hidp_session *session, unsigned 
char *data, int size)
+static int hidp_queue_report(struct hidp_session *session,
+   unsigned char *data, int size)
 {
struct sk_buff *skb;
 
@@ -287,7 +288,7 @@ static void hidp_idle_timeout(unsigned l
hidp_schedule(session);
 }
 
-static inline void hidp_set_timer(struct hidp_session *session)
+static void hidp_set_timer(struct hidp_session *session)
 {
if (session->idle_to > 0)
mod_timer(&session->timer, jiffies + HZ * session->idle_to);
@@ -332,7 +333,8 @@ static inline int hidp_send_ctrl_message
return err;
 }
 
-static inline void hidp_process_handshake(struct hidp_session *session, 
unsigned char param)
+static void hidp_process_handshake(struct hidp_session *session,
+   unsigned char param)
 {
BT_DBG("session %p param 0x%02x", session, param);
 
@@ -365,7 +367,8 @@ static inline void hidp_process_handshak
}
 }
 
-static inline void hidp_process_hid_control(struct hidp_session *session, 
unsigned char param)
+static void hidp_process_hid_control(struct hidp_session *session,
+   unsigned char param)
 {
BT_DBG("session %p param 0x%02x", session, param);
 
@@ -379,7 +382,8 @@ static inline void hidp_process_hid_cont
}
 }
 
-static inline void hidp_process_data(struct hidp_session *session, struct 
sk_buff *skb, unsigned char param)
+static void hidp_process_data(struct hidp_session *session, struct sk_buff 
*skb,
+   unsigned char param)
 {
BT_DBG("session %p skb %p len %d param 0x%02x", session, skb, skb->len, 
param);
 
@@ -406,7 +410,8 @@ static inline void hidp_process_data(str
}
 }
 
-static inline void hidp_recv_ctrl_frame(struct hidp_session *session, struct 
sk_buff *skb)
+static void hidp_recv_ctrl_frame(struct hidp_session *session,
+   struct sk_buff *skb)
 {
unsigned char hdr, type, param;
 
@@ -440,7 +445,8 @@ static inline void hidp_recv_ctrl_frame(
kfree_skb(skb);
 }
 
-static inline void hidp_recv_intr_frame(struct hidp_session *session, struct 
sk_buff *skb)
+static void hidp_recv_intr_frame(struct hidp_session *session,
+   struct sk_buff *skb)
 {
unsigned char hdr;
 
@@ -608,7 +614,8 @@ static struct device *hidp_get_device(st
return conn ? &conn->dev : NULL;
 }
 
-static inline int hidp_setup_input(struct hidp_session *session, struct 
hidp_connadd_req *req)
+static int hidp_setup_input(struct hidp_session *session,
+   struct hidp_connadd_req *req)
 {
struct input_dev *input = session->input;
int i;
@@ -685,7 +692,8 @@ static void hidp_setup_quirks(struct hid
hid->quirks = hidp_blacklist[n].quirks;
 }
 
-static inline void hidp_setup_hid(struct hidp_session *session, struct 
hidp_connadd_req *req)
+static void hidp_setup_hid(struct hidp_session *session,
+   struct hidp_connadd_req *req)
 {
struct hid_device *hid = session->hid;
struct hid_report *report;
_
-
To unsubscribe from this list: send 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/8] drivers/net/chelsio/: #if 0 unused functions

2007-11-21 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch #if 0's the following unused functions:
- espi.c:t1_espi_set_misc_ctrl()
- sge.c:t1_sched_set_max_avail_bytes()
- sge.c:t1_sched_set_drain_bits_per_us()

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/chelsio/espi.c |2 ++
 drivers/net/chelsio/espi.h |1 -
 drivers/net/chelsio/sge.c  |4 
 drivers/net/chelsio/sge.h  |2 --
 4 files changed, 6 insertions(+), 3 deletions(-)

diff -puN drivers/net/chelsio/espi.c~drivers-net-chelsio-if-0-unused-functions 
drivers/net/chelsio/espi.c
--- a/drivers/net/chelsio/espi.c~drivers-net-chelsio-if-0-unused-functions
+++ a/drivers/net/chelsio/espi.c
@@ -297,6 +297,7 @@ struct peespi *t1_espi_create(adapter_t 
return espi;
 }
 
+#if 0
 void t1_espi_set_misc_ctrl(adapter_t *adapter, u32 val)
 {
struct peespi *espi = adapter->espi;
@@ -309,6 +310,7 @@ void t1_espi_set_misc_ctrl(adapter_t *ad
writel(espi->misc_ctrl, adapter->regs + A_ESPI_MISC_CONTROL);
spin_unlock(&espi->lock);
 }
+#endif  /*  0  */
 
 u32 t1_espi_get_mon(adapter_t *adapter, u32 addr, u8 wait)
 {
diff -puN drivers/net/chelsio/espi.h~drivers-net-chelsio-if-0-unused-functions 
drivers/net/chelsio/espi.h
--- a/drivers/net/chelsio/espi.h~drivers-net-chelsio-if-0-unused-functions
+++ a/drivers/net/chelsio/espi.h
@@ -62,7 +62,6 @@ void t1_espi_intr_disable(struct peespi 
 int t1_espi_intr_handler(struct peespi *);
 const struct espi_intr_counts *t1_espi_get_intr_counts(struct peespi *espi);
 
-void t1_espi_set_misc_ctrl(adapter_t *adapter, u32 val);
 u32 t1_espi_get_mon(adapter_t *adapter, u32 addr, u8 wait);
 int t1_espi_get_mon_t204(adapter_t *, u32 *, u8);
 
diff -puN drivers/net/chelsio/sge.c~drivers-net-chelsio-if-0-unused-functions 
drivers/net/chelsio/sge.c
--- a/drivers/net/chelsio/sge.c~drivers-net-chelsio-if-0-unused-functions
+++ a/drivers/net/chelsio/sge.c
@@ -330,6 +330,8 @@ unsigned int t1_sched_update_parms(struc
return max_avail_segs * (p->mtu - 40);
 }
 
+#if 0
+
 /*
  * t1_sched_max_avail_bytes() tells the scheduler the maximum amount of
  * data that can be pushed per port.
@@ -357,6 +359,8 @@ void t1_sched_set_drain_bits_per_us(stru
t1_sched_update_parms(sge, port, 0, 0);
 }
 
+#endif  /*  0  */
+
 
 /*
  * get_clock() implements a ns clock (see ktime_get)
diff -puN drivers/net/chelsio/sge.h~drivers-net-chelsio-if-0-unused-functions 
drivers/net/chelsio/sge.h
--- a/drivers/net/chelsio/sge.h~drivers-net-chelsio-if-0-unused-functions
+++ a/drivers/net/chelsio/sge.h
@@ -89,8 +89,6 @@ void t1_sge_intr_disable(struct sge *);
 void t1_sge_intr_clear(struct sge *);
 const struct sge_intr_counts *t1_sge_get_intr_counts(const struct sge *sge);
 void t1_sge_get_port_stats(const struct sge *sge, int port, struct 
sge_port_stats *);
-void t1_sched_set_max_avail_bytes(struct sge *, unsigned int);
-void t1_sched_set_drain_bits_per_us(struct sge *, unsigned int, unsigned int);
 unsigned int t1_sched_update_parms(struct sge *, unsigned int, unsigned int,
   unsigned int);
 
_
-
To unsubscribe from this list: send 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/8] forcedeth: fix MAC address detection on network card (regression in 2.6.23)

2007-11-21 Thread akpm
From: Michael Pyne <[EMAIL PROTECTED]>

Partially revert a change to mac address detection introduced to the forcedeth
driver.  The change was intended to correct mac address detection for newer
nVidia chipsets where the mac address was stored in reverse order.  One of
those chipsets appears to still have the mac address in reverse order (or at
least, it does on my system).

The change that broke mac address detection for my card was commit
ef756b3e56c68a4d76d9d7b9a73fa8f4f739180f "forcedeth: mac address correct"

My network card is an nVidia built-in Ethernet card, output from lspci as
follows (with text and numeric ids):
$ lspci | grep Ethernet
00:07.0 Bridge: nVidia Corporation MCP61 Ethernet (rev a2)
$ lspci -n | grep 07.0
00:07.0 0680: 10de:03ef (rev a2)

The vendor id is, of course, nVidia.  The device id corresponds to the
NVIDIA_NVENET_19 entry.

The included patch fixes the MAC address detection on my system.
Interestingly, the MAC address appears to be in the range reserved for my
motherboard manufacturer (Gigabyte) and not nVidia.

Signed-off-by: Michael J. Pyne <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
 drivers/net/forcedeth.c
--- 
a/drivers/net/forcedeth.c~forcedeth-fix-mac-address-detection-on-network-card-regression-in-2623
+++ a/drivers/net/forcedeth.c
@@ -,7 +,7 @@ static struct pci_device_id pci_tbl[] = 
},
{   /* MCP61 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_19),
-   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT|DEV_HAS_CORRECT_MACADDR,
+   .driver_data = 
DEV_NEED_TIMERIRQ|DEV_NEED_LINKTIMER|DEV_HAS_HIGH_DMA|DEV_HAS_POWER_CNTRL|DEV_HAS_MSI|DEV_HAS_PAUSEFRAME_TX|DEV_HAS_STATISTICS_V2|DEV_HAS_TEST_EXTENDED|DEV_HAS_MGMT_UNIT,
},
{   /* MCP65 Ethernet Controller */
PCI_DEVICE(PCI_VENDOR_ID_NVIDIA, 
PCI_DEVICE_ID_NVIDIA_NVENET_20),
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 8/8] forcedeth boot delay fix

2007-11-21 Thread akpm
From: Ayaz Abdulla <[EMAIL PROTECTED]>

Fix a long boot delay in the forcedeth driver.  During initialization, the
timeout for the handshake between mgmt unit and driver can be very long. 
The patch reduces the timeout by eliminating a extra loop around the
timeout logic.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=9308

Signed-off-by: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: Alex Howells <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/forcedeth.c~forcedeth-boot-delay-fix 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-boot-delay-fix
+++ a/drivers/net/forcedeth.c
@@ -5294,19 +5294,15 @@ static int __devinit nv_probe(struct pci
if (readl(base + NvRegTransmitterControl) & 
NVREG_XMITCTL_SYNC_PHY_INIT) {
np->mac_in_use = readl(base + NvRegTransmitterControl) 
& NVREG_XMITCTL_MGMT_ST;
dprintk(KERN_INFO "%s: mgmt unit is running. mac in use 
%x.\n", pci_name(pci_dev), np->mac_in_use);
-   for (i = 0; i < 5000; i++) {
-   msleep(1);
-   if (nv_mgmt_acquire_sema(dev)) {
-   /* management unit setup the phy 
already? */
-   if ((readl(base + 
NvRegTransmitterControl) & NVREG_XMITCTL_SYNC_MASK) ==
-   NVREG_XMITCTL_SYNC_PHY_INIT) {
-   /* phy is inited by mgmt unit */
-   phyinitialized = 1;
-   dprintk(KERN_INFO "%s: Phy 
already initialized by mgmt unit.\n", pci_name(pci_dev));
-   } else {
-   /* we need to init the phy */
-   }
-   break;
+   if (nv_mgmt_acquire_sema(dev)) {
+   /* management unit setup the phy already? */
+   if ((readl(base + NvRegTransmitterControl) & 
NVREG_XMITCTL_SYNC_MASK) ==
+   NVREG_XMITCTL_SYNC_PHY_INIT) {
+   /* phy is inited by mgmt unit */
+   phyinitialized = 1;
+   dprintk(KERN_INFO "%s: Phy already 
initialized by mgmt unit.\n", pci_name(pci_dev));
+   } else {
+   /* we need to init the phy */
}
}
}
_
-
To unsubscribe from this list: send 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/8] ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes

2007-11-21 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Emil Medve <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Kumar Gala <[EMAIL PROTECTED]>
Cc: Li Yang <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
 drivers/net/ucc_geth.c
--- 
a/drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
+++ a/drivers/net/ucc_geth.c
@@ -3443,7 +3443,7 @@ static int ucc_geth_rx(struct ucc_geth_p
u16 length, howmany = 0;
u32 bd_status;
u8 *bdBuffer;
-   struct net_device * dev;
+   struct net_device *dev;
 
ugeth_vdbg("%s: IN", __FUNCTION__);
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 5/8] pcmcia net: use roundup_pow_of_two() macro instead of grotesque loop

2007-11-21 Thread akpm
From: "Robert P. J. Day" <[EMAIL PROTECTED]>

Signed-off-by: Robert P. J. Day <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Dominik Brodowski <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/pcmcia/pcnet_cs.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/pcmcia/pcnet_cs.c~pcmcia-net-use-roundup_pow_of_two-macro-instead-of-grotesque-loop
 drivers/net/pcmcia/pcnet_cs.c
--- 
a/drivers/net/pcmcia/pcnet_cs.c~pcmcia-net-use-roundup_pow_of_two-macro-instead-of-grotesque-loop
+++ a/drivers/net/pcmcia/pcnet_cs.c
@@ -38,6 +38,7 @@
 #include 
 #include 
 #include 
+#include 
 #include "../8390.h"
 
 #include 
@@ -1484,8 +1485,7 @@ static int setup_shmem_window(struct pcm
window_size = 32 * 1024;
 
 /* Make sure it's a power of two.  */
-while ((window_size & (window_size - 1)) != 0)
-   window_size += window_size & ~(window_size - 1);
+window_size = roundup_pow_of_two(window_size);
 
 /* Allocate a memory window */
 req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/4] make sunrpc/xprtsock.c:xs_setup_{udp,tcp}() static

2007-11-21 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

xs_setup_{udp,tcp}() can now become static.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 include/linux/sunrpc/xprtsock.h |6 --
 net/sunrpc/xprtsock.c   |4 ++--
 2 files changed, 2 insertions(+), 8 deletions(-)

diff -puN 
include/linux/sunrpc/xprtsock.h~make-sunrpc-xprtsockcxs_setup_udptcp-static 
include/linux/sunrpc/xprtsock.h
--- 
a/include/linux/sunrpc/xprtsock.h~make-sunrpc-xprtsockcxs_setup_udptcp-static
+++ a/include/linux/sunrpc/xprtsock.h
@@ -9,12 +9,6 @@
 
 #ifdef __KERNEL__
 
-/*
- * Socket transport setup operations
- */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args);
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args);
-
 intinit_socket_xprt(void);
 void   cleanup_socket_xprt(void);
 
diff -puN net/sunrpc/xprtsock.c~make-sunrpc-xprtsockcxs_setup_udptcp-static 
net/sunrpc/xprtsock.c
--- a/net/sunrpc/xprtsock.c~make-sunrpc-xprtsockcxs_setup_udptcp-static
+++ a/net/sunrpc/xprtsock.c
@@ -1828,7 +1828,7 @@ static struct rpc_xprt *xs_setup_xprt(st
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_udp(struct xprt_create *args)
 {
struct sockaddr *addr = args->dstaddr;
struct rpc_xprt *xprt;
@@ -1894,7 +1894,7 @@ struct rpc_xprt *xs_setup_udp(struct xpr
  * @args: rpc transport creation arguments
  *
  */
-struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
+static struct rpc_xprt *xs_setup_tcp(struct xprt_create *args)
 {
struct sockaddr *addr = args->dstaddr;
struct rpc_xprt *xprt;
_
-
To unsubscribe from this list: send 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/4] pfkey: sending an SADB_GET responds with an SADB_GET

2007-11-21 Thread akpm
From: Charles Hardin <[EMAIL PROTECTED]>

Kernel needs to respond to an SADB_GET with the same message type to
conform to the RFC 2367 Section 3.1.5

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/key/af_key.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN net/key/af_key.c~pfkey-sending-an-sadb_get-responds-with-an-sadb_get 
net/key/af_key.c
--- a/net/key/af_key.c~pfkey-sending-an-sadb_get-responds-with-an-sadb_get
+++ a/net/key/af_key.c
@@ -1552,7 +1552,7 @@ static int pfkey_get(struct sock *sk, st
 
out_hdr = (struct sadb_msg *) out_skb->data;
out_hdr->sadb_msg_version = hdr->sadb_msg_version;
-   out_hdr->sadb_msg_type = SADB_DUMP;
+   out_hdr->sadb_msg_type = SADB_GET;
out_hdr->sadb_msg_satype = pfkey_proto2satype(proto);
out_hdr->sadb_msg_errno = 0;
out_hdr->sadb_msg_reserved = 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 3/4] tlan list is subscribers-only

2007-11-21 Thread akpm
From: Gabriel C <[EMAIL PROTECTED]>

Your mail to 'Tlan-devel' with the subject

drivers/net/tlan question

Is being held until the list moderator can review it for approval.

The reason it is being held:

Post by non-member to a members-only list

Signed-off-by: Gabriel Craciunescu <[EMAIL PROTECTED]>

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 MAINTAINERS |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN MAINTAINERS~tlan-list-is-subscribers-only MAINTAINERS
--- a/MAINTAINERS~tlan-list-is-subscribers-only
+++ a/MAINTAINERS
@@ -3733,7 +3733,7 @@ S:Maintained
 TLAN NETWORK DRIVER
 P: Samuel Chessman
 M: [EMAIL PROTECTED]
-L: [EMAIL PROTECTED]
+L: [EMAIL PROTECTED] (subscribers-only)
 W: http://sourceforge.net/projects/tlan/
 S: Maintained
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 4/4] Net: sunrpc, remove SPIN_LOCK_UNLOCKED

2007-11-21 Thread akpm
From: Jiri Slaby <[EMAIL PROTECTED]>

sunrpc, remove SPIN_LOCK_UNLOCKED

SPIN_LOCK_UNLOCKED is deprecated, use DEFINE_SPINLOCK instead

Signed-off-by: Jiri Slaby <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/sunrpc/xprt.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN net/sunrpc/xprt.c~net-sunrpc-remove-spin_lock_unlocked 
net/sunrpc/xprt.c
--- a/net/sunrpc/xprt.c~net-sunrpc-remove-spin_lock_unlocked
+++ a/net/sunrpc/xprt.c
@@ -62,7 +62,7 @@ static inline voiddo_xprt_reserve(struc
 static voidxprt_connect_status(struct rpc_task *task);
 static int  __xprt_get_cong(struct rpc_xprt *, struct rpc_task *);
 
-static spinlock_t xprt_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(xprt_list_lock);
 static LIST_HEAD(xprt_list);
 
 /*
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 4/4] ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes

2007-10-16 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Emil Medve <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Kumar Gala <[EMAIL PROTECTED]>
Cc: Li Yang <[EMAIL PROTECTED]>
Cc: Paul Mackerras <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
 drivers/net/ucc_geth.c
--- 
a/drivers/net/ucc_geth.c~ucc_geth-fix-build-break-introduced-by-commit-09f75cd7bf13720738e6a196cc0107ce9a5bd5a0-checkpatch-fixes
+++ a/drivers/net/ucc_geth.c
@@ -3454,7 +3454,7 @@ static int ucc_geth_rx(struct ucc_geth_p
u16 length, howmany = 0;
u32 bd_status;
u8 *bdBuffer;
-   struct net_device * dev;
+   struct net_device *dev;
 
ugeth_vdbg("%s: IN", __FUNCTION__);
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/4] tokenring/3c359.c: fixed array index problem

2007-10-16 Thread akpm
From: Marcus Meissner <[EMAIL PROTECTED]>

The xl_laa array is just 6 bytes long, so we should substract 10 from the
index, like is also done some lines above already.

Signed-off-by: Marcus Meissner <[EMAIL PROTECTED]>
Reviewed-by: Pekka Enberg <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tokenring/3c359.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN 
drivers/net/tokenring/3c359.c~tokenring-3c359c-fixed-array-index-problem 
drivers/net/tokenring/3c359.c
--- a/drivers/net/tokenring/3c359.c~tokenring-3c359c-fixed-array-index-problem
+++ a/drivers/net/tokenring/3c359.c
@@ -760,7 +760,7 @@ static int xl_open_hw(struct net_device 
if (xl_priv->xl_laa[0]) {  /* If using a LAA address */
for (i=10;i<16;i++) { 
writel( (MEM_BYTE_WRITE | 0xD | xl_priv->srb) + i, 
xl_mmio + MMIO_MAC_ACCESS_CMD) ; 
-   writeb(xl_priv->xl_laa[i],xl_mmio + MMIO_MACDATA) ; 
+   writeb(xl_priv->xl_laa[i-10], xl_mmio + MMIO_MACDATA);
}
memcpy(dev->dev_addr,xl_priv->xl_laa,dev->addr_len) ; 
} else { /* Regular hardware address */ 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 3/4] WOL bugfix for 3c59x.c

2007-10-16 Thread akpm
From: Steffen Klassert <[EMAIL PROTECTED]>

Some NICs (3c905B) can not generate PME in power state PCI_D0, while others
like 3c905C can.  Call pci_enable_wake() with PCI_D3hot should give proper
WOL for 3c905B.

Signed-off-by: Steffen Klassert <[EMAIL PROTECTED]>
Tested-by: Harry Coin <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/3c59x.c |8 +++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff -puN drivers/net/3c59x.c~wol-bugfix-for-3c59xc drivers/net/3c59x.c
--- a/drivers/net/3c59x.c~wol-bugfix-for-3c59xc
+++ a/drivers/net/3c59x.c
@@ -3118,7 +3118,13 @@ static void acpi_set_WOL(struct net_devi
iowrite16(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr 
+ EL3_CMD);
iowrite16(RxEnable, ioaddr + EL3_CMD);
 
-   pci_enable_wake(VORTEX_PCI(vp), 0, 1);
+   if (pci_enable_wake(VORTEX_PCI(vp), PCI_D3hot, 1)) {
+   printk(KERN_INFO "%s: WOL not supported.\n",
+   pci_name(VORTEX_PCI(vp)));
+
+   vp->enable_wol = 0;
+   return;
+   }
 
/* Change the power state to D3; RxEnable doesn't take effect. 
*/
pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
_
-
To unsubscribe from this list: send 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/4] forcedeth: power down phy when interface is down

2007-10-16 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Bring the physical link down when the interface is down by placing the PHY
in power-down state, unless WOL is enabled.  This mirrors the behavior of
other drivers including e1000 and tg3.

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1313,9 +1313,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-   /* restart auto negotiation */
+   /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4791,6 +4791,10 @@ static int nv_open(struct net_device *de
 
dprintk(KERN_DEBUG "nv_open: begin\n");
 
+   /* power up phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4973,6 +4977,10 @@ static int nv_close(struct net_device *d
if (np->wolenabled) {
writel(NVREG_PFF_ALWAYS|NVREG_PFF_MYADDR, base + 
NvRegPacketFilterFlags);
nv_start_rx(dev);
+   } else {
+   /* power down phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ)|BMCR_PDOWN);
}
 
/* FIXME: power down nic */
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/13] ax88796: add 93cx6 eeprom support

2007-10-02 Thread akpm
From: Magnus Damm <[EMAIL PROTECTED]>

Hook up the 93cx6 eeprom code to the ax88796 driver and modify the ax88796
driver to read out the mac address from the eeprom.  We need this for the
ax88796 on certain SuperH boards.  The pin configuration used to connect
the eeprom to the ax88796 on these boards is the same as pointed out by the
ax88796 datasheet, so we can probably reuse this code for multiple
platforms in the future.

Signed-off-by: Magnus Damm <[EMAIL PROTECTED]>
Cc: Ben Dooks <[EMAIL PROTECTED]>
Cc: Paul Mundt <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/Kconfig  |7 
 drivers/net/ax88796.c|   49 +
 include/linux/eeprom_93cx6.h |3 +-
 include/net/ax88796.h|1 
 4 files changed, 59 insertions(+), 1 deletion(-)

diff -puN drivers/net/Kconfig~ax88796-add-93cx6-eeprom-support 
drivers/net/Kconfig
--- a/drivers/net/Kconfig~ax88796-add-93cx6-eeprom-support
+++ a/drivers/net/Kconfig
@@ -240,6 +240,13 @@ config AX88796
  AX88796 driver, using platform bus to provide
  chip detection and resources
 
+config AX88796_93CX6
+   bool "ASIX AX88796 external 93CX6 eeprom support"
+   depends on AX88796
+   select EEPROM_93CX6
+   help
+ Select this if your platform comes with an external 93CX6 eeprom.
+
 config MACE
tristate "MACE (Power Mac ethernet) support"
depends on PPC_PMAC && PPC32
diff -puN drivers/net/ax88796.c~ax88796-add-93cx6-eeprom-support 
drivers/net/ax88796.c
--- a/drivers/net/ax88796.c~ax88796-add-93cx6-eeprom-support
+++ a/drivers/net/ax88796.c
@@ -24,6 +24,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -582,6 +583,37 @@ static const struct ethtool_ops ax_ethto
.get_link   = ax_get_link,
 };
 
+#ifdef CONFIG_AX88796_93CX6
+static void ax_eeprom_register_read(struct eeprom_93cx6 *eeprom)
+{
+   struct ei_device *ei_local = eeprom->data;
+   u8 reg = ei_inb(ei_local->mem + AX_MEMR);
+
+   eeprom->reg_data_in = reg & AX_MEMR_EEI;
+   eeprom->reg_data_out = reg & AX_MEMR_EEO; /* Input pin */
+   eeprom->reg_data_clock = reg & AX_MEMR_EECLK;
+   eeprom->reg_chip_select = reg & AX_MEMR_EECS;
+}
+
+static void ax_eeprom_register_write(struct eeprom_93cx6 *eeprom)
+{
+   struct ei_device *ei_local = eeprom->data;
+   u8 reg = ei_inb(ei_local->mem + AX_MEMR);
+
+   reg &= ~(AX_MEMR_EEI | AX_MEMR_EECLK | AX_MEMR_EECS);
+
+   if (eeprom->reg_data_in)
+   reg |= AX_MEMR_EEI;
+   if (eeprom->reg_data_clock)
+   reg |= AX_MEMR_EECLK;
+   if (eeprom->reg_chip_select)
+   reg |= AX_MEMR_EECS;
+
+   ei_outb(reg, ei_local->mem + AX_MEMR);
+   udelay(10);
+}
+#endif
+
 /* setup code */
 
 static void ax_initial_setup(struct net_device *dev, struct ei_device 
*ei_local)
@@ -640,6 +672,23 @@ static int ax_init_dev(struct net_device
memcpy(dev->dev_addr,  SA_prom, 6);
}
 
+#ifdef CONFIG_AX88796_93CX6
+   if (first_init && ax->plat->flags & AXFLG_HAS_93CX6) {
+   unsigned char mac_addr[6];
+   struct eeprom_93cx6 eeprom;
+
+   eeprom.data = ei_local;
+   eeprom.register_read = ax_eeprom_register_read;
+   eeprom.register_write = ax_eeprom_register_write;
+   eeprom.width = PCI_EEPROM_WIDTH_93C56;
+
+   eeprom_93cx6_multiread(&eeprom, 0,
+  (__le16 __force *)mac_addr,
+  sizeof(mac_addr) >> 1);
+
+   memcpy(dev->dev_addr,  mac_addr, 6);
+   }
+#endif
if (ax->plat->wordlength == 2) {
/* We must set the 8390 for word mode. */
ei_outb(ax->plat->dcr_val, ei_local->mem + EN0_DCFG);
diff -puN include/linux/eeprom_93cx6.h~ax88796-add-93cx6-eeprom-support 
include/linux/eeprom_93cx6.h
--- a/include/linux/eeprom_93cx6.h~ax88796-add-93cx6-eeprom-support
+++ a/include/linux/eeprom_93cx6.h
@@ -21,13 +21,14 @@
 /*
Module: eeprom_93cx6
Abstract: EEPROM reader datastructures for 93cx6 chipsets.
-   Supported chipsets: 93c46 & 93c66.
+   Supported chipsets: 93c46, 93c56 and 93c66.
  */
 
 /*
  * EEPROM operation defines.
  */
 #define PCI_EEPROM_WIDTH_93C46 6
+#define PCI_EEPROM_WIDTH_93C56 8
 #define PCI_EEPROM_WIDTH_93C66 8
 #define PCI_EEPROM_WIDTH_OPCODE3
 #define PCI_EEPROM_WRITE_OPCODE0x05
diff -puN include/net/ax88796.h~ax88796-add-93cx6-eeprom-support 
include/net/ax88796.h
--- a/include/net/ax88796.h~ax88796-add-93cx6-eeprom-support
+++ a/include/net/ax88796.h
@@ -14,6 +14,7 @@
 
 #define AXFLG_HAS_EEPROM   (1<<0)
 #define AXFLG_MAC_FROMDEV  (1<<1)  /* device already has MAC */
+#define AXFLG_HAS_93CX6(1<<2)  /* use eeprom_93cx6 
driver */
 
 struct ax_plat_data {
unsigned int flags;
_
-
To unsub

[patch 11/13] PHYLIB: fix an interrupt loop potential when halting

2007-10-02 Thread akpm
From: "Maciej W. Rozycki" <[EMAIL PROTECTED]>

Ensure the PHY_HALTED state is not entered with the IRQ asserted as it
could lead to an interrupt loop.

There is a small window in phy_stop(), where the state of the PHY machine
indicates it has been halted, but its interrupt output might still be
unmasked.  If an interrupt goes active right at this moment it will loop as
the phy_interrupt() handler exits immediately with IRQ_NONE if the halted
state is seen.  It is unsafe to extend the phydev spinlock to cover
phy_interrupt().  It is safe to swap the order of the actions though as all
the competing places to unmask the interrupt output of the PHY, which are
phy_change() and phy_timer() are already covered with the lock as is the
sequence in question.

Signed-off-by: Maciej W. Rozycki <[EMAIL PROTECTED]>
Cc: Andy Fleming <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/phy/phy.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/phy/phy.c~phylib-fix-an-interrupt-loop-potential-when-halting 
drivers/net/phy/phy.c
--- a/drivers/net/phy/phy.c~phylib-fix-an-interrupt-loop-potential-when-halting
+++ a/drivers/net/phy/phy.c
@@ -737,8 +737,6 @@ void phy_stop(struct phy_device *phydev)
if (PHY_HALTED == phydev->state)
goto out_unlock;
 
-   phydev->state = PHY_HALTED;
-
if (phydev->irq != PHY_POLL) {
/* Disable PHY Interrupts */
phy_config_interrupt(phydev, PHY_INTERRUPT_DISABLED);
@@ -747,6 +745,8 @@ void phy_stop(struct phy_device *phydev)
phy_clear_interrupt(phydev);
}
 
+   phydev->state = PHY_HALTED;
+
 out_unlock:
spin_unlock_bh(&phydev->lock);
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 12/13] Clean up redundant PHY write line for ULi526x Ethernet driver

2007-10-02 Thread akpm
From: Roy Zang <[EMAIL PROTECTED]>

Clean up redundant PHY write line for ULi526x Ethernet Driver.

Signed-off-by: Roy Zang <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Acked-by: Grant Grundler <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN 
drivers/net/tulip/uli526x.c~clean-up-redundant-phy-write-line-for-uli526x-ethernet
 drivers/net/tulip/uli526x.c
--- 
a/drivers/net/tulip/uli526x.c~clean-up-redundant-phy-write-line-for-uli526x-ethernet
+++ a/drivers/net/tulip/uli526x.c
@@ -1599,7 +1599,6 @@ static void uli526x_process_mode(struct 
case ULI526X_100MFD: phy_reg = 0x2100; break;
}
phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, 
db->chip_id);
-   phy_write(db->ioaddr, db->phy_addr, 0, phy_reg, 
db->chip_id);
}
}
 }
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/13] PHYLIB: IRQ event workqueue handling fixes

2007-10-02 Thread akpm
From: "Maciej W. Rozycki" <[EMAIL PROTECTED]>

Keep track of disable_irq_nosync() invocations and call enable_irq() the
right number of times if work has been cancelled that would include them.

Now that the call to flush_work_keventd() (problematic because of
rtnl_mutex being held) has been replaced by cancel_work_sync() another
issue has arisen and been left unresolved.  As the MDIO bus cannot be
accessed from the interrupt context the PHY interrupt handler uses
disable_irq_nosync() to prevent from looping and schedules some work to be
done as a softirq, which, apart from handling the state change of the
originating PHY, is responsible for reenabling the interrupt.  Now if the
interrupt line is shared by another device and a call to the softirq
handler has been cancelled, that call to enable_irq() never happens and the
other device cannot use its interrupt anymore as its stuck disabled.

I decided to use a counter rather than a flag because there may be more
than one call to phy_change() cancelled in the queue -- a real one and a
fake one triggered by free_irq() if DEBUG_SHIRQ is used, if nothing else. 
Therefore because of its nesting property enable_irq() has to be called the
right number of times to match the number disable_irq_nosync() was called
and restore the original state.  This DEBUG_SHIRQ feature is also the
reason why free_irq() has to be called before cancel_work_sync().

While at it I updated the comment about phy_stop_interrupts() being called
from `keventd' -- this is no longer relevant as the use of
cancel_work_sync() makes such an approach unnecessary.  OTOH a similar
comment referring to flush_scheduled_work() in phy_stop() still applies as
using cancel_work_sync() there would be dangerous.

Checked with checkpatch.pl and at the run time (with and without
DEBUG_SHIRQ).

Signed-off-by: Maciej W. Rozycki <[EMAIL PROTECTED]>
Cc: Andy Fleming <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/phy/phy.c |   24 +++-
 include/linux/phy.h   |3 +++
 2 files changed, 22 insertions(+), 5 deletions(-)

diff -puN drivers/net/phy/phy.c~phylib-irq-event-workqueue-handling-fixes 
drivers/net/phy/phy.c
--- a/drivers/net/phy/phy.c~phylib-irq-event-workqueue-handling-fixes
+++ a/drivers/net/phy/phy.c
@@ -7,7 +7,7 @@
  * Author: Andy Fleming
  *
  * Copyright (c) 2004 Freescale Semiconductor, Inc.
- * Copyright (c) 2006  Maciej W. Rozycki
+ * Copyright (c) 2006, 2007  Maciej W. Rozycki
  *
  * This program is free software; you can redistribute  it and/or modify it
  * under  the terms of  the GNU General  Public License as published by the
@@ -35,6 +35,7 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
@@ -562,6 +563,7 @@ static irqreturn_t phy_interrupt(int irq
 * queue will write the PHY to disable and clear the
 * interrupt, and then reenable the irq line. */
disable_irq_nosync(irq);
+   atomic_inc(&phydev->irq_disable);
 
schedule_work(&phydev->phy_queue);
 
@@ -632,6 +634,7 @@ int phy_start_interrupts(struct phy_devi
 
INIT_WORK(&phydev->phy_queue, phy_change);
 
+   atomic_set(&phydev->irq_disable, 0);
if (request_irq(phydev->irq, phy_interrupt,
IRQF_SHARED,
"phy_interrupt",
@@ -662,13 +665,22 @@ int phy_stop_interrupts(struct phy_devic
if (err)
phy_error(phydev);
 
+   free_irq(phydev->irq, phydev);
+
/*
-* Finish any pending work; we might have been scheduled to be called
-* from keventd ourselves, but cancel_work_sync() handles that.
+* Cannot call flush_scheduled_work() here as desired because
+* of rtnl_lock(), but we do not really care about what would
+* be done, except from enable_irq(), so cancel any work
+* possibly pending and take care of the matter below.
 */
cancel_work_sync(&phydev->phy_queue);
-
-   free_irq(phydev->irq, phydev);
+   /*
+* If work indeed has been cancelled, disable_irq() will have
+* been left unbalanced from phy_interrupt() and enable_irq()
+* has to be called so that other devices on the line work.
+*/
+   while (atomic_dec_return(&phydev->irq_disable) >= 0)
+   enable_irq(phydev->irq);
 
return err;
 }
@@ -695,6 +707,7 @@ static void phy_change(struct work_struc
phydev->state = PHY_CHANGELINK;
spin_unlock_bh(&phydev->lock);
 
+   atomic_dec(&phydev->irq_disable);
enable_irq(phydev->irq);
 
/* Reenable interrupts */
@@ -708,6 +721,7 @@ static void phy_change(struct work_struc
 
 irq_enable_err:
disable_irq(phydev->irq);
+   atomic_inc(&phydev->irq_disable);
 phy_err:
phy_error(phydev);
 }
diff -puN include/linux/phy.h~phylib-irq-event-workqueue-handling-fixes 
include/linux/phy.h
--- a/include/linux/phy.h~p

[patch 07/13] PHYLIB: Spinlock fixes for softirqs

2007-10-02 Thread akpm
From: "Maciej W. Rozycki" <[EMAIL PROTECTED]>

Use spin_lock_bh()/spin_unlock_bh() for the phydev lock throughout as it
is used in phy_timer() that is called as a softirq and all the other
operations may happen in the user context.

There has been a change recently that did such a conversion for some of the
operations on the lock, but some have been left intact.  Many of them,
perhaps all, may be called in the user context and I was able to trigger
recursive spinlock acquisition indeed, so I think for the sake of long-term
maintenance it is best to convert them all, even if unnecessarily for one
or two -- better safe than sorry.

Perhaps one in phy_timer() could actually be skipped as only called as a
softirq -- I can send an update if that sounds like a good idea.

Checked with checkpatch.pl and at the runtime.

Signed-off-by: Maciej W. Rozycki <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/phy/phy.c|   24 
 drivers/net/phy/phy_device.c |4 ++--
 2 files changed, 14 insertions(+), 14 deletions(-)

diff -puN drivers/net/phy/phy.c~phylib-spinlock-fixes-for-softirqs 
drivers/net/phy/phy.c
--- a/drivers/net/phy/phy.c~phylib-spinlock-fixes-for-softirqs
+++ a/drivers/net/phy/phy.c
@@ -424,7 +424,7 @@ int phy_start_aneg(struct phy_device *ph
 {
int err;
 
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
 
if (AUTONEG_DISABLE == phydev->autoneg)
phy_sanitize_settings(phydev);
@@ -445,7 +445,7 @@ int phy_start_aneg(struct phy_device *ph
}
 
 out_unlock:
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
return err;
 }
 EXPORT_SYMBOL(phy_start_aneg);
@@ -490,10 +490,10 @@ void phy_stop_machine(struct phy_device 
 {
del_timer_sync(&phydev->phy_timer);
 
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
if (phydev->state > PHY_UP)
phydev->state = PHY_UP;
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 
phydev->adjust_state = NULL;
 }
@@ -537,9 +537,9 @@ static void phy_force_reduction(struct p
  */
 void phy_error(struct phy_device *phydev)
 {
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
phydev->state = PHY_HALTED;
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 }
 
 /**
@@ -690,10 +690,10 @@ static void phy_change(struct work_struc
if (err)
goto phy_err;
 
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
if ((PHY_RUNNING == phydev->state) || (PHY_NOLINK == phydev->state))
phydev->state = PHY_CHANGELINK;
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 
enable_irq(phydev->irq);
 
@@ -718,7 +718,7 @@ phy_err:
  */
 void phy_stop(struct phy_device *phydev)
 {
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
 
if (PHY_HALTED == phydev->state)
goto out_unlock;
@@ -734,7 +734,7 @@ void phy_stop(struct phy_device *phydev)
}
 
 out_unlock:
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 
/*
 * Cannot call flush_scheduled_work() here as desired because
@@ -782,7 +782,7 @@ static void phy_timer(unsigned long data
int needs_aneg = 0;
int err = 0;
 
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
 
if (phydev->adjust_state)
phydev->adjust_state(phydev->attached_dev);
@@ -948,7 +948,7 @@ static void phy_timer(unsigned long data
break;
}
 
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 
if (needs_aneg)
err = phy_start_aneg(phydev);
diff -puN drivers/net/phy/phy_device.c~phylib-spinlock-fixes-for-softirqs 
drivers/net/phy/phy_device.c
--- a/drivers/net/phy/phy_device.c~phylib-spinlock-fixes-for-softirqs
+++ a/drivers/net/phy/phy_device.c
@@ -670,9 +670,9 @@ static int phy_remove(struct device *dev
 
phydev = to_phy_device(dev);
 
-   spin_lock(&phydev->lock);
+   spin_lock_bh(&phydev->lock);
phydev->state = PHY_DOWN;
-   spin_unlock(&phydev->lock);
+   spin_unlock_bh(&phydev->lock);
 
if (phydev->drv->remove)
phydev->drv->remove(phydev);
_
-
To unsubscribe from this list: send 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 06/13] Fix a potential NULL pointer dereference in uli526x_interrupt() in drivers/net/tulip/uli526x.c

2007-10-02 Thread akpm
From: Micah Gruber <[EMAIL PROTECTED]>

This patch fixes an apparent potential null dereference bug where we
dereference dev before a null check.  This patch simply remvoes the
can't-happen test for a null pointer.

Signed-off-by: Micah Gruber <[EMAIL PROTECTED]>
Cc: Grant Grundler <[EMAIL PROTECTED]>
Acked-by: Jeff Garzik <[EMAIL PROTECTED]>
Acked-by: Kyle McMartin <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tulip/uli526x.c |5 -
 1 file changed, 5 deletions(-)

diff -puN 
drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt
 drivers/net/tulip/uli526x.c
--- 
a/drivers/net/tulip/uli526x.c~fix-a-potential-null-pointer-dereference-in-uli526x_interrupt
+++ a/drivers/net/tulip/uli526x.c
@@ -664,11 +664,6 @@ static irqreturn_t uli526x_interrupt(int
unsigned long ioaddr = dev->base_addr;
unsigned long flags;
 
-   if (!dev) {
-   ULI526X_DBUG(1, "uli526x_interrupt() without DEVICE arg", 0);
-   return IRQ_NONE;
-   }
-
spin_lock_irqsave(&db->lock, flags);
outl(0, ioaddr + DCR7);
 
_
-
To unsubscribe from this list: send 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 03/13] drivers/net/cxgb3/xgmac.c: remove dead code

2007-10-02 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch removes dead code ("tx_xcnt" can never be != 0 at this place)
spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/cxgb3/xgmac.c |5 +
 1 file changed, 1 insertion(+), 4 deletions(-)

diff -puN drivers/net/cxgb3/xgmac.c~drivers-net-cxgb3-xgmacc-remove-dead-code 
drivers/net/cxgb3/xgmac.c
--- a/drivers/net/cxgb3/xgmac.c~drivers-net-cxgb3-xgmacc-remove-dead-code
+++ a/drivers/net/cxgb3/xgmac.c
@@ -522,10 +522,7 @@ int t3b2_mac_watchdog_task(struct cmac *
goto rxcheck;
}
 
-   if (((tx_tcnt != mac->tx_tcnt) &&
-(tx_xcnt == 0) && (mac->tx_xcnt == 0)) ||
-   ((mac->tx_mcnt == tx_mcnt) &&
-(tx_xcnt != 0) && (mac->tx_xcnt != 0))) {
+   if ((tx_tcnt != mac->tx_tcnt) && (mac->tx_xcnt == 0))  {
if (mac->toggle_cnt > 4) {
status = 2;
goto out;
_
-
To unsubscribe from this list: send 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 02/13] PCI-X/PCI-Express read control interfaces: use them in e1000

2007-10-02 Thread akpm
From: "Peter Oruba" <[EMAIL PROTECTED]>

These driver changes incorporate the proposed PCI-X / PCI-Express read byte
count interface.  Reading and setting those valuse doesn't take place
"manually", instead wrapping functions are called to allow quirks for some
PCI bridges.

[EMAIL PROTECTED]: e1000: #if 0 two functions]
Signed-off by: Peter Oruba <[EMAIL PROTECTED]>
Based on work by Stephen Hemminger <[EMAIL PROTECTED]>
Acked-by: Auke Kok <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.c   |   25 +++--
 drivers/net/e1000/e1000_hw.h   |4 ++--
 drivers/net/e1000/e1000_main.c |   18 ++
 3 files changed, 23 insertions(+), 24 deletions(-)

diff -puN 
drivers/net/e1000/e1000_hw.c~pci-x-pci-express-read-control-interfaces-e1000 
drivers/net/e1000/e1000_hw.c
--- 
a/drivers/net/e1000/e1000_hw.c~pci-x-pci-express-read-control-interfaces-e1000
+++ a/drivers/net/e1000/e1000_hw.c
@@ -871,10 +871,6 @@ e1000_init_hw(struct e1000_hw *hw)
 uint32_t ctrl;
 uint32_t i;
 int32_t ret_val;
-uint16_t pcix_cmd_word;
-uint16_t pcix_stat_hi_word;
-uint16_t cmd_mmrbc;
-uint16_t stat_mmrbc;
 uint32_t mta_size;
 uint32_t reg_data;
 uint32_t ctrl_ext;
@@ -964,24 +960,9 @@ e1000_init_hw(struct e1000_hw *hw)
 break;
 default:
 /* Workaround for PCI-X problem when BIOS sets MMRBC incorrectly. */
-if (hw->bus_type == e1000_bus_type_pcix) {
-e1000_read_pci_cfg(hw, PCIX_COMMAND_REGISTER, &pcix_cmd_word);
-e1000_read_pci_cfg(hw, PCIX_STATUS_REGISTER_HI,
-&pcix_stat_hi_word);
-cmd_mmrbc = (pcix_cmd_word & PCIX_COMMAND_MMRBC_MASK) >>
-PCIX_COMMAND_MMRBC_SHIFT;
-stat_mmrbc = (pcix_stat_hi_word & PCIX_STATUS_HI_MMRBC_MASK) >>
-PCIX_STATUS_HI_MMRBC_SHIFT;
-if (stat_mmrbc == PCIX_STATUS_HI_MMRBC_4K)
-stat_mmrbc = PCIX_STATUS_HI_MMRBC_2K;
-if (cmd_mmrbc > stat_mmrbc) {
-pcix_cmd_word &= ~PCIX_COMMAND_MMRBC_MASK;
-pcix_cmd_word |= stat_mmrbc << PCIX_COMMAND_MMRBC_SHIFT;
-e1000_write_pci_cfg(hw, PCIX_COMMAND_REGISTER,
-&pcix_cmd_word);
-}
-}
-break;
+   if (hw->bus_type == e1000_bus_type_pcix && e1000_pcix_get_mmrbc(hw) > 
2048)
+   e1000_pcix_set_mmrbc(hw, 2048);
+   break;
 }
 
 /* More time needed for PHY to initialize */
diff -puN 
drivers/net/e1000/e1000_hw.h~pci-x-pci-express-read-control-interfaces-e1000 
drivers/net/e1000/e1000_hw.h
--- 
a/drivers/net/e1000/e1000_hw.h~pci-x-pci-express-read-control-interfaces-e1000
+++ a/drivers/net/e1000/e1000_hw.h
@@ -421,9 +421,9 @@ void e1000_tbi_adjust_stats(struct e1000
 void e1000_get_bus_info(struct e1000_hw *hw);
 void e1000_pci_set_mwi(struct e1000_hw *hw);
 void e1000_pci_clear_mwi(struct e1000_hw *hw);
-void e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
-void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 int32_t e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t 
*value);
+void e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc);
+int e1000_pcix_get_mmrbc(struct e1000_hw *hw);
 /* Port I/O is only supported on 82544 and newer */
 void e1000_io_write(struct e1000_hw *hw, unsigned long port, uint32_t value);
 int32_t e1000_disable_pciex_master(struct e1000_hw *hw);
diff -puN 
drivers/net/e1000/e1000_main.c~pci-x-pci-express-read-control-interfaces-e1000 
drivers/net/e1000/e1000_main.c
--- 
a/drivers/net/e1000/e1000_main.c~pci-x-pci-express-read-control-interfaces-e1000
+++ a/drivers/net/e1000/e1000_main.c
@@ -4887,6 +4887,8 @@ e1000_pci_clear_mwi(struct e1000_hw *hw)
pci_clear_mwi(adapter->pdev);
 }
 
+#if 0
+
 void
 e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
 {
@@ -4903,6 +4905,22 @@ e1000_write_pci_cfg(struct e1000_hw *hw,
pci_write_config_word(adapter->pdev, reg, *value);
 }
 
+#endif  /*  0  */
+
+int
+e1000_pcix_get_mmrbc(struct e1000_hw *hw)
+{
+   struct e1000_adapter *adapter = hw->back;
+   return pcix_get_mmrbc(adapter->pdev);
+}
+
+void
+e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc)
+{
+   struct e1000_adapter *adapter = hw->back;
+   pcix_set_mmrbc(adapter->pdev, mmrbc);
+}
+
 int32_t
 e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
 {
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 08/13] forcedeth: power down phy when interface is down

2007-10-02 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Bring the physical link down when the interface is down, by placing the PHY in
power-down state.  This mirrors the behavior of other drivers including e1000
and tg3.

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>

On Sat, 29 Sep 2007 01:57:04 -0400 Jeff Garzik <[EMAIL PROTECTED]> wrote:

> [EMAIL PROTECTED] wrote:
> > From: "Ed Swierk" <[EMAIL PROTECTED]>
> > 
> > Bring the physical link down when the interface is down, by placing the PHY 
> > in
> > power-down state.  This mirrors the behavior of other drivers including 
> > e1000
> > and tg3.
> > 
> > Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
> > Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
> > Cc: Jeff Garzik <[EMAIL PROTECTED]>
> > Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
> 
> 
> HOLD -- waiting a bit for comment from others, particularly NVIDIA.
> 
> I'm not opposed to applying it, the patch looks correct, but I would 
> also like see testing results and general "it's ok for this hardware" 
> comments.
> 

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/forcedeth.c |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff -puN 
drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-power-down-phy-when-interface-is-down
+++ a/drivers/net/forcedeth.c
@@ -1313,9 +1313,9 @@ static int phy_init(struct net_device *d
/* some phys clear out pause advertisment on reset, set it back */
mii_rw(dev, np->phyaddr, MII_ADVERTISE, reg);
 
-   /* restart auto negotiation */
+   /* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
-   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
+   mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE | BMCR_PDOWN);
if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
return PHY_ERROR;
}
@@ -4791,6 +4791,10 @@ static int nv_open(struct net_device *de
 
dprintk(KERN_DEBUG "nv_open: begin\n");
 
+   /* power up phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) & ~BMCR_PDOWN);
+
/* erase previous misconfiguration */
if (np->driver_data & DEV_HAS_POWER_CNTRL)
nv_mac_reset(dev);
@@ -4975,6 +4979,10 @@ static int nv_close(struct net_device *d
nv_start_rx(dev);
}
 
+   /* power down phy */
+   mii_rw(dev, np->phyaddr, MII_BMCR,
+  mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ) | BMCR_PDOWN);
+
/* FIXME: power down nic */
 
return 0;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/13] forcedeth: "no link" is informational

2007-10-02 Thread akpm
From: "Ed Swierk" <[EMAIL PROTECTED]>

Log "no link during initialization" at KERN_INFO as it's not an error, and
occurs every time the interface comes up (when the forcedeth-phy-power-down
patch is applied).

Signed-off-by: Ed Swierk <[EMAIL PROTECTED]>
Cc: Ayaz Abdulla <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/forcedeth.c~forcedeth-no-link-is-informational 
drivers/net/forcedeth.c
--- a/drivers/net/forcedeth.c~forcedeth-no-link-is-informational
+++ a/drivers/net/forcedeth.c
@@ -4921,7 +4921,7 @@ static int nv_open(struct net_device *de
if (ret) {
netif_carrier_on(dev);
} else {
-   printk("%s: no link during initialization.\n", dev->name);
+   printk(KERN_INFO "%s: no link during initialization.\n", 
dev->name);
netif_carrier_off(dev);
}
if (oom)
_
-
To unsubscribe from this list: send 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 05/13] skge: remove broken and unused PHY_M_PC_MDI_XMODE macro

2007-10-02 Thread akpm
From: Mariusz Kozlowski <[EMAIL PROTECTED]>

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>
Cc: Stephen Hemminger <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/skge.h |2 --
 1 file changed, 2 deletions(-)

diff -puN 
drivers/net/skge.h~skge-remove-broken-and-unused-phy_m_pc_mdi_xmode-macro 
drivers/net/skge.h
--- a/drivers/net/skge.h~skge-remove-broken-and-unused-phy_m_pc_mdi_xmode-macro
+++ a/drivers/net/skge.h
@@ -1351,8 +1351,6 @@ enum {
PHY_M_PC_EN_DET_PLUS= 3<<8, /* Energy Detect Plus (Mode 2) */
 };
 
-#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 */
PHY_M_PC_MAN_MDIX   = 1, /* 01 = Manual MDIX configuration */
_
-
To unsubscribe from this list: send 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 01/13] PHY fixed driver: rework release path and update phy_id notation

2007-10-02 Thread akpm
From: Vitaly Bordug <[EMAIL PROTECTED]>

device_bind_driver() error code returning has been fixed.  release()
function has been written, so that to free resources in correct way; the
release path is now clean.

Before the rework, it used to cause
 Device '[EMAIL PROTECTED]:1' does not have a release() function, it is broken
 and must be fixed.
 BUG: at drivers/base/core.c:104 device_release()

 Call Trace:
  [] kobject_cleanup+0x53/0x7e
  [] kobject_release+0x0/0x9
  [] kref_put+0x74/0x81
  [] fixed_mdio_register_device+0x230/0x265
  [] fixed_init+0x1f/0x35
  [] init+0x147/0x2fb
  [] schedule_tail+0x36/0x92
  [] child_rip+0xa/0x12
  [] acpi_ds_init_one_object+0x0/0x83
  [] init+0x0/0x2fb
  [] child_rip+0x0/0x12


Also changed the notation of the fixed phy definition on
mdio bus to the form of + to make it able to be used by
gianfar and ucc_geth that define phy_id strictly as "%d:%d" and cleaned up
the whitespace issues.

Signed-off-by: Vitaly Bordug <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/phy/Kconfig   |   14 +
 drivers/net/phy/fixed.c   |  310 ++--
 include/linux/phy_fixed.h |   38 
 3 files changed, 207 insertions(+), 155 deletions(-)

diff -puN 
drivers/net/phy/Kconfig~phy-fixed-driver-rework-release-path-and-update 
drivers/net/phy/Kconfig
--- a/drivers/net/phy/Kconfig~phy-fixed-driver-rework-release-path-and-update
+++ a/drivers/net/phy/Kconfig
@@ -76,4 +76,18 @@ config FIXED_MII_100_FDX
bool "Emulation for 100M Fdx fixed PHY behavior"
depends on FIXED_PHY
 
+config FIXED_MII_1000_FDX
+   bool "Emulation for 1000M Fdx fixed PHY behavior"
+   depends on FIXED_PHY
+
+config FIXED_MII_AMNT
+int "Number of emulated PHYs to allocate "
+depends on FIXED_PHY
+default "1"
+---help---
+Sometimes it is required to have several independent emulated
+PHYs on the bus (in case of multi-eth but phy-less HW for instance).
+This control will have specified number allocated for each fixed
+PHY type enabled.
+
 endif # PHYLIB
diff -puN 
drivers/net/phy/fixed.c~phy-fixed-driver-rework-release-path-and-update 
drivers/net/phy/fixed.c
--- a/drivers/net/phy/fixed.c~phy-fixed-driver-rework-release-path-and-update
+++ a/drivers/net/phy/fixed.c
@@ -30,53 +30,31 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
 #include 
 
-#define MII_REGS_NUM   7
-
-/*
-The idea is to emulate normal phy behavior by responding with
-pre-defined values to mii BMCR read, so that read_status hook could
-take all the needed info.
-*/
-
-struct fixed_phy_status {
-   u8  link;
-   u16 speed;
-   u8  duplex;
-};
-
-/*-
- *  Private information hoder for mii_bus
- 
*-*/
-struct fixed_info {
-   u16 *regs;
-   u8 regs_num;
-   struct fixed_phy_status phy_status;
-   struct phy_device *phydev; /* pointer to the container */
-   /* link & speed cb */
-   int(*link_update)(struct net_device*, struct fixed_phy_status*);
-
-};
+/* we need to track the allocated pointers in order to free them on exit */
+static struct fixed_info *fixed_phy_ptrs[CONFIG_FIXED_MII_AMNT*MAX_PHY_AMNT];
 
 /*-
  *  If something weird is required to be done with link/speed,
  * network driver is able to assign a function to implement this.
  * May be useful for PHY's that need to be software-driven.
  
*-*/
-int fixed_mdio_set_link_update(struct phy_device* phydev,
-   int(*link_update)(struct net_device*, struct fixed_phy_status*))
+int fixed_mdio_set_link_update(struct phy_device *phydev,
+  int (*link_update) (struct net_device *,
+  struct fixed_phy_status *))
 {
struct fixed_info *fixed;
 
-   if(link_update == NULL)
+   if (link_update == NULL)
return -EINVAL;
 
-   if(phydev) {
-   if(phydev->bus) {
+   if (phydev) {
+   if (phydev->bus) {
fixed = phydev->bus->priv;
fixed->link_update = link_update;
return 0;
@@ -84,54 +62,64 @@ int fixed_mdio_set_link_update(struct ph
}
return -EINVAL;
 }
+
 EXPORT_SYMBOL(fixed_mdio_set_link_update);
 
+struct fixed_info *fixed_mdio_get_phydev (int phydev_ind)
+{
+   if (phydev_ind >= MAX_PHY_AMNT)
+   return NULL;
+   return fixed_phy_ptrs[phydev_ind];
+}
+
+EXPORT_SYMBOL(fixed_mdio_get_phydev);
+
 /*-
  *  This is used for updating internal mii regs from the sta

[patch 04/13] Avoid possible NULL pointer deref in 3c359 driver

2007-10-02 Thread akpm
From: Jesper Juhl <[EMAIL PROTECTED]>

In xl_freemem(), if dev_if is NULL, the line

  struct xl_private *xl_priv =(struct xl_private *)dev->priv;

will cause a NULL pointer dereference.

(akpm: don't try to fix it: just delete the pointless test-for-null)

Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tokenring/3c359.c |5 -
 1 file changed, 5 deletions(-)

diff -puN 
drivers/net/tokenring/3c359.c~avoid-possible-null-pointer-deref-in-3c359-driver 
drivers/net/tokenring/3c359.c
--- 
a/drivers/net/tokenring/3c359.c~avoid-possible-null-pointer-deref-in-3c359-driver
+++ a/drivers/net/tokenring/3c359.c
@@ -1045,11 +1045,6 @@ static irqreturn_t xl_interrupt(int irq,
u8 __iomem * xl_mmio = xl_priv->xl_mmio ; 
u16 intstatus, macstatus  ;
 
-   if (!dev) { 
-   printk(KERN_WARNING "Device structure dead, aaa !\n") ;
-   return IRQ_NONE; 
-   }
-
intstatus = readw(xl_mmio + MMIO_INTSTATUS) ;  
 
if (!(intstatus & 1)) /* We didn't generate the interrupt */
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 3/3] git-net: sctp build fix (not for applying)

2007-10-02 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

net/sctp/sm_statetable.c:551: error: 'sctp_sf_tabort_8_4_8' undeclared here 
(not in a function)


Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/sctp/sm_statetable.c |2 --
 1 file changed, 2 deletions(-)

diff -puN net/sctp/sm_statetable.c~git-net-sctp-hack net/sctp/sm_statetable.c
--- a/net/sctp/sm_statetable.c~git-net-sctp-hack
+++ a/net/sctp/sm_statetable.c
@@ -527,8 +527,6 @@ static const sctp_sm_table_entry_t prsct
/* SCTP_STATE_EMPTY */ \
TYPE_SCTP_FUNC(sctp_sf_ootb), \
/* SCTP_STATE_CLOSED */ \
-   TYPE_SCTP_FUNC(sctp_sf_tabort_8_4_8), \
-   /* SCTP_STATE_COOKIE_WAIT */ \
TYPE_SCTP_FUNC(sctp_sf_discard_chunk), \
/* SCTP_STATE_COOKIE_ECHOED */ \
TYPE_SCTP_FUNC(sctp_sf_eat_auth), \
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 2/3] ipg.c doesn't compile with with CONFIG_HIGHMEM64G

2007-10-02 Thread akpm
From: trem <[EMAIL PROTECTED]>

I've tried to compile 2.6.23-rc8-mm2, but it fails on ipg.c with the
error : ERROR: "__udivdi3" [drivers/net/ipg.ko] undefined!

I've instigated a bit, and I've found this code in ipg.c :

static void ipg_nic_txfree(struct net_device *dev)
{
   struct ipg_nic_private *sp = netdev_priv(dev);
   void __iomem *ioaddr = sp->ioaddr;
   const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) -
   (sp->txd_map / sizeof(struct ipg_tx)) - 1;
   unsigned int released, pending;

sp->txd_map is an u64
because :
dma_addr_t txd_map;

And in asm-i386/types.h, I see :
#ifdef CONFIG_HIGHMEM64G
typedef u64 dma_addr_t;
#else
typedef u32 dma_addr_t;
#endif
I my config, I use CONFIG_HIGHMEM64G

sizeof(struct ipg_tx) is an u32
So the div failed on i386 because of u64 / u32.

[EMAIL PROTECTED]: cleanups]
Cc: Sorbica Shieh <[EMAIL PROTECTED]>
Cc: Jesse Huang <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/ipg.c |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

diff -puN drivers/net/ipg.c~ipgc-doesnt-compile-with-with-config_highmem64g 
drivers/net/ipg.c
--- a/drivers/net/ipg.c~ipgc-doesnt-compile-with-with-config_highmem64g
+++ a/drivers/net/ipg.c
@@ -25,6 +25,8 @@
 #include 
 #include 
 
+#include 
+
 #define IPG_RX_RING_BYTES  (sizeof(struct ipg_rx) * IPG_RFDLIST_LENGTH)
 #define IPG_TX_RING_BYTES  (sizeof(struct ipg_tx) * IPG_TFDLIST_LENGTH)
 #define IPG_RESET_MASK \
@@ -836,10 +838,14 @@ static void ipg_nic_txfree(struct net_de
 {
struct ipg_nic_private *sp = netdev_priv(dev);
void __iomem *ioaddr = sp->ioaddr;
-   const unsigned int curr = ipg_r32(TFD_LIST_PTR_0) -
-   (sp->txd_map / sizeof(struct ipg_tx)) - 1;
+   unsigned int curr;
+   u64 txd_map;
unsigned int released, pending;
 
+   txd_map = (u64)sp->txd_map;
+   curr = ipg_r32(TFD_LIST_PTR_0) -
+   do_div(txd_map, sizeof(struct ipg_tx)) - 1;
+
IPG_DEBUG_MSG("_nic_txfree\n");
 
pending = sp->tx_current - sp->tx_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


[patch 1/3] git-net: make it compile (not for applying?)

2007-10-02 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

drivers/net/hamradio/baycom_epp.c: In function 'baycom_probe':
drivers/net/hamradio/baycom_epp.c:1162: error: 'struct net_device' has no 
member named 'hard_header'
drivers/net/hamradio/baycom_epp.c:1163: error: 'struct net_device' has no 
member named 'rebuild_header'

Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Stephen Hemminger <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/hamradio/baycom_epp.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff -puN drivers/net/hamradio/baycom_epp.c~git-net-more-bustage 
drivers/net/hamradio/baycom_epp.c
--- a/drivers/net/hamradio/baycom_epp.c~git-net-more-bustage
+++ a/drivers/net/hamradio/baycom_epp.c
@@ -1159,8 +1159,8 @@ static void baycom_probe(struct net_devi
/* Fill in the fields of the device structure */
bc->skb = NULL;

-   dev->hard_header = ax25_hard_header;
-   dev->rebuild_header = ax25_rebuild_header;
+// dev->hard_header = ax25_hard_header;
+// dev->rebuild_header = ax25_rebuild_header;
dev->set_mac_address = baycom_set_mac_address;

dev->type = ARPHRD_AX25;   /* AF_AX25 device */
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/18] Clean up duplicate includes in drivers/net/

2007-08-10 Thread akpm
From: Jesper Juhl <[EMAIL PROTECTED]>

This patch cleans up duplicate includes in
 drivers/net/

Signed-off-by: Jesper Juhl <[EMAIL PROTECTED]>
Acked-by: "John W. Linville" <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/atl1/atl1_main.c   |1 -
 drivers/net/bfin_mac.c |5 -
 drivers/net/bonding/bond_sysfs.c   |1 -
 drivers/net/fs_enet/fs_enet-main.c |2 --
 drivers/net/gianfar.h  |1 -
 drivers/net/gianfar_ethtool.c  |1 -
 drivers/net/irda/kingsun-sir.c |1 -
 drivers/net/irda/mcs7780.c |1 -
 drivers/net/mipsnet.c  |1 -
 drivers/net/netxen/netxen_nic_main.c   |1 -
 drivers/net/qla3xxx.c  |1 -
 drivers/net/tsi108_eth.c   |1 -
 drivers/net/wireless/ipw2200.h |1 -
 drivers/net/wireless/zd1211rw/zd_def.h |1 -
 14 files changed, 19 deletions(-)

diff -puN 
drivers/net/atl1/atl1_main.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/atl1/atl1_main.c
--- a/drivers/net/atl1/atl1_main.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/atl1/atl1_main.c
@@ -76,7 +76,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 
 #include 
diff -puN drivers/net/bfin_mac.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/bfin_mac.c
--- a/drivers/net/bfin_mac.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/bfin_mac.c
@@ -47,15 +47,10 @@
 #include 
 #include 
 #include 
-
 #include 
 #include 
 #include 
-
 #include 
-#include 
-#include 
-#include 
 
 #include 
 #include 
diff -puN 
drivers/net/bonding/bond_sysfs.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/bonding/bond_sysfs.c
--- 
a/drivers/net/bonding/bond_sysfs.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/bonding/bond_sysfs.c
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff -puN 
drivers/net/fs_enet/fs_enet-main.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/fs_enet/fs_enet-main.c
--- 
a/drivers/net/fs_enet/fs_enet-main.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/fs_enet/fs_enet-main.c
@@ -39,8 +39,6 @@
 
 #include 
 #include 
-
-#include 
 #include 
 #include 
 
diff -puN drivers/net/gianfar.h~clean-up-duplicate-includes-in-drivers-net 
drivers/net/gianfar.h
--- a/drivers/net/gianfar.h~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/gianfar.h
@@ -45,7 +45,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include "gianfar_mii.h"
 
diff -puN 
drivers/net/gianfar_ethtool.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/gianfar_ethtool.c
--- a/drivers/net/gianfar_ethtool.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/gianfar_ethtool.c
@@ -34,7 +34,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff -puN 
drivers/net/irda/kingsun-sir.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/irda/kingsun-sir.c
--- a/drivers/net/irda/kingsun-sir.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/irda/kingsun-sir.c
@@ -66,7 +66,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff -puN drivers/net/irda/mcs7780.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/irda/mcs7780.c
--- a/drivers/net/irda/mcs7780.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/irda/mcs7780.c
@@ -50,7 +50,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff -puN drivers/net/mipsnet.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/mipsnet.c
--- a/drivers/net/mipsnet.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/mipsnet.c
@@ -11,7 +11,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff -puN 
drivers/net/netxen/netxen_nic_main.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/netxen/netxen_nic_main.c
--- 
a/drivers/net/netxen/netxen_nic_main.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/netxen/netxen_nic_main.c
@@ -39,7 +39,6 @@
 #include "netxen_nic_phan_reg.h"
 
 #include 
-#include 
 #include 
 
 MODULE_DESCRIPTION("NetXen Multi port (1/10) Gigabit Network Driver");
diff -puN drivers/net/qla3xxx.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/qla3xxx.c
--- a/drivers/net/qla3xxx.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/qla3xxx.c
@@ -31,7 +31,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 
diff -puN drivers/net/tsi108_eth.c~clean-up-duplicate-includes-in-drivers-net 
drivers/net/tsi108_eth.c
--- a/drivers/net/tsi108_eth.c~clean-up-duplicate-includes-in-drivers-net
+++ a/drivers/net/tsi108_eth.c
@@ -47,7 +47,6 @@
 #include 
 #include 
 #include 
-#include 
 
 #include 
 #include 
diff -puN 
drivers/net/wireless/ipw2200.h~clean-up-duplicate-includes-in-drivers-net 
drivers/net/wireless/ipw2200.h
--- a/d

[patch 26/28] netconsole: Support dynamic reconfiguration using configfs

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

This patch introduces support for dynamic reconfiguration (adding, removing
and/or modifying parameters of netconsole targets at runtime) using a
userspace interface exported via configfs.  Documentation is also updated
accordingly.

Issues and brief design overview:

(1) Kernel-initiated creation / destruction of kernel objects is not
possible with configfs -- the lifetimes of the "config items" is managed
exclusively from userspace.  But netconsole must support boot/module
params too, and these are parsed in kernel and hence netpolls must be
setup from the kernel.  Joel Becker suggested to separately manage the
lifetimes of the two kinds of netconsole_target objects -- those created
via configfs mkdir(2) from userspace and those specified from the
boot/module option string.  This adds complexity and some redundancy here
and also means that boot/module param-created targets are not exposed
through the configfs namespace (and hence cannot be updated / destroyed
dynamically).  However, this saves us from locking / refcounting
complexities that would need to be introduced in configfs to support
kernel-initiated item creation / destroy there.

(2) In configfs, item creation takes place in the call chain of the
mkdir(2) syscall in the driver subsystem.  If we used an ioctl(2) to
create / destroy objects from userspace, the special userspace program is
able to fill out the structure to be passed into the ioctl and hence
specify attributes such as local interface that are required at the time
we set up the netpoll.  For configfs, this information is not available at
the time of mkdir(2).  So, we keep all newly-created targets (via
configfs) disabled by default.  The user is expected to set various
attributes appropriately (including the local network interface if
required) and then write(2) "1" to the "enabled" attribute.  Thus,
netpoll_setup() is then called on the set parameters in the context of
_this_ write(2) on the "enabled" attribute itself.  This design enables
the user to reconfigure existing netconsole targets at runtime to be
attached to newly-come-up interfaces that may not have existed when
netconsole was loaded or when the targets were actually created.  All this
effectively enables us to get rid of custom ioctls.

(3) Ultra-paranoid configfs attribute show() and store() operations, with
sanity and input range checking, using only safe string primitives, and
compliant with the recommendations in Documentation/filesystems/sysfs.txt.

(4) A new function netpoll_print_options() is created in the netpoll API,
that just prints out the configured parameters for a netpoll structure. 
netpoll_parse_options() is modified to use that and it is also exported to
be used from netconsole.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Acked-by: Keiichi Kii <[EMAIL PROTECTED]>
Cc: Matt Mackall <[EMAIL PROTECTED]>
Cc: Joel Becker <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 Documentation/networking/netconsole.txt |   68 ++
 drivers/net/Kconfig |   10 
 drivers/net/netconsole.c|  605 +-
 include/linux/netpoll.h |1 
 net/core/netpoll.c  |   44 -
 5 files changed, 683 insertions(+), 45 deletions(-)

diff -puN 
Documentation/networking/netconsole.txt~netconsole-support-dynamic-reconfiguration-using-configfs
 Documentation/networking/netconsole.txt
--- 
a/Documentation/networking/netconsole.txt~netconsole-support-dynamic-reconfiguration-using-configfs
+++ a/Documentation/networking/netconsole.txt
@@ -3,6 +3,10 @@ started by Ingo Molnar <[EMAIL PROTECTED]
 2.6 port and netpoll api by Matt Mackall <[EMAIL PROTECTED]>, Sep 9 2003
 
 Please send bug reports to Matt Mackall <[EMAIL PROTECTED]>
+and Satyam Sharma <[EMAIL PROTECTED]>
+
+Introduction:
+=
 
 This module logs kernel printk messages over UDP allowing debugging of
 problem where disk logging fails and serial consoles are impractical.
@@ -13,6 +17,9 @@ the specified interface as soon as possi
 capture of early kernel panics, it does capture most of the boot
 process.
 
+Sender and receiver configuration:
+==
+
 It takes a string configuration parameter "netconsole" in the
 following format:
 
@@ -46,6 +53,67 @@ address.
 
 The remote host can run either 'netcat -u -l -p ' or syslogd.
 
+Dynamic reconfiguration:
+
+
+Dynamic reconfigurability is a useful addition to netconsole that enables
+remote logging targets to be dynamically added, removed, or have their
+parameters reconfigured at runtime from a configfs-based userspace interface.
+[ Note that the parameters of netconsole targets that were specified/created
+from the boot/module option are 

[patch 17/18] 3c59x: fix duplex configuration

2007-08-10 Thread akpm
From: Steffen Klassert <[EMAIL PROTECTED]>

A special sequence of ifconfig up/down and plug/unplug the cable can break
the duplex configuration of the driver.

Setting
vp->mii.full_duplex = vp->full_duplex
in vortex_up should fix this.

Addresses Bug 8575 3c59x duplex configuration broken
http://bugzilla.kernel.org/show_bug.cgi?id=8575

Cc: Martin Buck <[EMAIL PROTECTED]>
Signed-off-by: Steffen Klassert <[EMAIL PROTECTED]>
Cc: Natalie Protasevich <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/3c59x.c |1 +
 1 files changed, 1 insertion(+)

diff -puN drivers/net/3c59x.c~3c59x-fix-duplex-configuration drivers/net/3c59x.c
--- a/drivers/net/3c59x.c~3c59x-fix-duplex-configuration
+++ a/drivers/net/3c59x.c
@@ -1559,6 +1559,7 @@ vortex_up(struct net_device *dev)
mii_reg1 = mdio_read(dev, vp->phys[0], MII_BMSR);
mii_reg5 = mdio_read(dev, vp->phys[0], MII_LPA);
vp->partner_flow_ctrl = ((mii_reg5 & 0x0400) != 0);
+   vp->mii.full_duplex = vp->full_duplex;
 
vortex_check_media(dev, 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 14/18] uli526x: add suspend and resume routines

2007-08-10 Thread akpm
From: Rafael J. Wysocki <[EMAIL PROTECTED]>

Add suspend/resume support to the uli526x network driver (tested on x86_64,
with "Ethernet controller: ALi Corporation M5263 Ethernet Controller, rev 40").

This patch is based on the suspend/resume code in the tg3 driver.

Signed-off-by: Rafael J. Wysocki <[EMAIL PROTECTED]>
Acked-by: Grant Grundler <[EMAIL PROTECTED]>
Cc: Kyle McMartin <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tulip/uli526x.c |  109 --
 1 files changed, 103 insertions(+), 6 deletions(-)

diff -puN drivers/net/tulip/uli526x.c~uli526x-add-suspend-and-resume-routines 
drivers/net/tulip/uli526x.c
--- a/drivers/net/tulip/uli526x.c~uli526x-add-suspend-and-resume-routines
+++ a/drivers/net/tulip/uli526x.c
@@ -1110,19 +1110,15 @@ static void uli526x_timer(unsigned long 
 
 
 /*
- * Dynamic reset the ULI526X board
  * Stop ULI526X board
  * Free Tx/Rx allocated memory
- * Reset ULI526X board
- * Re-initialize ULI526X board
+ * Init system variable
  */
 
-static void uli526x_dynamic_reset(struct net_device *dev)
+static void uli526x_reset_prepare(struct net_device *dev)
 {
struct uli526x_board_info *db = netdev_priv(dev);
 
-   ULI526X_DBUG(0, "uli526x_dynamic_reset()", 0);
-
/* Sopt MAC controller */
db->cr6_data &= ~(CR6_RXSC | CR6_TXSC); /* Disable Tx/Rx */
update_cr6(db->cr6_data, dev->base_addr);
@@ -1141,6 +1137,22 @@ static void uli526x_dynamic_reset(struct
db->link_failed = 1;
db->init=1;
db->wait_reset = 0;
+}
+
+
+/*
+ * Dynamic reset the ULI526X board
+ * Stop ULI526X board
+ * Free Tx/Rx allocated memory
+ * Reset ULI526X board
+ * Re-initialize ULI526X board
+ */
+
+static void uli526x_dynamic_reset(struct net_device *dev)
+{
+   ULI526X_DBUG(0, "uli526x_dynamic_reset()", 0);
+
+   uli526x_reset_prepare(dev);
 
/* Re-initialize ULI526X board */
uli526x_init(dev);
@@ -1150,6 +1162,89 @@ static void uli526x_dynamic_reset(struct
 }
 
 
+#ifdef CONFIG_PM_SLEEP
+
+/*
+ * Suspend the interface.
+ */
+
+static int uli526x_suspend(struct pci_dev *pdev, pm_message_t state)
+{
+   struct net_device *dev = pci_get_drvdata(pdev);
+   pci_power_t power_state;
+   int err;
+
+   ULI526X_DBUG(0, "uli526x_suspend", 0);
+
+   if (!(dev && netdev_priv(dev)))
+   return 0;
+
+   pci_save_state(pdev);
+
+   if (!netif_running(dev))
+   return 0;
+
+   netif_device_detach(dev);
+   uli526x_reset_prepare(dev);
+
+   power_state = pci_choose_state(pdev, state);
+   pci_enable_wake(pdev, power_state, 0);
+   err = pci_set_power_state(pdev, power_state);
+   if (err) {
+   netif_device_attach(dev);
+   /* Re-initialize ULI526X board */
+   uli526x_init(dev);
+   /* Restart upper layer interface */
+   netif_wake_queue(dev);
+   }
+
+   return err;
+}
+
+/*
+ * Resume the interface.
+ */
+
+static int uli526x_resume(struct pci_dev *pdev)
+{
+   struct net_device *dev = pci_get_drvdata(pdev);
+   struct uli526x_board_info *db = netdev_priv(dev);
+   int err;
+
+   ULI526X_DBUG(0, "uli526x_resume", 0);
+
+   if (!(dev && db))
+   return 0;
+
+   pci_restore_state(pdev);
+
+   if (!netif_running(dev))
+   return 0;
+
+   err = pci_set_power_state(pdev, PCI_D0);
+   if (err) {
+   printk(KERN_WARNING "%s: Could not put device into D0\n",
+   dev->name);
+   return err;
+   }
+
+   netif_device_attach(dev);
+   /* Re-initialize ULI526X board */
+   uli526x_init(dev);
+   /* Restart upper layer interface */
+   netif_wake_queue(dev);
+
+   return 0;
+}
+
+#else /* !CONFIG_PM_SLEEP */
+
+#define uli526x_suspendNULL
+#define uli526x_resume NULL
+
+#endif /* !CONFIG_PM_SLEEP */
+
+
 /*
  * free all allocated rx buffer
  */
@@ -1689,6 +1784,8 @@ static struct pci_driver uli526x_driver 
.id_table   = uli526x_pci_tbl,
.probe  = uli526x_init_one,
.remove = __devexit_p(uli526x_remove_one),
+   .suspend= uli526x_suspend,
+   .resume = uli526x_resume,
 };
 
 MODULE_AUTHOR("Peer Chen, [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 12/18] e1000: #if 0 two functions

2007-08-10 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

e1000_{read,write}_pci_cfg() are no longer used.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Cc: Auke Kok <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/e1000/e1000_hw.h   |2 --
 drivers/net/e1000/e1000_main.c |4 
 2 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/net/e1000/e1000_hw.h~e1000-if-0-two-functions 
drivers/net/e1000/e1000_hw.h
--- a/drivers/net/e1000/e1000_hw.h~e1000-if-0-two-functions
+++ a/drivers/net/e1000/e1000_hw.h
@@ -421,8 +421,6 @@ void e1000_tbi_adjust_stats(struct e1000
 void e1000_get_bus_info(struct e1000_hw *hw);
 void e1000_pci_set_mwi(struct e1000_hw *hw);
 void e1000_pci_clear_mwi(struct e1000_hw *hw);
-void e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
-void e1000_write_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t * value);
 int32_t e1000_read_pcie_cap_reg(struct e1000_hw *hw, uint32_t reg, uint16_t 
*value);
 void e1000_pcix_set_mmrbc(struct e1000_hw *hw, int mmrbc);
 int e1000_pcix_get_mmrbc(struct e1000_hw *hw);
diff -puN drivers/net/e1000/e1000_main.c~e1000-if-0-two-functions 
drivers/net/e1000/e1000_main.c
--- a/drivers/net/e1000/e1000_main.c~e1000-if-0-two-functions
+++ a/drivers/net/e1000/e1000_main.c
@@ -4890,6 +4890,8 @@ e1000_pci_clear_mwi(struct e1000_hw *hw)
pci_clear_mwi(adapter->pdev);
 }
 
+#if 0
+
 void
 e1000_read_pci_cfg(struct e1000_hw *hw, uint32_t reg, uint16_t *value)
 {
@@ -4906,6 +4908,8 @@ e1000_write_pci_cfg(struct e1000_hw *hw,
pci_write_config_word(adapter->pdev, reg, *value);
 }
 
+#endif  /*  0  */
+
 int
 e1000_pcix_get_mmrbc(struct e1000_hw *hw)
 {
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/18] natsemi: fix netdev error acounting

2007-08-10 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

When a detailed netdev error is counted, we also must account for it in the
aggregated error count.

Addresses http://bugzilla.kernel.org/show_bug.cgi?id=8106

Cc: Tim Hockin <[EMAIL PROTECTED]>
Cc: Jeff Garzik <[EMAIL PROTECTED]>
Cc: Chongfeng Hu <[EMAIL PROTECTED]>
Cc: Natalie Protasevich <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/natsemi.c |3 +++
 1 files changed, 3 insertions(+)

diff -puN drivers/net/natsemi.c~natsemi-fix-netdev-error-acounting 
drivers/net/natsemi.c
--- a/drivers/net/natsemi.c~natsemi-fix-netdev-error-acounting
+++ a/drivers/net/natsemi.c
@@ -2438,13 +2438,16 @@ static void netdev_error(struct net_devi
dev->name);
}
np->stats.rx_fifo_errors++;
+   np->stats.rx_errors++;
}
/* Hm, it's not clear how to recover from PCI faults. */
if (intr_status & IntrPCIErr) {
printk(KERN_NOTICE "%s: PCI error %#08x\n", dev->name,
intr_status & IntrPCIErr);
np->stats.tx_fifo_errors++;
+   np->stats.tx_errors++;
np->stats.rx_fifo_errors++;
+   np->stats.rx_errors++;
}
spin_unlock(&np->lock);
 }
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 25/28] netconsole: Support multiple logging targets

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

This patch introduces support for multiple targets, independent of
CONFIG_NETCONSOLE_DYNAMIC -- this is useful even in the default case and
(including the infrastructure introduced in previous patches) doesn't really
add too many bytes to module text.  All the complexity (and size) comes with
the dynamic reconfigurability / userspace interface patch, and so it's
plausible users may want to keep this enabled but that disabled (say to avoid
a dependency on CONFIG_CONFIGFS_FS too).

Also update documentation to mention the use of ";" separator to specify
multiple logging targets in the boot/module option string.

Brief overview:

We maintain a target_list (and corresponding lock).  Get rid of the static
"default_target" and introduce allocation and release functions for our
netconsole_target objects (but keeping sure to preserve previous behaviour
such as default values).  During init_netconsole(), ";" is used as the
separator to identify multiple target specifications in the boot/module option
string.  The target specifications are parsed and netpolls setup.  During
exit, the target_list is torn down and all items released.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Keiichi Kii <[EMAIL PROTECTED]>
Cc: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 Documentation/networking/netconsole.txt |6 
 drivers/net/netconsole.c|  171 --
 2 files changed, 137 insertions(+), 40 deletions(-)

diff -puN 
Documentation/networking/netconsole.txt~netconsole-support-multiple-logging-targets
 Documentation/networking/netconsole.txt
--- 
a/Documentation/networking/netconsole.txt~netconsole-support-multiple-logging-targets
+++ a/Documentation/networking/netconsole.txt
@@ -34,6 +34,12 @@ Examples:
 
  insmod netconsole netconsole=@/,@10.0.0.2/
 
+It also supports logging to multiple remote agents by specifying
+parameters for the multiple agents separated by semicolons and the
+complete string enclosed in "quotes", thusly:
+
+ modprobe netconsole netconsole="@/,@10.0.0.2/;@/eth1,[EMAIL PROTECTED]/"
+
 Built-in netconsole starts immediately after the TCP stack is
 initialized and attempts to bring up the supplied dev at the supplied
 address.
diff -puN drivers/net/netconsole.c~netconsole-support-multiple-logging-targets 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netconsole-support-multiple-logging-targets
+++ a/drivers/net/netconsole.c
@@ -62,44 +62,93 @@ static int __init option_setup(char *opt
 __setup("netconsole=", option_setup);
 #endif /* MODULE */
 
+/* Linked list of all configured targets */
+static LIST_HEAD(target_list);
+
+/* This needs to be a spinlock because write_msg() cannot sleep */
+static DEFINE_SPINLOCK(target_list_lock);
+
 /**
  * struct netconsole_target - Represents a configured netconsole target.
+ * @list:  Links this target into the target_list.
  * @np:The netpoll structure for this target.
  */
 struct netconsole_target {
+   struct list_headlist;
struct netpoll  np;
 };
 
-static struct netconsole_target default_target = {
-   .np = {
-   .name   = "netconsole",
-   .dev_name   = "eth0",
-   .local_port = 6665,
-   .remote_port= ,
-   .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
-   },
-};
+/* Allocate new target and setup netpoll for it */
+static struct netconsole_target *alloc_target(char *target_config)
+{
+   int err = -ENOMEM;
+   struct netconsole_target *nt;
+
+   /* Allocate and initialize with defaults */
+   nt = kzalloc(sizeof(*nt), GFP_KERNEL);
+   if (!nt) {
+   printk(KERN_ERR "netconsole: failed to allocate memory\n");
+   goto fail;
+   }
+
+   nt->np.name = "netconsole";
+   strlcpy(nt->np.dev_name, "eth0", IFNAMSIZ);
+   nt->np.local_port = 6665;
+   nt->np.remote_port = ;
+   memset(nt->np.remote_mac, 0xff, ETH_ALEN);
+
+   /* Parse parameters and setup netpoll */
+   err = netpoll_parse_options(&nt->np, target_config);
+   if (err)
+   goto fail;
+
+   err = netpoll_setup(&nt->np);
+   if (err)
+   goto fail;
+
+   return nt;
+
+fail:
+   kfree(nt);
+   return ERR_PTR(err);
+}
+
+/* Cleanup netpoll for given target and free it */
+static void free_target(struct netconsole_target *nt)
+{
+   netpoll_cleanup(&nt->np);
+   kfree(nt);
+}
 
 /* Handle network interface device notifications */
 static int netconsole_netdev_event(struct notifier_block *this,
   unsigned long event,
   void *ptr)
 {
+   unsigned long flags;
+   struct netconsole_target *nt;
struct net_device *dev = ptr;
-   struct n

[patch 20/28] netconsole: Simplify boot/module option setup logic

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

Presently, boot/module parameters are set up quite differently for the case of
built-in netconsole (__setup() -> obsolete_checksetup() ->
netpoll_parse_options() -> strlen(config) == 0 in init_netconsole()) vs
modular netconsole (module_param_string() -> string copied to the config
variable -> strlen(config) != 0 init_netconsole() -> netpoll_parse_options()).

This patch makes both of them similar by doing exactly the equivalent of a
module_param_string() in option_setup() also -- just copying the param string
passed from the kernel command line into "config" variable.  So,
strlen(config) != 0 in both cases, and netpoll_parse_options() is always
called from init_netconsole(), thus making the setup logic for both cases
similar.

Now, option_setup() is only ever called / used for the built-in case, so we
put it inside a #ifndef MODULE, otherwise gcc will complain about
option_setup() being "defined but not used".  Also, the "configured" variable
is redundant with this patch and hence removed.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Keiichi Kii <[EMAIL PROTECTED]>
Acked-by: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/netconsole.c |   27 ++-
 1 files changed, 14 insertions(+), 13 deletions(-)

diff -puN 
drivers/net/netconsole.c~netconsole-simplify-boot-module-option-setup-logic 
drivers/net/netconsole.c
--- 
a/drivers/net/netconsole.c~netconsole-simplify-boot-module-option-setup-logic
+++ a/drivers/net/netconsole.c
@@ -53,6 +53,15 @@ static char config[MAX_PARAM_LENGTH];
 module_param_string(netconsole, config, MAX_PARAM_LENGTH, 0);
 MODULE_PARM_DESC(netconsole, " [EMAIL 
PROTECTED]/[dev],[tgt-port]@/[tgt-macaddr]\n");
 
+#ifndefMODULE
+static int __init option_setup(char *opt)
+{
+   strlcpy(config, opt, MAX_PARAM_LENGTH);
+   return 1;
+}
+__setup("netconsole=", option_setup);
+#endif /* MODULE */
+
 static struct netpoll np = {
.name   = "netconsole",
.dev_name   = "eth0",
@@ -60,7 +69,6 @@ static struct netpoll np = {
.remote_port= ,
.remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
 };
-static int configured;
 
 static void write_msg(struct console *con, const char *msg, unsigned int len)
 {
@@ -85,26 +93,19 @@ static struct console netconsole = {
.write  = write_msg,
 };
 
-static int __init option_setup(char *opt)
-{
-   configured = !netpoll_parse_options(&np, opt);
-   return 1;
-}
-
-__setup("netconsole=", option_setup);
-
 static int __init init_netconsole(void)
 {
int err = 0;
 
-   if (strnlen(config, MAX_PARAM_LENGTH))
-   option_setup(config);
-
-   if (!configured) {
+   if (!strnlen(config, MAX_PARAM_LENGTH)) {
printk(KERN_INFO "netconsole: not configured, aborting\n");
goto out;
}
 
+   err = netpoll_parse_options(&np, config);
+   if (err)
+   goto out;
+
err = netpoll_setup(&np);
if (err)
goto out;
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 23/28] netconsole: Introduce netconsole_target

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

Introduce a wrapper structure over netpoll to represent logging targets
configured in netconsole.  This will get extended with other members in
further patches.

This is done independent of the (to-be-introduced) NETCONSOLE_DYNAMIC config
option so that we're able to drastically cut down on the #ifdef complexity of
final netconsole.c.  Also, struct netconsole_target would be required for
multiple targets support also, and not just dynamic reconfigurability.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Keiichi Kii <[EMAIL PROTECTED]>
Cc: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/netconsole.c |   36 +---
 1 files changed, 25 insertions(+), 11 deletions(-)

diff -puN drivers/net/netconsole.c~netconsole-introduce-netconsole_target 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netconsole-introduce-netconsole_target
+++ a/drivers/net/netconsole.c
@@ -62,24 +62,35 @@ static int __init option_setup(char *opt
 __setup("netconsole=", option_setup);
 #endif /* MODULE */
 
-static struct netpoll np = {
-   .name   = "netconsole",
-   .dev_name   = "eth0",
-   .local_port = 6665,
-   .remote_port= ,
-   .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+/**
+ * struct netconsole_target - Represents a configured netconsole target.
+ * @np:The netpoll structure for this target.
+ */
+struct netconsole_target {
+   struct netpoll  np;
+};
+
+static struct netconsole_target default_target = {
+   .np = {
+   .name   = "netconsole",
+   .dev_name   = "eth0",
+   .local_port = 6665,
+   .remote_port= ,
+   .remote_mac = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff},
+   },
 };
 
 static void write_msg(struct console *con, const char *msg, unsigned int len)
 {
int frag, left;
unsigned long flags;
+   struct netconsole_target *nt = &default_target;
 
-   if (netif_running(np.dev)) {
+   if (netif_running(nt->np.dev)) {
local_irq_save(flags);
for (left = len; left;) {
frag = min(left, MAX_PRINT_CHUNK);
-   netpoll_send_udp(&np, msg, frag);
+   netpoll_send_udp(&nt->np, msg, frag);
msg += frag;
left -= frag;
}
@@ -96,17 +107,18 @@ static struct console netconsole = {
 static int __init init_netconsole(void)
 {
int err = 0;
+   struct netconsole_target *nt = &default_target;
 
if (!strnlen(config, MAX_PARAM_LENGTH)) {
printk(KERN_INFO "netconsole: not configured, aborting\n");
goto out;
}
 
-   err = netpoll_parse_options(&np, config);
+   err = netpoll_parse_options(&nt->np, config);
if (err)
goto out;
 
-   err = netpoll_setup(&np);
+   err = netpoll_setup(&nt->np);
if (err)
goto out;
 
@@ -119,8 +131,10 @@ out:
 
 static void __exit cleanup_netconsole(void)
 {
+   struct netconsole_target *nt = &default_target;
+
unregister_console(&netconsole);
-   netpoll_cleanup(&np);
+   netpoll_cleanup(&nt->np);
 }
 
 module_init(init_netconsole);
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 24/28] netconsole: Introduce netconsole_netdev_notifier

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

To update fields of underlying netpoll structure at runtime on corresponding
NETDEV_CHANGEADDR or NETDEV_CHANGENAME notifications.

ioctl(SIOCSIFHWADDR or SIOCSIFNAME) could be used to change the hardware/MAC
address or name of the local interface that our netpoll is attached to. 
Whenever this happens, netdev notifier chain is called out with the
NETDEV_CHANGEADDR or NETDEV_CHANGENAME event message.  We respond to that and
update the local_mac or dev_name field of the struct netpoll.  This makes
sense anyway, but is especially required for dynamic netconsole because the
netpoll structure's internal members become user visible files when either
sysfs or configfs are used.  So this helps us to keep up with the MAC
address/name changes and keep values in struct netpoll uptodate.

[ Note that ioctl(SIOCSIFADDR) to change IP address of interface at
  runtime is not handled (to update local_ip of netpoll) on purpose --
  some setups may set the local_ip to a private address, not necessary
  the actual IP address of the sender host, as presently allowed. ]

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Keiichi Kii <[EMAIL PROTECTED]>
Cc: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/netconsole.c |   32 
 1 files changed, 32 insertions(+)

diff -puN 
drivers/net/netconsole.c~netconsole-introduce-netconsole_netdev_notifier 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netconsole-introduce-netconsole_netdev_notifier
+++ a/drivers/net/netconsole.c
@@ -80,6 +80,33 @@ static struct netconsole_target default_
},
 };
 
+/* Handle network interface device notifications */
+static int netconsole_netdev_event(struct notifier_block *this,
+  unsigned long event,
+  void *ptr)
+{
+   struct net_device *dev = ptr;
+   struct netconsole_target *nt = &default_target;
+
+   if (nt->np.dev == dev) {
+   switch (event) {
+   case NETDEV_CHANGEADDR:
+   memcpy(nt->np.local_mac, dev->dev_addr, ETH_ALEN);
+   break;
+
+   case NETDEV_CHANGENAME:
+   strlcpy(nt->np.dev_name, dev->name, IFNAMSIZ);
+   break;
+   }
+   }
+
+   return NOTIFY_DONE;
+}
+
+static struct notifier_block netconsole_netdev_notifier = {
+   .notifier_call  = netconsole_netdev_event,
+};
+
 static void write_msg(struct console *con, const char *msg, unsigned int len)
 {
int frag, left;
@@ -122,6 +149,10 @@ static int __init init_netconsole(void)
if (err)
goto out;
 
+   err = register_netdevice_notifier(&netconsole_netdev_notifier);
+   if (err)
+   goto out;
+
register_console(&netconsole);
printk(KERN_INFO "netconsole: network logging started\n");
 
@@ -134,6 +165,7 @@ static void __exit cleanup_netconsole(vo
struct netconsole_target *nt = &default_target;
 
unregister_console(&netconsole);
+   unregister_netdevice_notifier(&netconsole_netdev_notifier);
netpoll_cleanup(&nt->np);
 }
 
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 16/18] net/tulip/xircom_cb.c: remove superfulous priv assignment

2007-08-10 Thread akpm
From: Mariusz Kozlowski <[EMAIL PROTECTED]>

It does

dev = alloc_etherdev(...
private = netdev_priv(dev);
...
dev->priv = private;

which doesn't make much sense (does it?) because this is done in
alloc_netdev() already.

struct net_device *alloc_netdev(...
{
...
if (sizeof_priv)
dev->priv = netdev_priv(dev);

This patch removes superfluous code.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>
Acked-by: Arjan van de Ven <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/tulip/xircom_cb.c |1 -
 1 files changed, 1 deletion(-)

diff -puN 
drivers/net/tulip/xircom_cb.c~net-tulip-xircom_cbc-remove-superfulous-priv-assignment
 drivers/net/tulip/xircom_cb.c
--- 
a/drivers/net/tulip/xircom_cb.c~net-tulip-xircom_cbc-remove-superfulous-priv-assignment
+++ a/drivers/net/tulip/xircom_cb.c
@@ -271,7 +271,6 @@ static int __devinit xircom_probe(struct
dev->hard_start_xmit = &xircom_start_xmit;
dev->stop = &xircom_close;
dev->get_stats = &xircom_get_stats;
-   dev->priv = private;
 #ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = &xircom_poll_controller;
 #endif
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 21/28] netconsole: Use netif_running() in write_msg()

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

Avoid unnecessarily disabling interrupts and calling netpoll_send_udp() if the
corresponding local interface is not up.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Acked-by: Keiichi Kii <[EMAIL PROTECTED]>
Cc: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

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

diff -puN drivers/net/netconsole.c~netconsole-use-netif_running-in-write_msg 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~netconsole-use-netif_running-in-write_msg
+++ a/drivers/net/netconsole.c
@@ -75,16 +75,16 @@ static void write_msg(struct console *co
int frag, left;
unsigned long flags;
 
-   local_irq_save(flags);
-
-   for (left = len; left;) {
-   frag = min(left, MAX_PRINT_CHUNK);
-   netpoll_send_udp(&np, msg, frag);
-   msg += frag;
-   left -= frag;
+   if (netif_running(np.dev)) {
+   local_irq_save(flags);
+   for (left = len; left;) {
+   frag = min(left, MAX_PRINT_CHUNK);
+   netpoll_send_udp(&np, msg, frag);
+   msg += frag;
+   left -= frag;
+   }
+   local_irq_restore(flags);
}
-
-   local_irq_restore(flags);
 }
 
 static struct console netconsole = {
_
-
To unsubscribe from this list: send 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 18/18] 3c59x maintainer

2007-08-10 Thread akpm
From: Steffen Klassert <[EMAIL PROTECTED]>

Add 3c59x maintainer.

Signed-off-by: Steffen Klassert <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 MAINTAINERS |6 ++
 1 files changed, 6 insertions(+)

diff -puN MAINTAINERS~add-3c59x-maintainer MAINTAINERS
--- a/MAINTAINERS~add-3c59x-maintainer
+++ a/MAINTAINERS
@@ -97,6 +97,12 @@ M:   [EMAIL PROTECTED]
 L: netdev@vger.kernel.org
 S: Maintained
 
+3C59X NETWORK DRIVER
+P: Steffen Klassert
+M: [EMAIL PROTECTED]
+L: netdev@vger.kernel.org
+S: Maintained
+
 3CR990 NETWORK DRIVER
 P: David Dillow
 M: [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 11/18] drivers/net/cxgb3/xgmac.c: remove dead code

2007-08-10 Thread akpm
From: Adrian Bunk <[EMAIL PROTECTED]>

This patch removes dead code ("tx_xcnt" can never be != 0 at this place)
spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/cxgb3/xgmac.c |5 +
 1 files changed, 1 insertion(+), 4 deletions(-)

diff -puN drivers/net/cxgb3/xgmac.c~drivers-net-cxgb3-xgmacc-remove-dead-code 
drivers/net/cxgb3/xgmac.c
--- a/drivers/net/cxgb3/xgmac.c~drivers-net-cxgb3-xgmacc-remove-dead-code
+++ a/drivers/net/cxgb3/xgmac.c
@@ -524,10 +524,7 @@ int t3b2_mac_watchdog_task(struct cmac *
goto rxcheck;
}
 
-   if (((tx_tcnt != mac->tx_tcnt) &&
-(tx_xcnt == 0) && (mac->tx_xcnt == 0)) ||
-   ((mac->tx_mcnt == tx_mcnt) &&
-(tx_xcnt != 0) && (mac->tx_xcnt != 0))) {
+   if ((tx_tcnt != mac->tx_tcnt) && (mac->tx_xcnt == 0))  {
if (mac->toggle_cnt > 4) {
status = 2;
goto out;
_
-
To unsubscribe from this list: send 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 22/28] netconsole: Add some useful tips to documentation

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Based upon initial work by Keiichi Kii <[EMAIL PROTECTED]>.

Add some useful general-purpose tips.  Also suggest solution for the frequent
problem of console loglevel set too low numerically (i.e.  for high priority
messages only) on the sender.

Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Acked-by: Keiichi Kii <[EMAIL PROTECTED]>
Acked-by: Matt Mackall <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 Documentation/networking/netconsole.txt |   25 ++
 1 files changed, 25 insertions(+)

diff -puN 
Documentation/networking/netconsole.txt~netconsole-add-some-useful-tips-to-documentation
 Documentation/networking/netconsole.txt
--- 
a/Documentation/networking/netconsole.txt~netconsole-add-some-useful-tips-to-documentation
+++ a/Documentation/networking/netconsole.txt
@@ -44,11 +44,36 @@ WARNING: the default target ethernet set
 ethernet address to send packets, which can cause increased load on
 other systems on the same ethernet segment.
 
+TIP: some LAN switches may be configured to suppress ethernet broadcasts
+so it is advised to explicitly specify the remote agents' MAC addresses
+from the config parameters passed to netconsole.
+
+TIP: to find out the MAC address of, say, 10.0.0.2, you may try using:
+
+ ping -c 1 10.0.0.2 ; /sbin/arp -n | grep 10.0.0.2
+
+TIP: in case the remote logging agent is on a separate LAN subnet than
+the sender, it is suggested to try specifying the MAC address of the
+default gateway (you may use /sbin/route -n to find it out) as the
+remote MAC address instead.
+
 NOTE: the network device (eth1 in the above case) can run any kind
 of other network traffic, netconsole is not intrusive. Netconsole
 might cause slight delays in other traffic if the volume of kernel
 messages is high, but should have no other impact.
 
+NOTE: if you find that the remote logging agent is not receiving or
+printing all messages from the sender, it is likely that you have set
+the "console_loglevel" parameter (on the sender) to only send high
+priority messages to the console. You can change this at runtime using:
+
+ dmesg -n 8
+
+or by specifying "debug" on the kernel command line at boot, to send
+all kernel messages to the console. A specific value for this parameter
+can also be set using the "loglevel" kernel boot option. See the
+dmesg(8) man page and Documentation/kernel-parameters.txt for details.
+
 Netconsole was designed to be as instantaneous as possible, to
 enable the logging of even the most critical kernel bugs. It works
 from IRQ contexts as well, and does not enable interrupts while
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 15/18] drivers/net: remove superfluous memset

2007-08-10 Thread akpm
From: Mariusz Kozlowski <[EMAIL PROTECTED]>

This patch covers something like this:

dev = alloc_*dev(...
...
priv = netdev_priv(dev);
memset(priv, 0, sizeof(*priv));

The memset() here is superfluous. alloc_netdev() uses kzalloc()
to allocate needed memory so there is no need to zero the priv region
twice.

Signed-off-by: Mariusz Kozlowski <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/fs_enet/fs_enet-main.c   |1 -
 drivers/net/myri10ge/myri10ge.c  |1 -
 drivers/net/netxen/netxen_nic_main.c |1 -
 drivers/net/sunlance.c   |1 -
 drivers/net/usb/pegasus.c|1 -
 drivers/net/usb/rtl8150.c|1 -
 6 files changed, 6 deletions(-)

diff -puN 
drivers/net/fs_enet/fs_enet-main.c~drivers-net-remove-superfluous-memset 
drivers/net/fs_enet/fs_enet-main.c
--- a/drivers/net/fs_enet/fs_enet-main.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/fs_enet/fs_enet-main.c
@@ -962,7 +962,6 @@ static struct net_device *fs_init_instan
SET_MODULE_OWNER(ndev);
 
fep = netdev_priv(ndev);
-   memset(fep, 0, privsize);   /* clear everything */
 
fep->dev = dev;
dev_set_drvdata(dev, ndev);
diff -puN drivers/net/myri10ge/myri10ge.c~drivers-net-remove-superfluous-memset 
drivers/net/myri10ge/myri10ge.c
--- a/drivers/net/myri10ge/myri10ge.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/myri10ge/myri10ge.c
@@ -2852,7 +2852,6 @@ static int myri10ge_probe(struct pci_dev
SET_NETDEV_DEV(netdev, &pdev->dev);
 
mgp = netdev_priv(netdev);
-   memset(mgp, 0, sizeof(*mgp));
mgp->dev = netdev;
mgp->pdev = pdev;
mgp->csum_flag = MXGEFW_FLAGS_CKSUM;
diff -puN 
drivers/net/netxen/netxen_nic_main.c~drivers-net-remove-superfluous-memset 
drivers/net/netxen/netxen_nic_main.c
--- a/drivers/net/netxen/netxen_nic_main.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/netxen/netxen_nic_main.c
@@ -329,7 +329,6 @@ netxen_nic_probe(struct pci_dev *pdev, c
SET_NETDEV_DEV(netdev, &pdev->dev);
 
adapter = netdev->priv;
-   memset(adapter, 0 , sizeof(struct netxen_adapter));
 
adapter->ahw.pdev = pdev;
adapter->ahw.pci_func  = pci_func_id;
diff -puN drivers/net/sunlance.c~drivers-net-remove-superfluous-memset 
drivers/net/sunlance.c
--- a/drivers/net/sunlance.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/sunlance.c
@@ -1335,7 +1335,6 @@ static int __devinit sparc_lance_probe_o
return -ENOMEM;
 
lp = netdev_priv(dev);
-   memset(lp, 0, sizeof(*lp));
 
if (sparc_lance_debug && version_printed++ == 0)
printk (KERN_INFO "%s", version);
diff -puN drivers/net/usb/pegasus.c~drivers-net-remove-superfluous-memset 
drivers/net/usb/pegasus.c
--- a/drivers/net/usb/pegasus.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/usb/pegasus.c
@@ -1306,7 +1306,6 @@ static int pegasus_probe(struct usb_inte
}
 
pegasus = netdev_priv(net);
-   memset(pegasus, 0, sizeof (struct pegasus));
pegasus->dev_index = dev_index;
init_waitqueue_head(&pegasus->ctrl_wait);
 
diff -puN drivers/net/usb/rtl8150.c~drivers-net-remove-superfluous-memset 
drivers/net/usb/rtl8150.c
--- a/drivers/net/usb/rtl8150.c~drivers-net-remove-superfluous-memset
+++ a/drivers/net/usb/rtl8150.c
@@ -905,7 +905,6 @@ static int rtl8150_probe(struct usb_inte
}
 
dev = netdev_priv(netdev);
-   memset(dev, 0, sizeof(rtl8150_t));
 
dev->intr_buff = kmalloc(INTBUFSIZE, GFP_KERNEL);
if (!dev->intr_buff) {
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 28/28] Introduce strtol_check_range()

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

Callers (especially "store" functions for sysfs or configfs attributes)
that want to convert an input string to a number may often also want to
check for simple input sanity or allowable range.  strtol10_check_range()
of netconsole does this, so extract it out into lib/vsprintf.c, make it
generic w.r.t.  base, and export it to the rest of the kernel and modules.

[EMAIL PROTECTED]: cleanups]
Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/netconsole.c |   46 +
 include/linux/kernel.h   |2 +
 lib/vsprintf.c   |   29 +++
 3 files changed, 43 insertions(+), 34 deletions(-)

diff -puN drivers/net/netconsole.c~introduce-strtol_check_range 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~introduce-strtol_check_range
+++ a/drivers/net/netconsole.c
@@ -242,34 +242,6 @@ static struct netconsole_target *to_targ
 }
 
 /*
- * Wrapper over simple_strtol (base 10) with sanity and range checking.
- * We return (signed) long only because we may want to return errors.
- * Do not use this to convert numbers that are allowed to be negative.
- */
-static long strtol10_check_range(const char *cp, long min, long max)
-{
-   long ret;
-   char *p = (char *) cp;
-
-   WARN_ON(min < 0);
-   WARN_ON(max < min);
-
-   ret = simple_strtol(p, &p, 10);
-
-   if (*p && (*p != '\n')) {
-   printk(KERN_ERR "netconsole: invalid input\n");
-   return -EINVAL;
-   }
-   if ((ret < min) || (ret > max)) {
-   printk(KERN_ERR "netconsole: input %ld must be between "
-   "%ld and %ld\n", ret, min, max);
-   return -EINVAL;
-   }
-
-   return ret;
-}
-
-/*
  * Attribute operations for netconsole_target.
  */
 
@@ -335,9 +307,11 @@ static ssize_t store_enabled(struct netc
int err;
long enabled;
 
-   enabled = strtol10_check_range(buf, 0, 1);
-   if (enabled < 0)
+   enabled = strtol_check_range(buf, 0, 1, 10);
+   if (enabled < 0) {
+   printk(KERN_ERR "netconsole: invalid input\n");
return enabled;
+   }
 
if (enabled) {  /* 1 */
 
@@ -398,9 +372,11 @@ static ssize_t store_local_port(struct n
return -EINVAL;
}
 
-   local_port = strtol10_check_range(buf, 0, U16_MAX);
-   if (local_port < 0)
+   local_port = strtol_check_range(buf, 0, U16_MAX, 10);
+   if (local_port < 0) {
+   printk(KERN_ERR "netconsole: invalid input\n");
return local_port;
+   }
 
nt->np.local_port = local_port;
 
@@ -420,9 +396,11 @@ static ssize_t store_remote_port(struct 
return -EINVAL;
}
 
-   remote_port = strtol10_check_range(buf, 0, U16_MAX);
-   if (remote_port < 0)
+   remote_port = strtol_check_range(buf, 0, U16_MAX, 10);
+   if (remote_port < 0) {
+   printk(KERN_ERR "netconsole: invalid input\n");
return remote_port;
+   }
 
nt->np.remote_port = remote_port;
 
diff -puN include/linux/kernel.h~introduce-strtol_check_range 
include/linux/kernel.h
--- a/include/linux/kernel.h~introduce-strtol_check_range
+++ a/include/linux/kernel.h
@@ -121,6 +121,8 @@ extern unsigned long simple_strtoul(cons
 extern long simple_strtol(const char *,char **,unsigned int);
 extern unsigned long long simple_strtoull(const char *,char **,unsigned int);
 extern long long simple_strtoll(const char *,char **,unsigned int);
+extern long strtol_check_range(const char *cp, long min, long max,
+   unsigned int base);
 extern int sprintf(char * buf, const char * fmt, ...)
__attribute__ ((format (printf, 2, 3)));
 extern int vsprintf(char *buf, const char *, va_list)
diff -puN lib/vsprintf.c~introduce-strtol_check_range lib/vsprintf.c
--- a/lib/vsprintf.c~introduce-strtol_check_range
+++ a/lib/vsprintf.c
@@ -126,6 +126,35 @@ long long simple_strtoll(const char *cp,
return simple_strtoull(cp,endp,base);
 }
 
+/**
+ * strtol_check_range - wrapper over simple_strtol with input and range 
checking
+ * @cp: The start of the string
+ * @min: Minimum value allowed
+ * @max: Maximum value allowed
+ * @base: The number base to use
+ *
+ * We return (signed) long only because we may want to return errors.
+ * Do not use this to convert numbers that are allowed to be negative.
+ */
+long strtol_check_range(const char *cp, long min, long max, unsigned int base)
+{
+   long ret;
+   char *p = (char *) cp;
+
+   WARN_ON(min < 0);
+   WARN_ON(max < min);
+
+   ret = simple_strtol(p, &p, base);
+
+   if (*p && (*p != '\n'))
+   return -EINVAL;
+   if ((ret < min) || (ret > max))
+   return -EINVAL;
+
+   return ret;
+}
+EXPORT_SYMBOL(strtol_check_range);
+
 static int skip_atoi(const char *

[patch 27/28] Introduce U16_MAX and U32_MAX

2007-08-10 Thread akpm
From: Satyam Sharma <[EMAIL PROTECTED]>

... in kernel.h and clean up home-grown macros elsewhere in the tree.

Leave out the one in reiserfs_fs.h as it is in the userspace-visible part
of that header. Still, #undef the (equivalent) kernel version there to
avoid seeing "redefined, previous definition was here" gcc warnings.

[EMAIL PROTECTED]: fix U16_MAX, U32_MAX defns]
Signed-off-by: Satyam Sharma <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 drivers/net/netconsole.c|7 +++
 include/linux/kernel.h  |3 +++
 include/linux/reiserfs_fs.h |1 +
 net/ipv4/tcp_illinois.c |2 +-
 4 files changed, 8 insertions(+), 5 deletions(-)

diff -puN drivers/net/netconsole.c~introduce-u16_max-and-u32_max 
drivers/net/netconsole.c
--- a/drivers/net/netconsole.c~introduce-u16_max-and-u32_max
+++ a/drivers/net/netconsole.c
@@ -34,6 +34,7 @@
  *
  /
 
+#include 
 #include 
 #include 
 #include 
@@ -389,7 +390,6 @@ static ssize_t store_local_port(struct n
size_t count)
 {
long local_port;
-#define __U16_MAX  ((__u16) ~0U)
 
if (nt->enabled) {
printk(KERN_ERR "netconsole: target (%s) is enabled, "
@@ -398,7 +398,7 @@ static ssize_t store_local_port(struct n
return -EINVAL;
}
 
-   local_port = strtol10_check_range(buf, 0, __U16_MAX);
+   local_port = strtol10_check_range(buf, 0, U16_MAX);
if (local_port < 0)
return local_port;
 
@@ -412,7 +412,6 @@ static ssize_t store_remote_port(struct 
 size_t count)
 {
long remote_port;
-#define __U16_MAX  ((__u16) ~0U)
 
if (nt->enabled) {
printk(KERN_ERR "netconsole: target (%s) is enabled, "
@@ -421,7 +420,7 @@ static ssize_t store_remote_port(struct 
return -EINVAL;
}
 
-   remote_port = strtol10_check_range(buf, 0, __U16_MAX);
+   remote_port = strtol10_check_range(buf, 0, U16_MAX);
if (remote_port < 0)
return remote_port;
 
diff -puN include/linux/kernel.h~introduce-u16_max-and-u32_max 
include/linux/kernel.h
--- a/include/linux/kernel.h~introduce-u16_max-and-u32_max
+++ a/include/linux/kernel.h
@@ -30,6 +30,9 @@ extern const char linux_proc_banner[];
 #define LLONG_MIN  (-LLONG_MAX - 1)
 #define ULLONG_MAX (~0ULL)
 
+#define U16_MAX(0x)
+#define U32_MAX(0x)
+
 #define STACK_MAGIC0xdeadbeef
 
 #define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1)
diff -puN include/linux/reiserfs_fs.h~introduce-u16_max-and-u32_max 
include/linux/reiserfs_fs.h
--- a/include/linux/reiserfs_fs.h~introduce-u16_max-and-u32_max
+++ a/include/linux/reiserfs_fs.h
@@ -1225,6 +1225,7 @@ struct treepath var = {.path_length = IL
 #define MAX_US_INT 0x
 
 // reiserfs version 2 has max offset 60 bits. Version 1 - 32 bit offset
+#undef U32_MAX
 #define U32_MAX (~(__u32)0)
 
 static inline loff_t max_reiserfs_offset(struct inode *inode)
diff -puN net/ipv4/tcp_illinois.c~introduce-u16_max-and-u32_max 
net/ipv4/tcp_illinois.c
--- a/net/ipv4/tcp_illinois.c~introduce-u16_max-and-u32_max
+++ a/net/ipv4/tcp_illinois.c
@@ -12,6 +12,7 @@
  * Copyright (C) 2007 Stephen Hemminger <[EMAIL PROTECTED]>
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -23,7 +24,6 @@
 #define ALPHA_MIN  ((3*ALPHA_SCALE)/10)/* ~0.3 */
 #define ALPHA_MAX  (10*ALPHA_SCALE)/* 10.0 */
 #define ALPHA_BASE ALPHA_SCALE /* 1.0 */
-#define U32_MAX((u32)~0U)
 #define RTT_MAX(U32_MAX / ALPHA_MAX)   /* 3.3 secs */
 
 #define BETA_SHIFT 6
_
-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 10/18] ax88796 printk fixes

2007-08-10 Thread akpm
From: Andrew Morton <[EMAIL PROTECTED]>

drivers/net/ax88796.c: In function `ax_probe':
drivers/net/ax88796.c:825: warning: size_t format, different type arg (arg 4)
drivers/net/ax88796.c:825: warning: size_t format, different type arg (arg 5)

resource_size_t isn't size_t.

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

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

diff -puN drivers/net/ax88796.c~ax88796-printk-fixes drivers/net/ax88796.c
--- a/drivers/net/ax88796.c~ax88796-printk-fixes
+++ a/drivers/net/ax88796.c
@@ -821,8 +821,9 @@ static int ax_probe(struct platform_devi
dev->base_addr = (unsigned long)ei_status.mem;
 
if (ei_status.mem == NULL) {
-   dev_err(&pdev->dev, "Cannot ioremap area (%08zx,%08zx)\n",
-   res->start, res->end);
+   dev_err(&pdev->dev, "Cannot ioremap area (%08llx,%08llx)\n",
+   (unsigned long long)res->start,
+   (unsigned long long)res->end);
 
ret = -ENXIO;
goto exit_req;
_
-
To unsubscribe from this list: send 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 02/28] ip_auto_config fix

2007-08-10 Thread akpm
From: Joakim Tjernlund <[EMAIL PROTECTED]>

The following commandline:

 root=/dev/mtdblock6 rw rootfstype=jffs2 
ip=192.168.1.10:::255.255.255.0:localhost.localdomain:eth1:off 
console=ttyS0,115200

makes ip_auto_config fall back to DHCP and complain "IP-Config: Incomplete
network configuration information." depending on if CONFIG_IP_PNP_DHCP is
set or not.

The only way I can make ip_auto_config accept my IP config is to add an
entry for the server IP:

ip=192.168.1.10:192.168.1.15::255.255.255.0:localhost.localdomain:eth1:off

I think this is a bug since I am not using a NFS root FS.

The following patch fixes the above problem.


From: Andrew Morton <[EMAIL PROTECTED]>

Davem said (in February!):

  Well, first of all the change in question is not in 2.4.x either.  I just
  checked the current 2.4.x GIT tree and the test is exactly:

if (ic_myaddr == INADDR_NONE ||
#ifdef CONFIG_ROOT_NFS
(MAJOR(ROOT_DEV) == UNNAMED_MAJOR
 && root_server_addr == INADDR_NONE
 && ic_servaddr == INADDR_NONE) ||
#endif
ic_first_dev->next) {

  which matches 2.6.x

  I even checked 2.4.x when it was branched for 2.5.x and the test was the
  same at the point in time too.

  Looking at the proposed change a bit it appears that it is probably
  correct, as it's trying to check that ROOT_DEV is nfs root.  But if it is
  correct then the UNNAMED_MAJOR comparison in the same code block should be
  removed as it becomes superfluous.

  I'm happy to apply this patch with that modification made.


Signed-off-by: Joakim Tjernlund <[EMAIL PROTECTED]>
Cc: "David S. Miller" <[EMAIL PROTECTED]>
Cc: Trond Myklebust <[EMAIL PROTECTED]>

Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 net/ipv4/ipconfig.c |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff -puN net/ipv4/ipconfig.c~ip_auto_config-fix net/ipv4/ipconfig.c
--- a/net/ipv4/ipconfig.c~ip_auto_config-fix
+++ a/net/ipv4/ipconfig.c
@@ -1281,9 +1281,9 @@ static int __init ip_auto_config(void)
 */
if (ic_myaddr == NONE ||
 #ifdef CONFIG_ROOT_NFS
-   (MAJOR(ROOT_DEV) == UNNAMED_MAJOR
-&& root_server_addr == NONE
-&& ic_servaddr == NONE) ||
+   (root_server_addr == NONE
+&& ic_servaddr == NONE
+&& ROOT_DEV == Root_NFS) ||
 #endif
ic_first_dev->next) {
 #ifdef IPCONFIG_DYNAMIC
_
-
To unsubscribe from this list: send 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   3   4   5   6   >