summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_wlan.h
Commit message (Collapse)AuthorAgeFilesLines
* staging: ks7010: avoid CamelCase in fields of struct local_gain_tJanusz Lisiecki2017-05-151-4/+4
| | | | | | | | | Replace CamelCase fields of struct with underscores to comply with the standard kernel coding style Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Reviewed-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: make abbreviation mgmt uniformTobin C. Harding2017-04-281-1/+1
| | | | | | | | | | | | | | | | Driver currently uses abbreviations 'mgt' and 'mngmt' for 'management'. Also 'power' is sometimes abbreviated to 'pow' and other times not. It makes the code easier to read and easier to modify if one abbreviation is used throughout the driver. 'mgmt' is widely accepted as an abbreviation of 'management'. 'power' can be spelled out in full, the extra two characters aids readability without an excessive cost. Make abbreviation of 'management' uniform across the driver, function names, preprocessor defined constants, and enumeration types. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: abstract connection statusTobin C. Harding2017-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Host interface connection status is handled using a 32 bit type. Top byte is used as for FORCE_DISCONNECT status, low bits are used for connect/disconnect status. Driver masks and checks integers to ascertain status. If functions are defined to do the masking and equality check then the details of how the status integer is used are abstracted away. This makes the code easier to read. Also future updates to the status handling will be easier because the code is in one place. Driver currently uses the CONNECT_STATUS and DISCONNECT_STATUS as values, as apposed to opaque values. Because of this driver code checks for equality with CONNECT_STATUS and DISCONNECT_STATUS as apposed to negating a single check (ie 'foo != CONNECT_STATUS). In order to maintain the current functionality we define two separate functions is_connect_status() and is_disconnect_status(). Add functions to abstract the status integer check. Update all sites that do the check manually to use the newly defined functions. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: move hw info into dev private dataTobin C. Harding2017-04-181-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: ks7010: move tasklet_struct to ks_wlan_privateTobin C. Harding2017-04-181-0/+1
| | | | | | | | | | | | | | | | | | | | 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>
* staging: ks7010: rename wakeup work structTobin C. Harding2017-04-181-1/+1
| | | | | | | | | | | | | | struct work_struct uses identifier ks_wlan_wakeup_task, this is confusing because the 'task' suffix implies that this is a tasklet_struct instead of a work struct. Suffix 'work' would be more clear. The code would be easier to read if it followed the principle of least surprise and used the 'work' suffix for a work_struct identifier. Rename work_struct structure 'ks_wlan_wakeup_task' to 'wakeup_work'. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix coding style issue of aligning comments properlyChetan Sethi2017-03-061-1/+2
| | | | | | | | This patch fixes coding style issue of having block comments using a trailing */ on a separate line, warning as issued by checkpatch Signed-off-by: Chetan Sethi <cpsethi369@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix coding style issue of using __func__ instead of ↵Chetan Sethi2017-03-061-1/+1
| | | | | | | | | | __FUNCTION__ This patch fixes coding style issue of using __func__ instead of gcc specific __FUNCTION__, warning as issued by checkpatch Signed-off-by: Chetan Sethi <cpsethi369@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix coding style issue of using pr_notice instead of printkChetan Sethi2017-03-061-1/+1
| | | | | Signed-off-by: Chetan Sethi <cpsethi369@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fix coding style issue of enclosing complex macro value in ↵Chetan Sethi2017-03-061-2/+4
| | | | | | | | | | parentheses This patch fixes error of enclosing complex macro value in parentheses, error as issued by checkpatch Signed-off-by: Chetan Sethi <cpsethi369@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: fixed warning of avoiding line over 80 charactersChetan Sethi2017-03-061-5/+6
| | | | | | | | This patch fixes warning of line over 80 characters, as issued by checkpatch.pl Signed-off-by: Chetan Sethi <cpsethi369@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: ks_*: Use the BIT macro for bitwise checksShiva Kerdel2017-03-061-15/+15
| | | | | | | | | Changed bit swifting operators to BIT macros (preferred), This change will also solve the preferred space surrounding the operator checks. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: Add required and preferred spaces around operatorsShiva Kerdel2017-02-161-2/+2
| | | | | | | | Spaces should be added around operators to improve readability and are required in some cases. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: ks*: Add missing blank lines after declarationsShiva Kerdel2017-02-161-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>
* Staging: ks7010: ks_*: Removed blank lines before and after braces.Shiva Kerdel2017-02-121-1/+0
| | | | | | | Removing unnecessary blank lines around braces to solve CHECKS. Signed-off-by: Shiva Kerdel <shiva@exdev.nl> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: Use preffered kernel typesPunit Vara2016-11-161-69/+69
| | | | | | | | Replace uint8_t, uint16_t and uint32_t with preferred kernel types u8, u16 and u32 respectively suggested by checkpatch.pl Signed-off-by: Punit Vara <punitvara@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unused including <linux/version.h>Wei Yongjun2016-10-251-1/+0
| | | | | | | Remove including <linux/version.h> that don't need it. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: Replace header filesSabitha George2016-10-161-2/+2
| | | | | | | | This patch replaces inclusion of asm/atomic.h with linux/atomic.h and asm/io.h with linux/io.h to fix checkpatch warning in ks_wlan.h Signed-off-by: Sabitha George <sabitha.george@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: Use __packed over __attribute__((packed))Matt Kilgore2016-09-271-2/+2
| | | | | | | | | This replaces uses of __attribute__((packed)) with __packed, which is recommended to be used over the direct __attribute__. This patch then includes <linux/compiler.h> as necessary to use __packed. Signed-off-by: Matthew Kilgore <mattkilgore12@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* Staging: ks7010: Remove extern keyword from function declarationBhumika Goyal2016-09-171-2/+2
| | | | | | | | | | | | | | | | | Remove extern specifier from function declaration as they have it by default. Also move extern declaration from .c files to their respective header file 'ks_hostif.h'. Coccinelle was used to remove extern and other changes were done by hand. Script: @@ identifier func; type T; @@ - extern T func(...); Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: function declaration should be in a header fileWolfram Sang2016-06-181-0/+3
| | | | | Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove cfg file handlingWolfram Sang2016-06-181-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>
* staging: ks7010: cleanup file headersWolfram Sang2016-06-071-5/+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>
* staging: ks7010: drop counting sd errorsWolfram Sang2016-06-071-2/+0
| | | | | | | | | They were counted but never really used anywhere. Also change the printk to a debug print, since it mostly shows on the expected -ENOMEDIUM on card removal. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: indent ks_wlan.hWolfram Sang2016-06-071-125/+121
| | | | | Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove unecessary typedefWolfram Sang2016-06-071-2/+2
| | | | | | | | 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>
* staging: ks7010: delete seperate debug headerWolfram Sang2016-06-071-0/+7
| | | | | | | Move the one debug macro to the generic wlan header. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove code for old kernel versionsWolfram Sang2016-06-071-27/+1
| | | | | | | No need to be backwards compatible. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: remove non-SDIO code and #ifdefsWolfram Sang2016-06-071-10/+0
| | | | | | | | I couldn't find any trace of code or even products using ks7010 with something else than SDIO. So, remove the conditionals. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: ks7010: add driver from Nanonote extra-repositoryWolfram Sang2016-06-071-0/+541
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>
OpenPOWER on IntegriCloud