Lines Matching refs:HostP
84 int RIORouteRup(struct rio_info *p, unsigned int Rup, struct Host *HostP, struct PKT __iomem * PacketP)
107 MapP = HostP->Mapping;
118 TopP = HostP->Topology;
120 MyName = HostP->Name;
124 TopP = HostP->Mapping[Rup].Topology;
126 MyName = HostP->Mapping[Rup].Name;
199 RIOConCon(p, HostP, ThisUnit, ThisLink, OldUnit, OldLink, DISCONNECT);
203 RIOConCon(p, HostP, ThisUnit, ThisLink, NewUnit, NewLink, CONNECT);
219 if (HostP->Topology[OldLink].Unit == ThisUnit && HostP->Topology[OldLink].Link == ThisLink) {
221 HostP->Topology[OldLink].Unit = ROUTE_DISCONNECT;
222 HostP->Topology[OldLink].Link = NO_LINK;
224 rio_dprintk(RIO_DEBUG_ROUTE, "HOST(%c) WAS NOT CONNECTED TO %s (%c)!\n", OldLink + 'A', HostP->Mapping[ThisUnit - 1].Name, ThisLink + 'A');
227 if (HostP->Mapping[OldUnit - 1].Topology[OldLink].Unit == ThisUnit && HostP->Mapping[OldUnit - 1].Topology[OldLink].Link == ThisLink) {
228 rio_dprintk(RIO_DEBUG_ROUTE, "SETTING RTA %s (%c) TO DISCONNECTED!\n", HostP->Mapping[OldUnit - 1].Name, OldLink + 'A');
229 HostP->Mapping[OldUnit - 1].Topology[OldLink].Unit = ROUTE_DISCONNECT;
230 HostP->Mapping[OldUnit - 1].Topology[OldLink].Link = NO_LINK;
232 rio_dprintk(RIO_DEBUG_ROUTE, "RTA %s (%c) WAS NOT CONNECTED TO %s (%c)\n", HostP->Mapping[OldUnit - 1].Name, OldLink + 'A', HostP->Mapping[ThisUnit - 1].Name, ThisLink + 'A');
237 HostP->Topology[NewLink].Unit = ThisUnit;
238 HostP->Topology[NewLink].Link = ThisLink;
240 rio_dprintk(RIO_DEBUG_ROUTE, "MARKING RTA %s (%c) CONNECTED TO %s (%c)\n", HostP->Mapping[NewUnit - 1].Name, NewLink + 'A', MyName, ThisLink + 'A');
241 HostP->Mapping[NewUnit - 1].Topology[NewLink].Unit = ThisUnit;
242 HostP->Mapping[NewUnit - 1].Topology[NewLink].Link = ThisLink;
246 RIOCheckIsolated(p, HostP, OldUnit);
256 rio_dprintk(RIO_DEBUG_ROUTE, "Unknown command %d received on rup %d host %p ROUTE_RUP\n", readb(&PktCmdP->Command), Rup, HostP);
302 if (!RIOBootOk(p, HostP, RtaUniq)) {
306 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
315 ThisUnit, HostP->Mapping[ThisUnit].Flags & SLOT_IN_USE ? "Slot-In-Use" : "Not In Use", HostP->Mapping[ThisUnit].Flags & SLOT_TENTATIVE ? "Slot-Tentative" : "Not Tentative", HostP->Mapping[ThisUnit].RtaUniqueNum);
320 if ((HostP->Mapping[ThisUnit].Flags & (SLOT_IN_USE | SLOT_TENTATIVE)) && (HostP->Mapping[ThisUnit].RtaUniqueNum == RtaUniq)) {
322 ThisUnit2 = HostP->Mapping[ThisUnit].ID2 - 1;
332 if ((HostP->Mapping[ThisUnit].Flags & SLOT_IN_USE) && !(HostP->Mapping[ThisUnit].Flags & RTA_BOOTED)) {
333 if (!(HostP->Mapping[ThisUnit].Flags & MSG_DONE)) {
335 printk(KERN_DEBUG "rio: RTA '%s' is being updated.\n", HostP->Mapping[ThisUnit].Name);
336 HostP->Mapping[ThisUnit].Flags |= MSG_DONE;
340 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
353 if (HostP->Mapping[ThisUnit].Flags & SLOT_IN_USE)
358 RIOFixPhbs(p, HostP, ThisUnit2);
360 rio_dprintk(RIO_DEBUG_ROUTE, "RTA '%s' has been allocated IDs %d+%d\n", HostP->Mapping[ThisUnit].Name, PktReplyP->IDNum, PktReplyP->IDNum2);
363 rio_dprintk(RIO_DEBUG_ROUTE, "RTA '%s' has been allocated ID %d\n", HostP->Mapping[ThisUnit].Name, PktReplyP->IDNum);
367 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
374 if ((HostP->Mapping[ThisUnit].Flags & RTA_NEWBOOT) && (HostP->Mapping[ThisUnit].SysPort != NO_PORT)) {
381 PortP = p->RIOPortp[port + HostP->Mapping[ThisUnit].SysPort];
391 PortP = p->RIOPortp[port + HostP->Mapping[ThisUnit2].SysPort];
405 HostP->UnixRups[ThisUnit].ModTypes = Mod;
407 HostP->UnixRups[ThisUnit2].ModTypes = Mod;
414 if (HostP->Mapping[ThisUnit].SysPort != NO_PORT) {
416 p->RIOPortp[port + HostP->Mapping[ThisUnit].SysPort]->Config &= ~RIO_NOMASK;
417 p->RIOPortp[port + HostP->Mapping[ThisUnit].SysPort]->Config |= p->RIOModuleTypes[Mod1].Flags[port];
418 p->RIOPortp[port + PORTS_PER_MODULE + HostP->Mapping[ThisUnit].SysPort]->Config &= ~RIO_NOMASK;
419 p->RIOPortp[port + PORTS_PER_MODULE + HostP->Mapping[ThisUnit].SysPort]->Config |= p->RIOModuleTypes[Mod2].Flags[port];
423 p->RIOPortp[port + HostP->Mapping[ThisUnit2].SysPort]->Config &= ~RIO_NOMASK;
424 p->RIOPortp[port + HostP->Mapping[ThisUnit2].SysPort]->Config |= p->RIOModuleTypes[Mod1].Flags[port];
425 p->RIOPortp[port + PORTS_PER_MODULE + HostP->Mapping[ThisUnit2].SysPort]->Config &= ~RIO_NOMASK;
426 p->RIOPortp[port + PORTS_PER_MODULE + HostP->Mapping[ThisUnit2].SysPort]->Config |= p->RIOModuleTypes[Mod2].Flags[port];
444 for (ThisUnit = 0; ThisUnit < HostP->NumExtraBooted; ThisUnit++)
445 if (HostP->ExtraUnits[ThisUnit] == RtaUniq)
447 if (ThisUnit == HostP->NumExtraBooted && ThisUnit != MAX_EXTRA_UNITS) {
476 if (RIOFindFreeID(p, HostP, &ThisUnit, &ThisUnit2) == 0) {
477 RIODefaultName(p, HostP, ThisUnit);
478 rio_fill_host_slot(ThisUnit, ThisUnit2, RtaUniq, HostP);
481 if (RIOFindFreeID(p, HostP, &ThisUnit, NULL) == 0) {
482 RIODefaultName(p, HostP, ThisUnit);
483 rio_fill_host_slot(ThisUnit, 0, RtaUniq, HostP);
489 RIOQueueCmdBlk(HostP, Rup, CmdBlkP);
494 void RIOFixPhbs(struct rio_info *p, struct Host *HostP, unsigned int unit)
499 int PortN = HostP->Mapping[unit].SysPort;
504 unsigned short dest_unit = HostP->Mapping[unit].ID2;
509 PortP = p->RIOPortp[HostP->Mapping[dest_unit - 1].SysPort];
553 Pkt = (struct PKT __iomem *) RIO_PTR(HostP->Caddr, readw(TxPktP));
574 if (((unit * 8) + 7) > readw(&HostP->LinkStrP[link].last_port)) {
576 writew((unit * 8) + 7, &HostP->LinkStrP[link].last_port);
587 static int RIOCheckIsolated(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
590 rio_spin_lock_irqsave(&HostP->HostLock, flags);
592 if (RIOCheck(HostP, UnitId)) {
594 rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
598 RIOIsolate(p, HostP, UnitId);
600 rio_spin_unlock_irqrestore(&HostP->HostLock, flags);
609 static int RIOIsolate(struct rio_info *p, struct Host *HostP, unsigned int UnitId)
618 if (HostP->Mapping[UnitId].Flags & BEEN_HERE)
621 HostP->Mapping[UnitId].Flags |= BEEN_HERE;
624 rio_dprintk(RIO_DEBUG_ROUTE, "RIOMesgIsolated %s", HostP->Mapping[UnitId].Name);
627 unit = HostP->Mapping[UnitId].Topology[link].Unit;
628 HostP->Mapping[UnitId].Topology[link].Unit = ROUTE_DISCONNECT;
629 HostP->Mapping[UnitId].Topology[link].Link = NO_LINK;
630 RIOIsolate(p, HostP, unit);
632 HostP->Mapping[UnitId].Flags &= ~BEEN_HERE;
636 static int RIOCheck(struct Host *HostP, unsigned int UnitId)
656 if (HostP->Mapping[UnitId].Topology[link].Unit == HOST_ID) {
663 if (HostP->Mapping[UnitId].Flags & BEEN_HERE) {
668 HostP->Mapping[UnitId].Flags |= BEEN_HERE;
672 if (RIOCheck(HostP, HostP->Mapping[UnitId].Topology[link].Unit)) {
674 HostP->Mapping[UnitId].Flags &= ~BEEN_HERE;
679 HostP->Mapping[UnitId].Flags &= ~BEEN_HERE;
726 struct Host *HostP,
785 FromName = FromId ? HostP->Mapping[FromId - 1].Name : HostP->Name;
787 ToName = ToId ? HostP->Mapping[ToId - 1].Name : HostP->Name;
824 static int RIOFreeDisconnected(struct rio_info *p, struct Host *HostP, int unit)
836 if (HostP->Mapping[unit].Topology[link].Unit != ROUTE_DISCONNECT)
867 if (HostP->Mapping[unit].ID2 != 0) {
868 int nOther = (HostP->Mapping[unit].ID2) - 1;
871 memset(&HostP->Mapping[nOther], 0, sizeof(struct Map));
873 RIORemoveFromSavedTable(p, &HostP->Mapping[unit]);
886 int RIOFindFreeID(struct rio_info *p, struct Host *HostP, unsigned int * pID1, unsigned int * pID2)
909 if (HostP->Mapping[unit].Flags == 0) {
942 if (((HostP->Mapping[unit].Flags & SLOT_TENTATIVE) || (HostP->Mapping[unit].Flags == 0)) && !(HostP->Mapping[unit].Flags & RTA16_SECOND_SLOT)) {
958 if (HostP->Mapping[unit].Flags != 0)
959 if (RIOFreeDisconnected(p, HostP, unit) != 0)
971 memset(&HostP->Mapping[unit], 0, sizeof(struct Map));
989 memset(&HostP->Mapping[unit], 0, sizeof(struct Map));