aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/most/hdm-usb/hdm_usb.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-08-21staging: most: hdm-usb: provide MBO status when freeing buffersChristian Gromm1-3/+5
This patch adds the additional status parameter to function free_anchored_buffers. This allows to dispatch further processing based on this flag. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-21staging: most: hdm-usb: remove unused macro HW_RESYNCChristian Gromm1-1/+0
This patch removes the macro HW_RESYNC that is not used anymore. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: most: hdm-usb: reduce context of list_del mutexChristian Gromm1-5/+5
This patch reduces context of the list_del mutex for the function hdm_enqueue(). Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-15staging: most: hdm-usb: hdm_usb: don't print error when allocating urb failsWolfram Sang1-3/+1
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang <wsa-dev@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: most: hdm-usb: Remove invalid reference errorAmitoj Kaur Chawla1-2/+1
commit e3479f77("staging: most: hdm-usb: Remove create_workqueue()") cancel_work_sync(&anchor->clear_work_obj) is introduced after freeing `anchor` causing a invalid reference error. This patch removes this error by shifting the call to cancel_work_sync before freeing `anchor`. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-10Staging: most: Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN).Sandhya Bankar1-1/+1
Use usb_endpoint_dir_in(endpoint) instead of (endpoint->bEndpointAddress & USB_DIR_IN) to check if the endpoint has IN direction. This correction is based on following semantic patch, @@ struct usb_endpoint_descriptor *endpoint; expression E; @@ ( - endpoint->bEndpointAddress & USB_DIR_IN + usb_endpoint_dir_in(endpoint) | - endpoint->bEndpointAddress == USB_DIR_IN + usb_endpoint_dir_in(endpoint) | - (endpoint->bEndpointAddress & E) == USB_DIR_IN + usb_endpoint_dir_in(endpoint) ) Signed-off-by: Sandhya Bankar <bankarsandhya512@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-25staging: most: hdm-usb: Use macro DIV_ROUND_UPBhaktipriya Shridhar1-2/+1
The macro DIV_ROUND_UP performs the computation (((n) + (d) - 1) /(d)). It clarifies the divisor calculations. This occurence was detected using the coccinelle script: @@ expression e1; expression e2; @@ ( - ((e1) + e2 - 1) / (e2) + DIV_ROUND_UP(e1,e2) | - ((e1) + (e2 - 1))/ (e2) + DIV_ROUND_UP(e1,e2) ) The macro CEILING was dropped altogether and has been replaced with DIV_ROUND_UP. Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: most: hdm-usb: Remove create_workqueue()Amitoj Kaur Chawla1-11/+6
With concurrency managed workqueues, use of dedicated workqueues can be replaced by using system_wq. Drop schedule_usb_work by using system_wq. Since there is only one work item per buf_anchor and most_dev and they do not need to be ordered, increase of concurrency by switching to system_wq should not break anything. Both work items are sync canceled before the driver can be unregistered, to ensure no work item is pending or executing on any CPU by the time exit path is in flight. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: hdm-usb: Use setup_timerMuhammad Falak R Wani1-3/+2
Use the timer API function setup_timer instead of init_timer, removing the structure field assignments. <smpl> @timer@ expression e1,e2,e3,fn_ptr; @@ -init_timer(&e1); +setup_timer(&e1, fn_ptr, e2); ... when != fn_ptr = e3 -e1.function = fn_ptr; -e1.data = e2; </smpl> Signed-off-by: Muhammad Falak R Wani <falakreyaz@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: remove comparison to NULLChristian Gromm1-1/+1
Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: use blank line after declarationsChristian Gromm1-0/+4
This patch fixes style violation regarding blank lines after function/struct/union/enum declarations. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: use braces on all arms of statementChristian Gromm1-2/+3
This patch fixes style issues regarding braces on all arms of a statement. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24staging: most: remove multiple blank linesChristian Gromm1-1/+0
This patch removes the usage of multiple blank lines from driver modules. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16staging: most: make hdm-usb follow the coding styleChristian Gromm1-6/+8
This patch fixes a couple of issues of the hdm-usb module found by checkpatch.pl. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12Staging: most: Fix typo in staging/mostMasanari Iida1-2/+2
This patch fix spelling typo found in most Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: consolidate codeChristian Gromm1-6/+2
The function drci_rd_reg() always delivers little endian representation of the 16-bit DCI register. The value returned by this function must always be carefully converted from __le16 to u16 type. This patch moves all those conversions to the function itself. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: prevent DMA on stackChristian Gromm1-10/+16
This patch is needed to avoid having DMA on the stack. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: simplify codeChristian Gromm1-9/+8
This patch simply rearranges code for better readability. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: fix MAC address representationChristian Gromm1-8/+16
This patch fixes the representation of the MAC address within the HDM USB module. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: remove macro cpu_to_le16Christian Gromm1-4/+4
This patch removes the wrongly used macros cpu_to_le16 Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: fix buffer synchronization requestChristian Gromm1-31/+10
Revision D of OS81118 network interface controller have the internal buffer synchronization mechanism changed. This patch adapts the driver to this. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: remove dead codeChristian Gromm1-6/+0
The case where the channel type is neither synchronous nor isochronous is already covered by a previous condition. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: remove unnecessary field initializationChristian Gromm1-1/+0
Since conf->extra_len has already been reset in most_start_channel() when function hdm_configure_channel() gets called, it can safely be removed here. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29staging: most: fix USB babble on IN pipeChristian Gromm1-1/+2
This patch prevents the HDM USB from submitting an URB with a buffer size unaligned to 512 bytes to the USB subsystem. Signed-off-by: Andrey Shvetsov <andrey.shvetsov@k2l.de> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: most: style of bool comparisonSudip Mukherjee1-5/+5
BOOLEAN tests do not need any comparison to TRUE or FALSE. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-12staging: most: remove unused variableSudip Mukherjee1-3/+0
The variable conf was only assigned the value but was never used. Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-14Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword" warningsAdrian Remonda1-8/+8
This is a patch to the most/hdm-usb/hdm_usb.c file. It makes several local functions and structures static to prevent global visibility. Signed-off-by: Adrian Remonda <adrianremonda@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31Staging: most: replace pr_*() functions by dev_*()Christian Gromm1-57/+59
This patch replaces pr_*() functions with dev_*(). Reported-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-31Staging: most: fix doing DMA on stackChristian Gromm1-13/+23
This patch fixes error "doing DMA on the stack" by using kzalloc for buffer allocation. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-24Staging: most: add MOST driver's hdm-usb moduleChristian Gromm1-0/+1442
This patch adds the hdm-usb module of the MOST driver to the kernel's driver staging area. This module is part of the MOST driver and handles the USB interface of the MOST network interface controller. This patch is needed in order to use the USB peripheral interface of the network interface controller. Signed-off-by: Christian Gromm <christian.gromm@microchip.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>