26
27
#include "mv_sas.h"
29
static int lldd_max_execute_num = 1;
30
module_param_named(collector, lldd_max_execute_num, int, S_IRUGO);
31
MODULE_PARM_DESC(collector, "\n"
32
"\tIf greater than one, tells the SAS Layer to run in Task Collector\n"
33
"\tMode. If 1 or 0, tells the SAS Layer to run in Direct Mode.\n"
34
"\tThe mvsas SAS LLDD supports both modes.\n"
35
"\tDefault: 1 (Direct Mode).\n");
28
37
static struct scsi_transport_template *mvs_stt;
38
struct kmem_cache *mvs_task_list_cache;
29
39
static const struct mvs_chip_info mvs_chips[] = {
30
40
[chip_6320] = { 1, 2, 0x400, 17, 16, 9, &mvs_64xx_dispatch, },
31
41
[chip_6440] = { 1, 4, 0x400, 17, 16, 9, &mvs_64xx_dispatch, },
32
42
[chip_6485] = { 1, 8, 0x800, 33, 32, 10, &mvs_64xx_dispatch, },
33
43
[chip_9180] = { 2, 4, 0x800, 17, 64, 9, &mvs_94xx_dispatch, },
34
44
[chip_9480] = { 2, 4, 0x800, 17, 64, 9, &mvs_94xx_dispatch, },
45
[chip_9445] = { 1, 4, 0x800, 17, 64, 11, &mvs_94xx_dispatch, },
46
[chip_9485] = { 2, 4, 0x800, 17, 64, 11, &mvs_94xx_dispatch, },
35
47
[chip_1300] = { 1, 4, 0x400, 17, 16, 9, &mvs_64xx_dispatch, },
36
48
[chip_1320] = { 2, 4, 0x800, 17, 64, 9, &mvs_94xx_dispatch, },
120
131
slot_nr = MVS_SLOTS;
122
for (i = 0; i < mvi->tags_num; i++) {
123
struct mvs_slot_info *slot = &mvi->slot_info[i];
125
dma_free_coherent(mvi->dev, MVS_SLOT_BUF_SZ,
126
slot->buf, slot->buf_dma);
134
pci_pool_destroy(mvi->dma_pool);
130
137
dma_free_coherent(mvi->dev,
272
280
if (!mvi->bulk_buffer)
275
for (i = 0; i < slot_nr; i++) {
276
struct mvs_slot_info *slot = &mvi->slot_info[i];
278
slot->buf = dma_alloc_coherent(mvi->dev, MVS_SLOT_BUF_SZ,
279
&slot->buf_dma, GFP_KERNEL);
281
printk(KERN_DEBUG"failed to allocate slot->buf.\n");
283
sprintf(pool_name, "%s%d", "mvs_dma_pool", mvi->id);
284
mvi->dma_pool = pci_pool_create(pool_name, mvi->pdev, MVS_SLOT_BUF_SZ, 16, 0);
285
if (!mvi->dma_pool) {
286
printk(KERN_DEBUG "failed to create dma pool %s.\n", pool_name);
284
memset(slot->buf, 0, MVS_SLOT_BUF_SZ);
289
mvi->tags_num = slot_nr;
287
291
/* Initialize tags */
288
292
mvs_tag_init(mvi);
670
674
{ PCI_VDEVICE(TTI, 0x2740), chip_9480 },
671
675
{ PCI_VDEVICE(TTI, 0x2744), chip_9480 },
672
676
{ PCI_VDEVICE(TTI, 0x2760), chip_9480 },
680
.subvendor = PCI_ANY_ID,
684
.driver_data = chip_9445,
689
.subvendor = PCI_ANY_ID,
693
.driver_data = chip_9485,
674
696
{ } /* terminate list */
715
mvs_task_list_cache = kmem_cache_create("mvs_task_list", sizeof(struct mvs_task_list),
716
0, SLAB_HWCACHE_ALIGN, NULL);
717
if (!mvs_task_list_cache) {
719
mv_printk("%s: mvs_task_list_cache alloc failed! \n", __func__);
693
723
rc = pci_register_driver(&mvs_pci_driver);