Commit 9101a079 authored by John Garry's avatar John Garry Committed by Martin K. Petersen

hisi_sas: Add cq structure initialization

Each completion queue has a structure. This is mainly for passing to irq
handler so we know which queue the irq occured on.
Signed-off-by: default avatarJohn Garry <john.garry@huawei.com>
Reviewed-by: default avatarArnd Bergmann <arnd@arndb.de>
Reviewed-by: default avatarHannes Reinecke <hare@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 257efd1f
......@@ -45,6 +45,11 @@ struct hisi_sas_port {
struct asd_sas_port sas_port;
};
struct hisi_sas_cq {
struct hisi_hba *hisi_hba;
int id;
};
struct hisi_sas_slot {
};
......@@ -73,6 +78,8 @@ struct hisi_hba {
/* SCSI/SAS glue */
struct sas_ha_struct sha;
struct Scsi_Host *shost;
struct hisi_sas_cq cq[HISI_SAS_MAX_QUEUES];
struct hisi_sas_phy phy[HISI_SAS_MAX_PHYS];
struct hisi_sas_port port[HISI_SAS_MAX_PHYS];
......
......@@ -58,6 +58,12 @@ static int hisi_sas_alloc(struct hisi_hba *hisi_hba, struct Scsi_Host *shost)
struct device *dev = &pdev->dev;
for (i = 0; i < hisi_hba->queue_count; i++) {
struct hisi_sas_cq *cq = &hisi_hba->cq[i];
/* Completion queue structure */
cq->id = i;
cq->hisi_hba = hisi_hba;
/* Delivery queue */
s = sizeof(struct hisi_sas_cmd_hdr) * HISI_SAS_QUEUE_SLOTS;
hisi_hba->cmd_hdr[i] = dma_alloc_coherent(dev, s,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment