aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/wilc1000/wilc_wlan.c
diff options
context:
space:
mode:
authorGlen Lee <glen.lee@atmel.com>2016-02-04 18:15:30 +0900
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-02-07 17:34:58 -0800
commitef7e012fdc8b5c1d129429cf0cd68ddb0ccc6599 (patch)
treedeac69ce13129874da0468832d03f79ce1bda392 /drivers/staging/wilc1000/wilc_wlan.c
parentstaging: wilc1000: get mac address after setting drv handler (diff)
downloadlinux-dev-ef7e012fdc8b5c1d129429cf0cd68ddb0ccc6599.tar.xz
linux-dev-ef7e012fdc8b5c1d129429cf0cd68ddb0ccc6599.zip
staging: wilc1000: move wilc_send_config_pkt to wilc_wlan.c
This patch moves the function wilc_send_config_pkt to wilc_wlan.c which handles transport since the purpose of the function is sending/getting of config information. coreconfiguator.[ch] will be rename with frame.[ch] later. The print codes of the function is removed also and they will be implemented with netdev_xx print format later. struct wid need to be moved to wilc_wlan_if.h which defines configure informations. Signed-off-by: Glen Lee <glen.lee@atmel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000/wilc_wlan.c')
-rw-r--r--drivers/staging/wilc1000/wilc_wlan.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/drivers/staging/wilc1000/wilc_wlan.c b/drivers/staging/wilc1000/wilc_wlan.c
index 04d4c92e3948..265ddfe3a924 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1439,6 +1439,45 @@ int wilc_wlan_cfg_get_val(u32 wid, u8 *buffer, u32 buffer_size)
return ret;
}
+s32 wilc_send_config_pkt(struct wilc *wilc, u8 mode, struct wid *wids,
+ u32 count, u32 drv)
+{
+ s32 counter = 0, ret = 0;
+
+ if (mode == GET_CFG) {
+ for (counter = 0; counter < count; counter++) {
+ if (!wilc_wlan_cfg_get(wilc, !counter,
+ wids[counter].id,
+ (counter == count - 1),
+ drv)) {
+ ret = -ETIMEDOUT;
+ break;
+ }
+ }
+ counter = 0;
+ for (counter = 0; counter < count; counter++) {
+ wids[counter].size = wilc_wlan_cfg_get_val(
+ wids[counter].id,
+ wids[counter].val,
+ wids[counter].size);
+ }
+ } else if (mode == SET_CFG) {
+ for (counter = 0; counter < count; counter++) {
+ if (!wilc_wlan_cfg_set(wilc, !counter,
+ wids[counter].id,
+ wids[counter].val,
+ wids[counter].size,
+ (counter == count - 1),
+ drv)) {
+ ret = -ETIMEDOUT;
+ break;
+ }
+ }
+ }
+
+ return ret;
+}
+
static u32 init_chip(struct net_device *dev)
{
u32 chipid;