Commit Graph

31 Commits

Author SHA1 Message Date
Grygorii Maistrenko 896075a684 staging: slicoss: cleaning up codestyle warnings
This removes checkpatch.pl warnings:

WARNING: Block comments should align the * on each line

Signed-off-by: Grygorii Maistrenko <grygoriimkd@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-27 13:08:04 +02:00
Gargi Sharma c371ffa79c staging: slicoss: add new line after struct declaration
checkpatch generates a warning for no blank line after struct
declaration. Inserted a new line.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-13 15:01:29 +02:00
Lino Sanfilippo 473256b0ae staging: slicoss: simplify struct for statistics
Merge several structures for statistics to one structure and remove
unnecessary union nesting.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 17:59:45 +02:00
Lino Sanfilippo fdb7777512 staging: slicoss: improve implementation concerning the shared memory
Remove the volatile specifiers of struct slic_shmem. Furthermore store the
bus addresses for the isr pointer, link status and statistics separately
and access the upper and lower word of these addresses by means of
[lower|upper]_32_bits(). By doing this take the endianness into account.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 17:59:45 +02:00
Lino Sanfilippo c6d6a9a076 staging: slicoss: dont use a structure but offsets for register accesses
Use the new register accessors that use offsets instead of the slic_regs
structure to read/write registers. Since not longer needed remove the
structure completley.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 17:59:45 +02:00
Lino Sanfilippo bc894318e8 staging: slicoss: avoid PCI write posting
Introduce the function slic_flush_write() which reads from the HOSTID
register and can be used to avoid PCI write posting. Use the function at
several critical places in the code.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 17:59:45 +02:00
Lino Sanfilippo b200da6744 staging: slicoss: introduce register accessors that use register offsets
Introduce accessor functions that read and write registers by using a
register offset.
This is in preparation to replace the register addressing by means of the
slic_regs struct with an addressing by means of offsets.

Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21 17:59:45 +02:00
Kevin Wern c8e9b92d29 staging/slicoss: Use ethtool_ops instead of module_param.
ethtool_ops has attributes in sub struct ethtool_coalesce that
correspond to the parameters intagg_delay and dynamic_intagg. It is
preferable to set these properties with ethtool rather than
module_param, so create these attributes in adapter and set them using
ethtool_coalesce's rx_coalesce_usecs and rx_use_adaptive_coalesce.
(Outlined in TODO file)

Signed-off-by: Kevin Wern <kevin.m.wern@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-06 21:45:59 -08:00
Amarjargal Gundjalam f773a83479 staging: slicoss: Fixes block comment style
This patch fixes the checkpatch.pl warnings:

WARNING: Block comments use * on subsequent lines
WARNING: Block comments use a trailing */ on a separate line

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:43:31 +09:00
Amarjargal Gundjalam 0d45ffcd64 staging: slicoss: Adds space around operators
This patch fixes the checkpatch.pl check:

CHECK: spaces preferred around that ‘’

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:43:31 +09:00
Amarjargal Gundjalam dfe459398f staging: slicoss: Removes multiple blank lines
This patch fixes the checkpatch.pl check:

CHECK: Please don't use multiple blank lines

Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 14:43:31 +09:00
Hari Prasath Gujulan Elango b62b54378c staging: slicoss: remove unused macro
This patch removes a couple of ununsed MACRO's in this header file

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-17 21:30:40 -07:00
David Matlack 36bf51acc8 staging: slicoss: fix occasionally writing out only half of a dma address
curaddrupper caches the last written upper 32-bits of a dma address
(the device has one register for the upper 32-bits of all dma
address registers). The problem is, not every dma address write
checks and sets curaddrupper. This causes the driver to occasionally
not write the upper 32-bits of a dma address to the device when it
really should.

I've seen this manifest particularly when the driver is trying to
read config data from the device (RCONFIG) in order to checksum the
device's eeprom. Since the device writes its config data to the
wrong DMA address the driver reads 0 as the eeprom size and the
eeprom checksum fails.

This patch fixes the issue by removing curaddrupper and always
writing the upper 32-bits of dma addresses.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-13 16:13:24 -07:00
David Matlack eafe600205 staging: slicoss: remove slic_spinlock wrapper
As per TODO. This commit introduces no functional changes.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-13 16:13:24 -07:00
David Matlack 17dd4338f3 staging: slicoss: remove private netdev list
Remove the private linked list of netdev structs. This list isn't
being used anyway.

This patch has no noticable effect.

Signed-off-by: David Matlack <matlackdavid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-25 10:59:53 -07:00
David Matlack 28277a55fd staging: slicoss: fail on corrupt eeprom
Remove fail_on_bad_eeprom, which was always 0 and thus being used
to ignore incorrect checksumming. This means devices with corrupt
eeprom will now cause the driver to fail.

Since fail_on_bad_eeprom was the last member in use of struct
slic_reg_params, remove that struct altogether.

Signed-off-by: David Matlack <matlackdavid@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:13:13 +09:00
David Matlack 04cc3c8a80 staging: slicoss: remove gratuitous debug infrastructure
As per the TODO file, this patch removes the gratuitous debug
infrastructure. As an extra incentive for removing this code,
the debugfs files are not cleaned up properly. For example, if
register_netdev() fails in slic_entry_probe() then all debugfs
files get left behind, even after the driver module is unloaded.
Touching these files quickly leads to an oops.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:08:33 +09:00
David Matlack 563dce372f staging: slicoss: remove unused members of struct adapter
This patch removes two fields from the private "struct adapter".
Specifically,

memorybase      duplicate of slic_regs

memorylength    written once and never read. This field is trivially
                computed with pci_resource_len if it's ever needed in
                the future.

Signed-off-by: David Matlack <dmatlack@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-23 20:08:33 +09:00
Monam Agarwal 012317f7d6 Staging: slicoss: Fix line over 80 characters in slic.h
This patch fixes the following checkpatch.pl issues in slic.h:
WARNING: line over 80 characters

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-27 15:12:12 -08:00
Cruz Julian Bishop 2fbedf67ed staging: slicoss: Fix space-related checkpatch.pl warnings
This fixes all instances of
	"Please, no spaces at start of a new line"
	"Please, no spaces before tabs"

Please note that I probably got the warning names wrong,
but they should be close enough for usage here :)

Additional post-commit note: There is one comment on line 230ish in slic.h
that appears to have lost it's formatting. It was fine when I was working
in Geany, but it caught my eye in the below diff. Sorry if it actually happened!

Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17 13:53:06 -08:00
Denis Kirjanov 1033f1f7ef Staging: slicoss: Remove explicit arch dependencies
Remove explicit arch dependencies

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 11:52:28 -07:00
Denis Kirjanov 9092de6df3 Staging: slicoss: Remove net_device_stats from the driver's private
Remove net_device_stats from the driver's private.

Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:25:26 -07:00
Kulikov Vasiliy 9020dea380 staging: slicoss: Remove STATUS_XXX defines.
Remove defines of STATUS_XXX from header file.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Cc: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 13:16:43 -07:00
kirjanov@gmail.com 30ae835f89 staging: slicoss Use compare_ether_addr.
Use compare_ether_addr.

Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:28 -08:00
Greg Kroah-Hartman c6bc6cd23a Staging: slicoss: remove SLIC_GET_STATS_TIMER_ENABLED
SLIC_GET_STATS_TIMER_ENABLED was never defined, so remove the code that
was bound by it.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:06 -07:00
Greg Kroah-Hartman 7f75d4739c Staging: slicoss: clean up SLIC_DUMP_ENABLED
As SLIC_DUMP_ENABLED was disabled, remove the code that it was keeping
from being built as it was not ever used.  This removed a lot.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:06 -07:00
Greg Kroah-Hartman b574488e42 Staging: slicoss: remove TRUE/FALSE usage
Don't use TRUE and FALSE, we have proper boolean types in the kernel.

Cc: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-04-03 14:53:05 -07:00
Lior Dotan 874073ea29 Staging: slicoss: use request_firmware
This patch uses request_firmware() to download the firmware to the card.

Signed-off-by: Lior Dotan <liodot@gmail.com>
Cc: Christopher Harrer <charrer@alacritech.com>
2009-04-03 14:53:04 -07:00
Lior Dotan 470c5736ff Staging: slicoss: use request_firmware
This should make the driver use request_firmware() instead of a static
firmware.
Some obvious things are missing:
1) The unneeded header files are not removed yet. This is to keep the
   patch size small.
2) The .bin files are missing so the driver doesn't have what to load.
3) Testing. None of this was tested. It does compiles OK though :)

Signed-off-by: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-01-06 13:52:08 -08:00
Lior Dotan e9eff9d6a0 Staging: SLICOSS: lots of checkpatch fixes
Major cleanups of checkpatch warnings from the slicoss driver.

From: Lior Dotan <liodot@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-10 15:31:13 -07:00
Greg Kroah-Hartman 4d6f6af8d6 Staging: add Alacritech slicoss network driver
This adds the Alacritech slicoss driver to the tree.

This driver is supposed to support:

	Mojave cards (single port PCI Gigabit) both copper and fiber
	Oasis cards (single and dual port PCI-x Gigabit) copper and fiber
	Kalahari cards (dual and quad port PCI-e Gigabit) copper and fiber

The driver was acutally tested on Oasis and Kalahari cards.

TODO:
	- move firmware loading to request_firmware()
	- remove direct memory access of structures
	- any remaining sparse and checkpatch.pl warnings
	- any netdev recommended changes

Many thanks to Lior Dotan <liodot@gmail.com> for help with the cleanup
of this driver.

Cc: Lior Dotan <liodot@gmail.com>
Cc: Christopher Harrer <charrer@alacritech.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-10-10 15:31:07 -07:00