summaryrefslogtreecommitdiffstats
path: root/drivers/staging/ks7010/ks_wlan.h
diff options
context:
space:
mode:
authorTobin C. Harding <me@tobin.cc>2017-04-27 11:25:19 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-28 11:47:26 +0200
commit0e24eb8abf93a2e80ecbe97419d2d1fe089a7386 (patch)
tree843ed6348df2a10d81ff508083f646e993ee9591 /drivers/staging/ks7010/ks_wlan.h
parent11ce16da7b0f5335c7622ccc7c8151a387b44853 (diff)
downloadop-kernel-dev-0e24eb8abf93a2e80ecbe97419d2d1fe089a7386.zip
op-kernel-dev-0e24eb8abf93a2e80ecbe97419d2d1fe089a7386.tar.gz
staging: ks7010: abstract connection status
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>
Diffstat (limited to 'drivers/staging/ks7010/ks_wlan.h')
-rw-r--r--drivers/staging/ks7010/ks_wlan.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index eb15db9..a246539 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -508,5 +508,7 @@ struct ks_wlan_private {
int ks_wlan_net_start(struct net_device *dev);
int ks_wlan_net_stop(struct net_device *dev);
+bool is_connect_status(u32 status);
+bool is_disconnect_status(u32 status);
#endif /* _KS_WLAN_H */
OpenPOWER on IntegriCloud