aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks7010_sdio.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2017-04-18staging: ks7010: add struct comment to ks_sdio_cardTobin C. Harding1-0/+8
ks_sdio_card structure description does not have a kernel doc format comment. Add kernel doc format comment to struct ks_sdio_card. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: move hw info into dev private dataTobin C. Harding1-6/+0
Currently driver uses a hardware information struct description to group some SDIO related functionality (work, work queue, sdio private data pointer). This structure is then embedded in the device private data structure. Having nested structures described in different header files means that to view the device private data programmers must open two header files. This structure could be embedded anonymously in the device private data and achieve the same result (grouping of function specific to SDIO) without the need to open multiple headers. However, the SDIO private data structure already has various different data and pointers, adding the embedded structure adds little extra meaning and lengthens all the dereferences throughout the driver, often meaning addition line breaks and braces. We can increase readability and reduce code complexity by moving the hardware information data and pointers to directly be within the device private data structure description. While preparing for this refactoring it was noted that the identifier currently used for the delayed work is 'rw_wq', this is confusing since the 'wq' suffix typically means 'work queue'. This identifier would be more meaningful if it used the suffix 'dwork' as does the declaration of queue_delayed_work() (include/linux/workqueue.h). The identifier for the work queue is currently 'ks7010sdio_wq'. This identifier can be shortened without loss of meaning because there is only one work queue within the driver. Identifier 'wq' is typical within in-tree driver code and aptly describes the pointer. Current pointer to the SDIO private data is identified by 'sdio_card', this is sufficiently meaningful from within the hw_info structure but once the hw_info_t structure is removed the pointer would be better to have a prefix appended to it to retain the prior level of meaning. Move members from struct hw_info_t to struct ks_wlan_private. Rename identifiers; struct delayed_work pointer 'rw_wq' to 'rw_dwork'. struct workqueue_struct pointer 'ks7010sdio_wq' to 'wq'. struct ks_sdio_card pointer 'sdio_card' to 'ks_sdio_card'. Remove structure description hw_info_t. Fix init/destroy calls. Fix all call sites, SDIO private data access calls, and queuing calls. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: move tasklet_struct to ks_wlan_privateTobin C. Harding1-1/+0
Currently a pointer to the tasklet_struct used for bottom half processing on the receive path is within the hw_info_t structure. This structure is then embedded in the device private data structure. Having the tasklet_struct nested does not add meaning to the device private data, device private data already (and typically) has various data relating to the device, there is no real need to separate the tasklet_struct to a SDIO specific structure. While not adding allot of extra meaning having the nested structure means the programmer must open two header files to read the description of the device private data, the code would be easier to read if the device private data struct description was not spread over two files. Move tasklet_struct out of sdio header file and into the device private data structure description. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: clean up SDIO header commentsTobin C. Harding1-12/+34
SDIO header file does not use kernel doc format struct comments. Adding them aids readability and enables documentation to be built from the source code. Other comments may be tidied up as we do this. Add kernel format struct comments. Tidy up comments. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: fix complete_handlerTobin C. Harding1-3/+3
complete_handler() takes void * types as parameters. void * parameters are then cast to struct types. Call sites for this function either pass in NULL or pointers to the struct types cast to void *. This casting is unnecessary and can be removed. Struct tx_device_buffer (which contains a pointer member to the complete_handler() function) has as member 'ks_wlan_priv *priv' this is unnecessary, we always have a pointer to this struct there is no need to store it here. The complete_handler can be more clearly defined by using struct pointer types instead of void * types. The code is currently unnecessarily complex, storing and passing extraneous pointer parameters. Remove unnecessary parameters, unnecessary casting to/from 'void *'. Fix all call sites involving complete_handler(). Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: replace defines with enum typesTobin C. Harding1-5/+9
Header has multiple constants defined using preprocessor directive. In the cases where these are an integer progression an enumeration type can be used. Doing so adds documentation to the code and makes the usage explicit. Maintain original constant value, this value is returned by the device. Replace (integer progression) preprocessor constants with enumeration type. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: create reg_status_type enum typeTobin C. Harding1-8/+6
SDIO header currently defines unused constants READ_STATUS_BUSY and WRITE_STATUS_IDLE. There are reciprocal constants that are used READ_STATUS_IDLE and WRITE_STATUS_BUSY. We can roll these into a single enumeration type and remove the two that are unused. Add enumeration type containing IDLE/BUSY pair that are currently used within the SDIO source. Change source to use new enum types. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-14staging: ks7010: remove unused spin_lockTobin C. Harding1-1/+0
Driver SDIO private data structure description includes a spin_lock that is never used. This data structure only contains a pointer to the sdio_func and a pointer to the main device private data. A spin_lock is not required here. Remove unused spin_lock. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-14staging: ks7010: remove unused structure descriptionTobin C. Harding1-6/+0
Driver SDIO header describes a structure that is never used. It can be safely removed. Remove unused structure description. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-14staging: ks7010: remove unused read_bufTobin C. Harding1-1/+0
Driver SDIO code allocates memory for a buffer that is never used. It can be safely removed. Remove unused buffer, including allocation and freeing of memory. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-14staging: ks7010: remove unused completionTobin C. Harding1-1/+0
Driver SDIO code initializes a completion that is never used. It can be safely removed. Remove unused completion. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-03-16staging: ks7010: fix checkpatch SPACINGTobin C. Harding1-1/+1
Checkpatch emits WARNING: Unnecessary space before function pointer arguments. Remove unnecessary space before function pointer. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-16Staging: ks7010: ks*: Add missing blank lines after declarationsShiva Kerdel1-0/+1
A blank line should be added after function/struct/union/enum declarations. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03Staging: ks7010: ks7010_sdio.h: Trailing whitespaceManoj Sawai1-1/+1
Removed trailing whitespace. Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-01-03Staging: ks7010: ks7010_sdio.h: Complex macro not in parenthesesManoj Sawai1-1/+1
Fixed coding style error. Complex macro not inside parentheses. Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-12-06Staging: ks7010: ks7010_stio.h: fixed coding style errorManoj Sawai1-2/+2
Fixed 2 coding style errors about trailing whitespaces. Signed-off-by: Manoj Sawai <mas@iitkgp.ac.in> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-14Staging: ks7010: Prefer using the BIT macroPunit Vara1-8/+8
Replace all occurences of (1<<x) by BIT(x) in the file ks7010_sdio.h to get rid of checkpatch.pl "CHECK" output "Prefer using BIT macro". Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-16staging: ks7010: Replace __attribute__(aligned(x)) with __aligned(x)Sabitha George1-1/+1
Fixes checkpatch.pl warning: __aligned(size) is preferred over __attribute__((aligned(size)) in ks7010_sdio.h Signed-off-by: Sabitha George <sabitha.george@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: drop private handler for driver versionWolfram Sang1-1/+0
We are upstream now, we don't need seperate driver versioning. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: unify naming to ks7010Wolfram Sang1-0/+1
No 79xx anymore, this is confusing. Add a comment saying that old versions were probably named 7910/79xx. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-18staging: ks7010: remove cfg file handlingWolfram Sang1-1/+0
I verified that all but two settings from the config file can be set up also via 'iwconfig' or 'iwpriv'. The two missing are ROM_FILE and PhyInformationTimer. ROM_FILE can be easily dropped. There is only one known firmware floating on the net, so, the name is fix and we can make this constant. Frankly, I don't know when PhyInformationTimer needs to be set to non-zero. But if we need it somewhen, there is already (currently commented out) code to add this as another private method, so we could use that. Summa summarum: We can remove the config file handling and the example config file. The only useful action, initialization of the configuration struct, is now moved to the sdio main file. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: cleanup file headersWolfram Sang1-6/+2
Remove svn-ids and fix typos in the licence declaration. Add my copyright to the sdio code which I worked on mainly. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: remove supported card table with one elementWolfram Sang1-2/+0
There is only this card supported, no need to iterate over the table. The resulting firmware filename wasn't used anyway, but came from the config file or hardcoded default. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: indent ks7010_sdio.hWolfram Sang1-34/+30
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: remove unecessary typedefWolfram Sang1-1/+1
Let's simply specify the struct to keep in sync with kernel coding style. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: avoid workqueue racesWolfram Sang1-2/+0
My Spectec SDW823 card oopsed when it was already inserted during boot. When debugging this, I noticed that the card init was done in a seperate workqueue which was only activated once in probe. After removing the workqueue and calling the card init directly from probe, the OOPS went away. It turned out this is the same OOPS which happened when removing the card, so this seems possible now. Note: There is still a not-understood card-removed event during boot, but at least it doesn't crash anymore and the card will be re-probed right away. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: remove custom firmware loaderWolfram Sang1-5/+0
FW_LOADER works fine, no need for a open coded fallback. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-07staging: ks7010: add driver from Nanonote extra-repositoryWolfram Sang1-0/+165
See the TODO for details where this driver came from. Only a few minor changes were made to make the driver suitable for staging: * updated Kconfig help text and dependencies * added TODO * removed two __DATE__ and __TIME__ printouts to allow reproducible builds * added to staging main Kconfig + Makefile Tested on a Renesas Salvator-X board with a Spectec SDW-823 card. I could connect to a WPA-protected network. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>