From: Quytelda Kahja <quytelda@tamalin.org>
To: gregkh@linuxfoundation.org, wsa@the-dreams.de
Cc: devel@driverdev.osuosl.org,
driverdev-devel@linuxdriverproject.org,
linux-kernel@vger.kernel.org,
Quytelda Kahja <quytelda@tamalin.org>
Subject: [PATCH 71/72] staging: ks7010: Remove 'eth_addr' field from 'struct ks_wlan_private'.
Date: Fri, 30 Mar 2018 00:08:35 -0700 [thread overview]
Message-ID: <20180330070842.25224-72-quytelda@tamalin.org> (raw)
In-Reply-To: <20180330070842.25224-1-quytelda@tamalin.org>
The ethernet address of the network device is already stored in the
'dev_addr' field of 'struct net_device'. Since 'struct ks_wlan_private'
keeps a pointer to the driver's 'struct net_device', there is no reason
to duplicate this information in 'struct ks_wlan_private'.
Signed-off-by: Quytelda Kahja <quytelda@tamalin.org>
---
drivers/staging/ks7010/ks_hostif.c | 29 +++++++++++------------------
drivers/staging/ks7010/ks_wlan.h | 2 --
drivers/staging/ks7010/ks_wlan_net.c | 5 ++---
3 files changed, 13 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
index 1eff78540683..3c8a8d0f800c 100644
--- a/drivers/staging/ks7010/ks_hostif.c
+++ b/drivers/staging/ks7010/ks_hostif.c
@@ -388,6 +388,7 @@ int hostif_data_indication_wpa(struct ks_wlan_private *priv,
static
void hostif_data_indication(struct ks_wlan_private *priv)
{
+ struct net_device * dev = priv->net_dev;
unsigned int rx_ind_size; /* indicate data size */
struct sk_buff *skb;
unsigned short auth_type;
@@ -411,9 +412,9 @@ void hostif_data_indication(struct ks_wlan_private *priv)
eth_proto = ntohs(eth_hdr->h_proto);
/* source address check */
- if (memcmp(&priv->eth_addr[0], eth_hdr->h_source, ETH_ALEN) == 0) {
- netdev_err(priv->net_dev, "invalid : source is own mac address !!\n");
- netdev_err(priv->net_dev,
+ if (memcmp(dev->dev_addr, eth_hdr->h_source, ETH_ALEN) == 0) {
+ netdev_err(dev, "invalid : source is own mac address !!\n");
+ netdev_err(dev,
"eth_hdrernet->h_dest=%02X:%02X:%02X:%02X:%02X:%02X\n",
eth_hdr->h_source[0], eth_hdr->h_source[1],
eth_hdr->h_source[2], eth_hdr->h_source[3],
@@ -443,7 +444,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
priv->nstats.rx_dropped++;
return;
}
- netdev_dbg(priv->net_dev, "SNAP, rx_ind_size = %d\n",
+ netdev_dbg(dev, "SNAP, rx_ind_size = %d\n",
rx_ind_size);
size = ETH_ALEN * 2;
@@ -463,7 +464,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
priv->nstats.rx_dropped++;
return;
}
- netdev_dbg(priv->net_dev, "NETBEUI/NetBIOS rx_ind_size=%d\n",
+ netdev_dbg(dev, "NETBEUI/NetBIOS rx_ind_size=%d\n",
rx_ind_size);
/* 8802/FDDI MAC copy */
@@ -480,7 +481,7 @@ void hostif_data_indication(struct ks_wlan_private *priv)
aa1x_hdr = (struct ieee802_1x_hdr *)(priv->rxp + 14);
break;
default: /* other rx data */
- netdev_err(priv->net_dev, "invalid data format\n");
+ netdev_err(dev, "invalid data format\n");
priv->nstats.rx_errors++;
return;
}
@@ -522,17 +523,9 @@ void hostif_mib_get_confirm(struct ks_wlan_private *priv)
case DOT11_MAC_ADDRESS:
/* MAC address */
hostif_sme_enqueue(priv, SME_GET_MAC_ADDRESS);
- memcpy(priv->eth_addr, priv->rxp, ETH_ALEN);
+ memcpy(dev->dev_addr, priv->rxp, ETH_ALEN);
priv->mac_address_valid = true;
- dev->dev_addr[0] = priv->eth_addr[0];
- dev->dev_addr[1] = priv->eth_addr[1];
- dev->dev_addr[2] = priv->eth_addr[2];
- dev->dev_addr[3] = priv->eth_addr[3];
- dev->dev_addr[4] = priv->eth_addr[4];
- dev->dev_addr[5] = priv->eth_addr[5];
- dev->dev_addr[6] = 0x00;
- dev->dev_addr[7] = 0x00;
- netdev_info(dev, "MAC ADDRESS = %pM\n", priv->eth_addr);
+ netdev_info(dev, "MAC ADDRESS = %pM\n", dev->dev_addr);
break;
case DOT11_PRODUCT_VERSION:
/* firmware version */
@@ -1111,7 +1104,7 @@ int hostif_data_request(struct ks_wlan_private *priv, struct sk_buff *skb)
/* skb check */
eth = (struct ethhdr *)skb->data;
- if (memcmp(&priv->eth_addr[0], eth->h_source, ETH_ALEN) != 0) {
+ if (memcmp(priv->net_dev->dev_addr, eth->h_source, ETH_ALEN) != 0) {
netdev_err(priv->net_dev, "invalid mac address !!\n");
netdev_err(priv->net_dev, "ethernet->h_source=%pM\n", eth->h_source);
ret = -ENXIO;
@@ -2167,7 +2160,7 @@ void hostif_sme_execute(struct ks_wlan_private *priv, int event)
case SME_MACADDRESS_SET_REQUEST:
hostif_mib_set_request(priv, LOCAL_CURRENTADDRESS, ETH_ALEN,
MIB_VALUE_TYPE_OSTRING,
- &priv->eth_addr[0]);
+ priv->net_dev->dev_addr);
break;
case SME_BSS_SCAN_REQUEST:
hostif_bss_scan_request(priv, priv->reg.scan_type,
diff --git a/drivers/staging/ks7010/ks_wlan.h b/drivers/staging/ks7010/ks_wlan.h
index eb0c14e78bd2..012e0fe2b60d 100644
--- a/drivers/staging/ks7010/ks_wlan.h
+++ b/drivers/staging/ks7010/ks_wlan.h
@@ -421,8 +421,6 @@ struct ks_wlan_private {
struct work_struct wakeup_work;
int scan_ind_count;
- unsigned char eth_addr[ETH_ALEN];
-
struct local_aplist aplist;
struct local_ap current_ap;
struct power_save_status psstatus;
diff --git a/drivers/staging/ks7010/ks_wlan_net.c b/drivers/staging/ks7010/ks_wlan_net.c
index e98f6163e724..32515c296ca6 100644
--- a/drivers/staging/ks7010/ks_wlan_net.c
+++ b/drivers/staging/ks7010/ks_wlan_net.c
@@ -2749,11 +2749,10 @@ int ks_wlan_set_mac_address(struct net_device *dev, void *addr)
if (netif_running(dev))
return -EBUSY;
memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
- memcpy(priv->eth_addr, mac_addr->sa_data, ETH_ALEN);
priv->mac_address_valid = false;
hostif_sme_enqueue(priv, SME_MACADDRESS_SET_REQUEST);
- netdev_info(dev, "ks_wlan: MAC ADDRESS = %pM\n", priv->eth_addr);
+ netdev_info(dev, "ks_wlan: MAC ADDRESS = %pM\n", dev->dev_addr);
return 0;
}
@@ -2884,7 +2883,7 @@ int ks_wlan_net_start(struct net_device *dev)
timer_setup(&update_phyinfo_timer, ks_wlan_update_phyinfo_timeout, 0);
/* dummy address set */
- ether_addr_copy(dev->dev_addr, priv->eth_addr);
+ ether_addr_copy(dev->dev_addr, dummy_addr);
/* The ks_wlan-specific entries in the device structure. */
dev->netdev_ops = &ks_wlan_netdev_ops;
--
2.16.3
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
next prev parent reply other threads:[~2018-03-30 7:08 UTC|newest]
Thread overview: 81+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-30 7:07 [PATCH 01/76] staging: ks7010: Use the ARRAY_SIZE() macro to calculate array sizes Quytelda Kahja
2018-03-30 7:07 ` [PATCH 02/76] staging: ks7010: Remove trailing _t from 'struct wpa_suite_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 03/76] staging: ks7010: Remove trailing _t from 'struct rsn_mode_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 04/76] staging: ks7010: Remove trailing _t from 'struct pmk_cache_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 05/76] staging: ks7010: Remove trailing _t from 'struct hostif_data_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 06/76] staging: ks7010: Remove trailing _t from 'struct hostif_data_indication_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 07/76] staging: ks7010: Remove trailing _t from 'struct channel_list_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 08/76] staging: ks7010: Remove trailing _t from 'struct hostif_mib_get_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 09/76] staging: ks7010: Remove trailing _t from 'struct hostif_mib_value_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 10/76] staging: ks7010: Remove trailing _t from 'struct hostif_mib_get_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 11/76] staging: ks7010: Remove trailing _t from 'struct hostif_mib_set_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 12/76] staging: ks7010: Remove trailing _t from 'struct hostif_mib_set_confirm_t' Quytelda Kahja
2018-03-30 7:44 ` Joe Perches
2018-03-30 10:00 ` Greg KH
2018-03-30 7:07 ` [PATCH 13/76] staging: ks7010: Remove trailing _t from 'struct hostif_power_mgmt_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 14/76] staging: ks7010: Remove trailing _t from 'struct hostif_power_mgmt_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 15/76] staging: ks7010: Remove trailing _t from 'struct hostif_start_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 16/76] staging: ks7010: Remove trailing _t from 'struct hostif_start_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 17/76] staging: ks7010: Remove trailing _t from 'struct ssid_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 18/76] staging: ks7010: Remove trailing _t from 'struct rate_set8_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 19/76] staging: ks7010: Remove trailing _t from 'struct fh_parms_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 20/76] staging: ks7010: Remove trailing _t from 'struct ds_parms_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 21/76] staging: ks7010: Remove trailing _t from 'struct cf_parms_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 22/76] staging: ks7010: Remove trailing _t from 'struct ibss_parms_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 23/76] staging: ks7010: Remove trailing _t from 'struct rsn_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 24/76] staging: ks7010: Remove trailing _t from 'struct erp_params_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 25/76] staging: ks7010: Remove trailing _t from 'struct rate_set16_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 26/76] staging: ks7010: Remove trailing _t from 'struct ap_info_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 27/76] staging: ks7010: Remove trailing _t from 'struct link_ap_info_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 28/76] staging: ks7010: Remove trailing _t from 'struct hostif_connect_indication_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 29/76] staging: ks7010: Remove trailing _t from 'struct hostif_stop_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 30/76] staging: ks7010: Remove trailing _t from 'struct hostif_stop_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 31/76] staging: ks7010: Remove trailing _t from 'struct hostif_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 32/76] staging: ks7010: Remove trailing _t from 'struct hostif_ps_adhoc_set_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 33/76] staging: ks7010: Remove trailing _t from 'struct hostif_ps_adhoc_set_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 34/76] staging: ks7010: Remove trailing _t from 'struct hostif_infrastructure_set_request_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 35/76] staging: ks7010: Remove trailing _t from 'struct hostif_infrastructure_set_confirm_t' Quytelda Kahja
2018-03-30 7:07 ` [PATCH 36/76] staging: ks7010: Remove trailing _t from 'struct hostif_adhoc_set_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 37/76] staging: ks7010: Remove trailing _t from 'struct hostif_adhoc_set2_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 38/76] staging: ks7010: Remove trailing _t from 'struct hostif_adhoc_set_confirm_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 39/76] staging: ks7010: Remove trailing _t from 'struct last_associate_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 40/76] staging: ks7010: Remove trailing _t from 'struct association_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 41/76] staging: ks7010: Remove trailing _t from 'struct association_response_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 42/76] staging: ks7010: Remove trailing _t from 'struct hostif_associate_indication_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 43/76] staging: ks7010: Remove trailing _t from 'struct hostif_bss_scan_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 44/76] staging: ks7010: Remove trailing _t from 'struct hostif_bss_scan_confirm_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 45/76] staging: ks7010: Remove trailing _t from 'struct hostif_phy_information_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 46/76] staging: ks7010: Remove trailing _t from 'struct hostif_phy_information_confirm_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 47/76] staging: ks7010: Remove trailing _t from 'struct hostif_sleep_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 48/76] staging: ks7010: Remove trailing _t from 'struct hostif_sleep_confirm_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 49/76] staging: ks7010: Remove trailing _t from 'struct hostif_mic_failure_request_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 50/76] staging: ks7010: Remove trailing _t from 'struct hostif_mic_failure_confirm_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 51/76] staging: ks7010: Remove trailing _t from 'struct hostt_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 52/76] staging: ks7010: Remove trailing _t from 'struct rsn_ie_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 53/76] staging: ks7010: Remove trailing _t from 'struct wps_ie_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 54/76] staging: ks7010: Remove trailing _t from 'struct local_ap_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 55/76] staging: ks7010: Remove trailing _t from 'struct local_aplist_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 56/76] staging: ks7010: Remove trailing _t from 'struct local_gain_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 57/76] staging: ks7010: Remove trailing _t from 'struct local_eeprom_sum_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 58/76] staging: ks7010: Remove trailing _t from 'struct power_save_status_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 59/76] staging: ks7010: Remove trailing _t from 'struct sleep_status_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 60/76] staging: ks7010: Remove trailing _t from 'struct scan_ext_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 61/76] staging: ks7010: Remove trailing _t from 'struct wpa_key_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 62/76] staging: ks7010: Remove trailing _t from 'struct mic_failure_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 63/76] staging: ks7010: Remove trailing _t from 'struct wpa_status_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 64/76] staging: ks7010: Remove trailing _t from 'struct pmk_list_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 65/76] staging: ks7010: Remove trailing _t from 'struct pmk_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 66/76] staging: ks7010: Remove trailing _t from 'struct wps_status_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 67/76] staging: ks7010: Remove trailing _t from 'struct michael_mic_t' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 68/76] staging: ks7010: Replace manual array copy with ether_addr_copy() Quytelda Kahja
2018-03-30 7:08 ` [PATCH 69/76] staging: ks7010: Remove 'eth_addr' field from 'struct ks_wlan_private' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 70/76] staging: ks7010: Remove extra blank line between functions Quytelda Kahja
2018-03-30 7:08 ` [PATCH 70/72] staging: ks7010: Rename ks_wlan_set_multicast_list() Quytelda Kahja
2018-03-30 7:08 ` Quytelda Kahja [this message]
2018-03-30 7:08 ` [PATCH 71/76] " Quytelda Kahja
2018-03-30 7:08 ` [PATCH 72/76] staging: ks7010: Remove dummy address set Quytelda Kahja
2018-03-30 7:08 ` [PATCH 72/72] staging: ks7010: Remove extra blank line between functions Quytelda Kahja
2018-03-30 7:08 ` [PATCH 73/76] staging: ks7010: Change 'device_open_status' to a bool Quytelda Kahja
2018-03-30 7:08 ` [PATCH 74/76] staging: ks7010: Remove unnecessary casts in 'struct ks_wlan_handler_def' Quytelda Kahja
2018-03-30 7:08 ` [PATCH 75/76] staging: ks7010: Replace memcmp() with ether_addr_equal() Quytelda Kahja
2018-03-30 7:08 ` [PATCH 76/76] staging: ks7010: Replace memcpy() with ether_addr_copy() Quytelda Kahja
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=20180330070842.25224-72-quytelda@tamalin.org \
--to=quytelda@tamalin.org \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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
all inboxes | Powered by JetHome®