Lines Matching refs:destid

58 	int destid;  in rio_destid_alloc()  local
62 destid = find_first_zero_bit(idtab->table, idtab->max); in rio_destid_alloc()
64 if (destid < idtab->max) { in rio_destid_alloc()
65 set_bit(destid, idtab->table); in rio_destid_alloc()
66 destid += idtab->start; in rio_destid_alloc()
68 destid = RIO_INVALID_DESTID; in rio_destid_alloc()
71 return (u16)destid; in rio_destid_alloc()
82 static int rio_destid_reserve(struct rio_net *net, u16 destid) in rio_destid_reserve() argument
87 destid -= idtab->start; in rio_destid_reserve()
89 oldbit = test_and_set_bit(destid, idtab->table); in rio_destid_reserve()
101 static void rio_destid_free(struct rio_net *net, u16 destid) in rio_destid_free() argument
105 destid -= idtab->start; in rio_destid_free()
107 clear_bit(destid, idtab->table); in rio_destid_free()
117 int destid; in rio_destid_first() local
121 destid = find_first_bit(idtab->table, idtab->max); in rio_destid_first()
122 if (destid >= idtab->max) in rio_destid_first()
123 destid = RIO_INVALID_DESTID; in rio_destid_first()
125 destid += idtab->start; in rio_destid_first()
127 return (u16)destid; in rio_destid_first()
137 int destid; in rio_destid_next() local
141 destid = find_next_bit(idtab->table, idtab->max, from); in rio_destid_next()
142 if (destid >= idtab->max) in rio_destid_next()
143 destid = RIO_INVALID_DESTID; in rio_destid_next()
145 destid += idtab->start; in rio_destid_next()
147 return (u16)destid; in rio_destid_next()
159 static u16 rio_get_device_id(struct rio_mport *port, u16 destid, u8 hopcount) in rio_get_device_id() argument
163 rio_mport_read_config_32(port, destid, hopcount, RIO_DID_CSR, &result); in rio_get_device_id()
177 static void rio_set_device_id(struct rio_mport *port, u16 destid, u8 hopcount, u16 did) in rio_set_device_id() argument
179 rio_mport_write_config_32(port, destid, hopcount, RIO_DID_CSR, in rio_set_device_id()
323 struct rio_mport *port, u16 destid, in rio_setup_device() argument
334 if (rio_mport_read_config_32(port, destid, hopcount, in rio_setup_device()
339 rio_mport_read_config_32(port, destid, hopcount, in rio_setup_device()
352 rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_ID_CAR, in rio_setup_device()
356 rio_mport_read_config_32(port, destid, hopcount, RIO_DEV_INFO_CAR, in rio_setup_device()
358 rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_ID_CAR, in rio_setup_device()
362 rio_mport_read_config_32(port, destid, hopcount, RIO_ASM_INFO_CAR, in rio_setup_device()
367 rdev->phys_efptr = rio_mport_get_physefb(port, 0, destid, in rio_setup_device()
372 rdev->em_efptr = rio_mport_get_feature(port, 0, destid, in rio_setup_device()
375 rdev->em_efptr = rio_mport_get_feature(port, 0, destid, in rio_setup_device()
379 rio_mport_read_config_32(port, destid, hopcount, RIO_SRC_OPS_CAR, in rio_setup_device()
381 rio_mport_read_config_32(port, destid, hopcount, RIO_DST_OPS_CAR, in rio_setup_device()
390 rio_mport_write_config_32(port, destid, hopcount, in rio_setup_device()
395 rio_mport_read_config_32(port, destid, hopcount, in rio_setup_device()
402 rio_set_device_id(port, destid, hopcount, next_destid); in rio_setup_device()
403 rdev->destid = next_destid; in rio_setup_device()
406 rdev->destid = rio_get_device_id(port, destid, hopcount); in rio_setup_device()
413 rdev->destid = destid; in rio_setup_device()
439 rio_enable_rx_tx_port(port, 0, destid, hopcount, 0); in rio_setup_device()
596 u16 destid; in rio_enum_peer() local
604 destid = rio_destid_first(net); in rio_enum_peer()
605 while (destid != RIO_INVALID_DESTID && destid < next_destid) { in rio_enum_peer()
606 if (destid != port->host_deviceid) { in rio_enum_peer()
608 destid, sw_inport, 0); in rio_enum_peer()
609 rdev->rswitch->route_table[destid] = sw_inport; in rio_enum_peer()
611 destid = rio_destid_next(net, destid + 1); in rio_enum_peer()
648 destid = rio_destid_next(net, cur_destid + 1); in rio_enum_peer()
649 if (destid != RIO_INVALID_DESTID) { in rio_enum_peer()
650 for (destid = cur_destid; in rio_enum_peer()
651 destid < next_destid;) { in rio_enum_peer()
652 if (destid != port->host_deviceid) { in rio_enum_peer()
655 destid, in rio_enum_peer()
659 route_table[destid] = in rio_enum_peer()
662 destid = rio_destid_next(net, in rio_enum_peer()
663 destid + 1); in rio_enum_peer()
692 rdev->destid = sw_destid; in rio_enum_peer()
730 rio_disc_peer(struct rio_net *net, struct rio_mport *port, u16 destid, in rio_disc_peer() argument
738 if ((rdev = rio_setup_device(net, port, destid, hopcount, 0))) { in rio_disc_peer()
747 rdev->destid = destid; in rio_disc_peer()
764 rio_lock_device(port, destid, hopcount, 1000); in rio_disc_peer()
779 rio_unlock_device(port, destid, hopcount); in rio_disc_peer()
893 u16 destid; in rio_update_route_tables() local
897 destid = rdev->destid; in rio_update_route_tables()
904 if (RIO_INVALID_ROUTE == rswitch->route_table[destid]) { in rio_update_route_tables()
908 if (swrdev->destid == destid) in rio_update_route_tables()
914 destid, sport, 0); in rio_update_route_tables()
915 rswitch->route_table[destid] = sport; in rio_update_route_tables()
1034 rio_lock_device(net->hport, rdev->destid, in rio_build_route_tables()
1045 rio_unlock_device(net->hport, rdev->destid, rdev->hopcount); in rio_build_route_tables()