| .. | .. |
|---|
| 1 | 1 | /* |
|---|
| 2 | | - * Marvell Wireless LAN device driver: HW/FW Initialization |
|---|
| 2 | + * NXP Wireless LAN device driver: HW/FW Initialization |
|---|
| 3 | 3 | * |
|---|
| 4 | | - * Copyright (C) 2011-2014, Marvell International Ltd. |
|---|
| 4 | + * Copyright 2011-2020 NXP |
|---|
| 5 | 5 | * |
|---|
| 6 | | - * This software file (the "File") is distributed by Marvell International |
|---|
| 7 | | - * Ltd. under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 6 | + * This software file (the "File") is distributed by NXP |
|---|
| 7 | + * under the terms of the GNU General Public License Version 2, June 1991 |
|---|
| 8 | 8 | * (the "License"). You may use, redistribute and/or modify this File in |
|---|
| 9 | 9 | * accordance with the terms and conditions of the License, a copy of which |
|---|
| 10 | 10 | * is available by writing to the Free Software Foundation, Inc., |
|---|
| .. | .. |
|---|
| 36 | 36 | struct mwifiex_adapter *adapter = priv->adapter; |
|---|
| 37 | 37 | struct mwifiex_bss_prio_node *bss_prio; |
|---|
| 38 | 38 | struct mwifiex_bss_prio_tbl *tbl = adapter->bss_prio_tbl; |
|---|
| 39 | | - unsigned long flags; |
|---|
| 40 | 39 | |
|---|
| 41 | 40 | bss_prio = kzalloc(sizeof(struct mwifiex_bss_prio_node), GFP_KERNEL); |
|---|
| 42 | 41 | if (!bss_prio) |
|---|
| .. | .. |
|---|
| 45 | 44 | bss_prio->priv = priv; |
|---|
| 46 | 45 | INIT_LIST_HEAD(&bss_prio->list); |
|---|
| 47 | 46 | |
|---|
| 48 | | - spin_lock_irqsave(&tbl[priv->bss_priority].bss_prio_lock, flags); |
|---|
| 47 | + spin_lock_bh(&tbl[priv->bss_priority].bss_prio_lock); |
|---|
| 49 | 48 | list_add_tail(&bss_prio->list, &tbl[priv->bss_priority].bss_prio_head); |
|---|
| 50 | | - spin_unlock_irqrestore(&tbl[priv->bss_priority].bss_prio_lock, flags); |
|---|
| 49 | + spin_unlock_bh(&tbl[priv->bss_priority].bss_prio_lock); |
|---|
| 51 | 50 | |
|---|
| 52 | 51 | return 0; |
|---|
| 53 | 52 | } |
|---|
| .. | .. |
|---|
| 60 | 59 | adapter->hw_status = MWIFIEX_HW_STATUS_RESET; |
|---|
| 61 | 60 | mwifiex_cancel_all_pending_cmd(adapter); |
|---|
| 62 | 61 | |
|---|
| 63 | | - if (adapter->if_ops.card_reset && !adapter->hs_activated) |
|---|
| 62 | + if (adapter->if_ops.card_reset) |
|---|
| 64 | 63 | adapter->if_ops.card_reset(adapter); |
|---|
| 65 | 64 | } |
|---|
| 66 | 65 | |
|---|
| .. | .. |
|---|
| 344 | 343 | void mwifiex_wake_up_net_dev_queue(struct net_device *netdev, |
|---|
| 345 | 344 | struct mwifiex_adapter *adapter) |
|---|
| 346 | 345 | { |
|---|
| 347 | | - unsigned long dev_queue_flags; |
|---|
| 348 | | - |
|---|
| 349 | | - spin_lock_irqsave(&adapter->queue_lock, dev_queue_flags); |
|---|
| 346 | + spin_lock_bh(&adapter->queue_lock); |
|---|
| 350 | 347 | netif_tx_wake_all_queues(netdev); |
|---|
| 351 | | - spin_unlock_irqrestore(&adapter->queue_lock, dev_queue_flags); |
|---|
| 348 | + spin_unlock_bh(&adapter->queue_lock); |
|---|
| 352 | 349 | } |
|---|
| 353 | 350 | |
|---|
| 354 | 351 | /* |
|---|
| .. | .. |
|---|
| 357 | 354 | void mwifiex_stop_net_dev_queue(struct net_device *netdev, |
|---|
| 358 | 355 | struct mwifiex_adapter *adapter) |
|---|
| 359 | 356 | { |
|---|
| 360 | | - unsigned long dev_queue_flags; |
|---|
| 361 | | - |
|---|
| 362 | | - spin_lock_irqsave(&adapter->queue_lock, dev_queue_flags); |
|---|
| 357 | + spin_lock_bh(&adapter->queue_lock); |
|---|
| 363 | 358 | netif_tx_stop_all_queues(netdev); |
|---|
| 364 | | - spin_unlock_irqrestore(&adapter->queue_lock, dev_queue_flags); |
|---|
| 359 | + spin_unlock_bh(&adapter->queue_lock); |
|---|
| 365 | 360 | } |
|---|
| 366 | 361 | |
|---|
| 367 | 362 | /* |
|---|
| .. | .. |
|---|
| 506 | 501 | struct mwifiex_private *priv; |
|---|
| 507 | 502 | u8 i, first_sta = true; |
|---|
| 508 | 503 | int is_cmd_pend_q_empty; |
|---|
| 509 | | - unsigned long flags; |
|---|
| 510 | 504 | |
|---|
| 511 | 505 | adapter->hw_status = MWIFIEX_HW_STATUS_INITIALIZING; |
|---|
| 512 | 506 | |
|---|
| .. | .. |
|---|
| 547 | 541 | } |
|---|
| 548 | 542 | } |
|---|
| 549 | 543 | |
|---|
| 550 | | - spin_lock_irqsave(&adapter->cmd_pending_q_lock, flags); |
|---|
| 544 | + spin_lock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 551 | 545 | is_cmd_pend_q_empty = list_empty(&adapter->cmd_pending_q); |
|---|
| 552 | | - spin_unlock_irqrestore(&adapter->cmd_pending_q_lock, flags); |
|---|
| 546 | + spin_unlock_bh(&adapter->cmd_pending_q_lock); |
|---|
| 553 | 547 | if (!is_cmd_pend_q_empty) { |
|---|
| 554 | 548 | /* Send the first command in queue and return */ |
|---|
| 555 | 549 | if (mwifiex_main_process(adapter) != -1) |
|---|
| .. | .. |
|---|
| 574 | 568 | struct mwifiex_bss_prio_node *bssprio_node, *tmp_node; |
|---|
| 575 | 569 | struct list_head *head; |
|---|
| 576 | 570 | spinlock_t *lock; /* bss priority lock */ |
|---|
| 577 | | - unsigned long flags; |
|---|
| 578 | 571 | |
|---|
| 579 | 572 | for (i = 0; i < adapter->priv_num; ++i) { |
|---|
| 580 | 573 | head = &adapter->bss_prio_tbl[i].bss_prio_head; |
|---|
| .. | .. |
|---|
| 586 | 579 | priv->bss_type, priv->bss_num, i, head); |
|---|
| 587 | 580 | |
|---|
| 588 | 581 | { |
|---|
| 589 | | - spin_lock_irqsave(lock, flags); |
|---|
| 582 | + spin_lock_bh(lock); |
|---|
| 590 | 583 | list_for_each_entry_safe(bssprio_node, tmp_node, head, |
|---|
| 591 | 584 | list) { |
|---|
| 592 | 585 | if (bssprio_node->priv == priv) { |
|---|
| .. | .. |
|---|
| 598 | 591 | kfree(bssprio_node); |
|---|
| 599 | 592 | } |
|---|
| 600 | 593 | } |
|---|
| 601 | | - spin_unlock_irqrestore(lock, flags); |
|---|
| 594 | + spin_unlock_bh(lock); |
|---|
| 602 | 595 | } |
|---|
| 603 | 596 | } |
|---|
| 604 | 597 | } |
|---|
| .. | .. |
|---|
| 630 | 623 | { |
|---|
| 631 | 624 | struct mwifiex_private *priv; |
|---|
| 632 | 625 | s32 i; |
|---|
| 633 | | - unsigned long flags; |
|---|
| 634 | 626 | struct sk_buff *skb; |
|---|
| 635 | 627 | |
|---|
| 636 | 628 | /* mwifiex already shutdown */ |
|---|
| .. | .. |
|---|
| 665 | 657 | while ((skb = skb_dequeue(&adapter->tx_data_q))) |
|---|
| 666 | 658 | mwifiex_write_data_complete(adapter, skb, 0, 0); |
|---|
| 667 | 659 | |
|---|
| 668 | | - spin_lock_irqsave(&adapter->rx_proc_lock, flags); |
|---|
| 660 | + spin_lock_bh(&adapter->rx_proc_lock); |
|---|
| 669 | 661 | |
|---|
| 670 | 662 | while ((skb = skb_dequeue(&adapter->rx_data_q))) { |
|---|
| 671 | 663 | struct mwifiex_rxinfo *rx_info = MWIFIEX_SKB_RXCB(skb); |
|---|
| .. | .. |
|---|
| 678 | 670 | dev_kfree_skb_any(skb); |
|---|
| 679 | 671 | } |
|---|
| 680 | 672 | |
|---|
| 681 | | - spin_unlock_irqrestore(&adapter->rx_proc_lock, flags); |
|---|
| 673 | + spin_unlock_bh(&adapter->rx_proc_lock); |
|---|
| 682 | 674 | |
|---|
| 683 | 675 | mwifiex_adapter_cleanup(adapter); |
|---|
| 684 | 676 | |
|---|
| .. | .. |
|---|
| 703 | 695 | int ret; |
|---|
| 704 | 696 | u32 poll_num = 1; |
|---|
| 705 | 697 | |
|---|
| 706 | | - if (adapter->if_ops.check_fw_status) { |
|---|
| 707 | | - /* check if firmware is already running */ |
|---|
| 708 | | - ret = adapter->if_ops.check_fw_status(adapter, poll_num); |
|---|
| 709 | | - if (!ret) { |
|---|
| 710 | | - mwifiex_dbg(adapter, MSG, |
|---|
| 711 | | - "WLAN FW already running! Skip FW dnld\n"); |
|---|
| 712 | | - return 0; |
|---|
| 713 | | - } |
|---|
| 698 | + /* check if firmware is already running */ |
|---|
| 699 | + ret = adapter->if_ops.check_fw_status(adapter, poll_num); |
|---|
| 700 | + if (!ret) { |
|---|
| 701 | + mwifiex_dbg(adapter, MSG, |
|---|
| 702 | + "WLAN FW already running! Skip FW dnld\n"); |
|---|
| 703 | + return 0; |
|---|
| 714 | 704 | } |
|---|
| 715 | 705 | |
|---|
| 716 | 706 | /* check if we are the winner for downloading FW */ |
|---|