Lines Matching refs:destid

58 	int destid;
62 destid = find_first_zero_bit(idtab->table, idtab->max);
64 if (destid < idtab->max) {
65 set_bit(destid, idtab->table);
66 destid += idtab->start;
68 destid = RIO_INVALID_DESTID;
71 return (u16)destid;
77 * @destid: destID to reserve
82 static int rio_destid_reserve(struct rio_net *net, u16 destid)
87 destid -= idtab->start;
89 oldbit = test_and_set_bit(destid, idtab->table);
97 * @destid: destID to free
101 static void rio_destid_free(struct rio_net *net, u16 destid)
105 destid -= idtab->start;
107 clear_bit(destid, idtab->table);
117 int destid;
121 destid = find_first_bit(idtab->table, idtab->max);
122 if (destid >= idtab->max)
123 destid = RIO_INVALID_DESTID;
125 destid += idtab->start;
127 return (u16)destid;
137 int destid;
141 destid = find_next_bit(idtab->table, idtab->max, from);
142 if (destid >= idtab->max)
143 destid = RIO_INVALID_DESTID;
145 destid += idtab->start;
147 return (u16)destid;
153 * @destid: Destination ID of device
159 static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount)
163 rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, &result);
171 * @destid: Destination ID of device
177 static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did)
179 rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR,
252 /* Set master port destid and init destid ctr */
310 * @destid: Current destination ID
323 struct rio_mport *port, u16 destid,
334 if (rio_mport_read_config_32(port, destid, hopcount,
339 rio_mport_read_config_32(port, destid, hopcount,
352 rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_ID_CAR,
356 rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_INFO_CAR,
358 rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_ID_CAR,
362 rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_INFO_CAR,
367 rdev->phys_efptr = rio_mport_get_physefb(port, 0, destid,
372 rdev->em_efptr = rio_mport_get_feature(port, 0, destid,
375 rdev->em_efptr = rio_mport_get_feature(port, 0, destid,
379 rio_mport_read_config_32(port, destid, hopcount, RIO_SRC_OPS_CAR,
381 rio_mport_read_config_32(port, destid, hopcount, RIO_DST_OPS_CAR,
390 rio_mport_write_config_32(port, destid, hopcount,
395 rio_mport_read_config_32(port, destid, hopcount,
402 rio_set_device_id(port, destid, hopcount, next_destid);
403 rdev->destid = next_destid;
406 rdev->destid = rio_get_device_id(port, destid, hopcount);
413 rdev->destid = destid;
439 rio_enable_rx_tx_port(port, 0, destid, hopcount, 0);
596 u16 destid;
604 destid = rio_destid_first(net);
605 while (destid != RIO_INVALID_DESTID && destid < next_destid) {
606 if (destid != port->host_deviceid) {
608 destid, sw_inport, 0);
609 rdev->rswitch->route_table[destid] = sw_inport;
611 destid = rio_destid_next(net, destid + 1);
648 destid = rio_destid_next(net, cur_destid + 1);
649 if (destid != RIO_INVALID_DESTID) {
650 for (destid = cur_destid;
651 destid < next_destid;) {
652 if (destid != port->host_deviceid) {
655 destid,
659 route_table[destid] =
662 destid = rio_destid_next(net,
663 destid + 1);
692 rdev->destid = sw_destid;
721 * @destid: Current destination ID in network
730 rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid,
738 if ((rdev = rio_setup_device(net, port, destid, hopcount, 0))) {
746 /* Associated destid is how we accessed this switch */
747 rdev->destid = destid;
764 rio_lock_device(port, destid, hopcount, 1000);
779 rio_unlock_device(port, destid, hopcount);
893 u16 destid;
897 destid = rdev->destid;
904 if (RIO_INVALID_ROUTE == rswitch->route_table[destid]) {
907 /* Skip if destid ends in empty switch*/
908 if (swrdev->destid == destid)
914 destid, sport, 0);
915 rswitch->route_table[destid] = sport;
1034 rio_lock_device(net->hport, rdev->destid,
1045 rio_unlock_device(net->hport, rdev->destid, rdev->hopcount);