/* * This switch device does not have the dedicated global routing table. * It is substituted by reading routing table of the ingress port of * maintenance read requests.
*/ if (table == RIO_GLOBAL_TABLE)
table = RIO_GET_PORT_NUM(rval); elseif (table >= RIO_GET_TOTAL_PORTS(rval)) return -EINVAL;
if (table >= RIO_GET_TOTAL_PORTS(rval)) return -EINVAL;
for (i = 0; i <= 0xff; i++) {
err = rio_mport_write_config_32(mport, destid, hopcount,
RIO_SPx_L2_Gn_ENTRYy_CSR(table, 0, i),
RIO_RT_ENTRY_DROP_PKT); if (err) break;
}
return err;
}
/* * This routine performs device-specific initialization only. * All standard EM configuration should be performed at upper level.
*/ staticint
idtg3_em_init(struct rio_dev *rdev)
{ int i, tmp;
u32 rval;
/* * idtg3_em_handler - device-specific error handler * * If the link is down (PORT_UNINIT) does nothing - this is considered * as link partner removal from the port. * * If the link is up (PORT_OK) - situation is handled as *new* device insertion. * In this case ERR_STOP bits are cleared by issuing soft reset command to the * reporting port. Inbound and outbound ackIDs are cleared by the reset as well. * This way the port is synchronized with freshly inserted device (assuming it * was reset/powered-up on insertion). * * TODO: This is not sufficient in a situation when a link between two devices * was down and up again (e.g. cable disconnect). For that situation full ackID * realignment process has to be implemented.
*/ staticint
idtg3_em_handler(struct rio_dev *rdev, u8 pnum)
{
u32 err_status;
u32 rval;
/* Do nothing for device/link removal */ if (err_status & RIO_PORT_N_ERR_STS_PORT_UNINIT) return 0;
/* When link is OK we have a device insertion. * Request port soft reset to clear errors if they present. * Inbound and outbound ackIDs will be 0 after reset.
*/ if (err_status & (RIO_PORT_N_ERR_STS_OUT_ES |
RIO_PORT_N_ERR_STS_INP_ES)) {
rio_read_config_32(rdev, RIO_PLM_SPx_IMP_SPEC_CTL(pnum), &rval);
rio_write_config_32(rdev, RIO_PLM_SPx_IMP_SPEC_CTL(pnum),
rval | RIO_PLM_SPx_IMP_SPEC_CTL_SOFT_RST);
udelay(10);
rio_write_config_32(rdev, RIO_PLM_SPx_IMP_SPEC_CTL(pnum), rval);
msleep(500);
}
/* * Gen3 switches repeat sending PW messages until a corresponding event flag * is cleared. Use shutdown notification to disable generation of port-write * messages if their destination node is shut down.
*/ staticvoid idtg3_shutdown(struct rio_dev *rdev)
{ int i;
u32 rval;
u16 destid;
/* Currently the enumerator node acts also as PW handler */ if (!rdev->do_enum) return;
rio_read_config_32(rdev, RIO_PW_ROUTE, &rval);
i = RIO_GET_PORT_NUM(rdev->swpinfo);
/* Check port-write destination port */ if (!((1 << i) & rval)) return;
/* Disable sending port-write event notifications if PW destID * matches to one of the enumerator node
*/
rio_read_config_32(rdev, rdev->em_efptr + RIO_EM_PW_TGT_DEVID, &rval);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.