From: Ajay Singh <ajay.kathat@microchip.com>
To: <linux-wireless@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>, <gregkh@linuxfoundation.org>,
<ganesh.krishna@microchip.com>, <venkateswara.kaja@microchip.com>,
<aditya.shankar@microchip.com>, <claudiu.beznea@microchip.com>,
<adham.abozaeid@microchip.com>,
Ajay Singh <ajay.kathat@microchip.com>
Subject: [PATCH 21/24] staging: wilc1000: remove unused code to set and get IP address
Date: Tue, 14 Aug 2018 12:20:13 +0530 [thread overview]
Message-ID: <1534229416-13254-22-git-send-email-ajay.kathat@microchip.com> (raw)
In-Reply-To: <1534229416-13254-1-git-send-email-ajay.kathat@microchip.com>
Cleanup code to remove the variables related to setting and getting IP
address as this case was not handled from firmware side.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
---
drivers/staging/wilc1000/host_interface.c | 105 ------------------------------
drivers/staging/wilc1000/host_interface.h | 3 -
drivers/staging/wilc1000/linux_wlan.c | 3 -
3 files changed, 111 deletions(-)
diff --git a/drivers/staging/wilc1000/host_interface.c b/drivers/staging/wilc1000/host_interface.c
index bffe0c8..f37ba64 100644
--- a/drivers/staging/wilc1000/host_interface.c
+++ b/drivers/staging/wilc1000/host_interface.c
@@ -187,11 +187,6 @@ struct join_bss_param {
static u8 p2p_listen_state;
-static u8 set_ip[2][4];
-static u8 get_ip[2][4];
-
-static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
-
/* 'msg' should be free by the caller for syc */
static struct host_if_msg*
wilc_alloc_work(struct wilc_vif *vif, void (*work_fun)(struct work_struct *),
@@ -344,64 +339,6 @@ static void handle_set_operation_mode(struct work_struct *work)
kfree(msg);
}
-static void handle_set_ip_address(struct work_struct *work)
-{
- struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
- struct wilc_vif *vif = msg->vif;
- u8 *ip_addr = msg->body.ip_info.ip_addr;
- u8 idx = msg->body.ip_info.idx;
- int ret;
- struct wid wid;
- char firmware_ip_addr[4] = {0};
-
- if (ip_addr[0] < 192)
- ip_addr[0] = 0;
-
- memcpy(set_ip[idx], ip_addr, IP_ALEN);
-
- wid.id = WID_IP_ADDRESS;
- wid.type = WID_STR;
- wid.val = ip_addr;
- wid.size = IP_ALEN;
-
- ret = wilc_send_config_pkt(vif, SET_CFG, &wid, 1,
- wilc_get_vif_idx(vif));
-
- host_int_get_ipaddress(vif, firmware_ip_addr, idx);
-
- if (ret)
- netdev_err(vif->ndev, "Failed to set IP address\n");
- kfree(msg);
-}
-
-static void handle_get_ip_address(struct work_struct *work)
-{
- struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
- struct wilc_vif *vif = msg->vif;
- u8 idx = msg->body.ip_info.idx;
- int ret;
- struct wid wid;
-
- wid.id = WID_IP_ADDRESS;
- wid.type = WID_STR;
- wid.val = kmalloc(IP_ALEN, GFP_KERNEL);
- wid.size = IP_ALEN;
-
- ret = wilc_send_config_pkt(vif, GET_CFG, &wid, 1,
- wilc_get_vif_idx(vif));
-
- memcpy(get_ip[idx], wid.val, IP_ALEN);
-
- kfree(wid.val);
-
- if (memcmp(get_ip[idx], set_ip[idx], IP_ALEN) != 0)
- wilc_setup_ipaddress(vif, set_ip[idx], idx);
-
- if (ret)
- netdev_err(vif->ndev, "Failed to get IP address\n");
- kfree(msg);
-}
-
static void handle_get_mac_address(struct work_struct *work)
{
struct host_if_msg *msg = container_of(work, struct host_if_msg, work);
@@ -4002,48 +3939,6 @@ int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
return result;
}
-int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
-{
- int result;
- struct host_if_msg *msg;
-
- msg = wilc_alloc_work(vif, handle_set_ip_address, false);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- msg->body.ip_info.ip_addr = ip_addr;
- msg->body.ip_info.idx = idx;
-
- result = wilc_enqueue_work(msg);
- if (result) {
- netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
- kfree(msg);
- }
-
- return result;
-}
-
-static int host_int_get_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx)
-{
- int result;
- struct host_if_msg *msg;
-
- msg = wilc_alloc_work(vif, handle_get_ip_address, false);
- if (IS_ERR(msg))
- return PTR_ERR(msg);
-
- msg->body.ip_info.ip_addr = ip_addr;
- msg->body.ip_info.idx = idx;
-
- result = wilc_enqueue_work(msg);
- if (result) {
- netdev_err(vif->ndev, "%s: enqueue work failed\n", __func__);
- kfree(msg);
- }
-
- return result;
-}
-
int wilc_set_tx_power(struct wilc_vif *vif, u8 tx_power)
{
int ret;
diff --git a/drivers/staging/wilc1000/host_interface.h b/drivers/staging/wilc1000/host_interface.h
index 80cb298..0f0d509 100644
--- a/drivers/staging/wilc1000/host_interface.h
+++ b/drivers/staging/wilc1000/host_interface.h
@@ -9,8 +9,6 @@
#include <linux/ieee80211.h>
#include "coreconfigurator.h"
-#define IP_ALEN 4
-
#define IDLE_MODE 0x00
#define AP_MODE 0x01
#define STATION_MODE 0x02
@@ -344,7 +342,6 @@ int wilc_edit_station(struct wilc_vif *vif,
int wilc_set_power_mgmt(struct wilc_vif *vif, bool enabled, u32 timeout);
int wilc_setup_multicast_filter(struct wilc_vif *vif, bool enabled,
u32 count);
-int wilc_setup_ipaddress(struct wilc_vif *vif, u8 *ip_addr, u8 idx);
int wilc_remain_on_channel(struct wilc_vif *vif, u32 session_id,
u32 duration, u16 chan,
wilc_remain_on_chan_expired expired,
diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c
index bbaa653..74f8166 100644
--- a/drivers/staging/wilc1000/linux_wlan.c
+++ b/drivers/staging/wilc1000/linux_wlan.c
@@ -61,7 +61,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
netdev_dbg(dev, "IP add=%d:%d:%d:%d\n",
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
- wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx);
break;
@@ -83,8 +82,6 @@ static int dev_state_ev_handler(struct notifier_block *this,
ip_addr_buf[0], ip_addr_buf[1],
ip_addr_buf[2], ip_addr_buf[3]);
- wilc_setup_ipaddress(vif, ip_addr_buf, vif->idx);
-
break;
default:
--
2.7.4
next prev parent reply other threads:[~2018-08-14 9:37 UTC|newest]
Thread overview: 61+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-14 6:49 [PATCH 00/24] staging: wilc1000: avoid use of static and global variable Ajay Singh
2018-08-14 6:49 ` [PATCH 01/24] staging: wilc1000: move 'wilc_enable_ps' global variable into 'wilc' struct Ajay Singh
2018-08-14 6:49 ` [PATCH 02/24] staging: wilc1000: move 'aging_timer' static variable to wilc_priv struct Ajay Singh
2018-08-14 6:49 ` [PATCH 03/24] staging: wilc1000: fix to use correct index to free scanned info in clear_shadow_scan() Ajay Singh
2018-08-14 6:49 ` [PATCH 04/24] staging: wilc1000: remove unnecessary NULL check " Ajay Singh
2018-08-14 6:49 ` [PATCH 05/24] staging: wilc1000: moved last_scanned_shadow & last_scanned_cnt to wilc_priv struct Ajay Singh
2018-08-14 6:49 ` [PATCH 06/24] staging: wilc1000: move during_ip_timer & wilc_optaining_ip to 'wilc_vif' struct Ajay Singh
2018-08-23 8:09 ` Claudiu Beznea
2018-08-23 9:43 ` Ajay Singh
2018-08-24 8:47 ` Claudiu Beznea
2018-08-14 6:49 ` [PATCH 07/24] staging: wilc1000: remove unused variable 'op_ifcs' Ajay Singh
2018-08-14 6:50 ` [PATCH 08/24] staging: wilc1000: avoid use of extra 'if' condition in wilc_init() Ajay Singh
2018-08-14 6:50 ` [PATCH 09/24] staging: wilc1000: move static variable clients_count to 'wilc' structure Ajay Singh
2018-08-23 8:09 ` Claudiu Beznea
2018-08-25 0:13 ` Adham Abozaeid
2018-08-14 6:50 ` [PATCH 10/24] staging: wilc1000: move wilc_multicast_mac_addr_list to 'wilc_vif' struct Ajay Singh
2018-08-23 8:10 ` Claudiu Beznea
2018-08-23 10:00 ` Ajay Singh
2018-08-24 8:47 ` Claudiu Beznea
2018-08-25 0:32 ` Adham Abozaeid
2018-08-27 5:40 ` Ajay Singh
2018-08-14 6:50 ` [PATCH 11/24] staging: wilc1000: move hif specific static variables to 'wilc' structure Ajay Singh
2018-08-23 8:11 ` Claudiu Beznea
2018-08-23 10:09 ` Ajay Singh
2018-08-24 8:47 ` Claudiu Beznea
2018-08-14 6:50 ` [PATCH 12/24] staging: wilc1000: move static variable 'terminated_handle' to wilc_vif struct Ajay Singh
2018-08-23 8:11 ` Claudiu Beznea
2018-08-23 14:36 ` Ajay Singh
2018-08-24 8:46 ` Claudiu Beznea
2018-08-27 5:27 ` Ajay Singh
2018-08-14 6:50 ` [PATCH 13/24] staging: wilc1000: move 'periodic_rssi' as part of 'wilc_vif' struct Ajay Singh
2018-08-14 6:50 ` [PATCH 14/24] staging: wilc1000: rename 'dummy_statistics' variable to 'periodic_stat' Ajay Singh
2018-08-14 6:50 ` [PATCH 15/24] staging: wilc1000: move 'rcv_assoc_resp' as part of hif_drv Ajay Singh
2018-08-14 6:50 ` [PATCH 16/24] staging: wilc1000: refactor tcp_process() to avoid extra leading tabs Ajay Singh
2018-08-14 6:50 ` [PATCH 17/24] staging: wilc1000: use lowercase for get_BSSID() and HIL variable Ajay Singh
2018-08-14 6:50 ` [PATCH 18/24] staging: wilc1000: move tcp_ack_filter algo related variables to 'wilc_vif' struct Ajay Singh
2018-08-14 6:50 ` [PATCH 19/24] staging: wilc1000: avoid line over 80 chars in wilc_wlan_txq_filter_dup_tcp_ack() Ajay Singh
2018-08-23 8:11 ` Claudiu Beznea
2018-08-23 12:18 ` Ajay Singh
2018-08-14 6:50 ` [PATCH 20/24] staging: wilc1000: avoid line over 80 chars in tcp_process() Ajay Singh
2018-08-23 8:12 ` Claudiu Beznea
2018-08-23 10:33 ` Ajay Singh
2018-08-24 9:31 ` Claudiu Beznea
2018-08-27 5:24 ` Ajay Singh
2018-08-27 12:00 ` Dan Carpenter
2018-08-28 4:29 ` Ajay Singh
2018-08-14 6:50 ` Ajay Singh [this message]
2018-08-14 6:50 ` [PATCH 22/24] staging: wilc1000: move 'chip_ps_state' static variable as part of 'wilc' struct Ajay Singh
2018-08-14 6:50 ` [PATCH 23/24] staging: wilc1000: move 'wilc_connecting' static variable to 'wilc_vif' struct Ajay Singh
2018-08-23 8:12 ` Claudiu Beznea
2018-08-23 10:55 ` Greg KH
2018-08-23 11:27 ` Ajay Singh
2018-08-23 12:37 ` Dan Carpenter
2018-08-23 13:06 ` Ajay Singh
2018-08-14 6:50 ` [PATCH 24/24] staging: wilc1000: remove unnecessary static variable 'p2p_listen_state' Ajay Singh
2018-08-23 8:13 ` Claudiu Beznea
2018-08-23 12:07 ` Ajay Singh
2018-08-23 8:09 ` [PATCH 00/24] staging: wilc1000: avoid use of static and global variable Claudiu Beznea
2018-08-23 9:35 ` Ajay Singh
2018-08-27 17:10 ` Greg KH
2018-08-28 4:35 ` Ajay Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1534229416-13254-22-git-send-email-ajay.kathat@microchip.com \
--to=ajay.kathat@microchip.com \
--cc=adham.abozaeid@microchip.com \
--cc=aditya.shankar@microchip.com \
--cc=claudiu.beznea@microchip.com \
--cc=devel@driverdev.osuosl.org \
--cc=ganesh.krishna@microchip.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-wireless@vger.kernel.org \
--cc=venkateswara.kaja@microchip.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).