* [PATCH 4/5] firewire: net: invalidate ARP entries for removed nodes.
From: Maxim Levitsky @ 2010-11-28 1:15 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>
This allows to be able to connect to nodes that disappered
from the bus and after some time appeared again.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
drivers/firewire/net.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/drivers/firewire/net.c b/drivers/firewire/net.c
index 1a467a9..d422519 100644
--- a/drivers/firewire/net.c
+++ b/drivers/firewire/net.c
@@ -189,6 +189,7 @@ struct fwnet_peer {
struct fwnet_device *dev;
u64 guid;
u64 fifo;
+ __be32 ip;
/* guarded by dev->lock */
struct list_head pd_list; /* received partial datagrams */
@@ -568,6 +569,8 @@ static int fwnet_finish_incoming_packet(struct net_device *net,
peer->speed = sspd;
if (peer->max_payload > max_payload)
peer->max_payload = max_payload;
+
+ peer->ip = arp1394->sip;
}
spin_unlock_irqrestore(&dev->lock, flags);
@@ -1443,6 +1446,7 @@ static int fwnet_add_peer(struct fwnet_device *dev,
peer->dev = dev;
peer->guid = (u64)device->config_rom[3] << 32 | device->config_rom[4];
peer->fifo = FWNET_NO_FIFO_ADDR;
+ peer->ip = 0;
INIT_LIST_HEAD(&peer->pd_list);
peer->pdg_size = 0;
peer->datagram_label = 0;
@@ -1558,6 +1562,9 @@ static int fwnet_remove(struct device *_dev)
mutex_lock(&fwnet_device_mutex);
+ if (dev->netdev && peer->ip)
+ arp_invalidate(dev->netdev, peer->ip);
+
fwnet_remove_peer(peer);
if (list_empty(&dev->peer_list)) {
--
1.7.1
^ permalink raw reply related
* [PATCH 2/5] firewire: ohci: restart ISO channels on resume
From: Maxim Levitsky @ 2010-11-28 1:15 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>
ISO streams are supposed to be not interrupted
on bus resets, and suspend resume can be though
as one big bus reset.
Of course users must as soon as they notice the
bus reset, revalidate the ISO channel with IRM.
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
drivers/firewire/ohci.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 48 insertions(+), 1 deletions(-)
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index cadd6af..9704b34 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -40,6 +40,7 @@
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/time.h>
+#include <linux/bitops.h>
#include <asm/byteorder.h>
#include <asm/page.h>
@@ -167,6 +168,9 @@ struct iso_context {
int excess_bytes;
void *header;
size_t header_length;
+
+ u8 sync;
+ u8 tags;
};
#define CONFIG_ROM_SIZE 1024
@@ -199,8 +203,11 @@ struct fw_ohci {
u32 it_context_mask; /* unoccupied IT contexts */
struct iso_context *it_context_list;
+ u32 it_active_mask;
+
u64 ir_context_channels; /* unoccupied channels */
u32 ir_context_mask; /* unoccupied IR contexts */
+ u32 ir_active_mask; /*running IR contexts */
struct iso_context *ir_context_list;
u64 mc_channels; /* channels in use by the multichannel IR context */
bool mc_allocated;
@@ -2596,6 +2603,7 @@ static int ohci_start_iso(struct fw_iso_context *base,
reg_write(ohci, OHCI1394_IsoXmitIntEventClear, 1 << index);
reg_write(ohci, OHCI1394_IsoXmitIntMaskSet, 1 << index);
+ ohci->it_active_mask |= (1 << index);
context_run(&ctx->context, match);
break;
@@ -2613,7 +2621,12 @@ static int ohci_start_iso(struct fw_iso_context *base,
reg_write(ohci, OHCI1394_IsoRecvIntEventClear, 1 << index);
reg_write(ohci, OHCI1394_IsoRecvIntMaskSet, 1 << index);
reg_write(ohci, CONTEXT_MATCH(ctx->context.regs), match);
+ ohci->ir_active_mask |= (1 << index);
context_run(&ctx->context, control);
+
+ ctx->sync = sync;
+ ctx->tags = tags;
+
break;
}
@@ -2630,12 +2643,14 @@ static int ohci_stop_iso(struct fw_iso_context *base)
case FW_ISO_CONTEXT_TRANSMIT:
index = ctx - ohci->it_context_list;
reg_write(ohci, OHCI1394_IsoXmitIntMaskClear, 1 << index);
+ ohci->it_active_mask &= ~(1 << index);
break;
case FW_ISO_CONTEXT_RECEIVE:
case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL:
index = ctx - ohci->ir_context_list;
reg_write(ohci, OHCI1394_IsoRecvIntMaskClear, 1 << index);
+ ohci->ir_active_mask &= ~(1 << index);
break;
}
flush_writes(ohci);
@@ -2711,6 +2726,33 @@ static int ohci_set_iso_channels(struct fw_iso_context *base, u64 *channels)
return ret;
}
+static int ohci_resume_iso(struct fw_ohci *ohci)
+{
+ int i, err;
+ struct iso_context *ctx;
+
+ for_each_set_bit(i, (unsigned long *)&ohci->ir_active_mask,
+ sizeof(ohci->ir_active_mask)) {
+ ctx = &ohci->ir_context_list[i];
+ err = ohci_start_iso(&ctx->base, 0, ctx->sync, ctx->tags);
+
+ if (err)
+ return err;
+ }
+
+ for_each_set_bit(i, (unsigned long *)&ohci->it_active_mask,
+ sizeof(ohci->it_active_mask)) {
+ ctx = &ohci->it_context_list[i];
+ err = ohci_start_iso(&ctx->base, 0, 0, 0);
+
+ if (err)
+ return err;
+ }
+
+
+ return 0;
+}
+
static int queue_iso_transmit(struct iso_context *ctx,
struct fw_iso_packet *packet,
struct fw_iso_buffer *buffer,
@@ -3244,7 +3286,12 @@ static int pci_resume(struct pci_dev *dev)
reg_write(ohci, OHCI1394_GUIDLo, ohci->card.guid & 0xFFFFFFFF);
reg_write(ohci, OHCI1394_GUIDHi, (ohci->card.guid >> 32) & 0xFFFFFFFF);
- return ohci_enable(&ohci->card, NULL, 0);
+ err = ohci_enable(&ohci->card, NULL, 0);
+
+ if (err)
+ return err;
+
+ return ohci_resume_iso(ohci);
}
#endif
--
1.7.1
^ permalink raw reply related
* [PATCH 1/5] firewire: ohci: restore GUID register on resume.
From: Maxim Levitsky @ 2010-11-28 1:15 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev, Maxim Levitsky
In-Reply-To: <1290906936-14472-1-git-send-email-maximlevitsky@gmail.com>
Some lousy BIOSes, eg my Aspire 5720 BIOS forgets to restore
device GUID on resume from ram.
Fix that by programming GUID register on resume from ram
Since that register is one time programable according to spec,
that has no effect on systems that have sane BIOS (Are there any?)
Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
---
drivers/firewire/ohci.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
index 6dd56cd..cadd6af 100644
--- a/drivers/firewire/ohci.c
+++ b/drivers/firewire/ohci.c
@@ -3240,6 +3240,10 @@ static int pci_resume(struct pci_dev *dev)
return err;
}
+ /* Some bioses forget to reinitialize the GUID. Do that ourselves */
+ reg_write(ohci, OHCI1394_GUIDLo, ohci->card.guid & 0xFFFFFFFF);
+ reg_write(ohci, OHCI1394_GUIDHi, (ohci->card.guid >> 32) & 0xFFFFFFFF);
+
return ohci_enable(&ohci->card, NULL, 0);
}
#endif
--
1.7.1
^ permalink raw reply related
* [PATCH 0/5] Firewire networking assorted fixes
From: Maxim Levitsky @ 2010-11-28 1:15 UTC (permalink / raw)
To: linux1394-devel; +Cc: Stefan Richter, netdev
Here is few patches to fix few annoying problems with firewire networking.
I need a feedback on patch #3 from netdev folks.
patch #2 implements initial version of IR/IR resume support.
Best regards,
Maxim Levitsky
^ permalink raw reply
* Re: [PATCH] econet: Move to staging; remove from defconfig
From: Greg KH @ 2010-11-28 0:21 UTC (permalink / raw)
To: Ben Hutchings
Cc: David Miller, netdev, devel, linux-arm-kernel,
Debian kernel maintainers
In-Reply-To: <1290897868.3292.59.camel@localhost>
On Sat, Nov 27, 2010 at 10:44:28PM +0000, Ben Hutchings wrote:
> Recent review has revealed several bugs in econet and other obscure
> protocol implementations that can be exploited by local users for
> denial of service or privilege escalation.
>
> The econet protocol (PF_ECONET) is unmaintained. There appear to be
> no published applications for it, and it has never progressed beyond
> 'experimental' status.
>
> This protocol generally should not be enabled by distributions, since
> the cost of a security flaw affecting all installed systems presumably
> outweighs the benefit to the few (if any) legitimate users.
>
> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> ---
> As requested, I'm actually renaming the directory this time. I also
> noticed that ECONET was enabled in a couple of ARM defconfigs and
> explicitly disabled in various other defconfigs, so I've removed those
> lines as well.
>
> This is based on linux-next; I hope it applies to staging.
>
> Ben.
>
> arch/arm/configs/ixp4xx_defconfig | 3 ---
> arch/arm/configs/pnx4008_defconfig | 3 ---
> arch/mips/configs/gpr_defconfig | 3 ---
> arch/mips/configs/mtx1_defconfig | 3 ---
> arch/um/defconfig | 1 -
> arch/xtensa/configs/common_defconfig | 1 -
> arch/xtensa/configs/iss_defconfig | 1 -
> arch/xtensa/configs/s6105_defconfig | 1 -
No need to change the defconfigs, they will get updated on their own if
they need to be.
> drivers/staging/Kconfig | 2 ++
> drivers/staging/Makefile | 1 +
> {net => drivers/staging}/econet/Kconfig | 0
> {net => drivers/staging}/econet/Makefile | 0
> {net => drivers/staging}/econet/af_econet.c | 0
> net/Kconfig | 1 -
> net/Makefile | 1 -
> 15 files changed, 3 insertions(+), 18 deletions(-)
> rename {net => drivers/staging}/econet/Kconfig (100%)
> rename {net => drivers/staging}/econet/Makefile (100%)
> rename {net => drivers/staging}/econet/af_econet.c (100%)
>
> diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
> index 5c50239..bd85c32 100644
> --- a/arch/arm/configs/ixp4xx_defconfig
> +++ b/arch/arm/configs/ixp4xx_defconfig
> @@ -88,9 +88,6 @@ CONFIG_IPDDP_ENCAP=y
> CONFIG_IPDDP_DECAP=y
> CONFIG_X25=m
> CONFIG_LAPB=m
> -CONFIG_ECONET=m
> -CONFIG_ECONET_AUNUDP=y
> -CONFIG_ECONET_NATIVE=y
Doesn't this imply that someone is actually using this?
> CONFIG_WAN_ROUTER=m
> CONFIG_NET_SCHED=y
> CONFIG_NET_SCH_CBQ=m
> diff --git a/arch/arm/configs/pnx4008_defconfig b/arch/arm/configs/pnx4008_defconfig
> index bd481f0..8301e4a 100644
> --- a/arch/arm/configs/pnx4008_defconfig
> +++ b/arch/arm/configs/pnx4008_defconfig
> @@ -101,9 +101,6 @@ CONFIG_IPDDP_ENCAP=y
> CONFIG_IPDDP_DECAP=y
> CONFIG_X25=m
> CONFIG_LAPB=m
> -CONFIG_ECONET=m
> -CONFIG_ECONET_AUNUDP=y
> -CONFIG_ECONET_NATIVE=y
Same here and for the others.
I also need a TODO file for the staging directory location (see the
others for drivers that are going away as an example.)
And I need an ack from the networking maintainer to be able to accept
this also.
thanks,
greg k-h
^ permalink raw reply
* Re: Regression 2.6.36 - driver rtl8169 crashes kernel, triggered by user app
From: Jarek Poplawski @ 2010-11-27 22:44 UTC (permalink / raw)
To: Francois Romieu; +Cc: Michael Monnerie, linux-kernel, netdev
In-Reply-To: <20101127215219.GA2691@electric-eye.fr.zoreil.com>
Francois Romieu wrote:
> Michael Monnerie <michael.monnerie@is.it-management.at> :
>> This is the 3rd time I send this, and I did not get any answer.
>
> What about changing your mx blacklisting policy or checking the mailing-list
> archive (http://marc.info/?t=128950098300003) ?
Maybe some artificial intelligence in the driver? ;-)
Jarek P.
>
>> I thought *regressions* are a bad thing that would be handled quickly?
>
> You are strongly suggested to try current -git kernel. A regression
> with similar symptoms has already been fixed.
>
>> Maybe this helps: *SHITTY DRIVER NOT WORKING ANYMORE*
>
> It does not help, Krusty. Try running for Congress.
>
^ permalink raw reply
* [PATCH] econet: Move to staging; remove from defconfig
From: Ben Hutchings @ 2010-11-27 22:44 UTC (permalink / raw)
To: Greg KH
Cc: David Miller, netdev, devel, linux-arm-kernel,
Debian kernel maintainers
Recent review has revealed several bugs in econet and other obscure
protocol implementations that can be exploited by local users for
denial of service or privilege escalation.
The econet protocol (PF_ECONET) is unmaintained. There appear to be
no published applications for it, and it has never progressed beyond
'experimental' status.
This protocol generally should not be enabled by distributions, since
the cost of a security flaw affecting all installed systems presumably
outweighs the benefit to the few (if any) legitimate users.
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
As requested, I'm actually renaming the directory this time. I also
noticed that ECONET was enabled in a couple of ARM defconfigs and
explicitly disabled in various other defconfigs, so I've removed those
lines as well.
This is based on linux-next; I hope it applies to staging.
Ben.
arch/arm/configs/ixp4xx_defconfig | 3 ---
arch/arm/configs/pnx4008_defconfig | 3 ---
arch/mips/configs/gpr_defconfig | 3 ---
arch/mips/configs/mtx1_defconfig | 3 ---
arch/um/defconfig | 1 -
arch/xtensa/configs/common_defconfig | 1 -
arch/xtensa/configs/iss_defconfig | 1 -
arch/xtensa/configs/s6105_defconfig | 1 -
drivers/staging/Kconfig | 2 ++
drivers/staging/Makefile | 1 +
{net => drivers/staging}/econet/Kconfig | 0
{net => drivers/staging}/econet/Makefile | 0
{net => drivers/staging}/econet/af_econet.c | 0
net/Kconfig | 1 -
net/Makefile | 1 -
15 files changed, 3 insertions(+), 18 deletions(-)
rename {net => drivers/staging}/econet/Kconfig (100%)
rename {net => drivers/staging}/econet/Makefile (100%)
rename {net => drivers/staging}/econet/af_econet.c (100%)
diff --git a/arch/arm/configs/ixp4xx_defconfig b/arch/arm/configs/ixp4xx_defconfig
index 5c50239..bd85c32 100644
--- a/arch/arm/configs/ixp4xx_defconfig
+++ b/arch/arm/configs/ixp4xx_defconfig
@@ -88,9 +88,6 @@ CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
CONFIG_X25=m
CONFIG_LAPB=m
-CONFIG_ECONET=m
-CONFIG_ECONET_AUNUDP=y
-CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=m
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
diff --git a/arch/arm/configs/pnx4008_defconfig b/arch/arm/configs/pnx4008_defconfig
index bd481f0..8301e4a 100644
--- a/arch/arm/configs/pnx4008_defconfig
+++ b/arch/arm/configs/pnx4008_defconfig
@@ -101,9 +101,6 @@ CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
CONFIG_X25=m
CONFIG_LAPB=m
-CONFIG_ECONET=m
-CONFIG_ECONET_AUNUDP=y
-CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=m
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
diff --git a/arch/mips/configs/gpr_defconfig b/arch/mips/configs/gpr_defconfig
index 53edc13..9f9aa97 100644
--- a/arch/mips/configs/gpr_defconfig
+++ b/arch/mips/configs/gpr_defconfig
@@ -116,9 +116,6 @@ CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
CONFIG_X25=m
CONFIG_LAPB=m
-CONFIG_ECONET=m
-CONFIG_ECONET_AUNUDP=y
-CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=m
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
diff --git a/arch/mips/configs/mtx1_defconfig b/arch/mips/configs/mtx1_defconfig
index 8146997..79cfb0b 100644
--- a/arch/mips/configs/mtx1_defconfig
+++ b/arch/mips/configs/mtx1_defconfig
@@ -154,9 +154,6 @@ CONFIG_IPDDP_ENCAP=y
CONFIG_IPDDP_DECAP=y
CONFIG_X25=m
CONFIG_LAPB=m
-CONFIG_ECONET=m
-CONFIG_ECONET_AUNUDP=y
-CONFIG_ECONET_NATIVE=y
CONFIG_WAN_ROUTER=m
CONFIG_NET_SCHED=y
CONFIG_NET_SCH_CBQ=m
diff --git a/arch/um/defconfig b/arch/um/defconfig
index 564f3de..1fd4718 100644
--- a/arch/um/defconfig
+++ b/arch/um/defconfig
@@ -296,7 +296,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_SCHED is not set
diff --git a/arch/xtensa/configs/common_defconfig b/arch/xtensa/configs/common_defconfig
index 1d230ee..8c8916c 100644
--- a/arch/xtensa/configs/common_defconfig
+++ b/arch/xtensa/configs/common_defconfig
@@ -239,7 +239,6 @@ CONFIG_IP_PNP_RARP=y
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
# CONFIG_NET_DIVERT is not set
-# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
#
diff --git a/arch/xtensa/configs/iss_defconfig b/arch/xtensa/configs/iss_defconfig
index 7368164..de0c75f 100644
--- a/arch/xtensa/configs/iss_defconfig
+++ b/arch/xtensa/configs/iss_defconfig
@@ -249,7 +249,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_PHONET is not set
# CONFIG_IEEE802154 is not set
diff --git a/arch/xtensa/configs/s6105_defconfig b/arch/xtensa/configs/s6105_defconfig
index bb84fbc..c273505 100644
--- a/arch/xtensa/configs/s6105_defconfig
+++ b/arch/xtensa/configs/s6105_defconfig
@@ -204,7 +204,6 @@ CONFIG_DEFAULT_TCP_CONG="cubic"
# CONFIG_ATALK is not set
# CONFIG_X25 is not set
# CONFIG_LAPB is not set
-# CONFIG_ECONET is not set
# CONFIG_WAN_ROUTER is not set
# CONFIG_NET_SCHED is not set
# CONFIG_DCB is not set
diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index 9f83e21..695110d 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -192,5 +192,7 @@ source "drivers/staging/cptm1217/Kconfig"
source "drivers/staging/ste_rmi4/Kconfig"
+source "drivers/staging/econet/Kconfig"
+
endif # !STAGING_EXCLUDE_BUILD
endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 75c0c1f..03f08ed 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -71,3 +71,4 @@ obj-$(CONFIG_SND_INTEL_SST) += intel_sst/
obj-$(CONFIG_SPEAKUP) += speakup/
obj-$(CONFIG_TOUCHSCREEN_CLEARPAD_TM1217) += cptm1217/
obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_I2C_RMI4) += ste_rmi4/
+obj-$(CONFIG_ECONET) += econet/
diff --git a/net/econet/Kconfig b/drivers/staging/econet/Kconfig
similarity index 100%
rename from net/econet/Kconfig
rename to drivers/staging/econet/Kconfig
diff --git a/net/econet/Makefile b/drivers/staging/econet/Makefile
similarity index 100%
rename from net/econet/Makefile
rename to drivers/staging/econet/Makefile
diff --git a/net/econet/af_econet.c b/drivers/staging/econet/af_econet.c
similarity index 100%
rename from net/econet/af_econet.c
rename to drivers/staging/econet/af_econet.c
diff --git a/net/Kconfig b/net/Kconfig
index 5e203b5..4d5b5ed 100644
--- a/net/Kconfig
+++ b/net/Kconfig
@@ -207,7 +207,6 @@ source "net/ipx/Kconfig"
source "drivers/net/appletalk/Kconfig"
source "net/x25/Kconfig"
source "net/lapb/Kconfig"
-source "net/econet/Kconfig"
source "net/wanrouter/Kconfig"
source "net/phonet/Kconfig"
source "net/ieee802154/Kconfig"
diff --git a/net/Makefile b/net/Makefile
index 6b7bfd7..0f4ed79 100644
--- a/net/Makefile
+++ b/net/Makefile
@@ -42,7 +42,6 @@ obj-$(CONFIG_AF_RXRPC) += rxrpc/
obj-$(CONFIG_ATM) += atm/
obj-$(CONFIG_L2TP) += l2tp/
obj-$(CONFIG_DECNET) += decnet/
-obj-$(CONFIG_ECONET) += econet/
obj-$(CONFIG_PHONET) += phonet/
ifneq ($(CONFIG_VLAN_8021Q),)
obj-y += 8021q/
--
1.7.2.3
^ permalink raw reply related
* Re: Regression 2.6.36 - driver rtl8169 crashes kernel, triggered by user app
From: Francois Romieu @ 2010-11-27 21:52 UTC (permalink / raw)
To: Michael Monnerie; +Cc: linux-kernel, netdev
In-Reply-To: <201011272122.28164@zmi.at>
Michael Monnerie <michael.monnerie@is.it-management.at> :
> This is the 3rd time I send this, and I did not get any answer.
What about changing your mx blacklisting policy or checking the mailing-list
archive (http://marc.info/?t=128950098300003) ?
> I thought *regressions* are a bad thing that would be handled quickly?
You are strongly suggested to try current -git kernel. A regression
with similar symptoms has already been fixed.
> Maybe this helps: *SHITTY DRIVER NOT WORKING ANYMORE*
It does not help, Krusty. Try running for Congress.
--
Ueimor
^ permalink raw reply
* Re: linux-next: Tree for November 26
From: Mariusz Kozlowski @ 2010-11-27 20:55 UTC (permalink / raw)
To: Jarek Poplawski
Cc: Zimny Lech, Stephen Rothwell, linux-next, LKML, Shreyas Bhatewara,
VMware, Inc., netdev
In-Reply-To: <4CF155CF.5090601@gmail.com>
On Sat, Nov 27, 2010 at 08:02:39PM +0100, Jarek Poplawski wrote:
> Zimny Lech wrote:
> ...
> > --
> > Slawa!
> > Zimny "Żyj i pozwól umrzeć" Lech z Wawelu
>
> FYI:
> http://www.kernel.org/pub/linux/docs/lkml/#s3-12
Also:
- be brave and use your real name
- change your email address to something that is not offending to people
who can read Polish
Too bad we have this in git history already.
--
Mariusz Kozlowski
^ permalink raw reply
* [PATCH] vmxnet3: fix compilation when RSS is disabled
From: Scott J. Goldman @ 2010-11-27 20:33 UTC (permalink / raw)
To: netdev, linux-kernel, linux-next
Cc: pv-drivers, randy.dunlap, Scott J. Goldman
In-Reply-To: <1290890035-32285-1-git-send-email-scottjg@vmware.com>
If RSS is disabled, we can ifdef out some RSS specific code. This fixes
the compile error found by Randy Dunlap.
Signed-off-by: Scott J. Goldman <scottjg@vmware.com>
---
drivers/net/vmxnet3/vmxnet3_ethtool.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/drivers/net/vmxnet3/vmxnet3_ethtool.c b/drivers/net/vmxnet3/vmxnet3_ethtool.c
index 9ddaea6..8e17fc8 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethtool.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethtool.c
@@ -553,7 +553,7 @@ vmxnet3_get_rxnfc(struct net_device *netdev, struct ethtool_rxnfc *info,
return -EOPNOTSUPP;
}
-
+#ifdef VMXNET3_RSS
static int
vmxnet3_get_rss_indir(struct net_device *netdev,
struct ethtool_rxfh_indir *p)
@@ -598,6 +598,7 @@ vmxnet3_set_rss_indir(struct net_device *netdev,
return 0;
}
+#endif
static struct ethtool_ops vmxnet3_ethtool_ops = {
.get_settings = vmxnet3_get_settings,
@@ -623,8 +624,10 @@ static struct ethtool_ops vmxnet3_ethtool_ops = {
.get_ringparam = vmxnet3_get_ringparam,
.set_ringparam = vmxnet3_set_ringparam,
.get_rxnfc = vmxnet3_get_rxnfc,
+#ifdef VMXNET3_RSS
.get_rxfh_indir = vmxnet3_get_rss_indir,
.set_rxfh_indir = vmxnet3_set_rss_indir,
+#endif
};
void vmxnet3_set_ethtool_ops(struct net_device *netdev)
--
1.7.0.4
^ permalink raw reply related
* [PATCH net-next] vmxnet3: fix compilation when RSS is disabled
From: Scott J. Goldman @ 2010-11-27 20:33 UTC (permalink / raw)
To: netdev, linux-kernel, linux-next; +Cc: pv-drivers, randy.dunlap
Since this was reported on linux-next, we may want to merge it there too.
^ permalink raw reply
* Regression 2.6.36 - driver rtl8169 crashes kernel, triggered by user app
From: Michael Monnerie @ 2010-11-27 20:22 UTC (permalink / raw)
To: linux-kernel; +Cc: romieu, netdev
[-- Attachment #1: Type: text/plain, Size: 1481 bytes --]
This is the 3rd time I send this, and I did not get any answer.
I thought *regressions* are a bad thing that would be handled quickly?
Maybe this helps: *SHITTY DRIVER NOT WORKING ANYMORE*
Dear list, I've hunted down a bug which does *NOT* occur in kernel
2.6.34.7-0.5-desktop from openSUSE 11.3, but crashes stock kernel 2.6.36
triggered by a user!
It's actually very simple. From my desktop (kernel 2.6.36) I "cd" to an
NFS4 share, where a xz compressed image of Win7-64.iso.xz is located.
# cd /q/iso-images
and then I try to uncompress it there (as user, not root!):
# xz -kv Win7-64.iso.xz
With kernel 2.6.34.7-0.5-desktop, this runs with ~41MiB/s without
problems.
With kernel 2.6.36, it runs at ~26MiB/s, and while doing so, dmesg shows
a lot of noise about r8169 complaining:
http://zmi.at/x/kernel2.6.36-crash86.jpg
Here are 2 pictures of different crashes:
http://zmi.at/x/kernel2.6.36-crash84.jpg
http://zmi.at/x/kernel2.6.36-crash85.jpg
Neither the dmesg-messages nor the crash happens with kernel
2.6.34.7-0.5-desktop as delivered by openSUSE 11.3, but it always fully
crashes 2.6.36. I've retried about 10 times, it *never* finished to
uncompress the ~3GB image. At around 500-1000MB the kernel was gone.
I'm sure someone knows how to fix it. :-)
--
mit freundlichen Grüssen,
Michael Monnerie, Ing. BSc
it-management Internet Services
http://proteger.at [gesprochen: Prot-e-schee]
Tel: 0660 / 415 65 31
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH 5/6] forcedeth: use KERN_ facility level in printk
From: Joe Perches @ 2010-11-27 19:45 UTC (permalink / raw)
To: Ben Hutchings; +Cc: Szymon Janc, netdev
In-Reply-To: <1290884641.3292.0.camel@localhost>
On Sat, 2010-11-27 at 19:04 +0000, Ben Hutchings wrote:
> On Sat, 2010-11-27 at 19:39 +0100, Szymon Janc wrote:
> > diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> > index 2f092d7..a2b6681 100644
> > --- a/drivers/net/forcedeth.c
> > +++ b/drivers/net/forcedeth.c
> > @@ -958,7 +958,7 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
> > delaymax -= delay;
> > if (delaymax < 0) {
> > if (msg)
> > - printk("%s", msg);
> > + printk(KERN_WARNING "%s", msg);
> No, msg already includes a log level.
True. The messages are still broken though.
Some have trailing newlines, others not.
It'd be better to move the msg after the reg_delay
call and add the missing newlines.
---
drivers/net/forcedeth.c | 28 +++++++++++++---------------
1 files changed, 13 insertions(+), 15 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 0fa1776..2d11028f 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -948,7 +948,7 @@ static bool nv_optimized(struct fe_priv *np)
}
static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
- int delay, int delaymax, const char *msg)
+ int delay, int delaymax)
{
u8 __iomem *base = get_hwbase(dev);
@@ -956,11 +956,8 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
do {
udelay(delay);
delaymax -= delay;
- if (delaymax < 0) {
- if (msg)
- printk("%s", msg);
+ if (delaymax < 0)
return 1;
- }
} while ((readl(base + offset) & mask) != target);
return 0;
}
@@ -1145,7 +1142,7 @@ static int mii_rw(struct net_device *dev, int addr, int miireg, int value)
writel(reg, base + NvRegMIIControl);
if (reg_delay(dev, NvRegMIIControl, NVREG_MIICTL_INUSE, 0,
- NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX, NULL)) {
+ NV_MIIPHY_DELAY, NV_MIIPHY_DELAYMAX)) {
dprintk(KERN_DEBUG "%s: mii_rw of reg %d at PHY %d timed out.\n",
dev->name, miireg, addr);
retval = -1;
@@ -1547,9 +1544,9 @@ static void nv_stop_rx(struct net_device *dev)
else
rx_ctrl |= NVREG_RCVCTL_RX_PATH_EN;
writel(rx_ctrl, base + NvRegReceiverControl);
- reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
- NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX,
- KERN_INFO "nv_stop_rx: ReceiverStatus remained busy");
+ if (reg_delay(dev, NvRegReceiverStatus, NVREG_RCVSTAT_BUSY, 0,
+ NV_RXSTOP_DELAY1, NV_RXSTOP_DELAY1MAX))
+ printk(KERN_INFO "nv_stop_rx: ReceiverStatus remained busy\n");
udelay(NV_RXSTOP_DELAY2);
if (!np->mac_in_use)
@@ -1582,9 +1579,9 @@ static void nv_stop_tx(struct net_device *dev)
else
tx_ctrl |= NVREG_XMITCTL_TX_PATH_EN;
writel(tx_ctrl, base + NvRegTransmitterControl);
- reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0,
- NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX,
- KERN_INFO "nv_stop_tx: TransmitterStatus remained busy");
+ if (reg_delay(dev, NvRegTransmitterStatus, NVREG_XMITSTAT_BUSY, 0,
+ NV_TXSTOP_DELAY1, NV_TXSTOP_DELAY1MAX))
+ printk(KERN_INFO "nv_stop_tx: TransmitterStatus remained busy\n");
udelay(NV_TXSTOP_DELAY2);
if (!np->mac_in_use)
@@ -5216,9 +5213,10 @@ static int nv_open(struct net_device *dev)
writel(np->vlanctl_bits, base + NvRegVlanControl);
pci_push(base);
writel(NVREG_TXRXCTL_BIT1|np->txrxctl_bits, base + NvRegTxRxControl);
- reg_delay(dev, NvRegUnknownSetupReg5, NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP5_BIT31,
- NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX,
- KERN_INFO "open: SetupReg5, Bit 31 remained off\n");
+ if (reg_delay(dev, NvRegUnknownSetupReg5,
+ NVREG_UNKSETUP5_BIT31, NVREG_UNKSETUP5_BIT31,
+ NV_SETUP5_DELAY, NV_SETUP5_DELAYMAX))
+ printk(KERN_INFO "open: SetupReg5, Bit 31 remained off\n");
writel(0, base + NvRegMIIMask);
writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
^ permalink raw reply related
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
From: Michael Büsch @ 2010-11-27 19:27 UTC (permalink / raw)
To: Ralf Baechle; +Cc: Hauke Mehrtens, linux-mips, netdev
In-Reply-To: <20101127192407.GA7175@linux-mips.org>
On Sat, 2010-11-27 at 19:24 +0000, Ralf Baechle wrote:
> On Sat, Nov 27, 2010 at 07:11:38PM +0000, Ralf Baechle wrote:
>
> > On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> > > Date: Sat, 27 Nov 2010 19:26:32 +0100
> > > From: Hauke Mehrtens <hauke@hauke-m.de>
> > > To: ralf@linux-mips.org, linux-mips@linux-mips.org
> > > Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> > > Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
> >
> > This has been applied in August, so bitbucket.
>
> Sorry - there was a different patch of similar subject which I accepted.
> Will feed this one upstream after I seen an ACK from one of the SSB/BCM47xx
> folks.
Acked-by: Michael Buesch <mb@bu3sch.de>
--
Greetings Michael.
^ permalink raw reply
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
From: Ralf Baechle @ 2010-11-27 19:24 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, mb, netdev
In-Reply-To: <20101127191138.GB4867@linux-mips.org>
On Sat, Nov 27, 2010 at 07:11:38PM +0000, Ralf Baechle wrote:
> On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> > Date: Sat, 27 Nov 2010 19:26:32 +0100
> > From: Hauke Mehrtens <hauke@hauke-m.de>
> > To: ralf@linux-mips.org, linux-mips@linux-mips.org
> > Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> > Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
>
> This has been applied in August, so bitbucket.
Sorry - there was a different patch of similar subject which I accepted.
Will feed this one upstream after I seen an ACK from one of the SSB/BCM47xx
folks.
Ralf
^ permalink raw reply
* Re: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
From: Ralf Baechle @ 2010-11-27 19:11 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-mips, mb, netdev
In-Reply-To: <1290882392-28327-1-git-send-email-hauke@hauke-m.de>
On Sat, Nov 27, 2010 at 07:26:32PM +0100, Hauke Mehrtens wrote:
> Date: Sat, 27 Nov 2010 19:26:32 +0100
> From: Hauke Mehrtens <hauke@hauke-m.de>
> To: ralf@linux-mips.org, linux-mips@linux-mips.org
> Cc: mb@bu3sch.de, netdev@vger.kernel.org, Hauke Mehrtens <hauke@hauke-m.de>
> Subject: [PATCH RESEND] ssb: fix nvram_get on bcm47xx platform
This has been applied in August, so bitbucket.
Ralf
^ permalink raw reply
* Re: [PATCH 5/6] forcedeth: use KERN_ facility level in printk
From: Ben Hutchings @ 2010-11-27 19:04 UTC (permalink / raw)
To: Szymon Janc; +Cc: netdev
In-Reply-To: <1290883188-2078-6-git-send-email-szymon@janc.net.pl>
On Sat, 2010-11-27 at 19:39 +0100, Szymon Janc wrote:
> Signed-off-by: Szymon Janc <szymon@janc.net.pl>
> ---
> drivers/net/forcedeth.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
> index 2f092d7..a2b6681 100644
> --- a/drivers/net/forcedeth.c
> +++ b/drivers/net/forcedeth.c
> @@ -958,7 +958,7 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
> delaymax -= delay;
> if (delaymax < 0) {
> if (msg)
> - printk("%s", msg);
> + printk(KERN_WARNING "%s", msg);
No, msg already includes a log level.
Ben.
> return 1;
> }
> } while ((readl(base + offset) & mask) != target);
--
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: linux-next: Tree for November 26
From: Jarek Poplawski @ 2010-11-27 19:02 UTC (permalink / raw)
To: Zimny Lech
Cc: Stephen Rothwell, linux-next, LKML, Shreyas Bhatewara,
VMware, Inc., netdev
In-Reply-To: <AANLkTinJUT=j_P9FSB=GWTLy4Bkr68iWmB2O=5Q3gcT-@mail.gmail.com>
Zimny Lech wrote:
...
> --
> Slawa!
> Zimny "Żyj i pozwól umrzeć" Lech z Wawelu
FYI:
http://www.kernel.org/pub/linux/docs/lkml/#s3-12
Jarek P.
^ permalink raw reply
* [PATCH 1/6] forcedeth: fix multiple code style issues
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 301 +++++++++++++++++++++--------------------------
1 files changed, 135 insertions(+), 166 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 0fa1776..87757c8 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -186,9 +186,9 @@ enum {
NvRegSlotTime = 0x9c,
#define NVREG_SLOTTIME_LEGBF_ENABLED 0x80000000
#define NVREG_SLOTTIME_10_100_FULL 0x00007f00
-#define NVREG_SLOTTIME_1000_FULL 0x0003ff00
+#define NVREG_SLOTTIME_1000_FULL 0x0003ff00
#define NVREG_SLOTTIME_HALF 0x0000ff00
-#define NVREG_SLOTTIME_DEFAULT 0x00007f00
+#define NVREG_SLOTTIME_DEFAULT 0x00007f00
#define NVREG_SLOTTIME_MASK 0x000000ff
NvRegTxDeferral = 0xA0,
@@ -297,7 +297,7 @@ enum {
#define NVREG_WAKEUPFLAGS_ENABLE 0x1111
NvRegMgmtUnitGetVersion = 0x204,
-#define NVREG_MGMTUNITGETVERSION 0x01
+#define NVREG_MGMTUNITGETVERSION 0x01
NvRegMgmtUnitVersion = 0x208,
#define NVREG_MGMTUNITVERSION 0x08
NvRegPowerCap = 0x268,
@@ -368,8 +368,8 @@ struct ring_desc_ex {
};
union ring_type {
- struct ring_desc* orig;
- struct ring_desc_ex* ex;
+ struct ring_desc *orig;
+ struct ring_desc_ex *ex;
};
#define FLAG_MASK_V1 0xffff0000
@@ -444,10 +444,10 @@ union ring_type {
#define NV_RX3_VLAN_TAG_MASK (0x0000FFFF)
/* Miscelaneous hardware related defines: */
-#define NV_PCI_REGSZ_VER1 0x270
-#define NV_PCI_REGSZ_VER2 0x2d4
-#define NV_PCI_REGSZ_VER3 0x604
-#define NV_PCI_REGSZ_MAX 0x604
+#define NV_PCI_REGSZ_VER1 0x270
+#define NV_PCI_REGSZ_VER2 0x2d4
+#define NV_PCI_REGSZ_VER3 0x604
+#define NV_PCI_REGSZ_MAX 0x604
/* various timeout delays: all in usec */
#define NV_TXRX_RESET_DELAY 4
@@ -717,7 +717,7 @@ static const struct register_test nv_registers_test[] = {
{ NvRegMulticastAddrA, 0xffffffff },
{ NvRegTxWatermark, 0x0ff },
{ NvRegWakeUpFlags, 0x07777 },
- { 0,0 }
+ { 0, 0 }
};
struct nv_skb_map {
@@ -911,7 +911,7 @@ static int phy_cross = NV_CROSSOVER_DETECTION_DISABLED;
* Power down phy when interface is down (persists through reboot;
* older Linux and other OSes may not power it up again)
*/
-static int phy_power_down = 0;
+static int phy_power_down;
static inline struct fe_priv *get_nvpriv(struct net_device *dev)
{
@@ -984,12 +984,10 @@ static void setup_hw_rings(struct net_device *dev, int rxtx_flags)
u8 __iomem *base = get_hwbase(dev);
if (!nv_optimized(np)) {
- if (rxtx_flags & NV_SETUP_RX_RING) {
+ if (rxtx_flags & NV_SETUP_RX_RING)
writel(dma_low(np->ring_addr), base + NvRegRxRingPhysAddr);
- }
- if (rxtx_flags & NV_SETUP_TX_RING) {
+ if (rxtx_flags & NV_SETUP_TX_RING)
writel(dma_low(np->ring_addr + np->rx_ring_size*sizeof(struct ring_desc)), base + NvRegTxRingPhysAddr);
- }
} else {
if (rxtx_flags & NV_SETUP_RX_RING) {
writel(dma_low(np->ring_addr), base + NvRegRxRingPhysAddr);
@@ -1174,9 +1172,8 @@ static int phy_reset(struct net_device *dev, u32 bmcr_setup)
unsigned int tries = 0;
miicontrol = BMCR_RESET | bmcr_setup;
- if (mii_rw(dev, np->phyaddr, MII_BMCR, miicontrol)) {
+ if (mii_rw(dev, np->phyaddr, MII_BMCR, miicontrol))
return -1;
- }
/* wait for 500ms */
msleep(500);
@@ -1196,7 +1193,7 @@ static int phy_init(struct net_device *dev)
{
struct fe_priv *np = get_nvpriv(dev);
u8 __iomem *base = get_hwbase(dev);
- u32 phyinterface, phy_reserved, mii_status, mii_control, mii_control_1000,reg;
+ u32 phyinterface, phy_reserved, mii_status, mii_control, mii_control_1000, reg;
/* phy errata for E3016 phy */
if (np->phy_model == PHY_MODEL_MARVELL_E3016) {
@@ -1313,8 +1310,7 @@ static int phy_init(struct net_device *dev)
printk(KERN_INFO "%s: phy init failed.\n", pci_name(np->pci_dev));
return PHY_ERROR;
}
- }
- else
+ } else
np->gigabit = 0;
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
@@ -1340,7 +1336,7 @@ static int phy_init(struct net_device *dev)
}
/* phy vendor specific configuration */
- if ((np->phy_oui == PHY_OUI_CICADA) && (phyinterface & PHY_RGMII) ) {
+ if ((np->phy_oui == PHY_OUI_CICADA) && (phyinterface & PHY_RGMII)) {
phy_reserved = mii_rw(dev, np->phyaddr, MII_RESV1, MII_READ);
phy_reserved &= ~(PHY_CICADA_INIT1 | PHY_CICADA_INIT2);
phy_reserved |= (PHY_CICADA_INIT3 | PHY_CICADA_INIT4);
@@ -1501,12 +1497,10 @@ static int phy_init(struct net_device *dev)
/* restart auto negotiation, power down phy */
mii_control = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
mii_control |= (BMCR_ANRESTART | BMCR_ANENABLE);
- if (phy_power_down) {
+ if (phy_power_down)
mii_control |= BMCR_PDOWN;
- }
- if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control)) {
+ if (mii_rw(dev, np->phyaddr, MII_BMCR, mii_control))
return PHY_ERROR;
- }
return 0;
}
@@ -1526,8 +1520,8 @@ static void nv_start_rx(struct net_device *dev)
}
writel(np->linkspeed, base + NvRegLinkSpeed);
pci_push(base);
- rx_ctrl |= NVREG_RCVCTL_START;
- if (np->mac_in_use)
+ rx_ctrl |= NVREG_RCVCTL_START;
+ if (np->mac_in_use)
rx_ctrl &= ~NVREG_RCVCTL_RX_PATH_EN;
writel(rx_ctrl, base + NvRegReceiverControl);
dprintk(KERN_DEBUG "%s: nv_start_rx to duplex %d, speed 0x%08x.\n",
@@ -1745,7 +1739,7 @@ static struct net_device_stats *nv_get_stats(struct net_device *dev)
static int nv_alloc_rx(struct net_device *dev)
{
struct fe_priv *np = netdev_priv(dev);
- struct ring_desc* less_rx;
+ struct ring_desc *less_rx;
less_rx = np->get_rx.orig;
if (less_rx-- == np->first_rx.orig)
@@ -1767,9 +1761,8 @@ static int nv_alloc_rx(struct net_device *dev)
np->put_rx.orig = np->first_rx.orig;
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
np->put_rx_ctx = np->first_rx_ctx;
- } else {
+ } else
return 1;
- }
}
return 0;
}
@@ -1777,7 +1770,7 @@ static int nv_alloc_rx(struct net_device *dev)
static int nv_alloc_rx_optimized(struct net_device *dev)
{
struct fe_priv *np = netdev_priv(dev);
- struct ring_desc_ex* less_rx;
+ struct ring_desc_ex *less_rx;
less_rx = np->get_rx.ex;
if (less_rx-- == np->first_rx.ex)
@@ -1800,9 +1793,8 @@ static int nv_alloc_rx_optimized(struct net_device *dev)
np->put_rx.ex = np->first_rx.ex;
if (unlikely(np->put_rx_ctx++ == np->last_rx_ctx))
np->put_rx_ctx = np->first_rx_ctx;
- } else {
+ } else
return 1;
- }
}
return 0;
}
@@ -2018,24 +2010,24 @@ static void nv_legacybackoff_reseed(struct net_device *dev)
/* Known Good seed sets */
static const u32 main_seedset[BACKOFF_SEEDSET_ROWS][BACKOFF_SEEDSET_LFSRS] = {
- {145, 155, 165, 175, 185, 196, 235, 245, 255, 265, 275, 285, 660, 690, 874},
- {245, 255, 265, 575, 385, 298, 335, 345, 355, 366, 375, 385, 761, 790, 974},
- {145, 155, 165, 175, 185, 196, 235, 245, 255, 265, 275, 285, 660, 690, 874},
- {245, 255, 265, 575, 385, 298, 335, 345, 355, 366, 375, 386, 761, 790, 974},
- {266, 265, 276, 585, 397, 208, 345, 355, 365, 376, 385, 396, 771, 700, 984},
- {266, 265, 276, 586, 397, 208, 346, 355, 365, 376, 285, 396, 771, 700, 984},
- {366, 365, 376, 686, 497, 308, 447, 455, 466, 476, 485, 496, 871, 800, 84},
- {466, 465, 476, 786, 597, 408, 547, 555, 566, 576, 585, 597, 971, 900, 184}};
+ {145, 155, 165, 175, 185, 196, 235, 245, 255, 265, 275, 285, 660, 690, 874},
+ {245, 255, 265, 575, 385, 298, 335, 345, 355, 366, 375, 385, 761, 790, 974},
+ {145, 155, 165, 175, 185, 196, 235, 245, 255, 265, 275, 285, 660, 690, 874},
+ {245, 255, 265, 575, 385, 298, 335, 345, 355, 366, 375, 386, 761, 790, 974},
+ {266, 265, 276, 585, 397, 208, 345, 355, 365, 376, 385, 396, 771, 700, 984},
+ {266, 265, 276, 586, 397, 208, 346, 355, 365, 376, 285, 396, 771, 700, 984},
+ {366, 365, 376, 686, 497, 308, 447, 455, 466, 476, 485, 496, 871, 800, 84},
+ {466, 465, 476, 786, 597, 408, 547, 555, 566, 576, 585, 597, 971, 900, 184} };
static const u32 gear_seedset[BACKOFF_SEEDSET_ROWS][BACKOFF_SEEDSET_LFSRS] = {
- {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
- {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
- {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 397},
- {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
- {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
- {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
- {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
- {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395}};
+ {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
+ {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
+ {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 397},
+ {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
+ {251, 262, 273, 324, 319, 508, 375, 364, 341, 371, 398, 193, 375, 30, 295},
+ {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
+ {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395},
+ {351, 375, 373, 469, 551, 639, 477, 464, 441, 472, 498, 293, 476, 130, 395} };
static void nv_gear_backoff_reseed(struct net_device *dev)
{
@@ -2083,13 +2075,12 @@ static void nv_gear_backoff_reseed(struct net_device *dev)
temp = NVREG_BKOFFCTRL_DEFAULT | (0 << NVREG_BKOFFCTRL_SELECT);
temp |= combinedSeed & NVREG_BKOFFCTRL_SEED_MASK;
temp |= combinedSeed >> NVREG_BKOFFCTRL_GEAR;
- writel(temp,base + NvRegBackOffControl);
+ writel(temp, base + NvRegBackOffControl);
- /* Setup seeds for all gear LFSRs. */
+ /* Setup seeds for all gear LFSRs. */
get_random_bytes(&seedset, sizeof(seedset));
seedset = seedset % BACKOFF_SEEDSET_ROWS;
- for (i = 1; i <= BACKOFF_SEEDSET_LFSRS; i++)
- {
+ for (i = 1; i <= BACKOFF_SEEDSET_LFSRS; i++) {
temp = NVREG_BKOFFCTRL_DEFAULT | (i << NVREG_BKOFFCTRL_SELECT);
temp |= main_seedset[seedset][i-1] & 0x3ff;
temp |= ((gear_seedset[seedset][i-1] & 0x3ff) << NVREG_BKOFFCTRL_GEAR);
@@ -2113,10 +2104,10 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
u32 size = skb_headlen(skb);
u32 entries = (size >> NV_TX2_TSO_MAX_SHIFT) + ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
u32 empty_slots;
- struct ring_desc* put_tx;
- struct ring_desc* start_tx;
- struct ring_desc* prev_tx;
- struct nv_skb_map* prev_tx_ctx;
+ struct ring_desc *put_tx;
+ struct ring_desc *start_tx;
+ struct ring_desc *prev_tx;
+ struct nv_skb_map *prev_tx_ctx;
unsigned long flags;
/* add fragments to entries count */
@@ -2208,10 +2199,10 @@ static netdev_tx_t nv_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev->name, entries, tx_flags_extra);
{
int j;
- for (j=0; j<64; j++) {
+ for (j = 0; j < 64; j++) {
if ((j%16) == 0)
dprintk("\n%03x:", j);
- dprintk(" %02x", ((unsigned char*)skb->data)[j]);
+ dprintk(" %02x", ((unsigned char *)skb->data)[j]);
}
dprintk("\n");
}
@@ -2233,11 +2224,11 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
u32 size = skb_headlen(skb);
u32 entries = (size >> NV_TX2_TSO_MAX_SHIFT) + ((size & (NV_TX2_TSO_MAX_SIZE-1)) ? 1 : 0);
u32 empty_slots;
- struct ring_desc_ex* put_tx;
- struct ring_desc_ex* start_tx;
- struct ring_desc_ex* prev_tx;
- struct nv_skb_map* prev_tx_ctx;
- struct nv_skb_map* start_tx_ctx;
+ struct ring_desc_ex *put_tx;
+ struct ring_desc_ex *start_tx;
+ struct ring_desc_ex *prev_tx;
+ struct nv_skb_map *prev_tx_ctx;
+ struct nv_skb_map *start_tx_ctx;
unsigned long flags;
/* add fragments to entries count */
@@ -2359,10 +2350,10 @@ static netdev_tx_t nv_start_xmit_optimized(struct sk_buff *skb,
dev->name, entries, tx_flags_extra);
{
int j;
- for (j=0; j<64; j++) {
+ for (j = 0; j < 64; j++) {
if ((j%16) == 0)
dprintk("\n%03x:", j);
- dprintk(" %02x", ((unsigned char*)skb->data)[j]);
+ dprintk(" %02x", ((unsigned char *)skb->data)[j]);
}
dprintk("\n");
}
@@ -2399,7 +2390,7 @@ static int nv_tx_done(struct net_device *dev, int limit)
struct fe_priv *np = netdev_priv(dev);
u32 flags;
int tx_work = 0;
- struct ring_desc* orig_get_tx = np->get_tx.orig;
+ struct ring_desc *orig_get_tx = np->get_tx.orig;
while ((np->get_tx.orig != np->put_tx.orig) &&
!((flags = le32_to_cpu(np->get_tx.orig->flaglen)) & NV_TX_VALID) &&
@@ -2464,7 +2455,7 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
struct fe_priv *np = netdev_priv(dev);
u32 flags;
int tx_work = 0;
- struct ring_desc_ex* orig_get_tx = np->get_tx.ex;
+ struct ring_desc_ex *orig_get_tx = np->get_tx.ex;
while ((np->get_tx.ex != np->put_tx.ex) &&
!((flags = le32_to_cpu(np->get_tx.ex->flaglen)) & NV_TX2_VALID) &&
@@ -2491,9 +2482,8 @@ static int nv_tx_done_optimized(struct net_device *dev, int limit)
np->get_tx_ctx->skb = NULL;
tx_work++;
- if (np->tx_limit) {
+ if (np->tx_limit)
nv_tx_flip_ownership(dev);
- }
}
if (unlikely(np->get_tx.ex++ == np->last_tx.ex))
np->get_tx.ex = np->first_tx.ex;
@@ -2532,7 +2522,7 @@ static void nv_tx_timeout(struct net_device *dev)
printk(KERN_INFO "%s: Ring at %lx\n",
dev->name, (unsigned long)np->ring_addr);
printk(KERN_INFO "%s: Dumping tx registers\n", dev->name);
- for (i=0;i<=np->register_size;i+= 32) {
+ for (i = 0; i <= np->register_size; i += 32) {
printk(KERN_INFO "%3x: %08x %08x %08x %08x %08x %08x %08x %08x\n",
i,
readl(base + i + 0), readl(base + i + 4),
@@ -2541,7 +2531,7 @@ static void nv_tx_timeout(struct net_device *dev)
readl(base + i + 24), readl(base + i + 28));
}
printk(KERN_INFO "%s: Dumping tx ring\n", dev->name);
- for (i=0;i<np->tx_ring_size;i+= 4) {
+ for (i = 0; i < np->tx_ring_size; i += 4) {
if (!nv_optimized(np)) {
printk(KERN_INFO "%03x: %08x %08x // %08x %08x // %08x %08x // %08x %08x\n",
i,
@@ -2616,11 +2606,11 @@ static int nv_getlen(struct net_device *dev, void *packet, int datalen)
int protolen; /* length as stored in the proto field */
/* 1) calculate len according to header */
- if ( ((struct vlan_ethhdr *)packet)->h_vlan_proto == htons(ETH_P_8021Q)) {
- protolen = ntohs( ((struct vlan_ethhdr *)packet)->h_vlan_encapsulated_proto );
+ if (((struct vlan_ethhdr *)packet)->h_vlan_proto == htons(ETH_P_8021Q)) {
+ protolen = ntohs(((struct vlan_ethhdr *)packet)->h_vlan_encapsulated_proto);
hdrlen = VLAN_HLEN;
} else {
- protolen = ntohs( ((struct ethhdr *)packet)->h_proto);
+ protolen = ntohs(((struct ethhdr *)packet)->h_proto);
hdrlen = ETH_HLEN;
}
dprintk(KERN_DEBUG "%s: nv_getlen: datalen %d, protolen %d, hdrlen %d\n",
@@ -2667,7 +2657,7 @@ static int nv_rx_process(struct net_device *dev, int limit)
struct sk_buff *skb;
int len;
- while((np->get_rx.orig != np->put_rx.orig) &&
+ while ((np->get_rx.orig != np->put_rx.orig) &&
!((flags = le32_to_cpu(np->get_rx.orig->flaglen)) & NV_RX_AVAIL) &&
(rx_work < limit)) {
@@ -2687,11 +2677,11 @@ static int nv_rx_process(struct net_device *dev, int limit)
{
int j;
- dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",flags);
- for (j=0; j<64; j++) {
+ dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).", flags);
+ for (j = 0; j < 64; j++) {
if ((j%16) == 0)
dprintk("\n%03x:", j);
- dprintk(" %02x", ((unsigned char*)skb->data)[j]);
+ dprintk(" %02x", ((unsigned char *)skb->data)[j]);
}
dprintk("\n");
}
@@ -2710,9 +2700,8 @@ static int nv_rx_process(struct net_device *dev, int limit)
}
/* framing errors are soft errors */
else if ((flags & NV_RX_ERROR_MASK) == NV_RX_FRAMINGERR) {
- if (flags & NV_RX_SUBSTRACT1) {
+ if (flags & NV_RX_SUBSTRACT1)
len--;
- }
}
/* the rest are hard errors */
else {
@@ -2745,9 +2734,8 @@ static int nv_rx_process(struct net_device *dev, int limit)
}
/* framing errors are soft errors */
else if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_FRAMINGERR) {
- if (flags & NV_RX2_SUBSTRACT1) {
+ if (flags & NV_RX2_SUBSTRACT1)
len--;
- }
}
/* the rest are hard errors */
else {
@@ -2797,7 +2785,7 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
struct sk_buff *skb;
int len;
- while((np->get_rx.ex != np->put_rx.ex) &&
+ while ((np->get_rx.ex != np->put_rx.ex) &&
!((flags = le32_to_cpu(np->get_rx.ex->flaglen)) & NV_RX2_AVAIL) &&
(rx_work < limit)) {
@@ -2817,11 +2805,11 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
{
int j;
- dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).",flags);
- for (j=0; j<64; j++) {
+ dprintk(KERN_DEBUG "Dumping packet (flags 0x%x).", flags);
+ for (j = 0; j < 64; j++) {
if ((j%16) == 0)
dprintk("\n%03x:", j);
- dprintk(" %02x", ((unsigned char*)skb->data)[j]);
+ dprintk(" %02x", ((unsigned char *)skb->data)[j]);
}
dprintk("\n");
}
@@ -2838,9 +2826,8 @@ static int nv_rx_process_optimized(struct net_device *dev, int limit)
}
/* framing errors are soft errors */
else if ((flags & NV_RX2_ERROR_MASK) == NV_RX2_FRAMINGERR) {
- if (flags & NV_RX2_SUBSTRACT1) {
+ if (flags & NV_RX2_SUBSTRACT1)
len--;
- }
}
/* the rest are hard errors */
else {
@@ -2949,7 +2936,7 @@ static int nv_change_mtu(struct net_device *dev, int new_mtu)
/* reinit nic view of the rx queue */
writel(np->rx_buf_sz, base + NvRegOffloadConfig);
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
pci_push(base);
writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
@@ -2986,7 +2973,7 @@ static void nv_copy_mac_to_hw(struct net_device *dev)
static int nv_set_mac_address(struct net_device *dev, void *addr)
{
struct fe_priv *np = netdev_priv(dev);
- struct sockaddr *macaddr = (struct sockaddr*)addr;
+ struct sockaddr *macaddr = (struct sockaddr *)addr;
if (!is_valid_ether_addr(macaddr->sa_data))
return -EADDRNOTAVAIL;
@@ -3302,7 +3289,7 @@ set_speed:
}
writel(txreg, base + NvRegTxWatermark);
- writel(NVREG_MISC1_FORCE | ( np->duplex ? 0 : NVREG_MISC1_HD),
+ writel(NVREG_MISC1_FORCE | (np->duplex ? 0 : NVREG_MISC1_HD),
base + NvRegMisc1);
pci_push(base);
writel(np->linkspeed, base + NvRegLinkSpeed);
@@ -3312,8 +3299,8 @@ set_speed:
/* setup pause frame */
if (np->duplex != 0) {
if (np->autoneg && np->pause_flags & NV_PAUSEFRAME_AUTONEG) {
- adv_pause = adv & (ADVERTISE_PAUSE_CAP| ADVERTISE_PAUSE_ASYM);
- lpa_pause = lpa & (LPA_PAUSE_CAP| LPA_PAUSE_ASYM);
+ adv_pause = adv & (ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM);
+ lpa_pause = lpa & (LPA_PAUSE_CAP | LPA_PAUSE_ASYM);
switch (adv_pause) {
case ADVERTISE_PAUSE_CAP:
@@ -3324,22 +3311,17 @@ set_speed:
}
break;
case ADVERTISE_PAUSE_ASYM:
- if (lpa_pause == (LPA_PAUSE_CAP| LPA_PAUSE_ASYM))
- {
+ if (lpa_pause == (LPA_PAUSE_CAP | LPA_PAUSE_ASYM))
pause_flags |= NV_PAUSEFRAME_TX_ENABLE;
- }
break;
- case ADVERTISE_PAUSE_CAP| ADVERTISE_PAUSE_ASYM:
- if (lpa_pause & LPA_PAUSE_CAP)
- {
+ case ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM:
+ if (lpa_pause & LPA_PAUSE_CAP) {
pause_flags |= NV_PAUSEFRAME_RX_ENABLE;
if (np->pause_flags & NV_PAUSEFRAME_TX_REQ)
pause_flags |= NV_PAUSEFRAME_TX_ENABLE;
}
if (lpa_pause == LPA_PAUSE_ASYM)
- {
pause_flags |= NV_PAUSEFRAME_RX_ENABLE;
- }
break;
}
} else {
@@ -3514,7 +3496,7 @@ static irqreturn_t nv_nic_irq_tx(int foo, void *data)
dprintk(KERN_DEBUG "%s: nv_nic_irq_tx\n", dev->name);
- for (i=0; ; i++) {
+ for (i = 0;; i++) {
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_TX_ALL;
writel(NVREG_IRQ_TX_ALL, base + NvRegMSIXIrqStatus);
dprintk(KERN_DEBUG "%s: tx irq: %08x\n", dev->name, events);
@@ -3553,7 +3535,7 @@ static int nv_napi_poll(struct napi_struct *napi, int budget)
u8 __iomem *base = get_hwbase(dev);
unsigned long flags;
int retcode;
- int rx_count, tx_work=0, rx_work=0;
+ int rx_count, tx_work = 0, rx_work = 0;
do {
if (!nv_optimized(np)) {
@@ -3628,7 +3610,7 @@ static irqreturn_t nv_nic_irq_rx(int foo, void *data)
dprintk(KERN_DEBUG "%s: nv_nic_irq_rx\n", dev->name);
- for (i=0; ; i++) {
+ for (i = 0;; i++) {
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_RX_ALL;
writel(NVREG_IRQ_RX_ALL, base + NvRegMSIXIrqStatus);
dprintk(KERN_DEBUG "%s: rx irq: %08x\n", dev->name, events);
@@ -3675,7 +3657,7 @@ static irqreturn_t nv_nic_irq_other(int foo, void *data)
dprintk(KERN_DEBUG "%s: nv_nic_irq_other\n", dev->name);
- for (i=0; ; i++) {
+ for (i = 0;; i++) {
events = readl(base + NvRegMSIXIrqStatus) & NVREG_IRQ_OTHER;
writel(NVREG_IRQ_OTHER, base + NvRegMSIXIrqStatus);
dprintk(KERN_DEBUG "%s: irq: %08x\n", dev->name, events);
@@ -3776,17 +3758,15 @@ static void set_msix_vector_map(struct net_device *dev, u32 vector, u32 irqmask)
* the remaining 8 interrupts.
*/
for (i = 0; i < 8; i++) {
- if ((irqmask >> i) & 0x1) {
+ if ((irqmask >> i) & 0x1)
msixmap |= vector << (i << 2);
- }
}
writel(readl(base + NvRegMSIXMap0) | msixmap, base + NvRegMSIXMap0);
msixmap = 0;
for (i = 0; i < 8; i++) {
- if ((irqmask >> (i + 8)) & 0x1) {
+ if ((irqmask >> (i + 8)) & 0x1)
msixmap |= vector << (i << 2);
- }
}
writel(readl(base + NvRegMSIXMap1) | msixmap, base + NvRegMSIXMap1);
}
@@ -3809,9 +3789,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
}
if (np->msi_flags & NV_MSI_X_CAPABLE) {
- for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) {
+ for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++)
np->msi_x_entry[i].entry = i;
- }
if ((ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK))) == 0) {
np->msi_flags |= NV_MSI_X_ENABLED;
if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT && !intr_test) {
@@ -3903,9 +3882,8 @@ static void nv_free_irq(struct net_device *dev)
int i;
if (np->msi_flags & NV_MSI_X_ENABLED) {
- for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++) {
+ for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++)
free_irq(np->msi_x_entry[i].vector, dev);
- }
pci_disable_msix(np->pci_dev);
np->msi_flags &= ~NV_MSI_X_ENABLED;
} else {
@@ -3975,7 +3953,7 @@ static void nv_do_nic_poll(unsigned long data)
/* reinit nic view of the rx queue */
writel(np->rx_buf_sz, base + NvRegOffloadConfig);
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
pci_push(base);
writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
@@ -4105,7 +4083,7 @@ static int nv_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
}
if (netif_carrier_ok(dev)) {
- switch(np->linkspeed & (NVREG_LINKSPEED_MASK)) {
+ switch (np->linkspeed & (NVREG_LINKSPEED_MASK)) {
case NVREG_LINKSPEED_10:
ecmd->speed = SPEED_10;
break;
@@ -4344,7 +4322,7 @@ static void nv_get_regs(struct net_device *dev, struct ethtool_regs *regs, void
regs->version = FORCEDETH_REGS_VER;
spin_lock_irq(&np->lock);
- for (i = 0;i <= np->register_size/sizeof(u32); i++)
+ for (i = 0; i <= np->register_size/sizeof(u32); i++)
rbuf[i] = readl(base + i*sizeof(u32));
spin_unlock_irq(&np->lock);
}
@@ -4491,14 +4469,14 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri
np->tx_ring_size = ring->tx_pending;
if (!nv_optimized(np)) {
- np->rx_ring.orig = (struct ring_desc*)rxtx_ring;
+ np->rx_ring.orig = (struct ring_desc *)rxtx_ring;
np->tx_ring.orig = &np->rx_ring.orig[np->rx_ring_size];
} else {
- np->rx_ring.ex = (struct ring_desc_ex*)rxtx_ring;
+ np->rx_ring.ex = (struct ring_desc_ex *)rxtx_ring;
np->tx_ring.ex = &np->rx_ring.ex[np->rx_ring_size];
}
- np->rx_skb = (struct nv_skb_map*)rx_skbuff;
- np->tx_skb = (struct nv_skb_map*)tx_skbuff;
+ np->rx_skb = (struct nv_skb_map *)rx_skbuff;
+ np->tx_skb = (struct nv_skb_map *)tx_skbuff;
np->ring_addr = ring_addr;
memset(np->rx_skb, 0, sizeof(struct nv_skb_map) * np->rx_ring_size);
@@ -4515,7 +4493,7 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri
/* reinit nic view of the queues */
writel(np->rx_buf_sz, base + NvRegOffloadConfig);
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
pci_push(base);
writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
@@ -4841,7 +4819,7 @@ static int nv_loopback_test(struct net_device *dev)
/* reinit nic view of the rx queue */
writel(np->rx_buf_sz, base + NvRegOffloadConfig);
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
pci_push(base);
@@ -4893,9 +4871,8 @@ static int nv_loopback_test(struct net_device *dev)
if (flags & NV_RX_ERROR)
ret = 0;
} else {
- if (flags & NV_RX2_ERROR) {
+ if (flags & NV_RX2_ERROR)
ret = 0;
- }
}
if (ret) {
@@ -4958,11 +4935,10 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
netif_addr_lock(dev);
spin_lock_irq(&np->lock);
nv_disable_hw_interrupts(dev, np->irqmask);
- if (!(np->msi_flags & NV_MSI_X_ENABLED)) {
+ if (!(np->msi_flags & NV_MSI_X_ENABLED))
writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
- } else {
+ else
writel(NVREG_IRQSTAT_MASK, base + NvRegMSIXIrqStatus);
- }
/* stop engines */
nv_stop_rxtx(dev);
nv_txrx_reset(dev);
@@ -5003,7 +4979,7 @@ static void nv_self_test(struct net_device *dev, struct ethtool_test *test, u64
/* reinit nic view of the rx queue */
writel(np->rx_buf_sz, base + NvRegOffloadConfig);
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
pci_push(base);
writel(NVREG_TXRXCTL_KICK|np->txrxctl_bits, get_hwbase(dev) + NvRegTxRxControl);
@@ -5106,8 +5082,7 @@ static int nv_mgmt_acquire_sema(struct net_device *dev)
((tx_ctrl & NVREG_XMITCTL_MGMT_SEMA_MASK) == NVREG_XMITCTL_MGMT_SEMA_FREE)) {
np->mgmt_sema = 1;
return 1;
- }
- else
+ } else
udelay(50);
}
@@ -5204,7 +5179,7 @@ static int nv_open(struct net_device *dev)
/* give hw rings */
setup_hw_rings(dev, NV_SETUP_RX_RING | NV_SETUP_TX_RING);
- writel( ((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
+ writel(((np->rx_ring_size-1) << NVREG_RINGSZ_RXSHIFT) + ((np->tx_ring_size-1) << NVREG_RINGSZ_TXSHIFT),
base + NvRegRingSizes);
writel(np->linkspeed, base + NvRegLinkSpeed);
@@ -5251,8 +5226,7 @@ static int nv_open(struct net_device *dev)
writel(NVREG_POLL_DEFAULT_THROUGHPUT, base + NvRegPollingInterval);
else
writel(NVREG_POLL_DEFAULT_CPU, base + NvRegPollingInterval);
- }
- else
+ } else
writel(poll_interval & 0xFFFF, base + NvRegPollingInterval);
writel(NVREG_UNKSETUP6_VAL, base + NvRegUnknownSetupReg6);
writel((np->phyaddr << NVREG_ADAPTCTL_PHYSHIFT)|NVREG_ADAPTCTL_PHYVALID|NVREG_ADAPTCTL_RUNNING,
@@ -5263,7 +5237,7 @@ static int nv_open(struct net_device *dev)
writel(NVREG_WAKEUPFLAGS_ENABLE , base + NvRegWakeUpFlags);
i = readl(base + NvRegPowerState);
- if ( (i & NVREG_POWERSTATE_POWEREDUP) == 0)
+ if ((i & NVREG_POWERSTATE_POWEREDUP) == 0)
writel(NVREG_POWERSTATE_POWEREDUP|i, base + NvRegPowerState);
pci_push(base);
@@ -5276,9 +5250,8 @@ static int nv_open(struct net_device *dev)
writel(NVREG_IRQSTAT_MASK, base + NvRegIrqStatus);
pci_push(base);
- if (nv_request_irq(dev, 0)) {
+ if (nv_request_irq(dev, 0))
goto out_drain;
- }
/* ask for interrupts */
nv_enable_hw_interrupts(dev, np->irqmask);
@@ -5466,7 +5439,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
addr = 0;
for (i = 0; i < DEVICE_COUNT_RESOURCE; i++) {
dprintk(KERN_DEBUG "%s: resource %d start %p len %ld flags 0x%08lx.\n",
- pci_name(pci_dev), i, (void*)pci_resource_start(pci_dev, i),
+ pci_name(pci_dev), i, (void *)pci_resource_start(pci_dev, i),
pci_resource_len(pci_dev, i),
pci_resource_flags(pci_dev, i));
if (pci_resource_flags(pci_dev, i) & IORESOURCE_MEM &&
@@ -5631,7 +5604,7 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
*/
dev_printk(KERN_ERR, &pci_dev->dev,
"Invalid Mac address detected: %pM\n",
- dev->dev_addr);
+ dev->dev_addr);
dev_printk(KERN_ERR, &pci_dev->dev,
"Please complain to your hardware vendor. Switching to a random MAC.\n");
random_ether_addr(dev->dev_addr);
@@ -5663,16 +5636,15 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
writel(powerstate, base + NvRegPowerState2);
}
- if (np->desc_ver == DESC_VER_1) {
+ if (np->desc_ver == DESC_VER_1)
np->tx_flags = NV_TX_VALID;
- } else {
+ else
np->tx_flags = NV_TX2_VALID;
- }
np->msi_flags = 0;
- if ((id->driver_data & DEV_HAS_MSI) && msi) {
+ if ((id->driver_data & DEV_HAS_MSI) && msi)
np->msi_flags |= NV_MSI_CAPABLE;
- }
+
if ((id->driver_data & DEV_HAS_MSI_X) && msix) {
/* msix has had reported issues when modifying irqmask
as in the case of napi, therefore, disable for now
@@ -5735,9 +5707,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
nv_mgmt_acquire_sema(dev) &&
nv_mgmt_get_version(dev)) {
np->mac_in_use = 1;
- if (np->mgmt_version > 0) {
+ if (np->mgmt_version > 0)
np->mac_in_use = readl(base + NvRegMgmtUnitControl) & NVREG_MGMTUNITCONTROL_INUSE;
- }
dprintk(KERN_INFO "%s: mgmt unit is running. mac in use %x.\n",
pci_name(pci_dev), np->mac_in_use);
/* management unit setup the phy already? */
@@ -5799,9 +5770,8 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
} else {
/* see if it is a gigabit phy */
u32 mii_status = mii_rw(dev, np->phyaddr, MII_BMSR, MII_READ);
- if (mii_status & PHY_GIGABIT) {
+ if (mii_status & PHY_GIGABIT)
np->gigabit = PHY_GIGABIT;
- }
}
/* set default link speed settings */
@@ -5829,19 +5799,19 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i
dev->dev_addr[5]);
dev_printk(KERN_INFO, &pci_dev->dev, "%s%s%s%s%s%s%s%s%s%sdesc-v%u\n",
- dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
- dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
- "csum " : "",
- dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
- "vlan " : "",
- id->driver_data & DEV_HAS_POWER_CNTRL ? "pwrctl " : "",
- id->driver_data & DEV_HAS_MGMT_UNIT ? "mgmt " : "",
- id->driver_data & DEV_NEED_TIMERIRQ ? "timirq " : "",
- np->gigabit == PHY_GIGABIT ? "gbit " : "",
- np->need_linktimer ? "lnktim " : "",
- np->msi_flags & NV_MSI_CAPABLE ? "msi " : "",
- np->msi_flags & NV_MSI_X_CAPABLE ? "msi-x " : "",
- np->desc_ver);
+ dev->features & NETIF_F_HIGHDMA ? "highdma " : "",
+ dev->features & (NETIF_F_IP_CSUM | NETIF_F_SG) ?
+ "csum " : "",
+ dev->features & (NETIF_F_HW_VLAN_RX | NETIF_F_HW_VLAN_TX) ?
+ "vlan " : "",
+ id->driver_data & DEV_HAS_POWER_CNTRL ? "pwrctl " : "",
+ id->driver_data & DEV_HAS_MGMT_UNIT ? "mgmt " : "",
+ id->driver_data & DEV_NEED_TIMERIRQ ? "timirq " : "",
+ np->gigabit == PHY_GIGABIT ? "gbit " : "",
+ np->need_linktimer ? "lnktim " : "",
+ np->msi_flags & NV_MSI_CAPABLE ? "msi " : "",
+ np->msi_flags & NV_MSI_X_CAPABLE ? "msi-x " : "",
+ np->desc_ver);
return 0;
@@ -5931,13 +5901,13 @@ static int nv_suspend(struct pci_dev *pdev, pm_message_t state)
int i;
if (netif_running(dev)) {
- // Gross.
+ /* Gross. */
nv_close(dev);
}
netif_device_detach(dev);
/* save non-pci configuration space */
- for (i = 0;i <= np->register_size/sizeof(u32); i++)
+ for (i = 0; i <= np->register_size/sizeof(u32); i++)
np->saved_config_space[i] = readl(base + i*sizeof(u32));
pci_save_state(pdev);
@@ -5960,7 +5930,7 @@ static int nv_resume(struct pci_dev *pdev)
pci_enable_wake(pdev, PCI_D0, 0);
/* restore non-pci configuration space */
- for (i = 0;i <= np->register_size/sizeof(u32); i++)
+ for (i = 0; i <= np->register_size/sizeof(u32); i++)
writel(np->saved_config_space[i], base+i*sizeof(u32));
if (np->driver_data & DEV_NEED_MSI_FIX)
@@ -5990,9 +5960,8 @@ static void nv_shutdown(struct pci_dev *pdev)
* If we really go for poweroff, we must not restore the MAC,
* otherwise the MAC for WOL will be reversed at least on some boards.
*/
- if (system_state != SYSTEM_POWER_OFF) {
+ if (system_state != SYSTEM_POWER_OFF)
nv_restore_mac_addr(pdev);
- }
pci_disable_device(pdev);
/*
--
1.7.2.3
^ permalink raw reply related
* [PATCH 6/6] forcedeth: use usleep_range not msleep for small sleeps
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index a2b6681..538bd9b 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1178,7 +1178,7 @@ static int phy_reset(struct net_device *dev, u32 bmcr_setup)
/* must wait till reset is deasserted */
while (miicontrol & BMCR_RESET) {
- msleep(10);
+ usleep_range(10000, 20000);
miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
/* FIXME: 100 tries seem excessive */
if (tries++ > 100)
--
1.7.2.3
^ permalink raw reply related
* [PATCH 5/6] forcedeth: use KERN_ facility level in printk
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 2f092d7..a2b6681 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -958,7 +958,7 @@ static int reg_delay(struct net_device *dev, int offset, u32 mask, u32 target,
delaymax -= delay;
if (delaymax < 0) {
if (msg)
- printk("%s", msg);
+ printk(KERN_WARNING "%s", msg);
return 1;
}
} while ((readl(base + offset) & mask) != target);
--
1.7.2.3
^ permalink raw reply related
* [PATCH 4/6] forcedeth: do not use assignment in if conditions
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 8deae90..2f092d7 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -3789,7 +3789,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
if (np->msi_flags & NV_MSI_X_CAPABLE) {
for (i = 0; i < (np->msi_flags & NV_MSI_X_VECTORS_MASK); i++)
np->msi_x_entry[i].entry = i;
- if ((ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK))) == 0) {
+ ret = pci_enable_msix(np->pci_dev, np->msi_x_entry, (np->msi_flags & NV_MSI_X_VECTORS_MASK));
+ if (ret == 0) {
np->msi_flags |= NV_MSI_X_ENABLED;
if (optimization_mode == NV_OPTIMIZATION_MODE_THROUGHPUT && !intr_test) {
/* Request irq for rx handling */
@@ -3841,7 +3842,8 @@ static int nv_request_irq(struct net_device *dev, int intr_test)
}
}
if (ret != 0 && np->msi_flags & NV_MSI_CAPABLE) {
- if ((ret = pci_enable_msi(np->pci_dev)) == 0) {
+ ret = pci_enable_msi(np->pci_dev);
+ if (ret == 0) {
np->msi_flags |= NV_MSI_ENABLED;
dev->irq = np->pci_dev->irq;
if (request_irq(np->pci_dev->irq, handler, IRQF_SHARED, dev->name, dev) != 0) {
--
1.7.2.3
^ permalink raw reply related
* [PATCH 0/6] Forcedeth code style cleanup
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
Hi,
Following patches make checkpatch less unhappy about forcedeth.c.
total: 107 errors, 511 warnings, 6222 lines checked
vs
total: 12 errors, 467 warnings, 6190 lines checked
Remaining errors are false positives, remaining warnings are all lines over 80
characters.
Please keep me in CC.
Szymon Janc (6):
forcedeth: fix multiple code style issues
forcedeth: remove unnecessary checks before kfree
forcedeth: include <linux/io.h> and <linux/uaccess.h> instead of
<asm/io.h> and <asm/uaccess.h> as suggested by checkpatch
forcedeth: do not use assignment in if conditions
forcedeth: use KERN_ facility level in printk
forcedeth: use usleep_range not msleep for small sleeps
drivers/net/forcedeth.c | 328 +++++++++++++++++++++--------------------------
1 files changed, 148 insertions(+), 180 deletions(-)
--
1.7.2.3
^ permalink raw reply
* [PATCH 2/6] forcedeth: remove unnecessary checks before kfree
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 13 +++++--------
1 files changed, 5 insertions(+), 8 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 87757c8..81722fb 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -1013,10 +1013,8 @@ static void free_rings(struct net_device *dev)
pci_free_consistent(np->pci_dev, sizeof(struct ring_desc_ex) * (np->rx_ring_size + np->tx_ring_size),
np->rx_ring.ex, np->ring_addr);
}
- if (np->rx_skb)
- kfree(np->rx_skb);
- if (np->tx_skb)
- kfree(np->tx_skb);
+ kfree(np->rx_skb);
+ kfree(np->tx_skb);
}
static int using_multi_irqs(struct net_device *dev)
@@ -4442,10 +4440,9 @@ static int nv_set_ringparam(struct net_device *dev, struct ethtool_ringparam* ri
pci_free_consistent(np->pci_dev, sizeof(struct ring_desc_ex) * (ring->rx_pending + ring->tx_pending),
rxtx_ring, ring_addr);
}
- if (rx_skbuff)
- kfree(rx_skbuff);
- if (tx_skbuff)
- kfree(tx_skbuff);
+
+ kfree(rx_skbuff);
+ kfree(tx_skbuff);
goto exit;
}
--
1.7.2.3
^ permalink raw reply related
* [PATCH 3/6] forcedeth: include <linux/io.h> and <linux/uaccess.h> instead of <asm/io.h> and <asm/uaccess.h> as suggested by checkpatch
From: Szymon Janc @ 2010-11-27 18:39 UTC (permalink / raw)
To: netdev; +Cc: Szymon Janc
In-Reply-To: <1290883188-2078-1-git-send-email-szymon@janc.net.pl>
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
---
drivers/net/forcedeth.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c
index 81722fb..8deae90 100644
--- a/drivers/net/forcedeth.c
+++ b/drivers/net/forcedeth.c
@@ -60,10 +60,10 @@
#include <linux/if_vlan.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
+#include <linux/uaccess.h>
+#include <linux/io.h>
#include <asm/irq.h>
-#include <asm/io.h>
-#include <asm/uaccess.h>
#include <asm/system.h>
#if 0
--
1.7.2.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox