aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/rio/rioctrl.c
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-05-15 12:44:26 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-05-15 14:20:57 -0400
commit655fdeab809a5612b0eab6aee873b00d26404ca7 (patch)
tree9aa5608c1ee21cf03abae11b8ae2f13c18d9c12c /drivers/char/rio/rioctrl.c
parent2a7362f52a17e8dbeab57c00c3c45fcfeb0dff54 (diff)
[PATCH] Final rio polish
Signed-off-by: Alan Cox <alan@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/char/rio/rioctrl.c')
-rw-r--r--drivers/char/rio/rioctrl.c43
1 files changed, 28 insertions, 15 deletions
diff --git a/drivers/char/rio/rioctrl.c b/drivers/char/rio/rioctrl.c
index d31aba62bb7f..75b2557c37ec 100644
--- a/drivers/char/rio/rioctrl.c
+++ b/drivers/char/rio/rioctrl.c
@@ -1394,14 +1394,17 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1394 return RIO_FAIL; 1394 return RIO_FAIL;
1395 } 1395 }
1396 1396
1397 if (((int) ((char) PortP->InUse) == -1) || !(CmdBlkP = RIOGetCmdBlk())) { 1397 if ((PortP->InUse == (typeof(PortP->InUse))-1) ||
1398 rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block for command %d on port %d\n", Cmd, PortP->PortNum); 1398 !(CmdBlkP = RIOGetCmdBlk())) {
1399 rio_dprintk(RIO_DEBUG_CTRL, "Cannot allocate command block "
1400 "for command %d on port %d\n", Cmd, PortP->PortNum);
1399 return RIO_FAIL; 1401 return RIO_FAIL;
1400 } 1402 }
1401 1403
1402 rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n", CmdBlkP, PortP->InUse); 1404 rio_dprintk(RIO_DEBUG_CTRL, "Command blk %p - InUse now %d\n",
1405 CmdBlkP, PortP->InUse);
1403 1406
1404 PktCmdP = (struct PktCmd_M *) &CmdBlkP->Packet.data[0]; 1407 PktCmdP = (struct PktCmd_M *)&CmdBlkP->Packet.data[0];
1405 1408
1406 CmdBlkP->Packet.src_unit = 0; 1409 CmdBlkP->Packet.src_unit = 0;
1407 if (PortP->SecondBlock) 1410 if (PortP->SecondBlock)
@@ -1425,38 +1428,46 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1425 1428
1426 switch (Cmd) { 1429 switch (Cmd) {
1427 case MEMDUMP: 1430 case MEMDUMP:
1428 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p (addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr); 1431 rio_dprintk(RIO_DEBUG_CTRL, "Queue MEMDUMP command blk %p "
1432 "(addr 0x%x)\n", CmdBlkP, (int) SubCmd.Addr);
1429 PktCmdP->SubCommand = MEMDUMP; 1433 PktCmdP->SubCommand = MEMDUMP;
1430 PktCmdP->SubAddr = SubCmd.Addr; 1434 PktCmdP->SubAddr = SubCmd.Addr;
1431 break; 1435 break;
1432 case FCLOSE: 1436 case FCLOSE:
1433 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n", CmdBlkP); 1437 rio_dprintk(RIO_DEBUG_CTRL, "Queue FCLOSE command blk %p\n",
1438 CmdBlkP);
1434 break; 1439 break;
1435 case READ_REGISTER: 1440 case READ_REGISTER:
1436 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) command blk %p\n", (int) SubCmd.Addr, CmdBlkP); 1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue READ_REGISTER (0x%x) "
1442 "command blk %p\n", (int) SubCmd.Addr, CmdBlkP);
1437 PktCmdP->SubCommand = READ_REGISTER; 1443 PktCmdP->SubCommand = READ_REGISTER;
1438 PktCmdP->SubAddr = SubCmd.Addr; 1444 PktCmdP->SubAddr = SubCmd.Addr;
1439 break; 1445 break;
1440 case RESUME: 1446 case RESUME:
1441 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n", CmdBlkP); 1447 rio_dprintk(RIO_DEBUG_CTRL, "Queue RESUME command blk %p\n",
1448 CmdBlkP);
1442 break; 1449 break;
1443 case RFLUSH: 1450 case RFLUSH:
1444 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n", CmdBlkP); 1451 rio_dprintk(RIO_DEBUG_CTRL, "Queue RFLUSH command blk %p\n",
1452 CmdBlkP);
1445 CmdBlkP->PostFuncP = RIORFlushEnable; 1453 CmdBlkP->PostFuncP = RIORFlushEnable;
1446 break; 1454 break;
1447 case SUSPEND: 1455 case SUSPEND:
1448 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n", CmdBlkP); 1456 rio_dprintk(RIO_DEBUG_CTRL, "Queue SUSPEND command blk %p\n",
1457 CmdBlkP);
1449 break; 1458 break;
1450 1459
1451 case MGET: 1460 case MGET:
1452 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n", CmdBlkP); 1461 rio_dprintk(RIO_DEBUG_CTRL, "Queue MGET command blk %p\n",
1462 CmdBlkP);
1453 break; 1463 break;
1454 1464
1455 case MSET: 1465 case MSET:
1456 case MBIC: 1466 case MBIC:
1457 case MBIS: 1467 case MBIS:
1458 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines; 1468 CmdBlkP->Packet.data[4] = (char) PortP->ModemLines;
1459 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command blk %p\n", CmdBlkP); 1469 rio_dprintk(RIO_DEBUG_CTRL, "Queue MSET/MBIC/MBIS command "
1470 "blk %p\n", CmdBlkP);
1460 break; 1471 break;
1461 1472
1462 case WFLUSH: 1473 case WFLUSH:
@@ -1465,12 +1476,14 @@ int RIOPreemptiveCmd(struct rio_info *p, struct Port *PortP, u8 Cmd)
1465 ** allowed then we should not bother sending any more to the 1476 ** allowed then we should not bother sending any more to the
1466 ** RTA. 1477 ** RTA.
1467 */ 1478 */
1468 if ((int) ((char) PortP->WflushFlag) == (int) -1) { 1479 if (PortP->WflushFlag == (typeof(PortP->WflushFlag))-1) {
1469 rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, WflushFlag about to wrap!"); 1480 rio_dprintk(RIO_DEBUG_CTRL, "Trashed WFLUSH, "
1481 "WflushFlag about to wrap!");
1470 RIOFreeCmdBlk(CmdBlkP); 1482 RIOFreeCmdBlk(CmdBlkP);
1471 return (RIO_FAIL); 1483 return (RIO_FAIL);
1472 } else { 1484 } else {
1473 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command blk %p\n", CmdBlkP); 1485 rio_dprintk(RIO_DEBUG_CTRL, "Queue WFLUSH command "
1486 "blk %p\n", CmdBlkP);
1474 CmdBlkP->PostFuncP = RIOWFlushMark; 1487 CmdBlkP->PostFuncP = RIOWFlushMark;
1475 } 1488 }
1476 break; 1489 break;