.. | .. |
---|
97 | 97 | |
---|
98 | 98 | /** |
---|
99 | 99 | * mgmt_open_connection()- Establish a TCP CXN |
---|
| 100 | + * @phba: driver priv structure |
---|
100 | 101 | * @dst_addr: Destination Address |
---|
101 | 102 | * @beiscsi_ep: ptr to device endpoint struct |
---|
102 | 103 | * @nonemb_cmd: ptr to memory allocated for command |
---|
.. | .. |
---|
209 | 210 | return tag; |
---|
210 | 211 | } |
---|
211 | 212 | |
---|
212 | | -/* |
---|
| 213 | +/** |
---|
213 | 214 | * beiscsi_exec_nemb_cmd()- execute non-embedded MBX cmd |
---|
214 | 215 | * @phba: driver priv structure |
---|
215 | 216 | * @nonemb_cmd: DMA address of the MBX command to be issued |
---|
.. | .. |
---|
284 | 285 | return rc; |
---|
285 | 286 | |
---|
286 | 287 | free_cmd: |
---|
287 | | - pci_free_consistent(ctrl->pdev, nonemb_cmd->size, |
---|
| 288 | + dma_free_coherent(&ctrl->pdev->dev, nonemb_cmd->size, |
---|
288 | 289 | nonemb_cmd->va, nonemb_cmd->dma); |
---|
289 | 290 | return rc; |
---|
290 | 291 | } |
---|
.. | .. |
---|
293 | 294 | struct be_dma_mem *cmd, |
---|
294 | 295 | u8 subsystem, u8 opcode, u32 size) |
---|
295 | 296 | { |
---|
296 | | - cmd->va = pci_zalloc_consistent(phba->ctrl.pdev, size, &cmd->dma); |
---|
| 297 | + cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, size, &cmd->dma, |
---|
| 298 | + GFP_KERNEL); |
---|
297 | 299 | if (!cmd->va) { |
---|
298 | 300 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_CONFIG, |
---|
299 | 301 | "BG_%d : Failed to allocate memory for if info\n"); |
---|
.. | .. |
---|
315 | 317 | __beiscsi_mcc_compl_status(phba, tag, NULL, NULL); |
---|
316 | 318 | tag_mem = &phba->ctrl.ptag_state[tag].tag_mem_state; |
---|
317 | 319 | if (tag_mem->size) { |
---|
318 | | - pci_free_consistent(phba->pcidev, tag_mem->size, |
---|
| 320 | + dma_free_coherent(&phba->pcidev->dev, tag_mem->size, |
---|
319 | 321 | tag_mem->va, tag_mem->dma); |
---|
320 | 322 | tag_mem->size = 0; |
---|
321 | 323 | } |
---|
.. | .. |
---|
761 | 763 | "BG_%d : Memory Allocation Failure\n"); |
---|
762 | 764 | |
---|
763 | 765 | /* Free the DMA memory for the IOCTL issuing */ |
---|
764 | | - pci_free_consistent(phba->ctrl.pdev, |
---|
| 766 | + dma_free_coherent(&phba->ctrl.pdev->dev, |
---|
765 | 767 | nonemb_cmd.size, |
---|
766 | 768 | nonemb_cmd.va, |
---|
767 | 769 | nonemb_cmd.dma); |
---|
.. | .. |
---|
780 | 782 | ioctl_size += sizeof(struct be_cmd_req_hdr); |
---|
781 | 783 | |
---|
782 | 784 | /* Free the previous allocated DMA memory */ |
---|
783 | | - pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, |
---|
| 785 | + dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, |
---|
784 | 786 | nonemb_cmd.va, |
---|
785 | 787 | nonemb_cmd.dma); |
---|
786 | 788 | |
---|
.. | .. |
---|
869 | 871 | status); |
---|
870 | 872 | boot_work = 0; |
---|
871 | 873 | } |
---|
872 | | - pci_free_consistent(phba->ctrl.pdev, bs->nonemb_cmd.size, |
---|
| 874 | + dma_free_coherent(&phba->ctrl.pdev->dev, bs->nonemb_cmd.size, |
---|
873 | 875 | bs->nonemb_cmd.va, bs->nonemb_cmd.dma); |
---|
874 | 876 | bs->nonemb_cmd.va = NULL; |
---|
875 | 877 | break; |
---|
.. | .. |
---|
1012 | 1014 | |
---|
1013 | 1015 | nonemb_cmd = &phba->boot_struct.nonemb_cmd; |
---|
1014 | 1016 | nonemb_cmd->size = sizeof(struct be_cmd_get_session_resp); |
---|
1015 | | - nonemb_cmd->va = pci_alloc_consistent(phba->ctrl.pdev, |
---|
| 1017 | + nonemb_cmd->va = dma_alloc_coherent(&phba->ctrl.pdev->dev, |
---|
1016 | 1018 | nonemb_cmd->size, |
---|
1017 | | - &nonemb_cmd->dma); |
---|
| 1019 | + &nonemb_cmd->dma, |
---|
| 1020 | + GFP_KERNEL); |
---|
1018 | 1021 | if (!nonemb_cmd->va) { |
---|
1019 | 1022 | mutex_unlock(&ctrl->mbox_lock); |
---|
1020 | 1023 | return 0; |
---|
.. | .. |
---|
1176 | 1179 | if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) { |
---|
1177 | 1180 | avlbl_cids = BEISCSI_ULP_AVLBL_CID(phba, ulp_num); |
---|
1178 | 1181 | total_cids = BEISCSI_GET_CID_COUNT(phba, ulp_num); |
---|
1179 | | - len += snprintf(buf+len, PAGE_SIZE - len, |
---|
1180 | | - "ULP%d : %d\n", ulp_num, |
---|
1181 | | - (total_cids - avlbl_cids)); |
---|
| 1182 | + len += scnprintf(buf+len, PAGE_SIZE - len, |
---|
| 1183 | + "ULP%d : %d\n", ulp_num, |
---|
| 1184 | + (total_cids - avlbl_cids)); |
---|
1182 | 1185 | } else |
---|
1183 | | - len += snprintf(buf+len, PAGE_SIZE - len, |
---|
1184 | | - "ULP%d : %d\n", ulp_num, 0); |
---|
| 1186 | + len += scnprintf(buf+len, PAGE_SIZE - len, |
---|
| 1187 | + "ULP%d : %d\n", ulp_num, 0); |
---|
1185 | 1188 | } |
---|
1186 | 1189 | |
---|
1187 | 1190 | return len; |
---|
.. | .. |
---|
1206 | 1209 | |
---|
1207 | 1210 | for (ulp_num = 0; ulp_num < BEISCSI_ULP_COUNT; ulp_num++) { |
---|
1208 | 1211 | if (test_bit(ulp_num, (void *)&phba->fw_config.ulp_supported)) |
---|
1209 | | - len += snprintf(buf+len, PAGE_SIZE - len, |
---|
1210 | | - "ULP%d : %d\n", ulp_num, |
---|
1211 | | - BEISCSI_ULP_AVLBL_CID(phba, ulp_num)); |
---|
| 1212 | + len += scnprintf(buf+len, PAGE_SIZE - len, |
---|
| 1213 | + "ULP%d : %d\n", ulp_num, |
---|
| 1214 | + BEISCSI_ULP_AVLBL_CID(phba, ulp_num)); |
---|
1212 | 1215 | else |
---|
1213 | | - len += snprintf(buf+len, PAGE_SIZE - len, |
---|
1214 | | - "ULP%d : %d\n", ulp_num, 0); |
---|
| 1216 | + len += scnprintf(buf+len, PAGE_SIZE - len, |
---|
| 1217 | + "ULP%d : %d\n", ulp_num, 0); |
---|
1215 | 1218 | } |
---|
1216 | 1219 | |
---|
1217 | 1220 | return len; |
---|
.. | .. |
---|
1508 | 1511 | return -EINVAL; |
---|
1509 | 1512 | |
---|
1510 | 1513 | nonemb_cmd.size = sizeof(union be_invldt_cmds_params); |
---|
1511 | | - nonemb_cmd.va = pci_zalloc_consistent(phba->ctrl.pdev, |
---|
1512 | | - nonemb_cmd.size, |
---|
1513 | | - &nonemb_cmd.dma); |
---|
| 1514 | + nonemb_cmd.va = dma_alloc_coherent(&phba->ctrl.pdev->dev, |
---|
| 1515 | + nonemb_cmd.size, &nonemb_cmd.dma, |
---|
| 1516 | + GFP_KERNEL); |
---|
1514 | 1517 | if (!nonemb_cmd.va) { |
---|
1515 | 1518 | beiscsi_log(phba, KERN_ERR, BEISCSI_LOG_EH, |
---|
1516 | 1519 | "BM_%d : invldt_cmds_params alloc failed\n"); |
---|
.. | .. |
---|
1521 | 1524 | wrb = alloc_mcc_wrb(phba, &tag); |
---|
1522 | 1525 | if (!wrb) { |
---|
1523 | 1526 | mutex_unlock(&ctrl->mbox_lock); |
---|
1524 | | - pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, |
---|
| 1527 | + dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, |
---|
1525 | 1528 | nonemb_cmd.va, nonemb_cmd.dma); |
---|
1526 | 1529 | return -ENOMEM; |
---|
1527 | 1530 | } |
---|
.. | .. |
---|
1548 | 1551 | |
---|
1549 | 1552 | rc = beiscsi_mccq_compl_wait(phba, tag, NULL, &nonemb_cmd); |
---|
1550 | 1553 | if (rc != -EBUSY) |
---|
1551 | | - pci_free_consistent(phba->ctrl.pdev, nonemb_cmd.size, |
---|
| 1554 | + dma_free_coherent(&phba->ctrl.pdev->dev, nonemb_cmd.size, |
---|
1552 | 1555 | nonemb_cmd.va, nonemb_cmd.dma); |
---|
1553 | 1556 | return rc; |
---|
1554 | 1557 | } |
---|