diff options
author | Ajay Singh <ajay.kathat@microchip.com> | 2019-11-22 20:52:04 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-12-10 10:28:31 +0100 |
commit | a02a9897cd6dd8b8b45162c8edd02ae924382b4b (patch) | |
tree | 5f64635e04b201b92a04c7fb49bcada21704394c /drivers/staging/wilc1000 | |
parent | 856be41e446a6918fc665399061f4ec75b580501 (diff) | |
download | linux-a02a9897cd6dd8b8b45162c8edd02ae924382b4b.tar.bz2 |
staging: wilc1000: use kernel provided struct cast to extract mac header
To parse the mac header make use of *struct ieee80211_hdr* instead of
extracting individual fields separately using pointer operation.
Signed-off-by: Ajay Singh <ajay.kathat@microchip.com>
Link: https://lore.kernel.org/r/20191122205153.30723-3-adham.abozaeid@microchip.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/wilc1000')
-rw-r--r-- | drivers/staging/wilc1000/netdev.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/staging/wilc1000/netdev.c b/drivers/staging/wilc1000/netdev.c index d2c0b0f7cf63..3fd8e008f733 100644 --- a/drivers/staging/wilc1000/netdev.c +++ b/drivers/staging/wilc1000/netdev.c @@ -96,21 +96,18 @@ void wilc_mac_indicate(struct wilc *wilc) static struct net_device *get_if_handler(struct wilc *wilc, u8 *mac_header) { - u8 *bssid, *bssid1; struct net_device *ndev = NULL; struct wilc_vif *vif; - - bssid = mac_header + 10; - bssid1 = mac_header + 4; + struct ieee80211_hdr *h = (struct ieee80211_hdr *)mac_header; list_for_each_entry_rcu(vif, &wilc->vif_list, list) { if (vif->mode == WILC_STATION_MODE) - if (ether_addr_equal_unaligned(bssid, vif->bssid)) { + if (ether_addr_equal_unaligned(h->addr2, vif->bssid)) { ndev = vif->ndev; goto out; } if (vif->mode == WILC_AP_MODE) - if (ether_addr_equal_unaligned(bssid1, vif->bssid)) { + if (ether_addr_equal_unaligned(h->addr1, vif->bssid)) { ndev = vif->ndev; goto out; } |