aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/crypto/hifn_795x.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/drivers/crypto/hifn_795x.c b/drivers/crypto/hifn_795x.c
index ce3a27ecfaa5..a03fe571265b 100644
--- a/drivers/crypto/hifn_795x.c
+++ b/drivers/crypto/hifn_795x.c
@@ -38,9 +38,6 @@
38 38
39#include <asm/kmap_types.h> 39#include <asm/kmap_types.h>
40 40
41#undef dprintk
42
43#define HIFN_TEST
44//#define HIFN_DEBUG 41//#define HIFN_DEBUG
45 42
46#ifdef HIFN_DEBUG 43#ifdef HIFN_DEBUG
@@ -406,8 +403,6 @@ struct hifn_dma {
406 u8 command_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_COMMAND]; 403 u8 command_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_COMMAND];
407 u8 result_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_RESULT]; 404 u8 result_bufs[HIFN_D_CMD_RSIZE][HIFN_MAX_RESULT];
408 405
409 u64 test_src, test_dst;
410
411 /* 406 /*
412 * Our current positions for insertion and removal from the descriptor 407 * Our current positions for insertion and removal from the descriptor
413 * rings. 408 * rings.
@@ -434,9 +429,6 @@ struct hifn_device
434 struct pci_dev *pdev; 429 struct pci_dev *pdev;
435 void __iomem *bar[3]; 430 void __iomem *bar[3];
436 431
437 unsigned long result_mem;
438 dma_addr_t dst;
439
440 void *desc_virt; 432 void *desc_virt;
441 dma_addr_t desc_dma; 433 dma_addr_t desc_dma;
442 434
@@ -446,8 +438,6 @@ struct hifn_device
446 438
447 spinlock_t lock; 439 spinlock_t lock;
448 440
449 void *priv;
450
451 u32 flags; 441 u32 flags;
452 int active, started; 442 int active, started;
453 struct delayed_work work; 443 struct delayed_work work;
@@ -2638,22 +2628,11 @@ static int hifn_probe(struct pci_dev *pdev, const struct pci_device_id *id)
2638 goto err_out_unmap_bars; 2628 goto err_out_unmap_bars;
2639 } 2629 }
2640 2630
2641 dev->result_mem = __get_free_pages(GFP_KERNEL, HIFN_MAX_RESULT_ORDER);
2642 if (!dev->result_mem) {
2643 dprintk("Failed to allocate %d pages for result_mem.\n",
2644 HIFN_MAX_RESULT_ORDER);
2645 goto err_out_unmap_bars;
2646 }
2647 memset((void *)dev->result_mem, 0, PAGE_SIZE*(1<<HIFN_MAX_RESULT_ORDER));
2648
2649 dev->dst = pci_map_single(pdev, (void *)dev->result_mem,
2650 PAGE_SIZE << HIFN_MAX_RESULT_ORDER, PCI_DMA_FROMDEVICE);
2651
2652 dev->desc_virt = pci_alloc_consistent(pdev, sizeof(struct hifn_dma), 2631 dev->desc_virt = pci_alloc_consistent(pdev, sizeof(struct hifn_dma),
2653 &dev->desc_dma); 2632 &dev->desc_dma);
2654 if (!dev->desc_virt) { 2633 if (!dev->desc_virt) {
2655 dprintk("Failed to allocate descriptor rings.\n"); 2634 dprintk("Failed to allocate descriptor rings.\n");
2656 goto err_out_free_result_pages; 2635 goto err_out_unmap_bars;
2657 } 2636 }
2658 memset(dev->desc_virt, 0, sizeof(struct hifn_dma)); 2637 memset(dev->desc_virt, 0, sizeof(struct hifn_dma));
2659 2638
@@ -2713,11 +2692,6 @@ err_out_free_desc:
2713 pci_free_consistent(pdev, sizeof(struct hifn_dma), 2692 pci_free_consistent(pdev, sizeof(struct hifn_dma),
2714 dev->desc_virt, dev->desc_dma); 2693 dev->desc_virt, dev->desc_dma);
2715 2694
2716err_out_free_result_pages:
2717 pci_unmap_single(pdev, dev->dst, PAGE_SIZE << HIFN_MAX_RESULT_ORDER,
2718 PCI_DMA_FROMDEVICE);
2719 free_pages(dev->result_mem, HIFN_MAX_RESULT_ORDER);
2720
2721err_out_unmap_bars: 2695err_out_unmap_bars:
2722 for (i=0; i<3; ++i) 2696 for (i=0; i<3; ++i)
2723 if (dev->bar[i]) 2697 if (dev->bar[i])
@@ -2755,10 +2729,6 @@ static void hifn_remove(struct pci_dev *pdev)
2755 2729
2756 pci_free_consistent(pdev, sizeof(struct hifn_dma), 2730 pci_free_consistent(pdev, sizeof(struct hifn_dma),
2757 dev->desc_virt, dev->desc_dma); 2731 dev->desc_virt, dev->desc_dma);
2758 pci_unmap_single(pdev, dev->dst,
2759 PAGE_SIZE << HIFN_MAX_RESULT_ORDER,
2760 PCI_DMA_FROMDEVICE);
2761 free_pages(dev->result_mem, HIFN_MAX_RESULT_ORDER);
2762 for (i=0; i<3; ++i) 2732 for (i=0; i<3; ++i)
2763 if (dev->bar[i]) 2733 if (dev->bar[i])
2764 iounmap(dev->bar[i]); 2734 iounmap(dev->bar[i]);