mirror of
https://github.com/torvalds/linux.git
synced 2024-12-14 15:13:52 +00:00
c82ee6d3be
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details you should have received a copy of the gnu general public license along with this program see the file copying if not write to the free software foundation 675 mass ave cambridge ma 02139 usa extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 52 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Jilayne Lovejoy <opensource@jilayne.com> Reviewed-by: Steve Winslow <swinslow@gmail.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190519154042.342335923@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
72 lines
1.6 KiB
C
72 lines
1.6 KiB
C
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
/*
|
|
* Adaptec AAC series RAID controller driver
|
|
*
|
|
* based on the old aacraid driver that is..
|
|
* Adaptec aacraid device driver for Linux.
|
|
*
|
|
* Copyright (c) 2000-2010 Adaptec, Inc.
|
|
* 2010-2015 PMC-Sierra, Inc. (aacraid@pmc-sierra.com)
|
|
* 2016-2017 Microsemi Corp. (aacraid@microsemi.com)
|
|
*
|
|
* Module Name:
|
|
* nark.c
|
|
*
|
|
* Abstract: Hardware Device Interface for NEMER/ARK
|
|
*/
|
|
|
|
#include <linux/pci.h>
|
|
#include <linux/blkdev.h>
|
|
|
|
#include <scsi/scsi_host.h>
|
|
|
|
#include "aacraid.h"
|
|
|
|
/**
|
|
* aac_nark_ioremap
|
|
* @size: mapping resize request
|
|
*
|
|
*/
|
|
static int aac_nark_ioremap(struct aac_dev * dev, u32 size)
|
|
{
|
|
if (!size) {
|
|
iounmap(dev->regs.rx);
|
|
dev->regs.rx = NULL;
|
|
iounmap(dev->base);
|
|
dev->base = NULL;
|
|
return 0;
|
|
}
|
|
dev->base_start = pci_resource_start(dev->pdev, 2);
|
|
dev->regs.rx = ioremap((u64)pci_resource_start(dev->pdev, 0) |
|
|
((u64)pci_resource_start(dev->pdev, 1) << 32),
|
|
sizeof(struct rx_registers) - sizeof(struct rx_inbound));
|
|
dev->base = NULL;
|
|
if (dev->regs.rx == NULL)
|
|
return -1;
|
|
dev->base = ioremap(dev->base_start, size);
|
|
if (dev->base == NULL) {
|
|
iounmap(dev->regs.rx);
|
|
dev->regs.rx = NULL;
|
|
return -1;
|
|
}
|
|
dev->IndexRegs = &((struct rx_registers __iomem *)dev->base)->IndexRegs;
|
|
return 0;
|
|
}
|
|
|
|
/**
|
|
* aac_nark_init - initialize an NEMER/ARK Split Bar card
|
|
* @dev: device to configure
|
|
*
|
|
*/
|
|
|
|
int aac_nark_init(struct aac_dev * dev)
|
|
{
|
|
/*
|
|
* Fill in the function dispatch table.
|
|
*/
|
|
dev->a_ops.adapter_ioremap = aac_nark_ioremap;
|
|
dev->a_ops.adapter_comm = aac_rx_select_comm;
|
|
|
|
return _aac_rx_init(dev);
|
|
}
|