aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/slicoss (follow)
AgeCommit message (Collapse)AuthorFilesLines
2013-05-13staging: slicoss: fix error return code in slic_entry_probe()Wei Yongjun1-7/+11
Fix to return a negative error code from the error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-04-05staging: slicoss: information leak in ETHTOOL_GSETDan Carpenter1-0/+1
There are some fields in "edata" which have not been cleared. One example is edata.cmd. It leaks uninitialized stack information to the user. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging: slicoss: Remove dma_addr_t cast compilation warningsJoe Perches1-11/+16
Eliminate some warnings by casting to unsigned long before casting a dma_addr_t value to a pointer. btw: Does slicoss always work on x86-32? Is a pshmem guaranteed to be accessible by a 32 bit address? Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Use ether_crc for mac hash calculationPeter Huewe1-65/+4
Instead of performing the hash calculation for the mac address by ourself, we can simply reuse ether_crc and shift only the result according to our needs. The code was tested against the previous implementation by verifying both implementations against each other in userspace for 16200000000 different mac addresses, changing the vendor bits of the mac address first. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Fix buffer possible overflow in slic_card_locatePeter Huewe1-3/+4
smatch complains about a possible buffer overflow slicoss.c:3651 slic_card_locate() error: buffer overflow 'physcard->adapter' 4 <= 4 If the for loop is not exited prematurely i++ is executed after the last iteration and thus i can be 4, which is out of bounds for physcard->adapter. -> Add check for this condition and simplify the if statement by inverting the condition. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Fix operation may be undefined warningPeter Huewe1-1/+1
gcc complains about an undefined operation: slicoss.c:1417:19: warning: operation on 'rspq->pageindex' may be undefined [-Wsequence-point] The intended operation was (probably) to retrieve the pageindex + 1 and let it wrap around if it reaches the num_pages. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Remove always true if statementPeter Huewe1-14/+10
skbtype is assigned once to NORMAL_ETHFRAME and then checked if it is NORMAL_ETHFRAME -> remove the checks. This also gets rid of the (false positive) smatch warning: slicoss.c:2829 slic_xmit_start() error: potential NULL dereference 'hcmd'. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-03-11staging/slicoss: Check pointer before dereferencingPeter Huewe1-2/+1
Smatch complains that the variable adapter is dereferenced before it is checked: slicoss.c:906 slic_timer_load_check() warn: variable dereferenced before check 'adapter' (see line 904) -> move the assignment after the check. Signed-off-by: Peter Huewe <peterhuewe@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17staging: slicoss: Fix space-related checkpatch.pl warningsCruz Julian Bishop3-266/+266
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-17staging: slicoss: Fix three checkpatch.pl errors in slicoss.cCruz Julian Bishop1-3/+6
The errors fixed are all instances of "ERROR: do not use assignment in if condition" Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-17staging: slicoss: Stop swearing in slicoss.cCruz Julian Bishop1-2/+2
I'm assuming that "CRC shit reg" is referencing the CRC register/registry. Please ignore this patch if "shit" is actually in context Signed-off-by: Cruz Julian Bishop <cruzjbishop@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devexitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devinitBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devinit is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21staging: slicoss: remove use of __devexit_pBill Pemberton1-1/+1
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer needed. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-26staging: slicoss: fix a leak when kzalloc failDevendra Naga1-1/+4
slic_card_locate does a kzalloc of physcard, and if it fails, in my previous patch i returned -ENOMEM, but left the driver leak the memory if card_hostid == SLIC_HOSTID_DEFAULT, fix this memory leak if the above condition is true Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: get rid of slic_cmdqmem_init functionDevendra Naga1-8/+1
this function memset's the cmdqmem, instead do it in slic_cmdq_init. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: remove default case in irqhandlerDevendra Naga1-3/+0
this default statement does nothing in the irqhandler, so remove it Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-23staging: slicoss: return -ENOMEM if kzalloc failDevendra Naga1-0/+2
this takes up the error path cleanup, fixes a crash too due to null deref Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: slicoss: remove ASSERT macro altogetherDevendra Naga1-138/+2
remove ASSERT and remove all its callers altogether in the code Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-10-22staging: slicoss: fail out if we dont have a valid firmware fileDevendra Naga1-2/+1
fail instead calling request_firmware with filename as a null string and return -ENOENT Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: fix a null deref when pci_alloc_consistent failDevendra Naga1-3/+2
we are dereferencing the pshmem , and the pci_alloc_consistent can fail returning null, do a memcpy if we have a valid pshmem Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: remove return statement at the end of slic_mcast_set_listDevendra Naga1-1/+0
this function return void, means return at the end of this function is not needed Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: clean the spinlock code in slic_entry_openDevendra Naga1-15/+5
the locked variable is used for checking whether the function acquired lock, then unlock. actually with out this we can achieve the same lock and unlock senario, remove the locked variable and also cleanup the code around. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-05staging: slicoss: remove default case after we done with request_firmwareDevendra Naga1-3/+0
we are returning -ENOENT when there is no firmware file for a matching device id. then we start calling request_firmware, after this we do checks on the firmware length of corresponding device id, since the default case is handled in the begining itself there is no need of a default case at the firmware length checks Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: slicoss: release firmware before returningDevendra Naga1-2/+6
we request_firmware in slic_card_download_gbrcv and we return out with out calling release_firmware, where we compare against a firmware lengths of certain device ids. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04staging: slicoss: return early before calling request_firmware with empty firmware filenameDevendra Naga1-2/+1
when the device id doesn't match in slic_card_download_gbrcv the filename is "", i.e an empty name, and we try calling request_firmware with that name, actually we can just fail out at default case before even calling request_firmware Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-11staging/slicoss: disable pci device at removeDevendra Naga1-0/+1
at probe we enabled the device, and we should disable it at remove. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09staging/slicoss: return -ENODEV if no devid matchesDevendra Naga1-2/+1
if no case matches we are simply asserting and doing break. and i think we may need to return that -ENODEV , no device is present, rather assert'ing. Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-09staging/slicoss: remove not-needed ASSERTDevendra Naga1-1/+0
As the private pointer is valid at the remove of driver, and remove wont' be called if probe fails, so no point for checking of ASSERT Signed-off-by: Devendra Naga <devendra.aaru@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-06-18staging: slicoss: Fix a typo.Justin P. Mattock1-1/+1
The below patch fixes a typo found while reading through staging/slicoss Signed-off-by: Justin P. Mattock <justinmattock@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-15staging: clean up Greg's email address in some TODO filesGreg Kroah-Hartman1-1/+1
My old email address was in some TODO files, so this fixes that issue. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2011-11-18staging: slicoss depends on NETRandy Dunlap1-1/+1
The slicoss driver uses network interfaces so it should depend on NET. Fixes the following build errors: ERROR: "eth_change_mtu" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "eth_validate_addr" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "register_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "alloc_etherdev_mqs" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "__netif_schedule" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "netif_rx" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "eth_type_trans" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "skb_put" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "skb_pull" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "__alloc_skb" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "free_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "unregister_netdev" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "consume_skb" [drivers/staging/slicoss/slicoss.ko] undefined! ERROR: "dev_kfree_skb_irq" [drivers/staging/slicoss/slicoss.ko] undefined! Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Cc: Lior Dotan <liodot@gmail.com> Cc: Christopher Harrer <charrer@alacritech.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-26Remove stale "depends on NETDEV_1000"in staging driversLinus Torvalds1-1/+1
Mark Einon points out that the Kconfig option for NETDEV_1000 no longer exists, and the merge of the staging drivers should have removed that for the et131x driver. And while checking for it, I noticed that slicoss had the same stale dependency. Remove that one too. Reported-by: Mark Einon <mark.einon@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2011-08-17net: remove use of ndo_set_multicast_list in driversJiri Pirko1-1/+1
replace it by ndo_set_rx_mode Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2011-03-31Fix common misspellingsLucas De Marchi1-1/+1
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-09-30staging: slicoss: use free_netdev(netdev) instead of kfree()Vasiliy Kulikov1-1/+1
Freeing netdev without free_netdev() leads to net, tx leaks. I might lead to dereferencing freed pointer. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) @@ struct net_device* dev; @@ -kfree(dev) +free_netdev(dev) Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Acked-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31Staging: slicoss: Remove explicit arch dependenciesDenis Kirjanov2-26/+24
Remove explicit arch dependencies Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02Staging: slicoss: Remove net_device_stats from the driver's privateDenis Kirjanov2-21/+21
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-07-22Staging: slicoss: kill functions prototypes and reorder functionsDenis Kirjanov1-1990/+1920
Reorder functions to kill their prototypes. Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08staging: slicoss: error handling with gotoKulikov Vasiliy1-13/+15
This patch makes error handling more readable due to 'goto err' pattern. 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-08staging: slicoss: error handling with gotoKulikov Vasiliy1-8/+7
This patch makes error handling more readable due to 'goto err' pattern. 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-08staging: slicoss: Remove STATUS_XXX defines.Kulikov Vasiliy1-11/+0
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-08staging: slicoss: Change return codes to -EYYY.Kulikov Vasiliy1-26/+26
Change defined STATUS_XXX return codes to standard -EYYY. Signed-off-by: Kulikov Vasiliy <segooon@gmail.com> Cc: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-04-03net: convert multicast list to list_headJiri Pirko1-3/+3
Converts the list and the core manipulating with it to be the same as uc_list. +uses two functions for adding/removing mc address (normal and "global" variant) instead of a function parameter. +removes dev_mcast.c completely. +exposes netdev_hw_addr_list_* macros along with __hw_addr_* functions for manipulation with lists on a sandbox (used in bonding and 80211 drivers) Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2010-03-04Staging: merge staging patches into Linus's main branchGreg Kroah-Hartman2-63/+62
There were a number of patches that went into Linus's tree already that conflicted with other changes in the staging branch. This merge resolves those merge conflicts. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03Staging: Fix continuation line formatsJoe Perches1-4/+2
String constants that are continued on subsequent lines with \ are not good. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03staging: declare MODULE_FIRMWARE in various driversBen Hutchings1-0/+6
Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03staging: slicoss Use pci_set_consistent_dma_mask.kirjanov@gmail.com1-5/+18
Use pci_set_consistent_dma_mask() in the case of 64-bit consistent allocations. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03staging: slicoss Use compare_ether_addr.kirjanov@gmail.com2-17/+3
Use compare_ether_addr. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03staging: slicoss Use PCI_DEVICE_TABLE.kirjanov@gmail.com1-8/+4
Use PCI_DEVICE_TABLE: defines array as const and puts it into the __devinitconst section. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>