If this memory allocation fails, we should go through the error handling
path as done everywhere else in this function before returning.
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
We add support for the PCIFB2 card from EAE.
Beside other cards, this card has the backplane mode enabled by default.
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
We read the backplane mode of each subcard from bits 2 and 3 of the misc
register.
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
We add the sysfs interface the read back the backplane
status of the interface.
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
We need to track the status of our queued packages. This way the driving
process knows if failed packages need to be retransmitted. For this
purpose we queue the transferred/failed packages back into the err_skb
message queue added with some status information.
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
We add the pdev data to the pci devices netdev structure. This way
the interface get consistent device names in the userspace (udev).
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
The dev_id was miscalculated. Only the two bits 4-5 are relevant for the
MA1 card. PCIARC1 and PCIFB2 use the four bits 4-7 for id selection.
Signed-off-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
It seems like a historic accident that these return unsigned char *,
and in many places that means casts are required, more often than not.
Make these functions return void * and remove all the casts across
the tree, adding a (u8 *) cast only where the unsigned char pointer
was used directly, all done with the following spatch:
@@
expression SKB, LEN;
typedef u8;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- *(fn(SKB, LEN))
+ *(u8 *)fn(SKB, LEN)
@@
expression E, SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
type T;
@@
- E = ((T *)(fn(SKB, LEN)))
+ E = fn(SKB, LEN)
@@
expression SKB, LEN;
identifier fn = { skb_push, __skb_push, skb_push_rcsum };
@@
- fn(SKB, LEN)[0]
+ *(u8 *)fn(SKB, LEN)
Note that the last part there converts from push(...)[0] to the
more idiomatic *(u8 *)push(...).
Signed-off-by: Johannes Berg <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
When the kernel is running in secure boot mode, we lock down the kernel to
prevent userspace from modifying the running kernel image. Whilst this
includes prohibiting access to things like /dev/mem, it must also prevent
access by means of configuring driver modules in such a way as to cause a
device to access or modify the kernel image.
To this end, annotate module_param* statements that refer to hardware
configuration and indicate for future reference what type of parameter they
specify. The parameter parser in the core sees this information and can
skip such parameters with an error message if the kernel is locked down.
The module initialisation then runs as normal, but just sees whatever the
default values for those parameters is.
Note that we do still need to do the module initialisation because some
drivers have viable defaults set in case parameters aren't specified and
some drivers support automatic configuration (e.g. PNP or PCI) in addition
to manually coded parameters.
This patch annotates drivers in drivers/net/arcnet/.
Suggested-by: Alan Cox <[email protected]>
Signed-off-by: David Howells <[email protected]>
cc: Michael Grzeschik <[email protected]>
cc: [email protected]
Now that %z is standartised in C99 there is no reason to support %Z.
Unlike %L it doesn't even make format strings smaller.
Use BUILD_BUG_ON in a couple ATM drivers.
In case anyone didn't notice lib/vsprintf.o is about half of SLUB which
is in my opinion is quite an achievement. Hopefully this patch inspires
someone else to trim vsprintf.c more.
Link: http://lkml.kernel.org/r/20170103230126.GA30170@avx2
Signed-off-by: Alexey Dobriyan <[email protected]>
Cc: Andy Shevchenko <[email protected]>
Cc: Rasmus Villemoes <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Add __init attribute on a function that is only called from other __init
functions and that is not inlined, at least with gcc version 4.8.4 on an
x86 machine with allyesconfig. Currently, the function is put in the
.text.unlikely segment. Declaring it as __init will cause it to be put in
the .init.text and to disappear after initialization.
The result of objdump -x on the function before the change is as follows:
0000000000000000 l F .text.unlikely 00000000000000bf check_mirror
And after the change it is as follows:
0000000000000000 l F .init.text 00000000000000ba check_mirror
Done with the help of Coccinelle. The semantic patch checks for local
static non-init functions that are called from an __init function and are
not called from any other function.
Signed-off-by: Julia Lawall <[email protected]>
Acked-by: Michael Grzeschik <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
The newly added led trigger support in the com20020-pci driver causes
build errors when CONFIG_LEDS_CLASS is disabled:
drivers/built-in.o: In function `com20020pci_probe':
(.text+0x185dc4): undefined reference to `devm_led_classdev_register'
(.text+0x185dd8): undefined reference to `devm_led_classdev_register'
This adds a Kconfig dependency to prevent the invalid configurations.
Other drivers appear to be split 50:50 between 'select' and 'depends on'
for this symbol, I picked 'depends on' as I could not find a common
policy and it generally causes fewer problems.
Signed-off-by: Arnd Bergmann <[email protected]>
Fixes: 8890624a4e ("arcnet: com20020-pci: add led trigger support")
Signed-off-by: David S. Miller <[email protected]>
The arcnet device has no interrupt to detect if the link has changed
from disconnected to connected. This patch adds an timer to toggle the
link detection. The timer will get retriggered as long as the
reconnection interrupts accure. If the recon interrupts hold off
for >1s we define the connection stable again.
Signed-off-by: Michael Grzeschik <[email protected]>
The EAE PLX-PCI card has special leds on the the main io pci resource
bar. This patch adds support to trigger the conflict and data leds with
the packages.
Signed-off-by: Michael Grzeschik <[email protected]>
The EAE PLX-PCI card has a special rotary encoder
to configure the address of every card individually.
We take this information for the initial setup of
the cards dev_id.
Signed-off-by: Michael Grzeschik <[email protected]>
This patch sets the dev_port according to the index of
the card. This can be used by udev to name the ports
in userspace.
Signed-off-by: Michael Grzeschik <[email protected]>
This patch changes the driver to properly work with the linux netif
interface. The controller gets enabled on open and disabled on close.
Therefor it removes every bogus start of the xceiver. It only gets
enabled on com20020_open and disabled on com20020_close.
Signed-off-by: Michael Grzeschik <[email protected]>
The call for dev_free_skb is done only once. This patch
moves its call to its only user and removes the obsolete
condition variable.
Signed-off-by: Michael Grzeschik <[email protected]>
Conflicts:
net/ipv4/arp.c
The net/ipv4/arp.c conflict was one commit adding a new
local variable while another commit was deleting one.
Signed-off-by: David S. Miller <[email protected]>
This patch cleans the capmode protocol module. It removes the obsolete
function arcnet_cap_init and replaces printk with pr_info.
Signed-off-by: Michael Grzeschik <[email protected]>
This patch moves the module_init and module_exit patches to
the end of the file. It also replaces the printk with pr_info.
Signed-off-by: Michael Grzeschik <[email protected]>
This patch replaces all magic numbers in the driver with
proper named macros. For the case of XTOcfg and STARTIOcmd
it introduces the new macros.
Signed-off-by: Michael Grzeschik <[email protected]>
This patch changes the macro definitions to match the C99
formating. This improves the readability.
Signed-off-by: Michael Grzeschik <[email protected]>
It's clearer to use function pointer calls directly instead of the
macro indirections of ARCRESET, ACOMMAND, ASTATUS, and AINTMASK.
Remove the now unused macros too.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Simplify and make consistent the current uses of readb/writeb
by using the newly introduced arcnet_<I/O> equivalents.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Simplify and make consistent the current uses of readb/writeb
by using the newly introduced arcnet_<I/O> equivalents.
o Add new #defines for register offsets
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Use the same indirection as the other arcnet_<I/O> macros.
Neither of these new macros add the BUS_ALIGN use for 8 bit devices
on 16 bit busses.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Simplify and make consistent the current uses of inb/outb
by using the newly introduced arcnet_<I/O> equivalents.
o Add new #defines for register offsets
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Simplify and make consistent the current uses of inb/outb
by using the newly introduced arcnet_<I/O> equivalents.
o Add new #defines for register offsets
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Simplify and make consistent the current uses of inb/outb
by using the newly introduced arcnet_<I/O> equivalents.
o Add new #defines for register offsets
There is an register offset, 8, that is unnamed and used as-is.
o Remove old #defines that included the ioaddr
o Remove obfuscating macros by expanding them in-place where appropriate
o Create static inline com20020_set_subaddress for the SET_SUBADR macro
There is an unused arcnet config entry CONFIGSA100_CT6001 which added a
special #define BUS_ALIGN which was introduced but never used in fullhist git
tree commit 22cfce4b82b0 ("[ARCNET]: Fixes.") in Nov 2004 for Linux v2.6.10.
This BUS_ALIGN #define tries to allow 8 bit devices to work on a 16 bit
bus by aligning addresses to 16 bit boundaries.
Move this currently unused CONFIG_SA1100_CT6001 BUS_ALIGN macro from
com20020.h to arcdevice.h.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
arcnet uses an I/O scheme which can align I/O addresses to word boundaries
on different architectures.
Add arcnet specific macros which can hide this alignment calculation.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Might as well be specific about the use of this array.
Add a commment questioning the indexing too.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
These #include files don't need to be in the include/linux directory
as they can be local to drivers/net/arcnet/
Move them and update the #include statements.
Update the MAINTAINERS file pattern by deleting arcdevice from the
NETWORKING block as arcnet is currently unmaintained.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Move the assignment above the if like general kernel style.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Alloc failures have generic stack dumps so these are redundant.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Use the more current logging style.
Remove #define VERSION, use pr_info normally.
Add pr_fmt with "arcnet:" prefixes and KBUILD_MODNAME.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
These macros don't actually represent BUG uses but are more commonly
used as logging macros, so use a more kernel style macro.
Convert the BUGMSG from a netdev_ like use to actually use netdev_<level>.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Don't hide what should be obvious.
Make the macro a simple test instead of using if and test.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Use the preferred kernel include path for asm paths.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>
Using coalesced strings helps grep for specific messages.
Signed-off-by: Joe Perches <[email protected]>
Signed-off-by: Michael Grzeschik <[email protected]>