diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index e95646bf7d56..da00e162b6d3 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -398,20 +398,16 @@ qlcnic_sre_macaddr_change(struct qlcnic_adapter *adapter, u8 *addr, | |||
398 | return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); | 398 | return qlcnic_send_cmd_descs(adapter, (struct cmd_desc_type0 *)&req, 1); |
399 | } | 399 | } |
400 | 400 | ||
401 | static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, | 401 | static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr) |
402 | u8 *addr, struct list_head *del_list) | ||
403 | { | 402 | { |
404 | struct list_head *head; | 403 | struct list_head *head; |
405 | struct qlcnic_mac_list_s *cur; | 404 | struct qlcnic_mac_list_s *cur; |
406 | 405 | ||
407 | /* look up if already exists */ | 406 | /* look up if already exists */ |
408 | list_for_each(head, del_list) { | 407 | list_for_each(head, &adapter->mac_list) { |
409 | cur = list_entry(head, struct qlcnic_mac_list_s, list); | 408 | cur = list_entry(head, struct qlcnic_mac_list_s, list); |
410 | 409 | if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0) | |
411 | if (memcmp(addr, cur->mac_addr, ETH_ALEN) == 0) { | ||
412 | list_move_tail(head, &adapter->mac_list); | ||
413 | return 0; | 410 | return 0; |
414 | } | ||
415 | } | 411 | } |
416 | 412 | ||
417 | cur = kzalloc(sizeof(struct qlcnic_mac_list_s), GFP_ATOMIC); | 413 | cur = kzalloc(sizeof(struct qlcnic_mac_list_s), GFP_ATOMIC); |
@@ -433,14 +429,9 @@ void qlcnic_set_multi(struct net_device *netdev) | |||
433 | struct dev_mc_list *mc_ptr; | 429 | struct dev_mc_list *mc_ptr; |
434 | u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; | 430 | u8 bcast_addr[ETH_ALEN] = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; |
435 | u32 mode = VPORT_MISS_MODE_DROP; | 431 | u32 mode = VPORT_MISS_MODE_DROP; |
436 | LIST_HEAD(del_list); | ||
437 | struct list_head *head; | ||
438 | struct qlcnic_mac_list_s *cur; | ||
439 | 432 | ||
440 | list_splice_tail_init(&adapter->mac_list, &del_list); | 433 | qlcnic_nic_add_mac(adapter, adapter->mac_addr); |
441 | 434 | qlcnic_nic_add_mac(adapter, bcast_addr); | |
442 | qlcnic_nic_add_mac(adapter, adapter->mac_addr, &del_list); | ||
443 | qlcnic_nic_add_mac(adapter, bcast_addr, &del_list); | ||
444 | 435 | ||
445 | if (netdev->flags & IFF_PROMISC) { | 436 | if (netdev->flags & IFF_PROMISC) { |
446 | mode = VPORT_MISS_MODE_ACCEPT_ALL; | 437 | mode = VPORT_MISS_MODE_ACCEPT_ALL; |
@@ -455,22 +446,12 @@ void qlcnic_set_multi(struct net_device *netdev) | |||
455 | 446 | ||
456 | if (!netdev_mc_empty(netdev)) { | 447 | if (!netdev_mc_empty(netdev)) { |
457 | netdev_for_each_mc_addr(mc_ptr, netdev) { | 448 | netdev_for_each_mc_addr(mc_ptr, netdev) { |
458 | qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr, | 449 | qlcnic_nic_add_mac(adapter, mc_ptr->dmi_addr); |
459 | &del_list); | ||
460 | } | 450 | } |
461 | } | 451 | } |
462 | 452 | ||
463 | send_fw_cmd: | 453 | send_fw_cmd: |
464 | qlcnic_nic_set_promisc(adapter, mode); | 454 | qlcnic_nic_set_promisc(adapter, mode); |
465 | head = &del_list; | ||
466 | while (!list_empty(head)) { | ||
467 | cur = list_entry(head->next, struct qlcnic_mac_list_s, list); | ||
468 | |||
469 | qlcnic_sre_macaddr_change(adapter, | ||
470 | cur->mac_addr, QLCNIC_MAC_DEL); | ||
471 | list_del(&cur->list); | ||
472 | kfree(cur); | ||
473 | } | ||
474 | } | 455 | } |
475 | 456 | ||
476 | int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32 mode) | 457 | int qlcnic_nic_set_promisc(struct qlcnic_adapter *adapter, u32 mode) |