megaraid.c (c1561cf463f4a480d1960e833c8fe628207b24e4) megaraid.c (bbfbbbc1182f8b44c8cc4c99f4a3f3a512149022)
1/*
2 *
3 * Linux MegaRAID device driver
4 *
5 * Copyright (c) 2002 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

--- 1739 unchanged lines hidden (view full) ---

1748 sgcnt = scsi_dma_map(cmd);
1749
1750 scb->dma_type = MEGA_SGLIST;
1751
1752 BUG_ON(sgcnt > adapter->sglen || sgcnt < 0);
1753
1754 *len = 0;
1755
1/*
2 *
3 * Linux MegaRAID device driver
4 *
5 * Copyright (c) 2002 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

--- 1739 unchanged lines hidden (view full) ---

1748 sgcnt = scsi_dma_map(cmd);
1749
1750 scb->dma_type = MEGA_SGLIST;
1751
1752 BUG_ON(sgcnt > adapter->sglen || sgcnt < 0);
1753
1754 *len = 0;
1755
1756 if (scsi_sg_count(cmd) == 1 && !adapter->has_64bit_addr) {
1757 sg = scsi_sglist(cmd);
1758 scb->dma_h_bulkdata = sg_dma_address(sg);
1759 *buf = (u32)scb->dma_h_bulkdata;
1760 *len = sg_dma_len(sg);
1761 return 0;
1762 }
1763
1764 scsi_for_each_sg(cmd, sg, sgcnt, idx) {
1765 if (adapter->has_64bit_addr) {
1766 scb->sgl64[idx].address = sg_dma_address(sg);
1767 *len += scb->sgl64[idx].length = sg_dma_len(sg);
1768 } else {
1769 scb->sgl[idx].address = sg_dma_address(sg);
1770 *len += scb->sgl[idx].length = sg_dma_len(sg);
1771 }

--- 2639 unchanged lines hidden (view full) ---

4411 mutex_lock(&adapter->int_mtx);
4412
4413 scb = &adapter->int_scb;
4414 memset(scb, 0, sizeof(scb_t));
4415
4416 scmd = &adapter->int_scmd;
4417 memset(scmd, 0, sizeof(Scsi_Cmnd));
4418
1756 scsi_for_each_sg(cmd, sg, sgcnt, idx) {
1757 if (adapter->has_64bit_addr) {
1758 scb->sgl64[idx].address = sg_dma_address(sg);
1759 *len += scb->sgl64[idx].length = sg_dma_len(sg);
1760 } else {
1761 scb->sgl[idx].address = sg_dma_address(sg);
1762 *len += scb->sgl[idx].length = sg_dma_len(sg);
1763 }

--- 2639 unchanged lines hidden (view full) ---

4403 mutex_lock(&adapter->int_mtx);
4404
4405 scb = &adapter->int_scb;
4406 memset(scb, 0, sizeof(scb_t));
4407
4408 scmd = &adapter->int_scmd;
4409 memset(scmd, 0, sizeof(Scsi_Cmnd));
4410
4419 sdev = kmalloc(sizeof(struct scsi_device), GFP_KERNEL);
4420 memset(sdev, 0, sizeof(struct scsi_device));
4411 sdev = kzalloc(sizeof(struct scsi_device), GFP_KERNEL);
4421 scmd->device = sdev;
4422
4423 scmd->device->host = adapter->host;
4424 scmd->host_scribble = (void *)scb;
4425 scmd->cmnd[0] = MEGA_INTERNAL_CMD;
4426
4427 scb->state |= SCB_ACTIVE;
4428 scb->cmd = scmd;

--- 620 unchanged lines hidden ---
4412 scmd->device = sdev;
4413
4414 scmd->device->host = adapter->host;
4415 scmd->host_scribble = (void *)scb;
4416 scmd->cmnd[0] = MEGA_INTERNAL_CMD;
4417
4418 scb->state |= SCB_ACTIVE;
4419 scb->cmd = scmd;

--- 620 unchanged lines hidden ---