Lines Matching +full:led +full:- +full:cur
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2009-2013 QLogic Corporation
14 #define MASK(n) ((1ULL<<(n))-1)
322 if (done != -1) in qlcnic_pcie_sem_lock()
323 dev_err(&adapter->pdev->dev, in qlcnic_pcie_sem_lock()
327 dev_err(&adapter->pdev->dev, in qlcnic_pcie_sem_lock()
331 dev_err(&adapter->pdev->dev, in qlcnic_pcie_sem_lock()
334 return -EIO; in qlcnic_pcie_sem_lock()
340 QLCWR32(adapter, id_reg, adapter->portnum); in qlcnic_pcie_sem_lock()
359 qlcnic_read_window_reg(addr, adapter->ahw->pci_base0, &data); in qlcnic_ind_rd()
362 if (err == -EIO) in qlcnic_ind_rd()
373 qlcnic_write_window_reg(addr, adapter->ahw->pci_base0, data); in qlcnic_ind_wr()
391 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) in qlcnic_send_cmd_descs()
392 return -EIO; in qlcnic_send_cmd_descs()
394 tx_ring = &adapter->tx_ring[0]; in qlcnic_send_cmd_descs()
395 __netif_tx_lock_bh(tx_ring->txq); in qlcnic_send_cmd_descs()
397 producer = tx_ring->producer; in qlcnic_send_cmd_descs()
400 netif_tx_stop_queue(tx_ring->txq); in qlcnic_send_cmd_descs()
404 netif_tx_wake_queue(tx_ring->txq); in qlcnic_send_cmd_descs()
406 adapter->stats.xmit_off++; in qlcnic_send_cmd_descs()
407 __netif_tx_unlock_bh(tx_ring->txq); in qlcnic_send_cmd_descs()
408 return -EBUSY; in qlcnic_send_cmd_descs()
415 pbuf = &tx_ring->cmd_buf_arr[producer]; in qlcnic_send_cmd_descs()
416 pbuf->skb = NULL; in qlcnic_send_cmd_descs()
417 pbuf->frag_count = 0; in qlcnic_send_cmd_descs()
419 memcpy(&tx_ring->desc_head[producer], in qlcnic_send_cmd_descs()
422 producer = get_next_index(producer, tx_ring->num_desc); in qlcnic_send_cmd_descs()
427 tx_ring->producer = producer; in qlcnic_send_cmd_descs()
431 __netif_tx_unlock_bh(tx_ring->txq); in qlcnic_send_cmd_descs()
447 word = QLCNIC_MAC_EVENT | ((u64)adapter->portnum << 16); in qlcnic_82xx_sre_macaddr_change()
451 mac_req->op = op; in qlcnic_82xx_sre_macaddr_change()
452 memcpy(mac_req->mac_addr, addr, ETH_ALEN); in qlcnic_82xx_sre_macaddr_change()
455 vlan_req->vlan_id = cpu_to_le16(vlan_id); in qlcnic_82xx_sre_macaddr_change()
462 struct qlcnic_mac_vlan_list *cur; in qlcnic_nic_del_mac() local
463 int err = -EINVAL; in qlcnic_nic_del_mac()
466 list_for_each_entry(cur, &adapter->mac_list, list) { in qlcnic_nic_del_mac()
467 if (ether_addr_equal(addr, cur->mac_addr)) { in qlcnic_nic_del_mac()
468 err = qlcnic_sre_macaddr_change(adapter, cur->mac_addr, in qlcnic_nic_del_mac()
472 list_del(&cur->list); in qlcnic_nic_del_mac()
473 kfree(cur); in qlcnic_nic_del_mac()
483 struct qlcnic_mac_vlan_list *cur; in qlcnic_nic_add_mac() local
486 list_for_each_entry(cur, &adapter->mac_list, list) { in qlcnic_nic_add_mac()
487 if (ether_addr_equal(addr, cur->mac_addr) && in qlcnic_nic_add_mac()
488 cur->vlan_id == vlan) in qlcnic_nic_add_mac()
492 cur = kzalloc(sizeof(*cur), GFP_ATOMIC); in qlcnic_nic_add_mac()
493 if (cur == NULL) in qlcnic_nic_add_mac()
494 return -ENOMEM; in qlcnic_nic_add_mac()
496 memcpy(cur->mac_addr, addr, ETH_ALEN); in qlcnic_nic_add_mac()
499 cur->mac_addr, vlan, QLCNIC_MAC_ADD)) { in qlcnic_nic_add_mac()
500 kfree(cur); in qlcnic_nic_add_mac()
501 return -EIO; in qlcnic_nic_add_mac()
504 cur->vlan_id = vlan; in qlcnic_nic_add_mac()
505 cur->mac_type = mac_type; in qlcnic_nic_add_mac()
507 list_add_tail(&cur->list, &adapter->mac_list); in qlcnic_nic_add_mac()
513 struct qlcnic_mac_vlan_list *cur; in qlcnic_flush_mcast_mac() local
516 list_for_each_safe(head, tmp, &adapter->mac_list) { in qlcnic_flush_mcast_mac()
517 cur = list_entry(head, struct qlcnic_mac_vlan_list, list); in qlcnic_flush_mcast_mac()
518 if (cur->mac_type != QLCNIC_MULTICAST_MAC) in qlcnic_flush_mcast_mac()
521 qlcnic_sre_macaddr_change(adapter, cur->mac_addr, in qlcnic_flush_mcast_mac()
522 cur->vlan_id, QLCNIC_MAC_DEL); in qlcnic_flush_mcast_mac()
523 list_del(&cur->list); in qlcnic_flush_mcast_mac()
524 kfree(cur); in qlcnic_flush_mcast_mac()
531 struct qlcnic_hardware_context *ahw = adapter->ahw; in __qlcnic_set_multi()
538 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) in __qlcnic_set_multi()
541 qlcnic_nic_add_mac(adapter, adapter->mac_addr, vlan, in __qlcnic_set_multi()
545 if (netdev->flags & IFF_PROMISC) { in __qlcnic_set_multi()
546 if (!(adapter->flags & QLCNIC_PROMISC_DISABLED)) in __qlcnic_set_multi()
548 } else if ((netdev->flags & IFF_ALLMULTI) || in __qlcnic_set_multi()
549 (netdev_mc_count(netdev) > ahw->max_mc_count)) { in __qlcnic_set_multi()
554 qlcnic_nic_add_mac(adapter, ha->addr, vlan, in __qlcnic_set_multi()
561 if (netdev_uc_count(netdev) > ahw->max_uc_count) { in __qlcnic_set_multi()
565 qlcnic_nic_add_mac(adapter, ha->addr, vlan, in __qlcnic_set_multi()
570 !adapter->fdb_mac_learn) { in __qlcnic_set_multi()
572 adapter->drv_mac_learn = 1; in __qlcnic_set_multi()
573 if (adapter->flags & QLCNIC_ESWITCH_ENABLED) in __qlcnic_set_multi()
574 adapter->rx_mac_learn = true; in __qlcnic_set_multi()
576 adapter->drv_mac_learn = 0; in __qlcnic_set_multi()
577 adapter->rx_mac_learn = false; in __qlcnic_set_multi()
587 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) in qlcnic_set_multi()
606 ((u64)adapter->portnum << 16); in qlcnic_82xx_nic_set_promisc()
617 struct list_head *head = &adapter->mac_list; in qlcnic_82xx_free_mac_list()
618 struct qlcnic_mac_vlan_list *cur; in qlcnic_82xx_free_mac_list() local
621 cur = list_entry(head->next, struct qlcnic_mac_vlan_list, list); in qlcnic_82xx_free_mac_list()
623 cur->mac_addr, 0, QLCNIC_MAC_DEL); in qlcnic_82xx_free_mac_list()
624 list_del(&cur->list); in qlcnic_82xx_free_mac_list()
625 kfree(cur); in qlcnic_82xx_free_mac_list()
638 for (i = 0; i < adapter->fhash.fbucket_size; i++) { in qlcnic_prune_lb_filters()
639 head = &(adapter->fhash.fhead[i]); in qlcnic_prune_lb_filters()
641 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL : in qlcnic_prune_lb_filters()
643 expires = tmp_fil->ftime + QLCNIC_FILTER_AGE * HZ; in qlcnic_prune_lb_filters()
646 tmp_fil->faddr, in qlcnic_prune_lb_filters()
647 tmp_fil->vlan_id, in qlcnic_prune_lb_filters()
649 spin_lock_bh(&adapter->mac_learn_lock); in qlcnic_prune_lb_filters()
650 adapter->fhash.fnum--; in qlcnic_prune_lb_filters()
651 hlist_del(&tmp_fil->fnode); in qlcnic_prune_lb_filters()
652 spin_unlock_bh(&adapter->mac_learn_lock); in qlcnic_prune_lb_filters()
657 for (i = 0; i < adapter->rx_fhash.fbucket_size; i++) { in qlcnic_prune_lb_filters()
658 head = &(adapter->rx_fhash.fhead[i]); in qlcnic_prune_lb_filters()
662 expires = tmp_fil->ftime + QLCNIC_FILTER_AGE * HZ; in qlcnic_prune_lb_filters()
664 spin_lock_bh(&adapter->rx_mac_learn_lock); in qlcnic_prune_lb_filters()
665 adapter->rx_fhash.fnum--; in qlcnic_prune_lb_filters()
666 hlist_del(&tmp_fil->fnode); in qlcnic_prune_lb_filters()
667 spin_unlock_bh(&adapter->rx_mac_learn_lock); in qlcnic_prune_lb_filters()
682 for (i = 0; i < adapter->fhash.fbucket_size; i++) { in qlcnic_delete_lb_filters()
683 head = &(adapter->fhash.fhead[i]); in qlcnic_delete_lb_filters()
685 cmd = tmp_fil->vlan_id ? QLCNIC_MAC_VLAN_DEL : in qlcnic_delete_lb_filters()
688 tmp_fil->faddr, in qlcnic_delete_lb_filters()
689 tmp_fil->vlan_id, in qlcnic_delete_lb_filters()
691 spin_lock_bh(&adapter->mac_learn_lock); in qlcnic_delete_lb_filters()
692 adapter->fhash.fnum--; in qlcnic_delete_lb_filters()
693 hlist_del(&tmp_fil->fnode); in qlcnic_delete_lb_filters()
694 spin_unlock_bh(&adapter->mac_learn_lock); in qlcnic_delete_lb_filters()
709 ((u64) adapter->portnum << 16) | ((u64) 0x1 << 32)); in qlcnic_set_fw_loopback()
715 dev_err(&adapter->pdev->dev, "%sting loopback mode failed\n", in qlcnic_set_fw_loopback()
723 return -EIO; in qlcnic_82xx_set_lb_mode()
728 return -EIO; in qlcnic_82xx_set_lb_mode()
737 struct net_device *netdev = adapter->netdev; in qlcnic_82xx_clear_lb_mode()
742 if (netdev->flags & IFF_PROMISC) in qlcnic_82xx_clear_lb_mode()
744 else if (netdev->flags & IFF_ALLMULTI) in qlcnic_82xx_clear_lb_mode()
758 adapter->ahw->physical_port); in qlcnic_82xx_read_phys_port_id()
762 memcpy(adapter->ahw->phys_port_id, mac, ETH_ALEN); in qlcnic_82xx_read_phys_port_id()
763 adapter->flags |= QLCNIC_HAS_PHYS_PORT_ID; in qlcnic_82xx_read_phys_port_id()
778 ((u64) adapter->portnum << 16)); in qlcnic_82xx_set_rx_coalesce()
780 req.words[0] = cpu_to_le64(((u64) adapter->ahw->coal.flag) << 32); in qlcnic_82xx_set_rx_coalesce()
781 req.words[2] = cpu_to_le64(adapter->ahw->coal.rx_packets | in qlcnic_82xx_set_rx_coalesce()
782 ((u64) adapter->ahw->coal.rx_time_us) << 16); in qlcnic_82xx_set_rx_coalesce()
783 req.words[5] = cpu_to_le64(adapter->ahw->coal.timer_out | in qlcnic_82xx_set_rx_coalesce()
784 ((u64) adapter->ahw->coal.type) << 32 | in qlcnic_82xx_set_rx_coalesce()
785 ((u64) adapter->ahw->coal.sts_ring_mask) << 40); in qlcnic_82xx_set_rx_coalesce()
788 dev_err(&adapter->netdev->dev, in qlcnic_82xx_set_rx_coalesce()
798 struct qlcnic_nic_intr_coalesce *coal = &adapter->ahw->coal; in qlcnic_82xx_config_intr_coalesce()
801 coal->flag = QLCNIC_INTR_DEFAULT; in qlcnic_82xx_config_intr_coalesce()
802 coal->rx_time_us = ethcoal->rx_coalesce_usecs; in qlcnic_82xx_config_intr_coalesce()
803 coal->rx_packets = ethcoal->rx_max_coalesced_frames; in qlcnic_82xx_config_intr_coalesce()
808 netdev_err(adapter->netdev, in qlcnic_82xx_config_intr_coalesce()
823 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) in qlcnic_82xx_config_hw_lro()
830 word = QLCNIC_H2C_OPCODE_CONFIG_HW_LRO | ((u64)adapter->portnum << 16); in qlcnic_82xx_config_hw_lro()
836 if (adapter->ahw->extra_capability[0] & in qlcnic_82xx_config_hw_lro()
845 dev_err(&adapter->netdev->dev, in qlcnic_82xx_config_hw_lro()
857 if (!!(adapter->flags & QLCNIC_BRIDGE_ENABLED) == enable) in qlcnic_config_bridged_mode()
865 ((u64)adapter->portnum << 16); in qlcnic_config_bridged_mode()
872 dev_err(&adapter->netdev->dev, in qlcnic_config_bridged_mode()
875 adapter->flags ^= QLCNIC_BRIDGE_ENABLED; in qlcnic_config_bridged_mode()
901 word = QLCNIC_H2C_OPCODE_CONFIG_RSS | ((u64)adapter->portnum << 16); in qlcnic_82xx_config_rss()
906 * bits 3-0: hash_method in qlcnic_82xx_config_rss()
907 * 5-4: hash_type_ipv4 in qlcnic_82xx_config_rss()
908 * 7-6: hash_type_ipv6 in qlcnic_82xx_config_rss()
911 * 10: type-c rss in qlcnic_82xx_config_rss()
913 * 47-12: reserved in qlcnic_82xx_config_rss()
914 * 62-48: indirection table mask in qlcnic_82xx_config_rss()
930 dev_err(&adapter->netdev->dev, "could not configure RSS\n"); in qlcnic_82xx_config_rss()
946 word = QLCNIC_H2C_OPCODE_CONFIG_IPADDR | ((u64)adapter->portnum << 16); in qlcnic_82xx_config_ipaddr()
951 ipa->ipv4 = ip; in qlcnic_82xx_config_ipaddr()
955 dev_err(&adapter->netdev->dev, in qlcnic_82xx_config_ipaddr()
968 word = QLCNIC_H2C_OPCODE_GET_LINKEVENT | ((u64)adapter->portnum << 16); in qlcnic_82xx_linkevent_request()
973 dev_err(&adapter->netdev->dev, in qlcnic_82xx_linkevent_request()
985 if (!test_bit(__QLCNIC_FW_ATTACHED, &adapter->state)) in qlcnic_send_lro_cleanup()
992 ((u64)adapter->portnum << 16) | in qlcnic_send_lro_cleanup()
999 dev_err(&adapter->netdev->dev, in qlcnic_send_lro_cleanup()
1006 * qlcnic_change_mtu - Change the Maximum Transfer Unit
1018 netdev->mtu = mtu; in qlcnic_change_mtu()
1026 u32 offload_flags = adapter->offload_flags; in qlcnic_process_flags()
1031 adapter->rx_csum = 1; in qlcnic_process_flags()
1050 adapter->rx_csum = 0; in qlcnic_process_flags()
1063 (adapter->flags & QLCNIC_ESWITCH_ENABLED)) { in qlcnic_fix_features()
1064 if (adapter->flags & QLCNIC_APP_CHANGED_FLAGS) { in qlcnic_fix_features()
1067 changed = features ^ netdev->features; in qlcnic_fix_features()
1086 netdev_features_t changed = netdev->features ^ features; in qlcnic_set_features()
1092 netdev->features ^= NETIF_F_LRO; in qlcnic_set_features()
1095 return -EIO; in qlcnic_set_features()
1099 return -EIO; in qlcnic_set_features()
1120 return -EINVAL; in qlcnic_pci_get_crb_addr_2M()
1122 off -= QLCNIC_PCI_CRBSPACE; in qlcnic_pci_get_crb_addr_2M()
1129 if (m->valid && (m->start_128M <= off) && (m->end_128M > off)) { in qlcnic_pci_get_crb_addr_2M()
1130 *addr = ahw->pci_base0 + m->start_2M + in qlcnic_pci_get_crb_addr_2M()
1131 (off - m->start_128M); in qlcnic_pci_get_crb_addr_2M()
1138 *addr = ahw->pci_base0 + CRB_INDIRECT_2M + (off & MASK(16)); in qlcnic_pci_get_crb_addr_2M()
1151 void __iomem *addr = adapter->ahw->pci_base0 + CRB_WINDOW_2M; in qlcnic_pci_set_crbwindow_2M()
1153 off -= QLCNIC_PCI_CRBSPACE; in qlcnic_pci_set_crbwindow_2M()
1157 dev_err(&adapter->pdev->dev, "Invalid offset 0x%lx\n", off); in qlcnic_pci_set_crbwindow_2M()
1158 return -EIO; in qlcnic_pci_set_crbwindow_2M()
1164 dev_warn(&adapter->pdev->dev, in qlcnic_pci_set_crbwindow_2M()
1167 return -EIO; in qlcnic_pci_set_crbwindow_2M()
1179 rv = qlcnic_pci_get_crb_addr_2M(adapter->ahw, off, &addr); in qlcnic_82xx_hw_write_wx_2M()
1188 write_lock_irqsave(&adapter->ahw->crb_lock, flags); in qlcnic_82xx_hw_write_wx_2M()
1194 write_unlock_irqrestore(&adapter->ahw->crb_lock, flags); in qlcnic_82xx_hw_write_wx_2M()
1198 dev_err(&adapter->pdev->dev, in qlcnic_82xx_hw_write_wx_2M()
1201 return -EIO; in qlcnic_82xx_hw_write_wx_2M()
1209 u32 data = -1; in qlcnic_82xx_hw_read_wx_2M()
1212 rv = qlcnic_pci_get_crb_addr_2M(adapter->ahw, off, &addr); in qlcnic_82xx_hw_read_wx_2M()
1219 write_lock_irqsave(&adapter->ahw->crb_lock, flags); in qlcnic_82xx_hw_read_wx_2M()
1224 write_unlock_irqrestore(&adapter->ahw->crb_lock, flags); in qlcnic_82xx_hw_read_wx_2M()
1228 dev_err(&adapter->pdev->dev, in qlcnic_82xx_hw_read_wx_2M()
1231 return -1; in qlcnic_82xx_hw_read_wx_2M()
1250 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_access_direct()
1252 writel(window, adapter->ahw->ocm_win_crb); in qlcnic_pci_mem_access_direct()
1254 readl(adapter->ahw->ocm_win_crb); in qlcnic_pci_mem_access_direct()
1257 addr = adapter->ahw->pci_base0 + start; in qlcnic_pci_mem_access_direct()
1265 writel(0, adapter->ahw->ocm_win_crb); in qlcnic_pci_mem_access_direct()
1266 readl(adapter->ahw->ocm_win_crb); in qlcnic_pci_mem_access_direct()
1268 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_access_direct()
1275 void __iomem *addr = adapter->ahw->pci_base0 + in qlcnic_pci_camqm_read_2M()
1276 QLCNIC_PCI_CAMQM_2M_BASE + (off - QLCNIC_PCI_CAMQM); in qlcnic_pci_camqm_read_2M()
1278 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_pci_camqm_read_2M()
1280 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_pci_camqm_read_2M()
1286 void __iomem *addr = adapter->ahw->pci_base0 + in qlcnic_pci_camqm_write_2M()
1287 QLCNIC_PCI_CAMQM_2M_BASE + (off - QLCNIC_PCI_CAMQM); in qlcnic_pci_camqm_write_2M()
1289 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_pci_camqm_write_2M()
1291 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_pci_camqm_write_2M()
1300 ms->control = QLCNIC_MS_CTRL; in qlcnic_set_ms_controls()
1301 ms->low = QLCNIC_MS_ADDR_LO; in qlcnic_set_ms_controls()
1302 ms->hi = QLCNIC_MS_ADDR_HI; in qlcnic_set_ms_controls()
1304 ms->wd[0] = QLCNIC_MS_WRTDATA_LO; in qlcnic_set_ms_controls()
1305 ms->rd[0] = QLCNIC_MS_RDDATA_LO; in qlcnic_set_ms_controls()
1306 ms->wd[1] = QLCNIC_MS_WRTDATA_HI; in qlcnic_set_ms_controls()
1307 ms->rd[1] = QLCNIC_MS_RDDATA_HI; in qlcnic_set_ms_controls()
1308 ms->wd[2] = QLCNIC_MS_WRTDATA_ULO; in qlcnic_set_ms_controls()
1309 ms->wd[3] = QLCNIC_MS_WRTDATA_UHI; in qlcnic_set_ms_controls()
1310 ms->rd[2] = QLCNIC_MS_RDDATA_ULO; in qlcnic_set_ms_controls()
1311 ms->rd[3] = QLCNIC_MS_RDDATA_UHI; in qlcnic_set_ms_controls()
1313 ms->wd[0] = QLCNIC_MS_WRTDATA_ULO; in qlcnic_set_ms_controls()
1314 ms->rd[0] = QLCNIC_MS_RDDATA_ULO; in qlcnic_set_ms_controls()
1315 ms->wd[1] = QLCNIC_MS_WRTDATA_UHI; in qlcnic_set_ms_controls()
1316 ms->rd[1] = QLCNIC_MS_RDDATA_UHI; in qlcnic_set_ms_controls()
1317 ms->wd[2] = QLCNIC_MS_WRTDATA_LO; in qlcnic_set_ms_controls()
1318 ms->wd[3] = QLCNIC_MS_WRTDATA_HI; in qlcnic_set_ms_controls()
1319 ms->rd[2] = QLCNIC_MS_RDDATA_LO; in qlcnic_set_ms_controls()
1320 ms->rd[3] = QLCNIC_MS_RDDATA_HI; in qlcnic_set_ms_controls()
1323 ms->ocm_window = OCM_WIN_P3P(off); in qlcnic_set_ms_controls()
1324 ms->off = GET_MEM_OFFS_2M(off); in qlcnic_set_ms_controls()
1333 /* Only 64-bit aligned access */ in qlcnic_pci_mem_write_2M()
1335 return -EIO; in qlcnic_pci_mem_write_2M()
1342 return -EIO; in qlcnic_pci_mem_write_2M()
1352 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_write_2M()
1367 ret = -EIO; in qlcnic_pci_mem_write_2M()
1371 /* This is the modify part of read-modify-write */ in qlcnic_pci_mem_write_2M()
1374 /* This is the write part of read-modify-write */ in qlcnic_pci_mem_write_2M()
1389 dev_err(&adapter->pdev->dev, in qlcnic_pci_mem_write_2M()
1391 ret = -EIO; in qlcnic_pci_mem_write_2M()
1396 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_write_2M()
1408 /* Only 64-bit aligned access */ in qlcnic_pci_mem_read_2M()
1410 return -EIO; in qlcnic_pci_mem_read_2M()
1415 return -EIO; in qlcnic_pci_mem_read_2M()
1424 mutex_lock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_read_2M()
1442 dev_err(&adapter->pdev->dev, in qlcnic_pci_mem_read_2M()
1444 ret = -EIO; in qlcnic_pci_mem_read_2M()
1454 mutex_unlock(&adapter->ahw->mem_lock); in qlcnic_pci_mem_read_2M()
1462 struct pci_dev *pdev = adapter->pdev; in qlcnic_82xx_get_board_info()
1466 return -EIO; in qlcnic_82xx_get_board_info()
1469 dev_err(&pdev->dev, "invalid board config, magic=%08x\n", in qlcnic_82xx_get_board_info()
1471 return -EIO; in qlcnic_82xx_get_board_info()
1476 return -EIO; in qlcnic_82xx_get_board_info()
1478 adapter->ahw->board_type = board_type; in qlcnic_82xx_get_board_info()
1482 if (err == -EIO) in qlcnic_82xx_get_board_info()
1499 adapter->ahw->port_type = QLCNIC_XGBE; in qlcnic_82xx_get_board_info()
1504 adapter->ahw->port_type = QLCNIC_GBE; in qlcnic_82xx_get_board_info()
1507 adapter->ahw->port_type = (adapter->portnum < 2) ? in qlcnic_82xx_get_board_info()
1511 dev_err(&pdev->dev, "unknown board type %x\n", board_type); in qlcnic_82xx_get_board_info()
1512 adapter->ahw->port_type = QLCNIC_XGBE; in qlcnic_82xx_get_board_info()
1526 if (wol_cfg & (1UL << adapter->portnum)) { in qlcnic_wol_supported()
1528 if (err == -EIO) in qlcnic_wol_supported()
1530 if (wol_cfg & (1 << adapter->portnum)) in qlcnic_wol_supported()
1546 word = QLCNIC_H2C_OPCODE_CONFIG_LED | ((u64)adapter->portnum << 16); in qlcnic_82xx_config_led()
1549 req.words[0] = cpu_to_le64(((u64)rate << 32) | adapter->portnum); in qlcnic_82xx_config_led()
1554 dev_err(&adapter->pdev->dev, "LED configuration failed.\n"); in qlcnic_82xx_config_led()
1561 struct qlcnic_hardware_context *ahw = adapter->ahw; in qlcnic_82xx_get_beacon_state()
1566 if (ahw->extra_capability[0] & QLCNIC_FW_CAPABILITY_2_BEACON) { in qlcnic_82xx_get_beacon_state()
1572 netdev_err(adapter->netdev, in qlcnic_82xx_get_beacon_state()
1578 ahw->beacon_state = QLCNIC_BEACON_OFF; in qlcnic_82xx_get_beacon_state()
1580 ahw->beacon_state = QLCNIC_BEACON_ON; in qlcnic_82xx_get_beacon_state()
1595 pci_read_config_dword(adapter->pdev, QLCNIC_MSIX_TABLE_OFFSET, &func); in qlcnic_82xx_get_func_no()
1596 msix_base_addr = adapter->ahw->pci_base0 + QLCNIC_MSIX_BASE; in qlcnic_82xx_get_func_no()
1598 func = (func - msix_base) / QLCNIC_MSIX_TBL_PGSIZE; in qlcnic_82xx_get_func_no()
1599 adapter->ahw->pci_func = func; in qlcnic_82xx_get_func_no()
1646 struct net_device *netdev = adapter->netdev; in qlcnic_82xx_shutdown()
1657 clear_bit(__QLCNIC_RESETTING, &adapter->state); in qlcnic_82xx_shutdown()
1660 device_wakeup_enable(&pdev->dev); in qlcnic_82xx_shutdown()
1667 struct net_device *netdev = adapter->netdev; in qlcnic_82xx_resume()
1672 dev_err(&adapter->pdev->dev, "failed to start firmware\n"); in qlcnic_82xx_resume()