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