[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 = >bstats,
-   .stats.qstats = >qstats,
+   {
+   .stats = {
+   .bstats = >bstats,
+   .qstats = >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, );
_


[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 = >bstats,
-   .stats.qstats = >qstats,
+   {
+   .stats.bstats = >bstats,
+   .stats.qstats = >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 = _stats,
+   {
+   .xstats = _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  = >channels
+   {
+   .rss = {
+   .hfunc = 
priv->channels.params.rss_hfunc,
+   .channels  = >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 ?  : NULL,
+   {
+   .next   = ctx_size ?  : 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 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 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 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 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/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 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 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 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 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 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 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 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 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 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=client-ip:server-ip:gw-ip:netm
   autoconfiguration.
 
   The autoconf 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.
 
   client-ip  IP address of the client.
 
@@ -142,7 +148,7 @@ ip=client-ip:server-ip:gw-ip:netm
into the kernel will be used, regardless of the value of
this option.
 
-  off or none: don't use autoconfiguration (default)
+  off or none: don't use autoconfiguration
  on or any:   use any protocol available in the kernel
  dhcp:use DHCP
  bootp:   use BOOTP
diff -puN net/ipv4/ipconfig.c~updates-to-nfsroot-documentation-take-3 
net/ipv4/ipconfig.c
--- a/net/ipv4/ipconfig.c~updates-to-nfsroot-documentation-take-3
+++ a/net/ipv4/ipconfig.c
@@ -1410,25 +1410,7 @@ late_initcall(ip_auto_config);
 
 /*
  *  Decode any IP configuration options in the ip= or nfsaddrs= kernel
- *  command line parameter. It consists of option fields separated by colons in
- *  the following order:
- *
- *  client-ip:server-ip:gw-ip:netmask:host name:device:PROTO
- *
- *  Any of the fields can be empty which means to use a default value:
- * client-ip - address given by BOOTP or RARP
- * server-ip - address of host returning BOOTP or RARP packet
- * gw-ip - none, or the address returned by BOOTP
- * netmask   - automatically determined from client-ip, or the
- *   one returned by BOOTP
- * host name - client-ip in ASCII notation, or the name returned
- *   by BOOTP
- * device- use all available devices
- * PROTO:
- *off|none - don't do autoconfig at all (DEFAULT)
- *on|any   - use any configured protocol
- *dhcp|bootp|rarp  - use only the specified protocol
- *both - use both BOOTP and RARP (not DHCP)
+ *  command line parameter.  See Documentation/nfsroot.txt.
  */
 static int __init ic_proto_name(char *name)
 {
_
--
To unsubscribe from this list: send 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 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 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 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 linux/if_plip.h
 #include linux/workqueue.h
 #include linux/spinlock.h
+#include linux/completion.h
 #include linux/parport.h
 #include linux/bitops.h
 
@@ -114,7 +115,6 @@ static const char version[] = NET3 PLIP
 #include asm/system.h
 #include asm/irq.h
 #include asm/byteorder.h
-#include asm/semaphore.h
 
 /* 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 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 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 linux/delay.h
 #include linux/ethtool.h
 #include linux/netdevice.h
+#include linux/log2.h
 #include ../8390.h
 
 #include pcmcia/cs_types.h
@@ -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 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:
 [a00100014340] show_stack+0x40/0xa0
sp=e0407c927b40 bsp=e0407c920eb8
 [a001000143d0] dump_stack+0x30/0x60
sp=e0407c927d10 bsp=e0407c920ea0
 [a001000e58e0] dynamic_irq_cleanup+0x160/0x1e0
sp=e0407c927d10 bsp=e0407c920e70
 [a001000106b0] destroy_and_reserve_irq+0x30/0xc0
sp=e0407c927d10 bsp=e0407c920e40
 [a001000508f0] iosapic_unregister_intr+0x5b0/0x5e0
sp=e0407c927d10 bsp=e0407c920dd8
 [a001aa70] acpi_unregister_gsi+0x30/0x60
sp=e0407c927d10 bsp=e0407c920db8
 [a0010042e300] acpi_pci_irq_disable+0x140/0x160
sp=e0407c927d10 bsp=e0407c920d88
 [a00100774200] pcibios_disable_device+0xa0/0xc0
sp=e0407c927d20 bsp=e0407c920d68
 [a001003778d0] pci_disable_device+0x130/0x160
sp=e0407c927d20 bsp=e0407c920d38
 [a00100525d20] e100_shutdown+0x1c0/0x220
sp=e0407c927d30 bsp=e0407c920d08
 [a0010037d0e0] pci_device_shutdown+0x80/0xc0
sp=e0407c927d30 bsp=e0407c920ce8
 [a001004ecb70] device_shutdown+0xf0/0x180
sp=e0407c927d30 bsp=e0407c920cc8
 [a001000ac4e0] kernel_restart+0x60/0x120
sp=e0407c927d30 bsp=e0407c920ca8
 [a001000ac990] sys_reboot+0x3b0/0x480
sp=e0407c927d30 bsp=e0407c920c30
 [a001b4e0] ia64_ret_from_syscall+0x0/0x20
sp=e0407c927e30 bsp=e0407c920c30
 [a0010620] 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 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 linux/if_ppp.h
 #include linux/ppp_channel.h
 #include linux/spinlock.h
+#include linux/completion.h
 #include linux/init.h
 #include asm/uaccess.h
-#include asm/semaphore.h
 
 #define PPP_VERSION2.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 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 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 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 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 linux/delay.h
 #include linux/ethtool.h
 #include linux/netdevice.h
+#include linux/log2.h
 #include ../8390.h
 
 #include pcmcia/cs_types.h
@@ -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 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 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 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 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 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/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 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 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 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;i16;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 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 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 linux/mii.h
 #include linux/mutex.h
 
+#include asm/div64.h
+
 #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 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 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:
  [802ec380] kobject_cleanup+0x53/0x7e
  [802ec3ab] kobject_release+0x0/0x9
  [802ecf3f] kref_put+0x74/0x81
  [8035493b] fixed_mdio_register_device+0x230/0x265
  [80564d31] fixed_init+0x1f/0x35
  [802071a4] init+0x147/0x2fb
  [80223b6e] schedule_tail+0x36/0x92
  [8020a678] child_rip+0xa/0x12
  [80311714] acpi_ds_init_one_object+0x0/0x83
  [8020705d] init+0x0/0x2fb
  [8020a66e] child_rip+0x0/0x12


Also changed the notation of the fixed phy definition on
mdio bus to the form of speed+duplex 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 linux/mii.h
 #include linux/ethtool.h
 #include linux/phy.h
+#include linux/phy_fixed.h
 
 #include asm/io.h
 #include asm/irq.h
 #include asm/uaccess.h
 
-#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)
+   

[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= 38, /* 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 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 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 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 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 linux/timer.h
 #include linux/workqueue.h
 
+#include asm/atomic.h
 #include asm/io.h
 #include asm/irq.h
 #include asm/uaccess.h
@@ -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 

[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 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 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 linux/etherdevice.h
 #include linux/ethtool.h
 #include linux/mii.h
+#include linux/eeprom_93cx6.h
 
 #include net/ax88796.h
 
@@ -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   (10)
 #define AXFLG_MAC_FROMDEV  (11)  /* device already has MAC */
+#define AXFLG_HAS_93CX6(12)  /* use eeprom_93cx6 
driver */
 
 struct ax_plat_data {
unsigned int 

[patch 01/18] revert 8139too: clean up I/O remapping

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

Revert git-netdev-all's 9ee6b32a47b9abc565466a9c3b127a5246b452e5.  Michal was
getting oopses.

Cc: Michal Piotrowski [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/8139too.c |   50 +++-
 1 files changed, 29 insertions(+), 21 deletions(-)

diff -puN drivers/net/8139too.c~revert-8139too-clean-up-i-o-remapping 
drivers/net/8139too.c
--- a/drivers/net/8139too.c~revert-8139too-clean-up-i-o-remapping
+++ a/drivers/net/8139too.c
@@ -121,15 +121,8 @@
 
 
 /* enable PIO instead of MMIO, if CONFIG_8139TOO_PIO is selected */
-enum rtl_bar_map_info {
-   rtl_pio_bar = 0,/* PCI BAR #0: PIO */
-   rtl_mmio_bar= 1,/* PCI BAR #1: MMIO */
-};
-
 #ifdef CONFIG_8139TOO_PIO
-static int use_pio = 1;
-#else
-static int use_pio;
+#define USE_IO_OPS 1
 #endif
 
 /* define to 1, 2 or 3 to enable copious debugging info */
@@ -620,17 +613,14 @@ MODULE_DESCRIPTION (RealTek RTL-8139 Fa
 MODULE_LICENSE(GPL);
 MODULE_VERSION(DRV_VERSION);
 
-module_param(multicast_filter_limit, int, 0444);
+module_param(multicast_filter_limit, int, 0);
 module_param_array(media, int, NULL, 0);
 module_param_array(full_duplex, int, NULL, 0);
-module_param(debug, int, 0444);
-module_param(use_pio, int, 0444);
-
+module_param(debug, int, 0);
+MODULE_PARM_DESC (debug, 8139too bitmapped message enable number);
 MODULE_PARM_DESC (multicast_filter_limit, 8139too maximum number of filtered 
multicast addresses);
 MODULE_PARM_DESC (media, 8139too: Bits 4+9: force full duplex, bit 5: 
100Mbps);
 MODULE_PARM_DESC (full_duplex, 8139too: Force full duplex for board(s) (1));
-MODULE_PARM_DESC (debug, 8139too bitmapped message enable number);
-MODULE_PARM_DESC (use_pio, Non-zero to enable PIO (rather than MMIO) register 
mapping);
 
 static int read_eeprom (void __iomem *ioaddr, int location, int addr_len);
 static int rtl8139_open (struct net_device *dev);
@@ -718,7 +708,13 @@ static void __rtl8139_cleanup_dev (struc
assert (tp-pci_dev != NULL);
pdev = tp-pci_dev;
 
-   pci_iounmap (pdev, tp-mmio_addr);
+#ifdef USE_IO_OPS
+   if (tp-mmio_addr)
+   ioport_unmap (tp-mmio_addr);
+#else
+   if (tp-mmio_addr)
+   pci_iounmap (pdev, tp-mmio_addr);
+#endif /* USE_IO_OPS */
 
/* it's ok to call this even if we have no regions to free */
pci_release_regions (pdev);
@@ -794,32 +790,32 @@ static int __devinit rtl8139_init_board 
DPRINTK(PIO region size == 0x%02X\n, pio_len);
DPRINTK(MMIO region size == 0x%02lX\n, mmio_len);
 
+#ifdef USE_IO_OPS
/* make sure PCI base addr 0 is PIO */
if (!(pio_flags  IORESOURCE_IO)) {
dev_err(pdev-dev, region #0 not a PIO resource, aborting\n);
rc = -ENODEV;
goto err_out;
}
-
/* check for weird/broken PCI region reporting */
if (pio_len  RTL_MIN_IO_SIZE) {
dev_err(pdev-dev, Invalid PCI I/O region size(s), 
aborting\n);
rc = -ENODEV;
goto err_out;
}
-
+#else
/* make sure PCI base addr 1 is MMIO */
if (!(mmio_flags  IORESOURCE_MEM)) {
dev_err(pdev-dev, region #1 not an MMIO resource, 
aborting\n);
rc = -ENODEV;
goto err_out;
}
-
if (mmio_len  RTL_MIN_IO_SIZE) {
dev_err(pdev-dev, Invalid PCI mem region size(s), 
aborting\n);
rc = -ENODEV;
goto err_out;
}
+#endif
 
rc = pci_request_regions (pdev, DRV_NAME);
if (rc)
@@ -829,16 +825,28 @@ static int __devinit rtl8139_init_board 
/* enable PCI bus-mastering */
pci_set_master (pdev);
 
-   /* iomap MMIO region */
-   ioaddr = pci_iomap(pdev, use_pio ? rtl_pio_bar : rtl_mmio_bar, 0);
+#ifdef USE_IO_OPS
+   ioaddr = ioport_map(pio_start, pio_len);
+   if (!ioaddr) {
+   dev_err(pdev-dev, cannot map PIO, aborting\n);
+   rc = -EIO;
+   goto err_out;
+   }
+   dev-base_addr = pio_start;
+   tp-mmio_addr = ioaddr;
+   tp-regs_len = pio_len;
+#else
+   /* ioremap MMIO region */
+   ioaddr = pci_iomap(pdev, 1, 0);
if (ioaddr == NULL) {
-   dev_err(pdev-dev, cannot map I/O regions, aborting\n);
+   dev_err(pdev-dev, cannot remap MMIO, aborting\n);
rc = -EIO;
goto err_out;
}
dev-base_addr = (long) ioaddr;
tp-mmio_addr = ioaddr;
tp-regs_len = mmio_len;
+#endif /* USE_IO_OPS */
 
/* Bring old chips out of low-power mode. */
RTL_W8 (HltClk, 'R');
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 07/18] PCI-X/PCI-Express read control interfaces: use them in e1000

2007-08-10 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.

Signed-off by: Peter Oruba [EMAIL PROTECTED]
Based on work by Stephen Hemminger [EMAIL PROTECTED]
Cc: Auke Kok [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/e1000/e1000_hw.c   |   25 +++--
 drivers/net/e1000/e1000_hw.h   |2 ++
 drivers/net/e1000/e1000_main.c |   14 ++
 3 files changed, 19 insertions(+), 22 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
@@ -865,10 +865,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;
@@ -958,24 +954,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
@@ -424,6 +424,8 @@ void e1000_pci_clear_mwi(struct e1000_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
@@ -4906,6 +4906,20 @@ e1000_write_pci_cfg(struct e1000_hw *hw,
pci_write_config_word(adapter-pdev, reg, *value);
 }
 
+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 02/18] sundance: PHY address form 0, only for device ID 0x0200 (IP100A) (20070605)

2007-08-10 Thread akpm
From: Jesse Huang [EMAIL PROTECTED]

Search PHY address form 0, only for device ID 0x0200 (IP100A).  Other
device are from PHY address 1.

Signed-off-by: Jesse Huang [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/sundance.c |6 +-
 1 files changed, 5 insertions(+), 1 deletion(-)

diff -puN 
drivers/net/sundance.c~sundance-phy-address-form-0-only-for-device-id-0x0200 
drivers/net/sundance.c
--- 
a/drivers/net/sundance.c~sundance-phy-address-form-0-only-for-device-id-0x0200
+++ a/drivers/net/sundance.c
@@ -559,7 +559,11 @@ static int __devinit sundance_probe1 (st
 * It seems some phys doesn't deal well with address 0 being accessed
 * first, so leave address zero to the end of the loop (32  31).
 */
-   for (phy = 1; phy = 32  phy_idx  MII_CNT; phy++) {
+   if (sundance_pci_tbl[np-chip_id].device == 0x0200)
+   phy = 0;
+   else
+   phy = 1;
+   for (; phy = 32  phy_idx  MII_CNT; phy++) {
int phyx = phy  0x1f;
int mii_status = mdio_read(dev, phyx, MII_BMSR);
if (mii_status != 0xmii_status != 0x) {
_
-
To unsubscribe from this list: send 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/18] PHY fixed driver: rework release path and update phy_id notation

2007-08-10 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:
  [802ec380] kobject_cleanup+0x53/0x7e
  [802ec3ab] kobject_release+0x0/0x9
  [802ecf3f] kref_put+0x74/0x81
  [8035493b] fixed_mdio_register_device+0x230/0x265
  [80564d31] fixed_init+0x1f/0x35
  [802071a4] init+0x147/0x2fb
  [80223b6e] schedule_tail+0x36/0x92
  [8020a678] child_rip+0xa/0x12
  [80311714] acpi_ds_init_one_object+0x0/0x83
  [8020705d] init+0x0/0x2fb
  [8020a66e] child_rip+0x0/0x12


Also changed the notation of the fixed phy definition on
mdio bus to the form of speed+duplex 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 linux/mii.h
 #include linux/ethtool.h
 #include linux/phy.h
+#include linux/phy_fixed.h
 
 #include asm/io.h
 #include asm/irq.h
 #include asm/uaccess.h
 
-#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)
+   

[patch 04/18] via-rhine: disable rx_copybreak on archs that don't allow unaligned DMA access

2007-08-10 Thread akpm
From: Dustin Marquess [EMAIL PROTECTED]

Patch to disable the rx_copybreak feature on hardware architectures that
don't allow unaligned DMA access.

#ifdef code taken from tulip_core.c.  Problem pointed out by Ivan
Kokshaysky.

Signed-off-by: Dustin Marquess [EMAIL PROTECTED]
Cc: Francois Romieu [EMAIL PROTECTED]
Cc: Ivan Kokshaysky [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/via-rhine.c |6 ++
 1 files changed, 6 insertions(+)

diff -puN drivers/net/via-rhine.c~via-rhine-disable-rx_copybreak-on-archs-that 
drivers/net/via-rhine.c
--- a/drivers/net/via-rhine.c~via-rhine-disable-rx_copybreak-on-archs-that
+++ a/drivers/net/via-rhine.c
@@ -42,7 +42,13 @@ static int max_interrupt_work = 20;
 
 /* Set the copy breakpoint for the copy-only-tiny-frames scheme.
Setting to  1518 effectively disables this feature. */
+#if defined(__alpha__) || defined(__arm__) || defined(__hppa__) \
+   || defined(CONFIG_SPARC) || defined(__ia64__) \
+   || defined(__sh__) || defined(__mips__)
+static int rx_copybreak = 1518;
+#else
 static int rx_copybreak;
+#endif
 
 /* Work-around for broken BIOSes: they are unable to get the chip back out of
power state D3 so PXE booting fails. bootparam(7): via-rhine.avoid_D3=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 06/18] PCI-X/PCI-Express read control interfaces: use them in myrinet

2007-08-10 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.

Signed-off by: Peter Oruba [EMAIL PROTECTED]
Based on work by Stephen Hemminger [EMAIL PROTECTED]
Cc: Roland Dreier [EMAIL PROTECTED]
Cc: Brice Goglin [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/myri10ge/myri10ge.c |3 +--
 1 files changed, 1 insertion(+), 2 deletions(-)

diff -puN 
drivers/net/myri10ge/myri10ge.c~pci-x-pci-express-read-control-interfaces-myrinet
 drivers/net/myri10ge/myri10ge.c
--- 
a/drivers/net/myri10ge/myri10ge.c~pci-x-pci-express-read-control-interfaces-myrinet
+++ a/drivers/net/myri10ge/myri10ge.c
@@ -2884,8 +2884,7 @@ static int myri10ge_probe(struct pci_dev
status);
goto abort_with_netdev;
}
-   val = (val  ~PCI_EXP_DEVCTL_READRQ) | (5  12);
-   status = pci_write_config_word(pdev, cap + PCI_EXP_DEVCTL, val);
+   status = pcie_set_readrq(pdev, 4096);
if (status != 0) {
dev_err(pdev-dev, Error %d writing PCI_EXP_DEVCTL\n,
status);
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 03/18] drivers/net/ns83820.c: add paramter to disable autonegotiation

2007-08-10 Thread akpm
From: Dan Faerch [EMAIL PROTECTED]

Adds ethtool command support to driver.  Initially 2 commands are
implemented: force fullduplex and toggle autoneg.

Also added a disable_autoneg module argument to completely disable
autoneg on all cards using this driver.

Signed-off-by: Dan Faerch [EMAIL PROTECTED]
Cc: Benjamin LaHaise [EMAIL PROTECTED]
Cc: Jeff Garzik [EMAIL PROTECTED]

[akpm: this is a previously-nacked patch, but the problem is real]

On Mon, 26 Jun 2006 12:29:28 -0400
Benjamin LaHaise [EMAIL PROTECTED] wrote:

 On Sun, Jun 25, 2006 at 01:44:36AM -0700, [EMAIL PROTECTED] wrote:
  
  From: Dan Faerch [EMAIL PROTECTED]
  
  Adds ethtool command support to driver.  Initially 2 commands are
  implemented: force fullduplex and toggle autoneg.
 
 This part is good, although doing something for copper cards needs doing, 
 which probably means poking around to support the phy properly.
 
  Also added a disable_autoneg module argument to completely disable
  autoneg on all cards using this driver.
 
 This is the part I disagree with.  Are you sure it isn't a bug in the 
 link autonegotiation state machine for fibre cards?  It should be defaulting 
 to 1Gbit/full duplex if no autonegotiation is happening, and if it isn't 
 then that should be fixed instead of papering over things with a config 
 option.

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

 drivers/net/ns83820.c |  183 +---
 1 files changed, 172 insertions(+), 11 deletions(-)

diff -puN 
drivers/net/ns83820.c~drivers-net-ns83820c-add-paramter-to-disable-auto 
drivers/net/ns83820.c
--- a/drivers/net/ns83820.c~drivers-net-ns83820c-add-paramter-to-disable-auto
+++ a/drivers/net/ns83820.c
@@ -1,4 +1,4 @@
-#define VERSION 0.22
+#define VERSION 0.23
 /* ns83820.c by Benjamin LaHaise with contributions.
  *
  * Questions/comments/discussion to [EMAIL PROTECTED]
@@ -68,6 +68,9 @@
  * 200504060.22 -  improved DAC ifdefs from Andi Kleen
  *  -  removal of dead code from Adrian Bunk
  *  -  fix half duplex collision behaviour
+ * 200602130.23 -  Basic skeleton for adding ethtool commands.
+ * Setting of autoneg  full-duplex via ethtool
+ * by Dan Faerch [EMAIL PROTECTED]
  * Driver Overview
  * ===
  *
@@ -124,8 +127,9 @@
 
 /* Global parameters.  See module_param near the bottom. */
 static int ihr = 2;
-static int reset_phy = 0;
-static int lnksts = 0; /* CFG_LNKSTS bit polarity */
+static int reset_phy;
+static int lnksts; /* CFG_LNKSTS bit polarity */
+static int disable_autoneg;
 
 /* Dprintk is used for more interesting debug events */
 #undef Dprintk
@@ -1247,6 +1251,154 @@ static struct net_device_stats *ns83820_
return dev-stats;
 }
 
+/* Let ethtool retrieve info */
+static int ns83820_get_settings(struct net_device *ndev,
+   struct ethtool_cmd *cmd)
+{
+   struct ns83820 *dev = PRIV(ndev);
+   u32 cfg, tanar, tbicr;
+   int have_optical = 0;
+   int fullduplex   = 0;
+
+   /*
+* Here's the list of available ethtool commands from other drivers:
+*  cmd-advertising =
+*  cmd-speed =
+*  cmd-duplex =
+*  cmd-port = 0;
+*  cmd-phy_address =
+*  cmd-transceiver = 0;
+*  cmd-autoneg =
+*  cmd-maxtxpkt = 0;
+*  cmd-maxrxpkt = 0;
+*/
+
+   /* read current configuration */
+   cfg   = readl(dev-base + CFG) ^ SPDSTS_POLARITY;
+   tanar = readl(dev-base + TANAR);
+   tbicr = readl(dev-base + TBICR);
+
+   if (dev-CFG_cache  CFG_TBI_EN) {
+   /* we have an optical interface */
+   have_optical = 1;
+   fullduplex = (cfg  CFG_DUPSTS) ? 1 : 0;
+
+   } else {
+   /* We have copper */
+   fullduplex = (cfg  CFG_DUPSTS) ? 1 : 0;
+}
+
+   cmd-supported = SUPPORTED_Autoneg;
+
+   /* we have optical interface */
+   if (dev-CFG_cache  CFG_TBI_EN) {
+   cmd-supported |= SUPPORTED_1000baseT_Half |
+   SUPPORTED_1000baseT_Full |
+   SUPPORTED_FIBRE;
+   cmd-port   = PORT_FIBRE;
+   } /* TODO: else copper related  support */
+
+   cmd-duplex = fullduplex ? DUPLEX_FULL : DUPLEX_HALF;
+   switch (cfg / CFG_SPDSTS0  3) {
+   case 2:
+   cmd-speed = SPEED_1000;
+   break;
+   case 1:
+   cmd-speed = SPEED_100;
+   break;
+   default:
+   cmd-speed = SPEED_10;
+   break;
+   }
+   cmd-autoneg = (tbicr  TBICR_MR_AN_ENABLE) ? 1: 0;
+   return 0;
+}
+
+/* Let ethool change settings*/
+static int ns83820_set_settings(struct net_device *ndev,
+   struct ethtool_cmd *cmd

[patch 08/18] 3c59x: check return of pci_enable_device()

2007-08-10 Thread akpm
From: Mark Hindley [EMAIL PROTECTED]

Check return of pci_enable_device in vortex_up().

Signed-off-by: Mark Hindley [EMAIL PROTECTED]
Acked-by: Steffen Klassert [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/3c59x.c |8 ++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff -puN drivers/net/3c59x.c~3c59x-check-return-of-pci_enable_device 
drivers/net/3c59x.c
--- a/drivers/net/3c59x.c~3c59x-check-return-of-pci_enable_device
+++ a/drivers/net/3c59x.c
@@ -1490,13 +1490,17 @@ vortex_up(struct net_device *dev)
struct vortex_private *vp = netdev_priv(dev);
void __iomem *ioaddr = vp-ioaddr;
unsigned int config;
-   int i, mii_reg1, mii_reg5;
+   int i, mii_reg1, mii_reg5, err;
 
if (VORTEX_PCI(vp)) {
pci_set_power_state(VORTEX_PCI(vp), PCI_D0);/* Go active */
if (vp-pm_state_valid)
pci_restore_state(VORTEX_PCI(vp));
-   pci_enable_device(VORTEX_PCI(vp));
+   err = pci_enable_device(VORTEX_PCI(vp));
+   if (err) {
+   printk(KERN_WARNING %s: Could not enable device \n,
+   dev-name);
+   }
}
 
/* Before initializing select the active media port. */
_
-
To unsubscribe from this list: send 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/28] Clean up duplicate includes in net/sched/

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

This patch cleans up duplicate includes in
net/sched/

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

 net/sched/act_police.c |1 -
 1 files changed, 1 deletion(-)

diff -puN net/sched/act_police.c~clean-up-duplicate-includes-in-net-sched 
net/sched/act_police.c
--- a/net/sched/act_police.c~clean-up-duplicate-includes-in-net-sched
+++ a/net/sched/act_police.c
@@ -16,7 +16,6 @@
 #include linux/string.h
 #include linux/errno.h
 #include linux/skbuff.h
-#include linux/module.h
 #include linux/rtnetlink.h
 #include linux/init.h
 #include net/act_api.h
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 09/28] Clean up duplicate includes in net/tipc/

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

This patch cleans up duplicate includes in
net/tipc/

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

 net/tipc/port.c |1 -
 1 files changed, 1 deletion(-)

diff -puN net/tipc/port.c~clean-up-duplicate-includes-in-net-tipc 
net/tipc/port.c
--- a/net/tipc/port.c~clean-up-duplicate-includes-in-net-tipc
+++ a/net/tipc/port.c
@@ -41,7 +41,6 @@
 #include addr.h
 #include link.h
 #include node.h
-#include port.h
 #include name_table.h
 #include user_reg.h
 #include msg.h
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 13/28] fib_trie: macro cleanup

2007-08-10 Thread akpm
From: Stephen Hemminger [EMAIL PROTECTED]

This patch converts the messy macro for MASK_PFX to inline function
and expands TKEY_GET_MASK in the one place it is used.

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

 net/ipv4/fib_trie.c |   18 +++---
 1 files changed, 11 insertions(+), 7 deletions(-)

diff -puN net/ipv4/fib_trie.c~fib_trie-macro-cleanup net/ipv4/fib_trie.c
--- a/net/ipv4/fib_trie.c~fib_trie-macro-cleanup
+++ a/net/ipv4/fib_trie.c
@@ -85,8 +85,6 @@
 #define MAX_STAT_DEPTH 32
 
 #define KEYLENGTH (8*sizeof(t_key))
-#define MASK_PFX(k, l) (((l)==0)?0:(k  (KEYLENGTH-l))  (KEYLENGTH-l))
-#define TKEY_GET_MASK(offset, bits) (((bits)==0)?0:((t_key)(-1)  (KEYLENGTH 
- bits)  offset))
 
 typedef unsigned int t_key;
 
@@ -195,6 +193,11 @@ static inline int tnode_child_length(con
return 1  tn-bits;
 }
 
+static inline t_key mask_pfx(t_key k, unsigned short l)
+{
+   return (l == 0) ? 0 : k  (KEYLENGTH-l)  (KEYLENGTH-l);
+}
+
 static inline t_key tkey_extract_bits(t_key a, int offset, int bits)
 {
if (offset  KEYLENGTH)
@@ -679,7 +682,7 @@ static struct tnode *inflate(struct trie
inode-pos == oldtnode-pos + oldtnode-bits 
inode-bits  1) {
struct tnode *left, *right;
-   t_key m = TKEY_GET_MASK(inode-pos, 1);
+   t_key m = ~0U  (KEYLENGTH - 1)  inode-pos;
 
left = tnode_new(inode-key(~m), inode-pos + 1,
 inode-bits - 1);
@@ -1367,7 +1370,8 @@ fn_trie_lookup(struct fib_table *tb, con
bits = pn-bits;
 
if (!chopped_off)
-   cindex = tkey_extract_bits(MASK_PFX(key, 
current_prefix_length), pos, bits);
+   cindex = tkey_extract_bits(mask_pfx(key, 
current_prefix_length),
+  pos, bits);
 
n = tnode_get_child(pn, cindex);
 
@@ -1453,8 +1457,8 @@ fn_trie_lookup(struct fib_table *tb, con
 * to find a matching prefix.
 */
 
-   node_prefix = MASK_PFX(cn-key, cn-pos);
-   key_prefix = MASK_PFX(key, cn-pos);
+   node_prefix = mask_pfx(cn-key, cn-pos);
+   key_prefix = mask_pfx(key, cn-pos);
pref_mismatch = key_prefix^node_prefix;
mp = 0;
 
@@ -2330,7 +2334,7 @@ static int fib_trie_seq_show(struct seq_
 
if (IS_TNODE(n)) {
struct tnode *tn = (struct tnode *) n;
-   __be32 prf = htonl(MASK_PFX(tn-key, tn-pos));
+   __be32 prf = htonl(mask_pfx(tn-key, tn-pos));
 
seq_indent(seq, iter-depth-1);
seq_printf(seq,   +-- %d.%d.%d.%d/%d %d %d %d\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 12/28] fib_trie: cleanup

2007-08-10 Thread akpm
From: Stephen Hemminger [EMAIL PROTECTED]

Try this out:
 * replace macro's with inlines
 * get rid of places doing multiple evaluations of NODE_PARENT

[EMAIL PROTECTED]: rcu_dereference wants an lval]
Cc: David S. Miller [EMAIL PROTECTED]
Cc: Paul E. McKenney [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/ipv4/fib_trie.c |   68 ++
 1 files changed, 36 insertions(+), 32 deletions(-)

diff -puN net/ipv4/fib_trie.c~fib_trie-cleanup net/ipv4/fib_trie.c
--- a/net/ipv4/fib_trie.c~fib_trie-cleanup
+++ a/net/ipv4/fib_trie.c
@@ -93,15 +93,8 @@ typedef unsigned int t_key;
 #define T_TNODE 0
 #define T_LEAF  1
 #define NODE_TYPE_MASK 0x1UL
-#define NODE_PARENT(node) \
-   ((struct tnode *)rcu_dereference(((node)-parent  ~NODE_TYPE_MASK)))
-
 #define NODE_TYPE(node) ((node)-parent  NODE_TYPE_MASK)
 
-#define NODE_SET_PARENT(node, ptr) \
-   rcu_assign_pointer((node)-parent,  \
-  ((unsigned long)(ptr)) | NODE_TYPE(node))
-
 #define IS_TNODE(n) (!(n-parent  T_LEAF))
 #define IS_LEAF(n) (n-parent  T_LEAF)
 
@@ -174,6 +167,19 @@ static void tnode_free(struct tnode *tn)
 static struct kmem_cache *fn_alias_kmem __read_mostly;
 static struct trie *trie_local = NULL, *trie_main = NULL;
 
+static inline struct tnode *node_parent(struct node *node)
+{
+   struct tnode *ret;
+
+   ret = (struct tnode *)(node-parent  ~NODE_TYPE_MASK);
+   return rcu_dereference(ret);
+}
+
+static inline void node_set_parent(struct node *node, struct tnode *ptr)
+{
+   rcu_assign_pointer(node-parent,
+  (unsigned long)ptr | NODE_TYPE(node));
+}
 
 /* rcu_read_lock needs to be hold by caller from readside */
 
@@ -446,7 +452,7 @@ static void tnode_put_child_reorg(struct
tn-full_children++;
 
if (n)
-   NODE_SET_PARENT(n, tn);
+   node_set_parent(n, tn);
 
rcu_assign_pointer(tn-child[i], n);
 }
@@ -481,7 +487,7 @@ static struct node *resize(struct trie *
continue;
 
/* compress one level */
-   NODE_SET_PARENT(n, NULL);
+   node_set_parent(n, NULL);
tnode_free(tn);
return n;
}
@@ -636,7 +642,7 @@ static struct node *resize(struct trie *
 
/* compress one level */
 
-   NODE_SET_PARENT(n, NULL);
+   node_set_parent(n, NULL);
tnode_free(tn);
return n;
}
@@ -961,24 +967,21 @@ fib_find_node(struct trie *t, u32 key)
 static struct node *trie_rebalance(struct trie *t, struct tnode *tn)
 {
int wasfull;
-   t_key cindex, key;
-   struct tnode *tp = NULL;
-
-   key = tn-key;
+   t_key cindex, key = tn-key;
+   struct tnode *tp;
 
-   while (tn != NULL  NODE_PARENT(tn) != NULL) {
-
-   tp = NODE_PARENT(tn);
+   while (tn != NULL  (tp = node_parent((struct node *)tn)) != NULL) {
cindex = tkey_extract_bits(key, tp-pos, tp-bits);
wasfull = tnode_full(tp, tnode_get_child(tp, cindex));
tn = (struct tnode *) resize (t, (struct tnode *)tn);
tnode_put_child_reorg((struct tnode *)tp, cindex,(struct 
node*)tn, wasfull);
 
-   if (!NODE_PARENT(tn))
+   tp = node_parent((struct node *) tn);
+   if (!tp)
break;
-
-   tn = NODE_PARENT(tn);
+   tn = tp;
}
+
/* Handle last (top) tnode */
if (IS_TNODE(tn))
tn = (struct tnode*) resize(t, (struct tnode *)tn);
@@ -1031,7 +1034,7 @@ fib_insert_node(struct trie *t, int *err
pos = tn-pos + tn-bits;
n = tnode_get_child(tn, tkey_extract_bits(key, tn-pos, 
tn-bits));
 
-   BUG_ON(n  NODE_PARENT(n) != tn);
+   BUG_ON(n  node_parent(n) != tn);
} else
break;
}
@@ -1083,7 +1086,7 @@ fib_insert_node(struct trie *t, int *err
if (t-trie  n == NULL) {
/* Case 2: n is NULL, and will just insert a new leaf */
 
-   NODE_SET_PARENT(l, tp);
+   node_set_parent((struct node *)l, tp);
 
cindex = tkey_extract_bits(key, tp-pos, tp-bits);
put_child(t, (struct tnode *)tp, cindex, (struct node *)l);
@@ -1114,7 +1117,7 @@ fib_insert_node(struct trie *t, int *err
goto err;
}
 
-   NODE_SET_PARENT(tn, tp);
+   node_set_parent((struct node *)tn, tp);
 
missbit = tkey_extract_bits(key, newpos, 1);
put_child(t, tn, missbit, (struct node *)l);
@@ -1495,12 +1498,13 @@ backtrace:
if (chopped_off = pn-bits) 

[patch 01/28] fore200e_param_bs_queue() must be __devinit

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

WARNING: drivers/built-in.o(.text+0x6203bb): Section mismatch: reference to 
.init.text:fore200e_param_bs_queue (between 'fore200e_initialize' and 
'fore200e_monitor_putc')

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

 drivers/atm/fore200e.c |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN drivers/atm/fore200e.c~fore200e_param_bs_queue-must-be-__devinit 
drivers/atm/fore200e.c
--- a/drivers/atm/fore200e.c~fore200e_param_bs_queue-must-be-__devinit
+++ a/drivers/atm/fore200e.c
@@ -2435,7 +2435,7 @@ fore200e_init_cmd_queue(struct fore200e*
 }
 
 
-static void __init
+static void __devinit
 fore200e_param_bs_queue(struct fore200e* fore200e,
enum buffer_scheme scheme, enum buffer_magn magn,
int queue_length, int pool_size, int supply_blksize)
_
-
To unsubscribe from this list: send 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/28] Clean up duplicate includes in net/xfrm/

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

This patch cleans up duplicate includes in
net/xfrm/

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

 net/xfrm/xfrm_policy.c |3 +--
 net/xfrm/xfrm_state.c  |3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff -puN net/xfrm/xfrm_policy.c~clean-up-duplicate-includes-in-net-xfrm 
net/xfrm/xfrm_policy.c
--- a/net/xfrm/xfrm_policy.c~clean-up-duplicate-includes-in-net-xfrm
+++ a/net/xfrm/xfrm_policy.c
@@ -23,10 +23,9 @@
 #include linux/netfilter.h
 #include linux/module.h
 #include linux/cache.h
+#include linux/audit.h
 #include net/xfrm.h
 #include net/ip.h
-#include linux/audit.h
-#include linux/cache.h
 
 #include xfrm_hash.h
 
diff -puN net/xfrm/xfrm_state.c~clean-up-duplicate-includes-in-net-xfrm 
net/xfrm/xfrm_state.c
--- a/net/xfrm/xfrm_state.c~clean-up-duplicate-includes-in-net-xfrm
+++ a/net/xfrm/xfrm_state.c
@@ -19,9 +19,8 @@
 #include linux/ipsec.h
 #include linux/module.h
 #include linux/cache.h
-#include asm/uaccess.h
 #include linux/audit.h
-#include linux/cache.h
+#include asm/uaccess.h
 
 #include xfrm_hash.h
 
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 14/28] dccp: fix memory leak and clean up style - dccp_feat_empty_confirm()

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

There's a memory leak in net/dccp/feat.c::dccp_feat_empty_confirm().  If we
hit the 'default:' case of the 'switch' statement, then we return without
freeing 'opt', thus leaking 'struct dccp_opt_pend' bytes.

The leak is fixed easily enough by adding a kfree(opt); before the return
statement.

The patch also changes the layout of the 'switch' to be more in line with
CodingStyle.

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Acked-by: Ian McDonald [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/dccp/feat.c |   14 ++
 1 files changed, 10 insertions(+), 4 deletions(-)

diff -puN 
net/dccp/feat.c~dccp-fix-memory-leak-and-clean-up-style-dccp_feat_empty_confirm 
net/dccp/feat.c
--- 
a/net/dccp/feat.c~dccp-fix-memory-leak-and-clean-up-style-dccp_feat_empty_confirm
+++ a/net/dccp/feat.c
@@ -327,10 +327,16 @@ static void dccp_feat_empty_confirm(stru
}
 
switch (type) {
-   case DCCPO_CHANGE_L: opt-dccpop_type = DCCPO_CONFIRM_R; break;
-   case DCCPO_CHANGE_R: opt-dccpop_type = DCCPO_CONFIRM_L; break;
-   default: DCCP_WARN(invalid type %d\n, type); return;
-
+   case DCCPO_CHANGE_L:
+   opt-dccpop_type = DCCPO_CONFIRM_R;
+   break;
+   case DCCPO_CHANGE_R:
+   opt-dccpop_type = DCCPO_CONFIRM_L;
+   break;
+   default:
+   DCCP_WARN(invalid type %d\n, type);
+   kfree(opt);
+   return;
}
opt-dccpop_feat = feature;
opt-dccpop_val  = 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 03/28] Clean up duplicate includes in drivers/atm/

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

This patch cleans up duplicate includes in
drivers/atm/

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Cc: Chas Williams [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/atm/lanai.c |1 -
 1 files changed, 1 deletion(-)

diff -puN drivers/atm/lanai.c~clean-up-duplicate-includes-in-drivers-atm 
drivers/atm/lanai.c
--- a/drivers/atm/lanai.c~clean-up-duplicate-includes-in-drivers-atm
+++ a/drivers/atm/lanai.c
@@ -65,7 +65,6 @@
 #include linux/init.h
 #include linux/delay.h
 #include linux/interrupt.h
-#include linux/dma-mapping.h
 
 /*  TUNABLE PARAMATERS: */
 
_
-
To unsubscribe from this list: send 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/28] Clean up duplicate includes in net/atm/

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

This patch cleans up duplicate includes in
net/atm/

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Cc: Chas Williams [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/atm/lec.c |1 -
 1 files changed, 1 deletion(-)

diff -puN net/atm/lec.c~clean-up-duplicate-includes-in-net-atm net/atm/lec.c
--- a/net/atm/lec.c~clean-up-duplicate-includes-in-net-atm
+++ a/net/atm/lec.c
@@ -21,7 +21,6 @@
 #include net/dst.h
 #include linux/proc_fs.h
 #include linux/spinlock.h
-#include linux/proc_fs.h
 #include linux/seq_file.h
 
 /* TokenRing if needed */
_
-
To unsubscribe from this list: send 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/28] Clean up duplicate includes in net/sunrpc/

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

This patch cleans up duplicate includes in
net/sunrpc/

Signed-off-by: Jesper Juhl [EMAIL PROTECTED]
Cc: Trond Myklebust [EMAIL PROTECTED]
Cc: Neil Brown [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 net/sunrpc/auth_gss/svcauth_gss.c |1 -
 1 files changed, 1 deletion(-)

diff -puN 
net/sunrpc/auth_gss/svcauth_gss.c~clean-up-duplicate-includes-in-net-sunrpc 
net/sunrpc/auth_gss/svcauth_gss.c
--- 
a/net/sunrpc/auth_gss/svcauth_gss.c~clean-up-duplicate-includes-in-net-sunrpc
+++ a/net/sunrpc/auth_gss/svcauth_gss.c
@@ -42,7 +42,6 @@
 #include linux/pagemap.h
 
 #include linux/sunrpc/auth_gss.h
-#include linux/sunrpc/svcauth.h
 #include linux/sunrpc/gss_err.h
 #include linux/sunrpc/svcauth.h
 #include linux/sunrpc/svcauth_gss.h
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 16/28] drivers/net/irda/irda-usb.c: mostly kmalloc + memset conversion to k[cz]alloc

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

 drivers/net/irda/irda-usb.c | 59694 - 59541 (-153 bytes)
 drivers/net/irda/irda-usb.o | 170588 - 169256 (-1332 bytes)

Signed-off-by: Mariusz Kozlowski [EMAIL PROTECTED]
Cc: Samuel Ortiz [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 drivers/net/irda/irda-usb.c |   24 ++--
 1 files changed, 10 insertions(+), 14 deletions(-)

diff -puN 
drivers/net/irda/irda-usb.c~drivers-net-irda-irda-usbc-mostly-kmalloc-memset-conversion-to-kalloc
 drivers/net/irda/irda-usb.c
--- 
a/drivers/net/irda/irda-usb.c~drivers-net-irda-irda-usbc-mostly-kmalloc-memset-conversion-to-kalloc
+++ a/drivers/net/irda/irda-usb.c
@@ -1561,10 +1561,9 @@ static inline struct irda_class_desc *ir
struct irda_class_desc *desc;
int ret;
 
-   desc = kmalloc(sizeof (*desc), GFP_KERNEL);
-   if (desc == NULL) 
+   desc = kzalloc(sizeof(*desc), GFP_KERNEL);
+   if (!desc)
return NULL;
-   memset(desc, 0, sizeof(*desc));
 
/* USB-IrDA class spec 1.0:
 *  6.1.3: Standard Get Descriptor Device Request is not
@@ -1617,7 +1616,7 @@ static int irda_usb_probe(struct usb_int
 {
struct net_device *net;
struct usb_device *dev = interface_to_usbdev(intf);
-   struct irda_usb_cb *self = NULL;
+   struct irda_usb_cb *self;
struct usb_host_interface *interface;
struct irda_class_desc *irda_desc;
int ret = -ENOMEM;
@@ -1655,7 +1654,7 @@ static int irda_usb_probe(struct usb_int
self-header_length = USB_IRDA_HEADER;
}
 
-   self-rx_urb = kzalloc(self-max_rx_urb * sizeof(struct urb *),
+   self-rx_urb = kcalloc(self-max_rx_urb, sizeof(struct urb *),
GFP_KERNEL);
 
for (i = 0; i  self-max_rx_urb; i++) {
@@ -1715,7 +1714,7 @@ static int irda_usb_probe(struct usb_int
/* Find IrDA class descriptor */
irda_desc = irda_usb_find_class_desc(intf);
ret = -ENODEV;
-   if (irda_desc == NULL)
+   if (!irda_desc)
goto err_out_3;
 
if (self-needspatch) {
@@ -1738,15 +1737,13 @@ static int irda_usb_probe(struct usb_int
/* Don't change this buffer size and allocation without doing
 * some heavy and complete testing. Don't ask why :-(
 * Jean II */
-   self-speed_buff = kmalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
-   if (self-speed_buff == NULL) 
+   self-speed_buff = kzalloc(IRDA_USB_SPEED_MTU, GFP_KERNEL);
+   if (!self-speed_buff)
goto err_out_3;
 
-   memset(self-speed_buff, 0, IRDA_USB_SPEED_MTU);
-
self-tx_buff = kzalloc(IRDA_SKB_MAX_MTU + self-header_length,
GFP_KERNEL);
-   if (self-tx_buff == NULL)
+   if (!self-tx_buff)
goto err_out_4;
 
ret = irda_usb_open(self);
@@ -1767,12 +1764,11 @@ static int irda_usb_probe(struct usb_int
 
/* replace IrDA class descriptor with what patched device is 
now reporting */
irda_desc = irda_usb_find_class_desc (self-usbintf);
-   if (irda_desc == NULL) {
+   if (!irda_desc) {
ret = -ENODEV;
goto err_out_6;
}
-   if (self-irda_desc)
-   kfree (self-irda_desc);
+   kfree(self-irda_desc);
self-irda_desc = irda_desc;
irda_usb_init_qos(self);
}
_
-
To unsubscribe from this list: send 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/28] Clean up duplicate includes in net/ipv6/

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

This patch cleans up duplicate includes in
net/ipv6/

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

 net/ipv6/tcp_ipv6.c |1 -
 1 files changed, 1 deletion(-)

diff -puN net/ipv6/tcp_ipv6.c~clean-up-duplicate-includes-in-net-ipv6 
net/ipv6/tcp_ipv6.c
--- a/net/ipv6/tcp_ipv6.c~clean-up-duplicate-includes-in-net-ipv6
+++ a/net/ipv6/tcp_ipv6.c
@@ -56,7 +56,6 @@
 #include net/inet_ecn.h
 #include net/protocol.h
 #include net/xfrm.h
-#include net/addrconf.h
 #include net/snmp.h
 #include net/dsfield.h
 #include net/timewait_sock.h
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[patch 05/28] Clean up duplicate includes in net/ipv4/

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

This patch cleans up duplicate includes in
net/ipv4/

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

 net/ipv4/ip_output.c   |1 -
 net/ipv4/ipvs/ip_vs_ctl.c  |1 -
 net/ipv4/netfilter/ipt_CLUSTERIP.c |1 -
 3 files changed, 3 deletions(-)

diff -puN net/ipv4/ip_output.c~clean-up-duplicate-includes-in-net-ipv4 
net/ipv4/ip_output.c
--- a/net/ipv4/ip_output.c~clean-up-duplicate-includes-in-net-ipv4
+++ a/net/ipv4/ip_output.c
@@ -75,7 +75,6 @@
 #include net/icmp.h
 #include net/checksum.h
 #include net/inetpeer.h
-#include net/checksum.h
 #include linux/igmp.h
 #include linux/netfilter_ipv4.h
 #include linux/netfilter_bridge.h
diff -puN net/ipv4/ipvs/ip_vs_ctl.c~clean-up-duplicate-includes-in-net-ipv4 
net/ipv4/ipvs/ip_vs_ctl.c
--- a/net/ipv4/ipvs/ip_vs_ctl.c~clean-up-duplicate-includes-in-net-ipv4
+++ a/net/ipv4/ipvs/ip_vs_ctl.c
@@ -29,7 +29,6 @@
 #include linux/proc_fs.h
 #include linux/workqueue.h
 #include linux/swap.h
-#include linux/proc_fs.h
 #include linux/seq_file.h
 
 #include linux/netfilter.h
diff -puN 
net/ipv4/netfilter/ipt_CLUSTERIP.c~clean-up-duplicate-includes-in-net-ipv4 
net/ipv4/netfilter/ipt_CLUSTERIP.c
--- a/net/ipv4/netfilter/ipt_CLUSTERIP.c~clean-up-duplicate-includes-in-net-ipv4
+++ a/net/ipv4/netfilter/ipt_CLUSTERIP.c
@@ -19,7 +19,6 @@
 #include linux/udp.h
 #include linux/icmp.h
 #include linux/if_arp.h
-#include linux/proc_fs.h
 #include linux/seq_file.h
 #include linux/netfilter_arp.h
 #include linux/netfilter/x_tables.h
_
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


  1   2   3   4   5   >