Commit 00492e8c authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://kernel.bkbits.net/davem/sparc-2.5

into home.transmeta.com:/home/torvalds/v2.5/linux
parents ba5ce248 45c20ae5
......@@ -1808,6 +1808,15 @@ C_LABEL(fpload):
retl
nop
.globl C_LABEL(ndelay)
C_LABEL(ndelay):
save %sp, -REGWIN_SZ, %sp
mov %i0, %o0
call .umul
mov 5, %o1
ba delay_continue
nop
.globl C_LABEL(udelay)
C_LABEL(udelay):
save %sp, -REGWIN_SZ, %sp
......@@ -1815,6 +1824,7 @@ C_LABEL(udelay):
sethi %hi(0x10c6), %o1
call .umul
or %o1, %lo(0x10c6), %o1
delay_continue:
#ifndef CONFIG_SMP
sethi %hi(C_LABEL(loops_per_jiffy)), %o3
call .umul
......
......@@ -151,6 +151,7 @@ EXPORT_SYMBOL(__cpu_logical_map);
#endif
EXPORT_SYMBOL(udelay);
EXPORT_SYMBOL(ndelay);
EXPORT_SYMBOL(mostek_lock);
EXPORT_SYMBOL(mstk48t02_regs);
#if CONFIG_SUN_AUXIO
......
......@@ -74,7 +74,7 @@
#endif
#define FCP_CMND(SCpnt) ((fcp_cmnd *)&(SCpnt->SCp))
#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->host->hostdata[0]))
#define FC_SCMND(SCpnt) ((fc_channel *)(SCpnt->device->host->hostdata[0]))
#define SC_FCMND(fcmnd) ((Scsi_Cmnd *)((long)fcmnd - (long)&(((Scsi_Cmnd *)0)->SCp)))
static int fcp_scsi_queue_it(fc_channel *, Scsi_Cmnd *, fcp_cmnd *, int);
......@@ -449,7 +449,7 @@ static inline void fcp_scsi_receive(fc_channel *fc, int token, int status, fc_hd
}
if (status_byte(rsp_status) == QUEUE_FULL) {
printk ("%s: (%d,%d) Received rsp_status 0x%x\n", fc->name, SCpnt->channel, SCpnt->target, rsp_status);
printk ("%s: (%d,%d) Received rsp_status 0x%x\n", fc->name, SCpnt->device->channel, SCpnt->device->id, rsp_status);
}
SCpnt->result = (host_status << 16) | (rsp_status & 0xff);
......@@ -771,10 +771,10 @@ static void fcp_scsi_done (Scsi_Cmnd *SCpnt)
{
unsigned long flags;
spin_lock_irqsave(SCpnt->host->host_lock, flags);
spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
if (FCP_CMND(SCpnt)->done)
FCP_CMND(SCpnt)->done(SCpnt);
spin_unlock_irqrestore(SCpnt->host->host_lock, flags);
spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
}
static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, int prepare)
......@@ -799,8 +799,8 @@ static int fcp_scsi_queue_it(fc_channel *fc, Scsi_Cmnd *SCpnt, fcp_cmnd *fcmd, i
fc->cmd_slots[fcmd->token] = fcmd;
if (SCpnt->device->tagged_supported) {
if (jiffies - fc->ages[SCpnt->channel * fc->targets + SCpnt->target] > (5 * 60 * HZ)) {
fc->ages[SCpnt->channel * fc->targets + SCpnt->target] = jiffies;
if (jiffies - fc->ages[SCpnt->device->channel * fc->targets + SCpnt->device->id] > (5 * 60 * HZ)) {
fc->ages[SCpnt->device->channel * fc->targets + SCpnt->device->id] = jiffies;
fcp_cntl = FCP_CNTL_QTYPE_ORDERED;
} else
fcp_cntl = FCP_CNTL_QTYPE_SIMPLE;
......@@ -916,9 +916,9 @@ int fcp_scsi_abort(Scsi_Cmnd *SCpnt)
unsigned long flags;
SCpnt->result = DID_ABORT;
spin_lock_irqsave(SCpnt->host->host_lock, flags);
spin_lock_irqsave(SCpnt->device->host->host_lock, flags);
fcmd->done(SCpnt);
spin_unlock_irqrestore(SCpnt->host->host_lock, flags);
spin_unlock_irqrestore(SCpnt->device->host->host_lock, flags);
printk("FC: soft abort\n");
return SUCCESS;
} else {
......@@ -932,7 +932,7 @@ void fcp_scsi_reset_done(Scsi_Cmnd *SCpnt)
fc_channel *fc = FC_SCMND(SCpnt);
fc->rst_pkt->eh_state = SCSI_STATE_FINISHED;
up(fc->rst_pkt->host->eh_action);
up(fc->rst_pkt->device->host->eh_action);
}
#define FCP_RESET_TIMEOUT (2*HZ)
......@@ -955,9 +955,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
cmd = fc->scsi_cmd_pool + 0;
FCD(("Preparing rst packet\n"))
fc->encode_addr (SCpnt, cmd->fcp_addr, fc, fcmd);
fc->rst_pkt->channel = SCpnt->channel;
fc->rst_pkt->target = SCpnt->target;
fc->rst_pkt->lun = 0;
fc->rst_pkt->device = SCpnt->device;
fc->rst_pkt->cmd_len = 0;
fc->cmd_slots[0] = fcmd;
......@@ -989,7 +987,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
* Set up the semaphore so we wait for the command to complete.
*/
fc->rst_pkt->host->eh_action = &sem;
fc->rst_pkt->device->host->eh_action = &sem;
fc->rst_pkt->request->rq_status = RQ_SCSI_BUSY;
fc->rst_pkt->done = fcp_scsi_reset_done;
......@@ -997,7 +995,7 @@ int fcp_scsi_dev_reset(Scsi_Cmnd *SCpnt)
down(&sem);
fc->rst_pkt->host->eh_action = NULL;
fc->rst_pkt->device->host->eh_action = NULL;
del_timer(&fc->rst_pkt->eh_timeout);
/*
......
......@@ -453,7 +453,7 @@ static inline Scsi_Cmnd *remove_SC(Scsi_Cmnd **SC, int target, int lun)
Scsi_Cmnd *ptr, *prev;
for (ptr = *SC, prev = NULL;
ptr && ((ptr->target != target) || (ptr->lun != lun));
ptr && ((ptr->device->id != target) || (ptr->device->lun != lun));
prev = ptr, ptr = (Scsi_Cmnd *) ptr->host_scribble)
;
if (ptr) {
......@@ -1447,7 +1447,7 @@ static void esp_release_dmabufs(struct esp *esp, Scsi_Cmnd *sp)
static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
{
struct esp_pointers *ep = &esp->data_pointers[sp->target];
struct esp_pointers *ep = &esp->data_pointers[sp->device->id];
sp->SCp.ptr = ep->saved_ptr;
sp->SCp.buffer = ep->saved_buffer;
......@@ -1457,7 +1457,7 @@ static void esp_restore_pointers(struct esp *esp, Scsi_Cmnd *sp)
static void esp_save_pointers(struct esp *esp, Scsi_Cmnd *sp)
{
struct esp_pointers *ep = &esp->data_pointers[sp->target];
struct esp_pointers *ep = &esp->data_pointers[sp->device->id];
ep->saved_ptr = sp->SCp.ptr;
ep->saved_buffer = sp->SCp.buffer;
......@@ -1559,8 +1559,8 @@ static void esp_exec_cmd(struct esp *esp)
SDptr = SCptr->device;
esp_dev = SDptr->hostdata;
lun = SCptr->lun;
target = SCptr->target;
lun = SCptr->device->lun;
target = SCptr->device->id;
esp->snip = 0;
esp->msgout_len = 0;
......@@ -1621,7 +1621,7 @@ static void esp_exec_cmd(struct esp *esp)
* disconnect.
*/
ESPMISC(("esp: Selecting device for first time. target=%d "
"lun=%d\n", target, SCptr->lun));
"lun=%d\n", target, SCptr->device->lun));
if (!SDptr->borken && !esp_dev->disconnect)
esp_dev->disconnect = 1;
......@@ -1731,7 +1731,7 @@ static void esp_exec_cmd(struct esp *esp)
SDptr->removable == 0) ||
cdrom_hwbug_wkaround || SDptr->borken) {
ESPMISC((KERN_INFO "esp%d: Disabling DISCONNECT for target %d "
"lun %d\n", esp->esp_id, SCptr->target, SCptr->lun));
"lun %d\n", esp->esp_id, SCptr->device->id, SCptr->device->lun));
esp_dev->disconnect = 0;
*cmdp++ = IDENTIFY(0, lun);
} else {
......@@ -1822,10 +1822,10 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
SCpnt->SCp.phase = not_issued;
/* We use the scratch area. */
ESPQUEUE(("esp_queue: target=%d lun=%d ", SCpnt->target, SCpnt->lun));
ESPDISC(("N<%02x,%02x>", SCpnt->target, SCpnt->lun));
ESPQUEUE(("esp_queue: target=%d lun=%d ", SCpnt->device->id, SCpnt->device->lun));
ESPDISC(("N<%02x,%02x>", SCpnt->device->id, SCpnt->device->lun));
esp = (struct esp *) SCpnt->host->hostdata;
esp = (struct esp *) SCpnt->device->host->hostdata;
esp_get_dmabufs(esp, SCpnt);
esp_save_pointers(esp, SCpnt); /* FIXME for tag queueing */
......@@ -1852,7 +1852,7 @@ static int esp_queue(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
/* Only queuing supported in this ESP driver. */
static int esp_command(Scsi_Cmnd *SCpnt)
{
struct esp *esp = (struct esp *) SCpnt->host->hostdata;
struct esp *esp = (struct esp *) SCpnt->device->host->hostdata;
ESPLOG(("esp%d: esp_command() called...\n", esp->esp_id));
return -1;
......@@ -1863,7 +1863,7 @@ static void esp_dump_cmd(Scsi_Cmnd *SCptr)
{
ESPLOG(("[tgt<%02x> lun<%02x> "
"pphase<%s> cphase<%s>]",
SCptr->target, SCptr->lun,
SCptr->device->id, SCptr->device->lun,
phase_string(SCptr->SCp.sent_command),
phase_string(SCptr->SCp.phase)));
}
......@@ -1917,7 +1917,7 @@ static void esp_dump_state(struct esp *esp)
/* Abort a command. The host_lock is acquired by caller. */
static int esp_abort(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
int don;
ESPLOG(("esp%d: Aborting command\n", esp->esp_id));
......@@ -2049,7 +2049,7 @@ static int esp_do_resetbus(struct esp *esp)
*/
static int esp_reset(Scsi_Cmnd *SCptr)
{
struct esp *esp = (struct esp *) SCptr->host->hostdata;
struct esp *esp = (struct esp *) SCptr->device->host->hostdata;
(void) esp_do_resetbus(esp);
......@@ -2474,13 +2474,13 @@ static inline void esp_connect(struct esp *esp, Scsi_Cmnd *sp)
if (esp->prev_soff != esp_dev->sync_max_offset ||
esp->prev_stp != esp_dev->sync_min_period ||
(esp->erev > esp100a &&
esp->prev_cfg3 != esp->config3[sp->target])) {
esp->prev_cfg3 != esp->config3[sp->device->id])) {
esp->prev_soff = esp_dev->sync_max_offset;
esp->prev_stp = esp_dev->sync_min_period;
sbus_writeb(esp->prev_soff, esp->eregs + ESP_SOFF);
sbus_writeb(esp->prev_stp, esp->eregs + ESP_STP);
if (esp->erev > esp100a) {
esp->prev_cfg3 = esp->config3[sp->target];
esp->prev_cfg3 = esp->config3[sp->device->id];
sbus_writeb(esp->prev_cfg3, esp->eregs + ESP_CFG3);
}
}
......@@ -2736,7 +2736,7 @@ static int esp_do_data_finale(struct esp *esp)
esp->esp_id,
SCptr->use_sg, SCptr->SCp.ptr, SCptr->SCp.this_residual));
ESPLOG(("esp%d: Forcing async for target %d\n", esp->esp_id,
SCptr->target));
SCptr->device->id));
SCptr->device->borken = 1;
esp_dev->sync = 0;
bytes_sent = 0;
......@@ -2842,7 +2842,7 @@ static int esp_do_freebus(struct esp *esp)
if (SCptr->SCp.Status != GOOD &&
SCptr->SCp.Status != CONDITION_GOOD &&
((1<<SCptr->target) & esp->targets_present) &&
((1<<SCptr->device->id) & esp->targets_present) &&
esp_dev->sync &&
esp_dev->sync_max_offset) {
/* SCSI standard says that the synchronous capabilities
......@@ -2853,7 +2853,7 @@ static int esp_do_freebus(struct esp *esp)
* state.
*/
ESPMISC(("esp: Status <%d> for target %d lun %d\n",
SCptr->SCp.Status, SCptr->target, SCptr->lun));
SCptr->SCp.Status, SCptr->device->id, SCptr->device->lun));
/* But don't do this when spinning up a disk at
* boot time while we poll for completion as it
......@@ -2864,14 +2864,14 @@ static int esp_do_freebus(struct esp *esp)
if (esp_should_clear_sync(SCptr) != 0)
esp_dev->sync = 0;
}
ESPDISC(("F<%02x,%02x>", SCptr->target, SCptr->lun));
ESPDISC(("F<%02x,%02x>", SCptr->device->id, SCptr->device->lun));
esp_done(esp, ((SCptr->SCp.Status & 0xff) |
((SCptr->SCp.Message & 0xff)<<8) |
(DID_OK << 16)));
} else if (esp->prevmsgin == DISCONNECT) {
/* Normal disconnect. */
esp_cmd(esp, ESP_CMD_ESEL);
ESPDISC(("D<%02x,%02x>", SCptr->target, SCptr->lun));
ESPDISC(("D<%02x,%02x>", SCptr->device->id, SCptr->device->lun));
append_SC(&esp->disconnected_SC, SCptr);
esp->current_SC = NULL;
if (esp->issue_SC)
......@@ -2901,21 +2901,21 @@ static int esp_bad_reconnect(struct esp *esp)
sp = esp->issue_SC;
ESPLOG(("esp%d: issue_SC[", esp->esp_id));
while (sp) {
ESPLOG(("<%02x,%02x>", sp->target, sp->lun));
ESPLOG(("<%02x,%02x>", sp->device->id, sp->device->lun));
sp = (Scsi_Cmnd *) sp->host_scribble;
}
ESPLOG(("]\n"));
sp = esp->current_SC;
ESPLOG(("esp%d: current_SC[", esp->esp_id));
if (sp)
ESPLOG(("<%02x,%02x>", sp->target, sp->lun));
ESPLOG(("<%02x,%02x>", sp->device->id, sp->device->lun));
else
ESPLOG(("<NULL>"));
ESPLOG(("]\n"));
sp = esp->disconnected_SC;
ESPLOG(("esp%d: disconnected_SC[", esp->esp_id));
while (sp) {
ESPLOG(("<%02x,%02x>", sp->target, sp->lun));
ESPLOG(("<%02x,%02x>", sp->device->id, sp->device->lun));
sp = (Scsi_Cmnd *) sp->host_scribble;
}
ESPLOG(("]\n"));
......@@ -2959,7 +2959,7 @@ static int esp_do_reconnect(struct esp *esp)
esp_cmd(esp, ESP_CMD_MOK);
if (esp->erev == fashme)
sbus_writeb(((SCptr->target & 0xf) |
sbus_writeb(((SCptr->device->id & 0xf) |
(ESP_BUSID_RESELID | ESP_BUSID_CTR32BIT)),
esp->eregs + ESP_BUSID);
......@@ -3246,7 +3246,7 @@ static int esp_select_complete(struct esp *esp)
*/
if (esp->ireg == (ESP_INTR_FDONE | ESP_INTR_BSERV)) {
/* target speaks... */
esp->targets_present |= (1<<SCptr->target);
esp->targets_present |= (1<<SCptr->device->id);
/* What if the target ignores the sdtr? */
if (esp->snip)
......@@ -3275,7 +3275,7 @@ static int esp_select_complete(struct esp *esp)
* XXX for synchronous transfers.
*/
ESPLOG(("esp%d: STEP_ASEL for tgt %d\n",
esp->esp_id, SCptr->target));
esp->esp_id, SCptr->device->id));
case ESP_STEP_SID:
/* Arbitration won, target selected, went
......@@ -3395,7 +3395,7 @@ static int esp_select_complete(struct esp *esp)
if (esp->disconnected_SC)
esp_cmd(esp, ESP_CMD_ESEL);
if (((1<<SCptr->target) & esp->targets_present) &&
if (((1<<SCptr->device->id) & esp->targets_present) &&
esp->seqreg != 0 &&
(esp->cur_msgout[0] == EXTENDED_MESSAGE) &&
(SCptr->SCp.phase == in_slct_msg ||
......@@ -3403,7 +3403,7 @@ static int esp_select_complete(struct esp *esp)
/* shit */
esp->snip = 0;
ESPLOG(("esp%d: Failed synchronous negotiation for target %d "
"lun %d\n", esp->esp_id, SCptr->target, SCptr->lun));
"lun %d\n", esp->esp_id, SCptr->device->id, SCptr->device->lun));
esp_dev->sync_max_offset = 0;
esp_dev->sync_min_period = 0;
esp_dev->sync = 1; /* so we don't negotiate again */
......@@ -3429,9 +3429,9 @@ static int esp_select_complete(struct esp *esp)
* or whenever when we are scanning the bus for targets.
* But first make sure that is really what is happening.
*/
if (((1<<SCptr->target) & esp->targets_present)) {
if (((1<<SCptr->device->id) & esp->targets_present)) {
ESPLOG(("esp%d: Warning, live target %d not responding to "
"selection.\n", esp->esp_id, SCptr->target));
"selection.\n", esp->esp_id, SCptr->device->id));
/* This _CAN_ happen. The SCSI standard states that
* the target is to _not_ respond to selection if
......@@ -3444,7 +3444,7 @@ static int esp_select_complete(struct esp *esp)
/* Else, there really isn't anyone there. */
ESPMISC(("esp: selection failure, maybe nobody there?\n"));
ESPMISC(("esp: target %d lun %d\n",
SCptr->target, SCptr->lun));
SCptr->device->id, SCptr->device->lun));
esp_done(esp, (DID_BAD_TARGET << 16));
}
return do_intr_end;
......@@ -3517,7 +3517,7 @@ static int check_singlebyte_msg(struct esp *esp)
case NOP:
ESPLOG(("esp%d: target %d sends a nop\n", esp->esp_id,
esp->current_SC->target));
esp->current_SC->device->id));
return 0;
case RESTORE_POINTERS:
......@@ -3600,7 +3600,7 @@ static void sync_report(struct esp *esp)
int integer = hz / 1000000;
int fraction = (hz - (integer * 1000000)) / 10000;
if ((esp->erev == fashme) &&
(esp->config3[esp->current_SC->target] & ESP_CONFIG3_EWIDE)) {
(esp->config3[esp->current_SC->device->id] & ESP_CONFIG3_EWIDE)) {
type = "FAST-WIDE";
integer <<= 1;
fraction <<= 1;
......@@ -3615,7 +3615,7 @@ static void sync_report(struct esp *esp)
* sibling call optimization. -DaveM
*/
ESPLOG((KERN_INFO "esp%d: target %d ",
esp->esp_id, esp->current_SC->target));
esp->esp_id, esp->current_SC->device->id));
ESPLOG(("[period %dns offset %d %d.%02dMHz ",
(int) msg3 * 4, (int) msg4,
integer, fraction));
......@@ -3623,7 +3623,7 @@ static void sync_report(struct esp *esp)
(((msg3 * 4) < 200) ? "-II" : "")));
} else {
ESPLOG((KERN_INFO "esp%d: target %d asynchronous\n",
esp->esp_id, esp->current_SC->target));
esp->esp_id, esp->current_SC->device->id));
}
}
......@@ -3707,11 +3707,11 @@ static int check_multibyte_msg(struct esp *esp)
*/
if (esp->erev == fashme)
esp_dev->sync_max_offset &= ~esp->radelay;
esp->config3[SCptr->target] |= bit;
esp->config3[SCptr->device->id] |= bit;
} else {
esp->config3[SCptr->target] &= ~bit;
esp->config3[SCptr->device->id] &= ~bit;
}
esp->prev_cfg3 = esp->config3[SCptr->target];
esp->prev_cfg3 = esp->config3[SCptr->device->id];
sbus_writeb(esp->prev_cfg3, esp->eregs + ESP_CFG3);
}
esp->prev_soff = esp_dev->sync_max_offset;
......@@ -3721,7 +3721,7 @@ static int check_multibyte_msg(struct esp *esp)
ESPSDTR(("soff=%2x stp=%2x cfg3=%2x\n",
esp_dev->sync_max_offset,
esp_dev->sync_min_period,
esp->config3[SCptr->target]));
esp->config3[SCptr->device->id]));
esp->snip = 0;
} else if (esp_dev->sync_max_offset) {
......@@ -3740,8 +3740,8 @@ static int check_multibyte_msg(struct esp *esp)
bit = ESP_CONFIG3_FAST;
else
bit = ESP_CONFIG3_FSCSI;
esp->config3[SCptr->target] &= ~bit;
esp->prev_cfg3 = esp->config3[SCptr->target];
esp->config3[SCptr->device->id] &= ~bit;
esp->prev_cfg3 = esp->config3[SCptr->device->id];
sbus_writeb(esp->prev_cfg3, esp->eregs + ESP_CFG3);
}
}
......@@ -3778,7 +3778,7 @@ static int check_multibyte_msg(struct esp *esp)
/* Things look good; let's see what we got. */
if (size == 16) {
/* Set config 3 register for this target. */
esp->config3[SCptr->target] |= ESP_CONFIG3_EWIDE;
esp->config3[SCptr->device->id] |= ESP_CONFIG3_EWIDE;
} else {
/* Just make sure it was one byte sized. */
if (size != 8) {
......@@ -3788,9 +3788,9 @@ static int check_multibyte_msg(struct esp *esp)
goto finish;
}
/* Pure paranoia. */
esp->config3[SCptr->target] &= ~(ESP_CONFIG3_EWIDE);
esp->config3[SCptr->device->id] &= ~(ESP_CONFIG3_EWIDE);
}
esp->prev_cfg3 = esp->config3[SCptr->target];
esp->prev_cfg3 = esp->config3[SCptr->device->id];
sbus_writeb(esp->prev_cfg3, esp->eregs + ESP_CFG3);
/* Regardless, next try for sync transfers. */
......@@ -4258,7 +4258,7 @@ static void esp_handle(struct esp *esp)
* a nexus is alive on the bus.
*/
ESPLOG(("esp%d: Forcing async and disabling disconnect for "
"target %d\n", esp->esp_id, SCptr->target));
"target %d\n", esp->esp_id, SCptr->device->id));
SCptr->device->borken = 1; /* foo on you */
}
......
......@@ -292,11 +292,12 @@ static int fcal_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmn
if (SCpnt->cmnd[1] & 0xe0) return -EINVAL;
/* FC-PLDA tells us... */
memset(addr, 0, 8);
f = (struct fcal *)SCpnt->host->hostdata;
if (!f->map[SCpnt->target]) return -EINVAL;
f = (struct fcal *)SCpnt->device->host->hostdata;
if (!f->map[SCpnt->device->id])
return -EINVAL;
/* Now, determine DID: It will be Native Identifier, so we zero upper
2 bytes of the 3 byte DID, lowest byte will be AL-PA */
fcmd->did = target2alpa[SCpnt->target];
fcmd->did = target2alpa[SCpnt->device->id];
FCALD(("trying DID %06x\n", fcmd->did))
return 0;
}
......
......@@ -156,12 +156,12 @@ int __init pluto_detect(Scsi_Host_Template *tpnt)
pluto->fc = fc;
SCpnt->host = host;
SCpnt->cmnd[0] = INQUIRY;
SCpnt->cmnd[4] = 255;
/* FC layer requires this, so that SCpnt->device->tagged_supported is initially 0 */
SCpnt->device = &dev;
dev.host = host;
SCpnt->cmd_len = COMMAND_SIZE(INQUIRY);
......@@ -325,16 +325,18 @@ const char *pluto_info(struct Scsi_Host *host)
*/
static int pluto_encode_addr(Scsi_Cmnd *SCpnt, u16 *addr, fc_channel *fc, fcp_cmnd *fcmd)
{
PLND(("encode addr %d %d %d\n", SCpnt->channel, SCpnt->target, SCpnt->cmnd[1] & 0xe0))
PLND(("encode addr %d %d %d\n", SCpnt->device->channel, SCpnt->device->id, SCpnt->cmnd[1] & 0xe0))
/* We don't support LUNs - neither does SSA :) */
if (SCpnt->cmnd[1] & 0xe0) return -EINVAL;
if (!SCpnt->channel) {
if (SCpnt->target) return -EINVAL;
if (SCpnt->cmnd[1] & 0xe0)
return -EINVAL;
if (!SCpnt->device->channel) {
if (SCpnt->device->id)
return -EINVAL;
memset (addr, 0, 4 * sizeof(u16));
} else {
addr[0] = 1;
addr[1] = SCpnt->channel - 1;
addr[2] = SCpnt->target;
addr[1] = SCpnt->device->channel - 1;
addr[2] = SCpnt->device->id;
addr[3] = 0;
}
/* We're Point-to-Point, so target it to the default DID */
......
......@@ -1004,16 +1004,16 @@ static inline void cmd_frob(struct Command_Entry *cmd, Scsi_Cmnd *Cmnd,
memset(cmd, 0, sizeof(struct Command_Entry));
cmd->hdr.entry_cnt = 1;
cmd->hdr.entry_type = ENTRY_COMMAND;
cmd->target_id = Cmnd->target;
cmd->target_lun = Cmnd->lun;
cmd->target_id = Cmnd->device->id;
cmd->target_lun = Cmnd->device->lun;
cmd->cdb_length = Cmnd->cmd_len;
cmd->control_flags = 0;
if (Cmnd->device->tagged_supported) {
if (qpti->cmd_count[Cmnd->target] == 0)
qpti->tag_ages[Cmnd->target] = jiffies;
if ((jiffies - qpti->tag_ages[Cmnd->target]) > (5*HZ)) {
if (qpti->cmd_count[Cmnd->device->id] == 0)
qpti->tag_ages[Cmnd->device->id] = jiffies;
if ((jiffies - qpti->tag_ages[Cmnd->device->id]) > (5*HZ)) {
cmd->control_flags = CFLAG_ORDERED_TAG;
qpti->tag_ages[Cmnd->target] = jiffies;
qpti->tag_ages[Cmnd->device->id] = jiffies;
} else
cmd->control_flags = CFLAG_SIMPLE_TAG;
}
......@@ -1097,7 +1097,7 @@ static inline int load_cmd(Scsi_Cmnd *Cmnd, struct Command_Entry *cmd,
cmd->handle = in_ptr;
qpti->cmd_slots[in_ptr] = Cmnd;
qpti->cmd_count[Cmnd->target]++;
qpti->cmd_count[Cmnd->device->id]++;
sbus_writew(in_ptr, qpti->qregs + MBOX4);
qpti->req_in_ptr = in_ptr;
......@@ -1118,8 +1118,8 @@ static inline void update_can_queue(struct Scsi_Host *host, u_int in_ptr, u_int
*/
static void ourdone(Scsi_Cmnd *Cmnd)
{
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->host->hostdata;
int tgt = Cmnd->target;
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
int tgt = Cmnd->device->id;
void (*done) (Scsi_Cmnd *);
/* This grot added by DaveM, blame him for ugliness.
......@@ -1170,7 +1170,7 @@ static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *));
static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
void (*done)(Scsi_Cmnd *))
{
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->host->hostdata;
struct qlogicpti *qpti = (struct qlogicpti *) Cmnd->device->host->hostdata;
unsigned long flags;
/*
......@@ -1229,7 +1229,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
* and can rock on..
*/
if (qpti == NULL)
Cmnd->host->hostt->queuecommand = qlogicpti_queuecommand;
Cmnd->device->host->hostt->queuecommand = qlogicpti_queuecommand;
spin_unlock_irqrestore(&qpti->lock, flags);
......@@ -1246,7 +1246,7 @@ static int qlogicpti_queuecommand_slow(Scsi_Cmnd *Cmnd,
*/
static int qlogicpti_queuecommand(Scsi_Cmnd *Cmnd, void (*done)(Scsi_Cmnd *))
{
struct Scsi_Host *host = Cmnd->host;
struct Scsi_Host *host = Cmnd->device->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
struct Command_Entry *cmd;
unsigned long flags;
......@@ -1431,7 +1431,7 @@ static Scsi_Cmnd *qlogicpti_intr_handler(struct qlogicpti *qpti)
Cmnd->request_bufflen,
scsi_to_sbus_dma_dir(Cmnd->sc_data_direction));
}
qpti->cmd_count[Cmnd->target]--;
qpti->cmd_count[Cmnd->device->id]--;
sbus_writew(out_ptr, qpti->qregs + MBOX5);
Cmnd->host_scribble = (unsigned char *) done_queue;
done_queue = Cmnd;
......@@ -1468,7 +1468,7 @@ static void qpti_intr(int irq, void *dev_id, struct pt_regs *regs)
static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
{
u_short param[6];
struct Scsi_Host *host = Cmnd->host;
struct Scsi_Host *host = Cmnd->device->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
int return_status = SUCCESS;
unsigned long flags;
......@@ -1476,7 +1476,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
int i;
printk(KERN_WARNING "qlogicpti : Aborting cmd for tgt[%d] lun[%d]\n",
(int)Cmnd->target, (int)Cmnd->lun);
(int)Cmnd->device->id, (int)Cmnd->device->lun);
spin_lock_irqsave(&qpti->lock, flags);
......@@ -1491,7 +1491,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
cmd_cookie = i;
param[0] = MBOX_ABORT;
param[1] = (((u_short) Cmnd->target) << 8) | Cmnd->lun;
param[1] = (((u_short) Cmnd->device->id) << 8) | Cmnd->device->lun;
param[2] = cmd_cookie >> 16;
param[3] = cmd_cookie & 0xffff;
if (qlogicpti_mbox_command(qpti, param, 0) ||
......@@ -1510,7 +1510,7 @@ static int qlogicpti_abort(Scsi_Cmnd *Cmnd)
static int qlogicpti_reset(Scsi_Cmnd *Cmnd)
{
u_short param[6];
struct Scsi_Host *host = Cmnd->host;
struct Scsi_Host *host = Cmnd->device->host;
struct qlogicpti *qpti = (struct qlogicpti *) host->hostdata;
int return_status = SUCCESS;
unsigned long flags;
......
......@@ -21,5 +21,6 @@ extern __inline__ void __delay(unsigned long loops)
/* This is too messy with inline asm on the Sparc. */
extern void udelay(unsigned long usecs);
extern void ndelay(unsigned long usecs);
#endif /* defined(__SPARC_DELAY_H) */
......@@ -45,6 +45,19 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
__delay(usecs * HZ);
}
extern __inline__ void __ndelay(unsigned long usecs, unsigned long lps)
{
usecs *= 0x0000000000000005UL; /* 2**32 / 10000 */
__asm__ __volatile__(
" mulx %1, %2, %0\n"
" srlx %0, 32, %0\n"
: "=r" (usecs)
: "r" (usecs), "r" (lps));
__delay(usecs * HZ);
}
#ifdef CONFIG_SMP
#define __udelay_val cpu_data[smp_processor_id()].udelay_val
#else
......@@ -52,6 +65,7 @@ static __inline__ void __udelay(unsigned long usecs, unsigned long lps)
#endif
#define udelay(usecs) __udelay((usecs),__udelay_val)
#define ndelay(usecs) __ndelay((usecs),__udelay_val)
#endif /* !__ASSEMBLY__ */
......
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