.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * |
---|
3 | 4 | * Linux MegaRAID device driver |
---|
4 | 5 | * |
---|
5 | 6 | * Copyright (c) 2003-2004 LSI Logic Corporation. |
---|
6 | | - * |
---|
7 | | - * This program is free software; you can redistribute it and/or |
---|
8 | | - * modify it under the terms of the GNU General Public License |
---|
9 | | - * as published by the Free Software Foundation; either version |
---|
10 | | - * 2 of the License, or (at your option) any later version. |
---|
11 | 7 | * |
---|
12 | 8 | * FILE : megaraid_mbox.c |
---|
13 | 9 | * Version : v2.20.5.1 (Nov 16 2006) |
---|
.. | .. |
---|
37 | 33 | * Dell PERC 4e/Di 1028 0013 1028 0170 |
---|
38 | 34 | * Dell PERC 4e/DC 1000 0408 1028 0002 |
---|
39 | 35 | * Dell PERC 4e/SC 1000 0408 1028 0001 |
---|
40 | | - * |
---|
41 | 36 | * |
---|
42 | 37 | * LSI MegaRAID SCSI 320-0 1000 1960 1000 A520 |
---|
43 | 38 | * LSI MegaRAID SCSI 320-1 1000 1960 1000 0520 |
---|
.. | .. |
---|
202 | 197 | MODULE_PARM_DESC(debug_level, "Debug level for driver (default=0)"); |
---|
203 | 198 | |
---|
204 | 199 | /* |
---|
205 | | - * ### global data ### |
---|
206 | | - */ |
---|
207 | | -static uint8_t megaraid_mbox_version[8] = |
---|
208 | | - { 0x02, 0x20, 0x04, 0x06, 3, 7, 20, 5 }; |
---|
209 | | - |
---|
210 | | - |
---|
211 | | -/* |
---|
212 | 200 | * PCI table for all supported controllers. |
---|
213 | 201 | */ |
---|
214 | 202 | static struct pci_device_id pci_id_table_g[] = { |
---|
.. | .. |
---|
314 | 302 | // definitions for the device attributes for exporting logical drive number |
---|
315 | 303 | // for a scsi address (Host, Channel, Id, Lun) |
---|
316 | 304 | |
---|
317 | | -DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl, |
---|
318 | | - NULL); |
---|
| 305 | +static DEVICE_ATTR(megaraid_mbox_app_hndl, S_IRUSR, megaraid_sysfs_show_app_hndl, |
---|
| 306 | + NULL); |
---|
319 | 307 | |
---|
320 | 308 | // Host template initializer for megaraid mbox sysfs device attributes |
---|
321 | 309 | static struct device_attribute *megaraid_shost_attrs[] = { |
---|
.. | .. |
---|
324 | 312 | }; |
---|
325 | 313 | |
---|
326 | 314 | |
---|
327 | | -DEVICE_ATTR(megaraid_mbox_ld, S_IRUSR, megaraid_sysfs_show_ldnum, NULL); |
---|
| 315 | +static DEVICE_ATTR(megaraid_mbox_ld, S_IRUSR, megaraid_sysfs_show_ldnum, NULL); |
---|
328 | 316 | |
---|
329 | 317 | // Host template initializer for megaraid mbox sysfs device attributes |
---|
330 | 318 | static struct device_attribute *megaraid_sdev_attrs[] = { |
---|
.. | .. |
---|
343 | 331 | .eh_abort_handler = megaraid_abort_handler, |
---|
344 | 332 | .eh_host_reset_handler = megaraid_reset_handler, |
---|
345 | 333 | .change_queue_depth = scsi_change_queue_depth, |
---|
346 | | - .use_clustering = ENABLE_CLUSTERING, |
---|
347 | 334 | .no_write_same = 1, |
---|
348 | 335 | .sdev_attrs = megaraid_sdev_attrs, |
---|
349 | 336 | .shost_attrs = megaraid_shost_attrs, |
---|
.. | .. |
---|
457 | 444 | |
---|
458 | 445 | // Setup the default DMA mask. This would be changed later on |
---|
459 | 446 | // depending on hardware capabilities |
---|
460 | | - if (pci_set_dma_mask(adapter->pdev, DMA_BIT_MASK(32)) != 0) { |
---|
461 | | - |
---|
| 447 | + if (dma_set_mask(&adapter->pdev->dev, DMA_BIT_MASK(32))) { |
---|
462 | 448 | con_log(CL_ANN, (KERN_WARNING |
---|
463 | | - "megaraid: pci_set_dma_mask failed:%d\n", __LINE__)); |
---|
| 449 | + "megaraid: dma_set_mask failed:%d\n", __LINE__)); |
---|
464 | 450 | |
---|
465 | 451 | goto out_free_adapter; |
---|
466 | 452 | } |
---|
.. | .. |
---|
484 | 470 | // Start the mailbox based controller |
---|
485 | 471 | if (megaraid_init_mbox(adapter) != 0) { |
---|
486 | 472 | con_log(CL_ANN, (KERN_WARNING |
---|
487 | | - "megaraid: maibox adapter did not initialize\n")); |
---|
| 473 | + "megaraid: mailbox adapter did not initialize\n")); |
---|
488 | 474 | |
---|
489 | 475 | goto out_free_adapter; |
---|
490 | 476 | } |
---|
.. | .. |
---|
745 | 731 | goto out_free_raid_dev; |
---|
746 | 732 | } |
---|
747 | 733 | |
---|
748 | | - raid_dev->baseaddr = ioremap_nocache(raid_dev->baseport, 128); |
---|
| 734 | + raid_dev->baseaddr = ioremap(raid_dev->baseport, 128); |
---|
749 | 735 | |
---|
750 | 736 | if (!raid_dev->baseaddr) { |
---|
751 | 737 | |
---|
.. | .. |
---|
878 | 864 | adapter->pdev->device == PCI_DEVICE_ID_PERC4_DI_EVERGLADES) || |
---|
879 | 865 | (adapter->pdev->vendor == PCI_VENDOR_ID_DELL && |
---|
880 | 866 | adapter->pdev->device == PCI_DEVICE_ID_PERC4E_DI_KOBUK)) { |
---|
881 | | - if (pci_set_dma_mask(adapter->pdev, DMA_BIT_MASK(64))) { |
---|
| 867 | + if (dma_set_mask(&adapter->pdev->dev, DMA_BIT_MASK(64))) { |
---|
882 | 868 | con_log(CL_ANN, (KERN_WARNING |
---|
883 | 869 | "megaraid: DMA mask for 64-bit failed\n")); |
---|
884 | 870 | |
---|
885 | | - if (pci_set_dma_mask (adapter->pdev, DMA_BIT_MASK(32))) { |
---|
| 871 | + if (dma_set_mask(&adapter->pdev->dev, |
---|
| 872 | + DMA_BIT_MASK(32))) { |
---|
886 | 873 | con_log(CL_ANN, (KERN_WARNING |
---|
887 | 874 | "megaraid: 32-bit DMA mask failed\n")); |
---|
888 | 875 | goto out_free_sysfs_res; |
---|
.. | .. |
---|
950 | 937 | * megaraid_alloc_cmd_packets - allocate shared mailbox |
---|
951 | 938 | * @adapter : soft state of the raid controller |
---|
952 | 939 | * |
---|
953 | | - * Allocate and align the shared mailbox. This maibox is used to issue |
---|
| 940 | + * Allocate and align the shared mailbox. This mailbox is used to issue |
---|
954 | 941 | * all the commands. For IO based controllers, the mailbox is also registered |
---|
955 | 942 | * with the FW. Allocate memory for all commands as well. |
---|
956 | 943 | * This is our big allocator. |
---|
.. | .. |
---|
975 | 962 | * Allocate the common 16-byte aligned memory for the handshake |
---|
976 | 963 | * mailbox. |
---|
977 | 964 | */ |
---|
978 | | - raid_dev->una_mbox64 = pci_zalloc_consistent(adapter->pdev, |
---|
979 | | - sizeof(mbox64_t), |
---|
980 | | - &raid_dev->una_mbox64_dma); |
---|
| 965 | + raid_dev->una_mbox64 = dma_alloc_coherent(&adapter->pdev->dev, |
---|
| 966 | + sizeof(mbox64_t), |
---|
| 967 | + &raid_dev->una_mbox64_dma, |
---|
| 968 | + GFP_KERNEL); |
---|
981 | 969 | |
---|
982 | 970 | if (!raid_dev->una_mbox64) { |
---|
983 | 971 | con_log(CL_ANN, (KERN_WARNING |
---|
.. | .. |
---|
1003 | 991 | align; |
---|
1004 | 992 | |
---|
1005 | 993 | // Allocate memory for commands issued internally |
---|
1006 | | - adapter->ibuf = pci_zalloc_consistent(pdev, MBOX_IBUF_SIZE, |
---|
1007 | | - &adapter->ibuf_dma_h); |
---|
| 994 | + adapter->ibuf = dma_alloc_coherent(&pdev->dev, MBOX_IBUF_SIZE, |
---|
| 995 | + &adapter->ibuf_dma_h, GFP_KERNEL); |
---|
1008 | 996 | if (!adapter->ibuf) { |
---|
1009 | 997 | |
---|
1010 | 998 | con_log(CL_ANN, (KERN_WARNING |
---|
.. | .. |
---|
1082 | 1070 | |
---|
1083 | 1071 | scb->scp = NULL; |
---|
1084 | 1072 | scb->state = SCB_FREE; |
---|
1085 | | - scb->dma_direction = PCI_DMA_NONE; |
---|
| 1073 | + scb->dma_direction = DMA_NONE; |
---|
1086 | 1074 | scb->dma_type = MRAID_DMA_NONE; |
---|
1087 | 1075 | scb->dev_channel = -1; |
---|
1088 | 1076 | scb->dev_target = -1; |
---|
.. | .. |
---|
1098 | 1086 | out_free_scb_list: |
---|
1099 | 1087 | kfree(adapter->kscb_list); |
---|
1100 | 1088 | out_free_ibuf: |
---|
1101 | | - pci_free_consistent(pdev, MBOX_IBUF_SIZE, (void *)adapter->ibuf, |
---|
| 1089 | + dma_free_coherent(&pdev->dev, MBOX_IBUF_SIZE, (void *)adapter->ibuf, |
---|
1102 | 1090 | adapter->ibuf_dma_h); |
---|
1103 | 1091 | out_free_common_mbox: |
---|
1104 | | - pci_free_consistent(adapter->pdev, sizeof(mbox64_t), |
---|
| 1092 | + dma_free_coherent(&adapter->pdev->dev, sizeof(mbox64_t), |
---|
1105 | 1093 | (caddr_t)raid_dev->una_mbox64, raid_dev->una_mbox64_dma); |
---|
1106 | 1094 | |
---|
1107 | 1095 | return -1; |
---|
.. | .. |
---|
1123 | 1111 | |
---|
1124 | 1112 | kfree(adapter->kscb_list); |
---|
1125 | 1113 | |
---|
1126 | | - pci_free_consistent(adapter->pdev, MBOX_IBUF_SIZE, |
---|
| 1114 | + dma_free_coherent(&adapter->pdev->dev, MBOX_IBUF_SIZE, |
---|
1127 | 1115 | (void *)adapter->ibuf, adapter->ibuf_dma_h); |
---|
1128 | 1116 | |
---|
1129 | | - pci_free_consistent(adapter->pdev, sizeof(mbox64_t), |
---|
| 1117 | + dma_free_coherent(&adapter->pdev->dev, sizeof(mbox64_t), |
---|
1130 | 1118 | (caddr_t)raid_dev->una_mbox64, raid_dev->una_mbox64_dma); |
---|
1131 | 1119 | return; |
---|
1132 | 1120 | } |
---|
.. | .. |
---|
1250 | 1238 | dma_pool_free(raid_dev->sg_pool_handle, sg_pci_blk[i].vaddr, |
---|
1251 | 1239 | sg_pci_blk[i].dma_addr); |
---|
1252 | 1240 | } |
---|
1253 | | - if (raid_dev->sg_pool_handle) |
---|
1254 | | - dma_pool_destroy(raid_dev->sg_pool_handle); |
---|
| 1241 | + dma_pool_destroy(raid_dev->sg_pool_handle); |
---|
1255 | 1242 | |
---|
1256 | 1243 | |
---|
1257 | 1244 | epthru_pci_blk = raid_dev->epthru_pool; |
---|
.. | .. |
---|
1259 | 1246 | dma_pool_free(raid_dev->epthru_pool_handle, |
---|
1260 | 1247 | epthru_pci_blk[i].vaddr, epthru_pci_blk[i].dma_addr); |
---|
1261 | 1248 | } |
---|
1262 | | - if (raid_dev->epthru_pool_handle) |
---|
1263 | | - dma_pool_destroy(raid_dev->epthru_pool_handle); |
---|
| 1249 | + dma_pool_destroy(raid_dev->epthru_pool_handle); |
---|
1264 | 1250 | |
---|
1265 | 1251 | |
---|
1266 | 1252 | mbox_pci_blk = raid_dev->mbox_pool; |
---|
.. | .. |
---|
1268 | 1254 | dma_pool_free(raid_dev->mbox_pool_handle, |
---|
1269 | 1255 | mbox_pci_blk[i].vaddr, mbox_pci_blk[i].dma_addr); |
---|
1270 | 1256 | } |
---|
1271 | | - if (raid_dev->mbox_pool_handle) |
---|
1272 | | - dma_pool_destroy(raid_dev->mbox_pool_handle); |
---|
| 1257 | + dma_pool_destroy(raid_dev->mbox_pool_handle); |
---|
1273 | 1258 | |
---|
1274 | 1259 | return; |
---|
1275 | 1260 | } |
---|
.. | .. |
---|
1427 | 1412 | mbox->cmdid = scb->sno; |
---|
1428 | 1413 | |
---|
1429 | 1414 | adapter->outstanding_cmds++; |
---|
1430 | | - |
---|
1431 | | - if (scb->dma_direction == PCI_DMA_TODEVICE) |
---|
1432 | | - pci_dma_sync_sg_for_device(adapter->pdev, |
---|
1433 | | - scsi_sglist(scb->scp), |
---|
1434 | | - scsi_sg_count(scb->scp), |
---|
1435 | | - PCI_DMA_TODEVICE); |
---|
1436 | 1415 | |
---|
1437 | 1416 | mbox->busy = 1; // Set busy |
---|
1438 | 1417 | mbox->poll = 0; |
---|
.. | .. |
---|
1602 | 1581 | return NULL; |
---|
1603 | 1582 | } |
---|
1604 | 1583 | |
---|
1605 | | - /* Fall through */ |
---|
| 1584 | + fallthrough; |
---|
1606 | 1585 | |
---|
1607 | 1586 | case READ_CAPACITY: |
---|
1608 | 1587 | /* |
---|
.. | .. |
---|
2181 | 2160 | |
---|
2182 | 2161 | |
---|
2183 | 2162 | /** |
---|
2184 | | - * megaraid_mbox_sync_scb - sync kernel buffers |
---|
2185 | | - * @adapter : controller's soft state |
---|
2186 | | - * @scb : pointer to the resource packet |
---|
2187 | | - * |
---|
2188 | | - * DMA sync if required. |
---|
2189 | | - */ |
---|
2190 | | -static void |
---|
2191 | | -megaraid_mbox_sync_scb(adapter_t *adapter, scb_t *scb) |
---|
2192 | | -{ |
---|
2193 | | - mbox_ccb_t *ccb; |
---|
2194 | | - |
---|
2195 | | - ccb = (mbox_ccb_t *)scb->ccb; |
---|
2196 | | - |
---|
2197 | | - if (scb->dma_direction == PCI_DMA_FROMDEVICE) |
---|
2198 | | - pci_dma_sync_sg_for_cpu(adapter->pdev, |
---|
2199 | | - scsi_sglist(scb->scp), |
---|
2200 | | - scsi_sg_count(scb->scp), |
---|
2201 | | - PCI_DMA_FROMDEVICE); |
---|
2202 | | - |
---|
2203 | | - scsi_dma_unmap(scb->scp); |
---|
2204 | | - return; |
---|
2205 | | -} |
---|
2206 | | - |
---|
2207 | | - |
---|
2208 | | -/** |
---|
2209 | 2163 | * megaraid_mbox_dpc - the tasklet to complete the commands from completed list |
---|
2210 | 2164 | * @devp : pointer to HBA soft state |
---|
2211 | 2165 | * |
---|
.. | .. |
---|
2403 | 2357 | megaraid_mbox_display_scb(adapter, scb); |
---|
2404 | 2358 | } |
---|
2405 | 2359 | |
---|
2406 | | - // Free our internal resources and call the mid-layer callback |
---|
2407 | | - // routine |
---|
2408 | | - megaraid_mbox_sync_scb(adapter, scb); |
---|
| 2360 | + scsi_dma_unmap(scp); |
---|
2409 | 2361 | |
---|
2410 | 2362 | // remove from local clist |
---|
2411 | 2363 | list_del_init(&scb->list); |
---|
.. | .. |
---|
2577 | 2529 | uint8_t raw_mbox[sizeof(mbox_t)]; |
---|
2578 | 2530 | int rval; |
---|
2579 | 2531 | int recovery_window; |
---|
2580 | | - int recovering; |
---|
2581 | 2532 | int i; |
---|
2582 | 2533 | uioc_t *kioc; |
---|
2583 | 2534 | |
---|
.. | .. |
---|
2590 | 2541 | "megaraid: hw error, cannot reset\n")); |
---|
2591 | 2542 | return FAILED; |
---|
2592 | 2543 | } |
---|
2593 | | - |
---|
2594 | 2544 | |
---|
2595 | 2545 | // Under exceptional conditions, FW can take up to 3 minutes to |
---|
2596 | 2546 | // complete command processing. Wait for additional 2 minutes for the |
---|
.. | .. |
---|
2639 | 2589 | } |
---|
2640 | 2590 | |
---|
2641 | 2591 | recovery_window = MBOX_RESET_WAIT + MBOX_RESET_EXT_WAIT; |
---|
2642 | | - |
---|
2643 | | - recovering = adapter->outstanding_cmds; |
---|
2644 | 2592 | |
---|
2645 | 2593 | for (i = 0; i < recovery_window; i++) { |
---|
2646 | 2594 | |
---|
.. | .. |
---|
2725 | 2673 | mbox_post_sync_cmd(adapter_t *adapter, uint8_t raw_mbox[]) |
---|
2726 | 2674 | { |
---|
2727 | 2675 | mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); |
---|
2728 | | - mbox64_t *mbox64; |
---|
2729 | 2676 | mbox_t *mbox; |
---|
2730 | 2677 | uint8_t status; |
---|
2731 | 2678 | int i; |
---|
2732 | 2679 | |
---|
2733 | | - |
---|
2734 | | - mbox64 = raid_dev->mbox64; |
---|
2735 | 2680 | mbox = raid_dev->mbox; |
---|
2736 | 2681 | |
---|
2737 | 2682 | /* |
---|
.. | .. |
---|
2948 | 2893 | * Issue an ENQUIRY3 command to find out certain adapter parameters, |
---|
2949 | 2894 | * e.g., max channels, max commands etc. |
---|
2950 | 2895 | */ |
---|
2951 | | - pinfo = pci_zalloc_consistent(adapter->pdev, sizeof(mraid_pinfo_t), |
---|
2952 | | - &pinfo_dma_h); |
---|
2953 | | - |
---|
| 2896 | + pinfo = dma_alloc_coherent(&adapter->pdev->dev, sizeof(mraid_pinfo_t), |
---|
| 2897 | + &pinfo_dma_h, GFP_KERNEL); |
---|
2954 | 2898 | if (pinfo == NULL) { |
---|
2955 | 2899 | con_log(CL_ANN, (KERN_WARNING |
---|
2956 | 2900 | "megaraid: out of memory, %s %d\n", __func__, |
---|
.. | .. |
---|
2971 | 2915 | |
---|
2972 | 2916 | con_log(CL_ANN, (KERN_WARNING "megaraid: Inquiry3 failed\n")); |
---|
2973 | 2917 | |
---|
2974 | | - pci_free_consistent(adapter->pdev, sizeof(mraid_pinfo_t), |
---|
| 2918 | + dma_free_coherent(&adapter->pdev->dev, sizeof(mraid_pinfo_t), |
---|
2975 | 2919 | pinfo, pinfo_dma_h); |
---|
2976 | 2920 | |
---|
2977 | 2921 | return -1; |
---|
.. | .. |
---|
3002 | 2946 | con_log(CL_ANN, (KERN_WARNING |
---|
3003 | 2947 | "megaraid: product info failed\n")); |
---|
3004 | 2948 | |
---|
3005 | | - pci_free_consistent(adapter->pdev, sizeof(mraid_pinfo_t), |
---|
| 2949 | + dma_free_coherent(&adapter->pdev->dev, sizeof(mraid_pinfo_t), |
---|
3006 | 2950 | pinfo, pinfo_dma_h); |
---|
3007 | 2951 | |
---|
3008 | 2952 | return -1; |
---|
.. | .. |
---|
3038 | 2982 | "megaraid: fw version:[%s] bios version:[%s]\n", |
---|
3039 | 2983 | adapter->fw_version, adapter->bios_version)); |
---|
3040 | 2984 | |
---|
3041 | | - pci_free_consistent(adapter->pdev, sizeof(mraid_pinfo_t), pinfo, |
---|
| 2985 | + dma_free_coherent(&adapter->pdev->dev, sizeof(mraid_pinfo_t), pinfo, |
---|
3042 | 2986 | pinfo_dma_h); |
---|
3043 | 2987 | |
---|
3044 | 2988 | return 0; |
---|
.. | .. |
---|
3135 | 3079 | static int |
---|
3136 | 3080 | megaraid_mbox_support_random_del(adapter_t *adapter) |
---|
3137 | 3081 | { |
---|
3138 | | - mbox_t *mbox; |
---|
3139 | 3082 | uint8_t raw_mbox[sizeof(mbox_t)]; |
---|
3140 | 3083 | int rval; |
---|
3141 | 3084 | |
---|
.. | .. |
---|
3156 | 3099 | con_log(CL_DLEVEL1, ("megaraid: disable random deletion\n")); |
---|
3157 | 3100 | return 0; |
---|
3158 | 3101 | } |
---|
3159 | | - |
---|
3160 | | - mbox = (mbox_t *)raw_mbox; |
---|
3161 | 3102 | |
---|
3162 | 3103 | memset((caddr_t)raw_mbox, 0, sizeof(mbox_t)); |
---|
3163 | 3104 | |
---|
.. | .. |
---|
3263 | 3204 | static void |
---|
3264 | 3205 | megaraid_mbox_flush_cache(adapter_t *adapter) |
---|
3265 | 3206 | { |
---|
3266 | | - mbox_t *mbox; |
---|
3267 | 3207 | uint8_t raw_mbox[sizeof(mbox_t)]; |
---|
3268 | | - |
---|
3269 | | - |
---|
3270 | | - mbox = (mbox_t *)raw_mbox; |
---|
3271 | 3208 | |
---|
3272 | 3209 | memset((caddr_t)raw_mbox, 0, sizeof(mbox_t)); |
---|
3273 | 3210 | |
---|
.. | .. |
---|
3299 | 3236 | mbox_t *mbox; |
---|
3300 | 3237 | uint8_t raw_mbox[sizeof(mbox_t)]; |
---|
3301 | 3238 | mraid_device_t *raid_dev = ADAP2RAIDDEV(adapter); |
---|
3302 | | - mbox64_t *mbox64; |
---|
3303 | 3239 | int status = 0; |
---|
3304 | 3240 | int i; |
---|
3305 | 3241 | uint32_t dword; |
---|
.. | .. |
---|
3310 | 3246 | |
---|
3311 | 3247 | raw_mbox[0] = 0xFF; |
---|
3312 | 3248 | |
---|
3313 | | - mbox64 = raid_dev->mbox64; |
---|
3314 | 3249 | mbox = raid_dev->mbox; |
---|
3315 | 3250 | |
---|
3316 | 3251 | /* Wait until mailbox is free */ |
---|
.. | .. |
---|
3369 | 3304 | * megaraid_mbox_display_scb - display SCB information, mostly debug purposes |
---|
3370 | 3305 | * @adapter : controller's soft state |
---|
3371 | 3306 | * @scb : SCB to be displayed |
---|
3372 | | - * @level : debug level for console print |
---|
3373 | 3307 | * |
---|
3374 | 3308 | * Diplay information about the given SCB iff the current debug level is |
---|
3375 | 3309 | * verbose. |
---|
.. | .. |
---|
3515 | 3449 | |
---|
3516 | 3450 | scb->scp = NULL; |
---|
3517 | 3451 | scb->state = SCB_FREE; |
---|
3518 | | - scb->dma_direction = PCI_DMA_NONE; |
---|
| 3452 | + scb->dma_direction = DMA_NONE; |
---|
3519 | 3453 | scb->dma_type = MRAID_DMA_NONE; |
---|
3520 | 3454 | scb->dev_channel = -1; |
---|
3521 | 3455 | scb->dev_target = -1; |
---|
.. | .. |
---|
3653 | 3587 | |
---|
3654 | 3588 | scb->state = SCB_ACTIVE; |
---|
3655 | 3589 | scb->dma_type = MRAID_DMA_NONE; |
---|
3656 | | - scb->dma_direction = PCI_DMA_NONE; |
---|
| 3590 | + scb->dma_direction = DMA_NONE; |
---|
3657 | 3591 | |
---|
3658 | 3592 | ccb = (mbox_ccb_t *)scb->ccb; |
---|
3659 | 3593 | mbox64 = (mbox64_t *)(unsigned long)kioc->cmdbuf; |
---|
.. | .. |
---|
3794 | 3728 | static int |
---|
3795 | 3729 | gather_hbainfo(adapter_t *adapter, mraid_hba_info_t *hinfo) |
---|
3796 | 3730 | { |
---|
3797 | | - uint8_t dmajor; |
---|
3798 | | - |
---|
3799 | | - dmajor = megaraid_mbox_version[0]; |
---|
3800 | | - |
---|
3801 | 3731 | hinfo->pci_vendor_id = adapter->pdev->vendor; |
---|
3802 | 3732 | hinfo->pci_device_id = adapter->pdev->device; |
---|
3803 | 3733 | hinfo->subsys_vendor_id = adapter->pdev->subsystem_vendor; |
---|
.. | .. |
---|
3843 | 3773 | |
---|
3844 | 3774 | raid_dev->sysfs_mbox64 = kmalloc(sizeof(mbox64_t), GFP_KERNEL); |
---|
3845 | 3775 | |
---|
3846 | | - raid_dev->sysfs_buffer = pci_alloc_consistent(adapter->pdev, |
---|
3847 | | - PAGE_SIZE, &raid_dev->sysfs_buffer_dma); |
---|
| 3776 | + raid_dev->sysfs_buffer = dma_alloc_coherent(&adapter->pdev->dev, |
---|
| 3777 | + PAGE_SIZE, &raid_dev->sysfs_buffer_dma, GFP_KERNEL); |
---|
3848 | 3778 | |
---|
3849 | 3779 | if (!raid_dev->sysfs_uioc || !raid_dev->sysfs_mbox64 || |
---|
3850 | 3780 | !raid_dev->sysfs_buffer) { |
---|
.. | .. |
---|
3881 | 3811 | kfree(raid_dev->sysfs_mbox64); |
---|
3882 | 3812 | |
---|
3883 | 3813 | if (raid_dev->sysfs_buffer) { |
---|
3884 | | - pci_free_consistent(adapter->pdev, PAGE_SIZE, |
---|
| 3814 | + dma_free_coherent(&adapter->pdev->dev, PAGE_SIZE, |
---|
3885 | 3815 | raid_dev->sysfs_buffer, raid_dev->sysfs_buffer_dma); |
---|
3886 | 3816 | } |
---|
3887 | 3817 | } |
---|
.. | .. |
---|
4041 | 3971 | |
---|
4042 | 3972 | /** |
---|
4043 | 3973 | * megaraid_sysfs_show_app_hndl - display application handle for this adapter |
---|
4044 | | - * @cdev : class device object representation for the host |
---|
| 3974 | + * @dev : class device object representation for the host |
---|
| 3975 | + * @attr : device attribute (unused) |
---|
4045 | 3976 | * @buf : buffer to send data to |
---|
4046 | 3977 | * |
---|
4047 | 3978 | * Display the handle used by the applications while executing management |
---|