summaryrefslogtreecommitdiff
path: root/drivers/staging/ks7010
AgeCommit message (Collapse)Author
2017-08-31staging: ks7010: Fix coding style and remove checkpatch.pl warnings.Jonathan Whitaker
Removed printk statements for debugging. The same information can be acquired via ftrace, so these print statements are uneccessary. Signed-off-by: Jonathan Whitaker <jon.b.whitaker@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-29Staging: ks7010: Fix alignment should match open parenthesis.Jonathan Whitaker
This commit fixes alignment styling as reported by checkpatch.pl. Signed-off-by: Jonathan Whitaker <jon.b.whitaker@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-16staging: ks7010: Fix cast to restricted __le16 in ks_wlan_net.cJanusz Lisiecki
This patch fixes the following Sparse warnings in ks_wlan_net.c: drivers/staging/ks7010/ks_wlan_net.c:1359:24: warning: cast to restricted __le16 link_ap_info_t structure field 'capability' has native order and is used everywhere in the code in such way (i.e get_ap_information, get_current_ap). Both sides of assignment are u16 (native order) so 'le16_to_cpu' is not needed and wrong. Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-05Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-nextLinus Torvalds
Pull networking updates from David Miller: "Reasonably busy this cycle, but perhaps not as busy as in the 4.12 merge window: 1) Several optimizations for UDP processing under high load from Paolo Abeni. 2) Support pacing internally in TCP when using the sch_fq packet scheduler for this is not practical. From Eric Dumazet. 3) Support mutliple filter chains per qdisc, from Jiri Pirko. 4) Move to 1ms TCP timestamp clock, from Eric Dumazet. 5) Add batch dequeueing to vhost_net, from Jason Wang. 6) Flesh out more completely SCTP checksum offload support, from Davide Caratti. 7) More plumbing of extended netlink ACKs, from David Ahern, Pablo Neira Ayuso, and Matthias Schiffer. 8) Add devlink support to nfp driver, from Simon Horman. 9) Add RTM_F_FIB_MATCH flag to RTM_GETROUTE queries, from Roopa Prabhu. 10) Add stack depth tracking to BPF verifier and use this information in the various eBPF JITs. From Alexei Starovoitov. 11) Support XDP on qed device VFs, from Yuval Mintz. 12) Introduce BPF PROG ID for better introspection of installed BPF programs. From Martin KaFai Lau. 13) Add bpf_set_hash helper for TC bpf programs, from Daniel Borkmann. 14) For loads, allow narrower accesses in bpf verifier checking, from Yonghong Song. 15) Support MIPS in the BPF selftests and samples infrastructure, the MIPS eBPF JIT will be merged in via the MIPS GIT tree. From David Daney. 16) Support kernel based TLS, from Dave Watson and others. 17) Remove completely DST garbage collection, from Wei Wang. 18) Allow installing TCP MD5 rules using prefixes, from Ivan Delalande. 19) Add XDP support to Intel i40e driver, from Björn Töpel 20) Add support for TC flower offload in nfp driver, from Simon Horman, Pieter Jansen van Vuuren, Benjamin LaHaise, Jakub Kicinski, and Bert van Leeuwen. 21) IPSEC offloading support in mlx5, from Ilan Tayari. 22) Add HW PTP support to macb driver, from Rafal Ozieblo. 23) Networking refcount_t conversions, From Elena Reshetova. 24) Add sock_ops support to BPF, from Lawrence Brako. This is useful for tuning the TCP sockopt settings of a group of applications, currently via CGROUPs" * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next: (1899 commits) net: phy: dp83867: add workaround for incorrect RX_CTRL pin strap dt-bindings: phy: dp83867: provide a workaround for incorrect RX_CTRL pin strap cxgb4: Support for get_ts_info ethtool method cxgb4: Add PTP Hardware Clock (PHC) support cxgb4: time stamping interface for PTP nfp: default to chained metadata prepend format nfp: remove legacy MAC address lookup nfp: improve order of interfaces in breakout mode net: macb: remove extraneous return when MACB_EXT_DESC is defined bpf: add missing break in for the TCP_BPF_SNDCWND_CLAMP case bpf: fix return in load_bpf_file mpls: fix rtm policy in mpls_getroute net, ax25: convert ax25_cb.refcount from atomic_t to refcount_t net, ax25: convert ax25_route.refcount from atomic_t to refcount_t net, ax25: convert ax25_uid_assoc.refcount from atomic_t to refcount_t net, sctp: convert sctp_ep_common.refcnt from atomic_t to refcount_t net, sctp: convert sctp_transport.refcnt from atomic_t to refcount_t net, sctp: convert sctp_chunk.refcnt from atomic_t to refcount_t net, sctp: convert sctp_datamsg.refcnt from atomic_t to refcount_t net, sctp: convert sctp_auth_bytes.refcnt from atomic_t to refcount_t ...
2017-06-29staging: ks7010: fix spelling mistake: "errror" -> "error"Colin Ian King
Trivial fix to spelling mistake in netdev_err message Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-16networking: introduce and use skb_put_data()Johannes Berg
A common pattern with skb_put() is to just want to memcpy() some data into the new space, introduce skb_put_data() for this. An spatch similar to the one for skb_put_zero() converts many of the places using it: @@ identifier p, p2; expression len, skb, data; type t, t2; @@ ( -p = skb_put(skb, len); +p = skb_put_data(skb, data, len); | -p = (t)skb_put(skb, len); +p = skb_put_data(skb, data, len); ) ( p2 = (t2)p; -memcpy(p2, data, len); | -memcpy(p, data, len); ) @@ type t, t2; identifier p, p2; expression skb, data; @@ t *p; ... ( -p = skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); | -p = (t *)skb_put(skb, sizeof(t)); +p = skb_put_data(skb, data, sizeof(t)); ) ( p2 = (t2)p; -memcpy(p2, data, sizeof(*p)); | -memcpy(p, data, sizeof(*p)); ) @@ expression skb, len, data; @@ -memcpy(skb_put(skb, len), data, len); +skb_put_data(skb, data, len); (again, manually post-processed to retain some comments) Reviewed-by: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2017-06-13staging: ks7010: use little-endian typesPerry Hooker
This patch fixes a number of sparse warnings of the form: drivers/staging/ks7010/ks_hostif.c:2187:29: warning: incorrect type in assignment (different base types) generated when storing little-endian data in variables that do not have a specified endianness. Signed-off-by: Perry Hooker <perry.hooker@gmail.com> Reviewed-By: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-04staging: ks7010: use le16_to_cpu() to access __le16 fieldRichard Porter
Fixes sparse warning: drivers/staging/ks7010/ks_hostif.c:959:24: warning: restricted __le16 degrades to integer Signed-off-by: Richard Porter <dick@acm.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-18staging: ks7010: avoid CamelCase: receiveDTIMsJanusz Lisiecki
Replace CamelCase variable name with underscores to comply with the standard kernel coding style. Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-16staging: ks7010: avoid CamelCase: local variables in ks_hostif.cJanusz Lisiecki
Replace CamelCase local variables' name with underscores to comply with the standard kernel coding style. Changed: - LinkSpeed - TransmittedFrameCount - ReceivedFragmentCount - FailedCount - FCSErrorCount Signed-off-by: Janusz Lisiecki <janusz.lisiecki@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: ks7010: hostif, u32 data types to __le32Tobin C. Harding
Target device is little endian. Host interface data structures used for building frames to pass to target device should use little endian data types. All u32 structure members in ks_hostif.h need to be changed to __le32. Change all u16 data types in host interface structures to be __le32. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: ks7010: hostif, u16 data types to __le16Tobin C. Harding
Target device is little endian. Host interface data structures used for building frames to pass to target device should use little endian data types. All u16 structure members in ks_hostif.h need to be changed to __le16, Sparse can then be used to make sure we update all code that touches these data. Change all u16 data types in host interface structures to be __le16. Update all code that touches modified data types. Check using Sparse. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: ks7010: eap, change unsigned short to __be16Tobin C. Harding
Sparse emits warning: cast to restricted __be16. EAP header uses network byte order. The structures used to describe it should use __beXX data types. Change data type unsigned short -> __be16. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-15staging: ks7010: avoid CamelCase: reqIEs_size and respIEs_sizeJanusz Lisiecki
Replace CamelCase association_request_t and association_response_t struct field names 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>
2017-05-15staging: ks7010: avoid CamelCase: atimWindowJanusz Lisiecki
Replace CamelCase variable name 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>
2017-05-15staging: ks7010: avoid CamelCase: CfParms_t fieldsJanusz Lisiecki
Replace CamelCase struct field names with underscores to comply with the standard kernel coding style. Changed: - maxDuration - durRemaining 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>
2017-05-15staging: ks7010: avoid CamelCase: link_ap_info_t fieldsJanusz Lisiecki
Replace CamelCase struct field names with underscores to comply with the standard kernel coding style. Changed: - FhParms_t - DsParms_t - CfParms_t - IbssParms_t - ErpParams_t 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>
2017-05-15staging: ks7010: avoid CamelCase: FhParms_t fieldsJanusz Lisiecki
Replace CamelCase struct field names with underscores to comply with the standard kernel coding style. Changed: - dwellTime - hopSet - hopPattern - hopIndex 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>
2017-05-15staging: ks7010: avoid CamelCase in fields of struct local_gain_tJanusz Lisiecki
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>
2017-05-15staging/ks7010: Fix type assignment for struct hostif_hdrCezary Gapinski
Sparse spits out a warnings about __le16 and unsigned short assignment. Change the type of size and event members of struct hostif_hdr to __le16 and correct conversion to the proper cpu type. Signed-off-by: Cezary Gapinski <gapalinux@gmail.com> Reviewed-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove line continuations in quoted stringsIlia Sergachev
Checkpatch emits WARNING: Avoid line continuations in quoted strings. Remove line continuations - split strings using quotes. Signed-off-by: Ilia Sergachev <ilia.sergachev@unibas.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: fix enumeration tagsTobin C. Harding
Driver header declares enumeration types without tags. Using informative tags makes the code easier to understand and eliminates the need to comment the enum. Add tags to enumeration types. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: add enum multicast_filter_typeTobin C. Harding
Driver uses preprocessor directives to define multicast filter constants. These can be defined using an enumeration type. Doing so adds to the readability and gives the assists the compiler. Add enumeration type multicast_filter_type to replace preprocessor defined constants. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: clean up macro ps_confirm_wait_incTobin C. Harding
Macro includes commented out code. Removing dead code line enables braces to be removed. Macro is easier to read if the code is clean. Clean up macro ps_confirm_wait_inc. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: continue from loop on unmatched macTobin C. Harding
Inside loop, code block is guarded with an 'if' statement. Instead of guarding the block we can invert the 'if' statement conditional and continue the loop. Doing so allows subsequent code indentation to be reduced and aids the readability of the code. Invert 'if' statement conditional, continue loop if new conditional evaluates to true. Reduce subsequent code indentation level. Do not change program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove cast from netdev_priv()Tobin C. Harding
The returned pointer from netdev_priv() (void *) does not need to be cast. Remove unnecessary cast of void * returned by netdev_priv(). Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: make abbreviation mgmt uniformTobin C. Harding
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>
2017-04-28staging: ks7010: fix checkpatch LINE_SPACINGTobin C. Harding
Checkpatch emits CHECK: Please don't use multiple blank lines. Remove multiple blank lines. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: add enum sleep_mode_typeTobin C. Harding
Driver uses preprocessor directives to define SLP_ASLEEP and SLP_ACTIVE. These can be defined using an enumeration type. Doing so adds to the readability and gives the usual compiler benefits of having an enum. Functions that currently accept integer types can now use the new enumeration type, further aiding readability. Add enumeration type sleep_mode_type. Update code that handles sleep mode to use the new enumeration type. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: abstract connection statusTobin C. Harding
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>
2017-04-28staging: ks7010: add hostif_generic_request()Tobin C. Harding
Driver contains duplicate code. Host interface has numerous request functions which allocate memory for a request header. Each request header is different but all contain, as the first member, a hostif_hdr structure. This structure has size and event members which need to be set. By defining a helper function to allocate the memory and set the initial hostif_hdr members code duplication is reduced. Add function to allocate memory for a host interface request. Set 'size' and 'event' members. Remove duplicate code using newly defined function. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: clean memory allocationTobin C. Harding
Memory allocation code contains unneeded debug statements, failed kmalloc() calls typically do not require a debug message. Introduction of a local 'size' variable allows kmalloc() call to be marginally cleaner, still uses magic numbers but these require a more substantial fix. Moving the magic numbers onto a single line opens the way for further refactoring. Clean memory allocation code, remove debug statements. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove duplicate codeTobin C. Harding
Current switch statement has duplicate code in branches. This code can be put after the switch statement so as to remove the duplication. Move code to after switch statement, remove duplicate code. Make error branch return so as not to execute the moved code block. Do not change the program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove magic numbersTobin C. Harding
Driver includes magic numbers. Defining constants or using existing constants aids the readability of the code. Magic number '12' is used for two ethernet addresses (6 bytes each). ETH_ALEN is already defined within the kernel to 6. We can us the expression '2 * ETH_ALEN' to make this code explicit. Magic number '20' refers to the data size, in bytes, of a struct ether_hdr (described in eap_packet.h). We can define a constant for this purpose, making the code explicit and easier to read. Define constant. Remove magic numbers, using newly defined constant and/or expression using existing kernel constant. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: move skb null check near allocationTobin C. Harding
Currently, after allocating an sk_buff, driver fills the sk_buff within code block guarded by a NULL check on the sk_buff. If a NULL check is done immediately after the allocation, and code returns on error, then the subsequent code need not be guarded and the level of indentation may be reduced. This aids the readability of the code and makes explicit the error path. Check for NULL directly after allocating the sk_buff, return if allocation fails. Reduce indentation of subsequent code. Do not change the program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove unused local variable eap_keyTobin C. Harding
Code declares and assigns to a local variable that is never used, it can be safely removed. Remove unused local variable. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-28staging: ks7010: remove unnecessary address checkTobin C. Harding
Currently source and destination ethernet addresses are checked twice, once in hostif_data_indication() and then again in hostif_data_indication_wpa(). The second of these functions is called from the first right after the address check is done. This check is a duplicate and is unnecessary. Remove unnecessary duplicate address check. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: fix checkpatch SPLIT_STRINGTobin C. Harding
Checkpatch emits WARNING: quoted string split across lines. Concatenate string onto single line. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: refactor SDIO read/write helpersTobin C. Harding
Driver SDIO code uses helper functions to do IO to the SDIO device. Current helpers handle IO of a single byte as well as multi-byte. Driver predominately uses single byte IO. If the common case is made simple it simplifies the whole driver. The common case can be made simple by splitting the multi-byte and single byte calls into separate functions, i.e 4 functions in total, read single byte, read multi-byte, write single byte, write multi-byte. Also, we need to handle the debug code. Currently debug calls after read/write fail access the IO buffer. This buffer, at best, does not hold useful data on the error path, at worst is uninitialized and holds garbage. Split read/write helper functions into two functions each, one for single byte IO and one for multi-byte IO. Fix all call sites. Do not change the program logic. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: fix checkpatch LINE_SPACINGTobin C. Harding
Checkpatch emits CHECK: Please don't use multiple blank lines. Remove multiple blank lines. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: fix checkpatch SPACE_BEFORE_TABTobin C. Harding
Checkpatch emits WARNING: please, no space before tabs. Remove space before tabs. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: remove err_ from non-error path labelTobin C. Harding
goto label includes 'err_' suffix but is executed on non-error paths. Remove err_ suffix from goto label. 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 source commentsTobin C. Harding
SDIO code currently has a number of unneeded comments. Following kernel coding style we do not need extraneous comments, especially on code where it is clear what is being done. Spelling typos can be fixed. Remove unnecessary comments, fix typos in comments. Signed-off-by: Tobin C. Harding <me@tobin.cc> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-18staging: ks7010: add struct comment to ks_sdio_cardTobin C. Harding
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. Harding
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. Harding
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: rename wakeup work structTobin C. Harding
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>
2017-04-18staging: ks7010: clean up SDIO header commentsTobin C. Harding
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. Harding
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. Harding
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>