summaryrefslogtreecommitdiff
path: root/drivers/staging/vt6655/device_main.c
AgeCommit message (Collapse)Author
2019-03-29staging: vt6655: Remove vif check from vnt_interruptMalcolm Priestley
A check for vif is made in vnt_interrupt_work. There is a small chance of leaving interrupt disabled while vif is NULL and the work hasn't been scheduled. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> CC: stable@vger.kernel.org # v4.2+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-03-26staging: vt6655: Fix interrupt race condition on device start up.Malcolm Priestley
It appears on some slower systems that the driver can find its way out of the workqueue while the interrupt is disabled by continuous polling by it. Move MACvIntEnable to vnt_interrupt_work so that it is always enabled on all routes out of vnt_interrupt_process. Move MACvIntDisable so that the device doesn't keep polling the system while the workqueue is being processed. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> CC: stable@vger.kernel.org # v4.2+ Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-27Staging: vt6655: Alignment should match open parenthesisMadhumitha Prabakaran
Fix the check to improve readibility CHECK: Alignment should match open parenthesis Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-02-26Staging: vt6655: Alignment should match open parenthesisMadhumitha Prabakaran
Fix the check to improve readibility. CHECK: Alignment should match open parenthesis Signed-off-by: Madhumitha Prabakaran <madhumithabiw@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-08cross-tree: phase out dma_zalloc_coherent()Luis Chamberlain
We already need to zero out memory for dma_alloc_coherent(), as such using dma_zalloc_coherent() is superflous. Phase it out. This change was generated with the following Coccinelle SmPL patch: @ replace_dma_zalloc_coherent @ expression dev, size, data, handle, flags; @@ -dma_zalloc_coherent(dev, size, handle, flags) +dma_alloc_coherent(dev, size, handle, flags) Suggested-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Luis Chamberlain <mcgrof@kernel.org> [hch: re-ran the script on the latest tree] Signed-off-by: Christoph Hellwig <hch@lst.de>
2018-04-23staging: vt6655: add handling memory leak on vnt_start()Ji-Hun Kim
There was no code for handling memory leaks of device_init_rings() and request_irq(). It needs to free allocated memory in the device_init_rings() , when request_irq() would be failed. Add freeing sequences of irq and device init rings. Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-04-23staging: vt6655: check for memory allocation failuresJi-Hun Kim
There are no null pointer checking on rd_info and td_info values which are allocated by kzalloc. It has potential null pointer dereferencing issues. Implement error handling code on device_init_rd*, device_init_td* and vnt_start for the allocation failures. Signed-off-by: Ji-Hun Kim <ji_hun.kim@samsung.com> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06staging: vt6655: remove unnecessary parenthesesSantha Meena Ramamoorthy
Remove unnecessary parentheses around variables to conform to the Linux kernel coding style. Issue found using checkpatch. Signed-off-by: Santha Meena Ramamoorthy <santhameena13@gmail.com> Acked-by: Julia Lawall <julia.lawall@lip6.fr> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-19staging: vt6655: Use GFP_KERNEL in kzallocJia-Ju Bai
Four kzalloc functions are called with GFP_ATOMIC. But according to driver call graph, they are not in atomic context, namely no spinlock is held nor in an interrupt handler. All these "GFP_ATOMIC"s are unnecessary, and replace with with "GFP_KERNEL"s. Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: vt6655: Remove redundant license textGreg Kroah-Hartman
Now that the SPDX tag is in all vt6655 files, that identifies the license in a specific and legally-defined manner. So the extra GPL text wording can be removed as it is no longer needed at all. This is done on a quest to remove the 700+ different ways that files in the kernel describe the GPL license text. And there's unneeded stuff like the address (sometimes incorrect) for the FSF which is never needed. No copyright headers or other non-license-description text was removed. Cc: Forest Bond <forest@alittletooquiet.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28staging: vt6655: add SPDX identifiers to all vt6655 driver filesGreg Kroah-Hartman
It's good to have SPDX identifiers in all files to make it easier to audit the kernel tree for correct licenses. Update the vt6655 driver files with the correct SPDX license identifier based on the license text in the file itself. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This work is based on a script and data from Thomas Gleixner, Philippe Ombredanne, and Kate Stewart. Cc: Forest Bond <forest@alittletooquiet.net> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Kate Stewart <kstewart@linuxfoundation.org> Cc: Philippe Ombredanne <pombredanne@nexb.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-18vt6655: Fix a possible sleep-in-atomic bug in vt6655_suspendJia-Ju Bai
The driver may sleep under a spinlock, and the function call path is: vt6655_suspend (acquire the spinlock) pci_set_power_state __pci_start_power_transition (drivers/pci/pci.c) msleep --> may sleep To fix it, pci_set_power_state is called without having a spinlock. This bug is found by my static analysis tool and my code review. Signed-off-by: Jia-Ju Bai <baijiaju1990@163.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25staging: vt6655: align function parameters to open parenthesisMarko Stankovic
Alignment styles are used interchangeably, align parameters to open parenthesis and fix issues reported by checkpatch.pl Signed-off-by: Marko Stankovic <dartnorris@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25staging: vt6655: remove unnecessary blank linesMarko Stankovic
Fix unnecessary blank lines issues reported by checkpatch.pl Signed-off-by: Marko Stankovic <dartnorris@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25staging: vt6655: replace NULL comparison with '!' operatorMarko Stankovic
Fix comparison to NULL issues reported by checkpatch.pl Signed-off-by: Marko Stankovic <dartnorris@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06staging: vt6655: Add spaces around +PrasannaKumar Muralidharan
Add spaces around + for better readability of the code. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: vt6655: Removes the FSF mailing address.Varsha Rao
This patch fixes the checkpatch issue by removing the Free Software Foundation's mailing address from the sample GPL notice. Because the FSF has changed address in the past, and may change again. Linux already includes a copy of the GPL. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: vt6655: Removes unnecessary blank lines.Varsha Rao
This patch fixes the checkpatch issue of multiple blank lines, by removing them. Signed-off-by: Varsha Rao <rvarsha016@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: vt6655: device_main: Replace NULL comparison with !xNamrata A Shettar
Replace NULL comparison to resolve checkpatch issue. - x == NULL => !x Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-09-18staging: vt6655: device_main: Replace explicit NULL comparisonNamrata A Shettar
Replace NULL comparison to resolve checkpatch issue. - x == NULL => !x Signed-off-by: Namrata A Shettar <namrataashettar@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: vt6655: Fix checkpatch warningAnson Jacob
Fix warning by checkpatch.pl Add * for block comments on subsequent lines Signed-off-by: Anson Jacob <ansonjacob.aj@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-12cfg80211: remove enum ieee80211_bandJohannes Berg
This enum is already perfectly aliased to enum nl80211_band, and the only reason for it is that we get IEEE80211_NUM_BANDS out of it. There's no really good reason to not declare the number of bands in nl80211 though, so do that and remove the cfg80211 one. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2016-03-10Staging: vt6655: Remove & from function name.Sandhya Bankar
Remove & from function name,when function name passed as an argument to another function. Function name is used as pointer without &. Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11Staging: vt6655: Add check dma_mapping_errorHaneen Mohammed
This patch checks for dma_mapping_error() after using dma_map_single. If the dma map fails we release skb buff allocated by dev_alloc_skb() to avoid possible causes of resource leak. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: vt6655: mac.c replace void __iomem * with struct vnt_privateMalcolm Priestley
Moving void __iomem down one level in the following functions MACbIsRegBitsOn MACbIsRegBitsOff MACbIsIntDisable MACvSetShortRetryLimit MACvSetLongRetryLimit MACvGetLongRetryLimit MACvSetLoopbackMode MACvSaveContext MACvRestoreContext MACbSoftwareReset MACbSafeSoftwareReset MACbSafeRxOff MACbSafeTxOff MACbSafeStop MACbShutdown MACvInitialize MACvSetCurrRx0DescAddr MACvSetCurrRx1DescAddr MACvSetCurrTXDescAddr MACvSetCurrTx0DescAddrEx MACvSetCurrAC0DescAddrEx MACvSetCurrSyncDescAddrEx MACvSetCurrATIMDescAddrEx MACvTimer0MicroSDelay MACvOneShotTimer1MicroSec MACvSetMISCFifo MACbPSWakeup MACvSetKeyEntry MACvDisableKeyEntry Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: vt6655: rename pOpts and sOpts to opts.Malcolm Priestley
bring pointers and members into line. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: vt6655: remove static inline alloc_td_info.Malcolm Priestley
Since this only contains one function and used only twice remove inline altogether. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: vt6655: remove static inline alloc_rd_info.Malcolm Priestley
Since this only contains one function and only used twice remove inline altogether. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: vt6655: replace typedef struct __device_optMalcolm Priestley
with struct vnt_options and members rx_descs0 for nRxDescs0 rx_descs1 for nRxDescs1 tx_descs for nTxDescs int_works short_retry long_retry bbp_type flags Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: vt6655: device_main Replace uIdx with idx.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_tx_srv rename pTDMalcolm Priestley
Following the convention elsewhere for vnt_tx_desc rename desc. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_main replace pTDInfo with td_info.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_main replace pRD with rd.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_alloc_rx_buf replace pRDInfo with rd_info.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_main.c replace pDesc with desc.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-04staging: vt6655: device_main replace pDevice with priv.Malcolm Priestley
Removing camel case. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: vt6655: don't stop TX queue unless buffer full.Malcolm Priestley
Presently the TX buffer stops while filling the buffer. However, this does not make use of the available buffer space, it also lags the speed of the TX troughtput. Only stop the queue when the buffer becomes full. The Interupt handler will start the queue again when a buffer is available. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: Move code in device_get_pci_infoMalcolm Priestley
Function always returns true and now only a few lines move to vt6655_probe. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: device_get_pci_info pcid already assigned.Malcolm Priestley
pcid has already been assigned earlier in vt6655_probe. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: device_get_pci_info remove call to set master.Malcolm Priestley
a call to PCI_COMMAND is used to set master. However, a call to pci_set_master earlier in function which does the same thing. So remove the calls and variable b. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: device_get_pci_info remove variable cis_addr.Malcolm Priestley
cis_addr is never used remove its call to pci_resource_start. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: device_get_pci_info remove unused pci_read_config_*Malcolm Priestley
These values are read from pci but never used. Removing variables byRevId, SubSystemID, SubVendorID and pci_cmd. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: remove and move vt6655_init_infoMalcolm Priestley
move code to vt6655_probe. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: vt6655_init_info remove memset.Malcolm Priestley
vnt_private is allocated with kzalloc so is already zero. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: remove unused multicast_limit.Malcolm Priestley
multicast_limit is assigned a vale that is never used. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: Remove typedef struct __chip_info_tblMalcolm Priestley
Only two values that are assigned from this table. DEVICE_FLAGS_TX_ALIGN and the value of io_size which is used as the size of ioremap which is 256. Remove all variables, DEVICE_FLAGS_TX_ALIGN check, apply io_size value and chip_info_table. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: remove get_chip_name and info message.Malcolm Priestley
This prints "VIA Networking Solomon-A/B/G Wireless LAN Adapter" which has already printed once in vt6655_probe. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-14staging: vt6655: vt6655_probe remove PCI debug infoMalcolm Priestley
Remove unnecessary debug PCI info that can be obtained by lspci. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: vt6655: replace typedef struct tagSRxDescMalcolm Priestley
with struct vnt_rx_desc and all members the same. volatile is removed from pointers as this generates warning message. Only the first four members of vnt_rx_desc need to be volatile. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: vt6655: replace typedef struct tagDEVICE_RD_INFOMalcolm Priestley
with struct vnt_rd_info volatile is removed because it will generate a warning (in any case this member is not) and renaming rd_info. Signed-off-by: Malcolm Priestley <tvboxspy@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>