Add missed things from Feral CVS repository.

git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@321 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Stanislaw Gruszka
2008-04-01 12:04:34 +00:00
parent 802ee69a76
commit ca650f2bb6
4 changed files with 22 additions and 80 deletions

View File

@@ -1297,9 +1297,9 @@ isp_taction(qact_e action, void *arg)
isp_prt(isp, ISP_LOGTDEBUG1, "freeing tmd %p [%llx]", tmd, tmd->cd_tagval);
if (tmd->cd_lflags & CDFL_RESRC_FILL) {
if (isp_target_putback_atio(isp, tmd)) {
ISP_THREAD_EVENT(isp, ISP_THREAD_FC_PUTBACK, tmd, 0, __FUNCTION__, __LINE__);
ISP_UNLK_SOFTC(isp);
break;
ISP_THREAD_EVENT(isp, ISP_THREAD_FC_PUTBACK, tmd, 0, __FUNCTION__, __LINE__);
ISP_UNLK_SOFTC(isp);
break;
}
}
if (tmd->cd_lflags & CDFL_NEED_CLNUP) {
@@ -1379,7 +1379,7 @@ isp_taction(qact_e action, void *arg)
rsp->abts_rsp_payload.ba_acc.high_seq_cnt = 0xffff;
isp_notify_ack(isp, ins->qentry);
} else if (ins->notify.nt_need_ack) {
isp_prt(isp, ISP_LOGDEBUG0, "[%llx] Notify Code 0x%x (qevalid=%d) being acked", ins->notify.nt_tagval, ins->notify.nt_ncode, ins->qevalid);
isp_prt(isp, ISP_LOGINFO, "[%llx] Notify Code 0x%x (qevalid=%d) being acked", ins->notify.nt_tagval, ins->notify.nt_ncode, ins->qevalid);
if (ins->qevalid) {
isp_notify_ack(isp, ins->qentry);
} else {

View File

@@ -112,7 +112,7 @@
#include <scsi/scsi_device.h>
#include <linux/cdev.h>
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,17)
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
#include <linux/devfs_fs_kernel.h>
#define ISP_CLASS struct class_simple
#define CREATE_ISP_CLASS class_simple_create
@@ -382,8 +382,8 @@ struct isposinfo {
up(&(x)->isp_osinfo.tcs)
#define ISP_THREAD_WAIT(x) \
wait_event_interruptible((x)->isp_osinfo.trq, (((x)->isp_osinfo.task_active == 0) || ((x)->isp_osinfo.nt_actions != 0)))
wait_event_interruptible((x)->isp_osinfo.trq, (((x)->isp_osinfo.task_active == 0) || ((x)->isp_osinfo.nt_actions != 0)))
#define ISP_THREAD_EVENT isp_thread_event
#define ISP_THREAD_WAKE(x) wake_up_all(&(x)->isp_osinfo.trq)
@@ -455,7 +455,7 @@ struct isposinfo {
#define GET_NANOSEC(x) ((uint64_t) ((((uint64_t)(x)->tv_sec) * 1000000 + (x)->tv_usec)))
#define NANOTIME_SUB _isp_microtime_sub
#define MAXISPREQUEST(isp) ((IS_FC(isp) || IS_ULTRA2(isp))? 1024 : 256)
#define MAXISPREQUEST(isp) (IS_24XX(isp)? 2048 : ((IS_FC(isp) || IS_ULTRA2(isp))? 1024 : 256))
#if defined(__powerpc__)
#define MEMORYBARRIER(isp, type, offset, size) __asm__ __volatile__("eieio" ::: "memory")
@@ -479,7 +479,8 @@ struct isposinfo {
#define FC_SCRATCH_ACQUIRE fc_scratch_acquire
#define FC_SCRATCH_RELEASE(isp, chan) ISP_DATA(isp, chan)->scratch_busy = 0
#ifndef SCSI_GOOD
#define SCSI_GOOD 0x0
#endif
@@ -612,14 +613,6 @@ void isp_prt(ispsoftc_t *, int level, const char *, ...) __attribute__((__format
void isp_prt(ispsoftc_t *, int level, const char *, ...);
#endif
#ifndef DECLARE_MUTEX_LOCKED
#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24)
#define sg_page(_sg) ((_sg)->page)
#define sg_assign_page(_sg, _pg) ((_sg)->page = (_pg))
#endif
/*
* isp_osinfo definitions, extensions and shorthand.

View File

@@ -131,8 +131,7 @@ static int isplinux_pci_exclude(struct pci_dev *);
#define ISP_2322_RISC_CODE NULL
#define ISP_2400_RISC_CODE NULL
#define DISABLE_FW_LOADER 1
#if defined(DISABLE_FW_LOADER) || !(defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE))
#if defined(DISABLE_FW_LOADER) || !(defined(CONFIG_FW_LOADER) || defined(CONFIG_FW_LOADER_MODULE))
#ifndef ISP_DISABLE_1020_SUPPORT
#include "asm_1040.h"
#endif

View File

@@ -153,9 +153,6 @@
#ifndef REPORT_LUNS
#define REPORT_LUNS 0xa0
#endif
#ifndef REPORT_LUNS
#define REPORT_LUNS 0xa0
#endif
#define MODE_ALL_PAGES 0x3f
#define MODE_VU_PAGE 0x00
@@ -998,64 +995,6 @@ scsi_target_start_cmd(tmd_cmd_t *tmd, int from_intr)
goto doit;
}
if (tmd->cd_cdb[0] == REPORT_LUNS) {
struct scatterlist *dp = NULL;
if (tmd->cd_totlen != 0) {
if (from_intr) {
scsi_cmd_sched_restart(tmd, "REPORT_LUNS");
return;
}
addr = scsi_target_kzalloc(SGS_SIZE, GFP_KERNEL|GFP_ATOMIC);
if (addr == NULL) {
printk("scsi_target_alloc: out of memory for report luns\n");
tmd->cd_scsi_status = SCSI_BUSY;
xact->td_xfrlen = 0;
} else {
int i;
uint32_t lim, nluns;
uint8_t *rpa = addr;
lim = (tmd->cd_cdb[6] << 24) | (tmd->cd_cdb[7] << 16) | (tmd->cd_cdb[8] << 8) | tmd->cd_cdb[9];
spin_lock_irqsave(&scsi_target_lock, flags);
for (nluns = i = 0; i < MAX_LUN; i++) {
lun_t *lp = &bp->luns[i];
if (lp->enabled) {
uint8_t *ptr = &rpa[8 + (nluns << 3)];
if (i >= 256) {
ptr[0] = 0x40 | ((i >> 8) & 0x3f);
}
ptr[1] = i;
nluns++;
}
}
spin_unlock_irqrestore(&scsi_target_lock, flags);
/*
* Make sure we always have *one* (lun 0) enabled
*/
if (nluns == 0) {
nluns = 1;
}
rpa[0] = (nluns << 3) >> 24;
rpa[1] = (nluns << 3) >> 16;
rpa[2] = (nluns << 3) >> 8;
rpa[3] = (nluns << 3);
dp = SGS_SGP(addr);
lim = min(lim, tmd->cd_totlen);
lim = min(lim, (nluns << 3) + 8);
init_sg_elem(dp, NULL, 0, addr, lim);
xact->td_xfrlen = dp->length;
xact->td_data = dp;
xact->td_hflags |= TDFH_DATA_IN;
tmd->cd_flags |= CDF_PRIVATE_0;
}
}
xact->td_hflags |= TDFH_STSVALID;
goto doit;
}
/*
* Make sure we have a legal and open lun
*/
@@ -2029,6 +1968,17 @@ scsi_target_handler(qact_e action, void *arg)
}
}
spin_unlock_irqrestore(&scsi_target_lock, flags);
} else if (np->nt_ncode == NT_TARGET_RESET) {
int i;
struct bus_chan *bc = &bp->bchan[np->nt_channel];
for (i = 0; i < HASH_WIDTH; i++) {
ini_t *ini;
for (ini = bc->list[i]; ini; ini = ini->ini_next) {
add_sdata(ini, ua);
}
}
} else if (np->nt_ncode == NT_LUN_RESET) {
printk(KERN_INFO "%s: LUN RESET from 0x%llx for lun %u\n", __FUNCTION__, np->nt_iid, np->nt_lun);
} else {
spin_unlock_irqrestore(&scsi_target_lock, flags);
SDprintk("scsi_target: MGT code %x from %s%d\n", np->nt_ncode, bp->h.r_name, bp->h.r_inst);