Lines 37-42
static void housekeeping_init(struct zd_
Link Here
|
37 |
static void housekeeping_enable(struct zd_mac *mac); |
37 |
static void housekeeping_enable(struct zd_mac *mac); |
38 |
static void housekeeping_disable(struct zd_mac *mac); |
38 |
static void housekeeping_disable(struct zd_mac *mac); |
39 |
|
39 |
|
|
|
40 |
static void set_multicast_hash_handler(void *mac_ptr); |
41 |
|
40 |
int zd_mac_init(struct zd_mac *mac, |
42 |
int zd_mac_init(struct zd_mac *mac, |
41 |
struct net_device *netdev, |
43 |
struct net_device *netdev, |
42 |
struct usb_interface *intf) |
44 |
struct usb_interface *intf) |
Lines 51-56
int zd_mac_init(struct zd_mac *mac,
Link Here
|
51 |
softmac_init(ieee80211_priv(netdev)); |
53 |
softmac_init(ieee80211_priv(netdev)); |
52 |
zd_chip_init(&mac->chip, netdev, intf); |
54 |
zd_chip_init(&mac->chip, netdev, intf); |
53 |
housekeeping_init(mac); |
55 |
housekeeping_init(mac); |
|
|
56 |
INIT_WORK(&mac->set_multicast_hash_work, set_multicast_hash_handler, |
57 |
mac); |
54 |
return 0; |
58 |
return 0; |
55 |
} |
59 |
} |
56 |
|
60 |
|
Lines 132-137
out:
Link Here
|
132 |
|
136 |
|
133 |
void zd_mac_clear(struct zd_mac *mac) |
137 |
void zd_mac_clear(struct zd_mac *mac) |
134 |
{ |
138 |
{ |
|
|
139 |
flush_workqueue(zd_workqueue); |
135 |
zd_chip_clear(&mac->chip); |
140 |
zd_chip_clear(&mac->chip); |
136 |
ZD_ASSERT(!spin_is_locked(&mac->lock)); |
141 |
ZD_ASSERT(!spin_is_locked(&mac->lock)); |
137 |
ZD_MEMCLEAR(mac, sizeof(struct zd_mac)); |
142 |
ZD_MEMCLEAR(mac, sizeof(struct zd_mac)); |
Lines 245-250
int zd_mac_set_mac_address(struct net_de
Link Here
|
245 |
return 0; |
250 |
return 0; |
246 |
} |
251 |
} |
247 |
|
252 |
|
|
|
253 |
static void set_multicast_hash_handler(void *mac_ptr) |
254 |
{ |
255 |
struct zd_mac *mac = mac_ptr; |
256 |
struct zd_mc_hash hash; |
257 |
|
258 |
spin_lock_irq(&mac->lock); |
259 |
hash = mac->multicast_hash; |
260 |
spin_unlock_irq(&mac->lock); |
261 |
|
262 |
zd_chip_set_multicast_hash(&mac->chip, &hash); |
263 |
} |
264 |
|
265 |
void zd_mac_set_multicast_list(struct net_device *dev) |
266 |
{ |
267 |
struct zd_mc_hash hash; |
268 |
struct zd_mac *mac = zd_netdev_mac(dev); |
269 |
struct dev_mc_list *mc; |
270 |
unsigned long flags; |
271 |
|
272 |
if (dev->flags & (IFF_PROMISC|IFF_ALLMULTI)) { |
273 |
zd_mc_add_all(&hash); |
274 |
} else { |
275 |
zd_mc_clear(&hash); |
276 |
for (mc = dev->mc_list; mc; mc = mc->next) { |
277 |
dev_dbg_f(zd_mac_dev(mac), "mc addr " MAC_FMT "\n", |
278 |
MAC_ARG(mc->dmi_addr)); |
279 |
zd_mc_add_addr(&hash, mc->dmi_addr); |
280 |
} |
281 |
} |
282 |
|
283 |
spin_lock_irqsave(&mac->lock, flags); |
284 |
mac->multicast_hash = hash; |
285 |
spin_unlock_irqrestore(&mac->lock, flags); |
286 |
queue_work(zd_workqueue, &mac->set_multicast_hash_work); |
287 |
} |
288 |
|
248 |
int zd_mac_set_regdomain(struct zd_mac *mac, u8 regdomain) |
289 |
int zd_mac_set_regdomain(struct zd_mac *mac, u8 regdomain) |
249 |
{ |
290 |
{ |
250 |
int r; |
291 |
int r; |
Lines 771-777
static int is_data_packet_for_us(struct
Link Here
|
771 |
} |
812 |
} |
772 |
|
813 |
|
773 |
return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 || |
814 |
return memcmp(hdr->addr1, netdev->dev_addr, ETH_ALEN) == 0 || |
774 |
is_multicast_ether_addr(hdr->addr1) || |
815 |
(is_multicast_ether_addr(hdr->addr1) && |
|
|
816 |
memcmp(hdr->addr3, netdev->dev_addr, ETH_ALEN) != 0) || |
775 |
(netdev->flags & IFF_PROMISC); |
817 |
(netdev->flags & IFF_PROMISC); |
776 |
} |
818 |
} |
777 |
|
819 |
|