Lines Matching defs:tunnel

64 #define	IOSRAM_GETB(tunnel, buf, sram, count) \
65 ddi_rep_get8(tunnel->reg_handle, buf, sram, count, DDI_DEV_AUTOINCR)
67 #define IOSRAM_PUTB(tunnel, buf, sram, count) \
68 ddi_rep_put8(tunnel->reg_handle, buf, sram, count, DDI_DEV_AUTOINCR)
70 #define IOSRAM_PUT(tunnel, sram, buf, size) \
72 ddi_put##size(tunnel->reg_handle, (uint##size##_t *)sram, \
76 #define IOSRAM_GET(tunnel, sram, buf, size) \
78 *(uint##size##_t *)buf = ddi_get##size(tunnel->reg_handle, \
95 uint_t tunnel;
101 (void) prom_getprop(nodeid, "iosram", (caddr_t)&tunnel);
106 if (prom_phandle_to_path((phandle_t)tunnel, chosen_iosram,
108 cmn_err(CE_NOTE, "prom_phandle_to_path(%x) failed\n", tunnel);
139 if ((master_iosram->tunnel = kmem_zalloc(sizeof (tunnel_t),
141 prom_printf("Can't allocate space for tunnel\n");
142 panic("Can't allocate space for tunnel");
148 master_iosram->tunnel->tunnel_keys[i].key = 0;
149 master_iosram->tunnel->tunnel_keys[i].base = NULL;
150 master_iosram->tunnel->tunnel_keys[i].size = 0;
162 struct tunnel_key *tunnel;
169 * destroy any tunnel maps
172 tunnel = &master_iosram->tunnel->tunnel_keys[i];
173 if (tunnel->base != NULL) {
174 ddi_regs_map_free(&tunnel->reg_handle);
175 tunnel->base = NULL;
179 kmem_free(master_iosram->tunnel, sizeof (tunnel_t));
211 master_iosram->tunnel = new_tunnel;
225 struct tunnel_key *tunnel;
245 * First map in the TOC, then set up the tunnel
264 tunnel = &new_tunnel->tunnel_keys[key];
265 tunnel->key = key;
266 tunnel->size = toc->iosram_keys[i].size;
274 (caddr_t *)&tunnel->base,
277 &tunnel->reg_handle) != DDI_SUCCESS) {
286 (void *)tunnel->base);
313 * Unmap a tunnel
316 tunnel_fini(tunnel_t *tunnel)
322 * Unmap the tunnel
325 tunnel_key = &tunnel->tunnel_keys[i];
342 tunnel_key = master_iosram->tunnel->tunnel_keys[SBBC_SC_INTR_KEY];
358 if ((rc = tunnel_init(softsp, master_iosram->tunnel)) == DDI_SUCCESS) {
359 tunnel_commit(softsp, master_iosram->tunnel);
385 struct tunnel_key *tunnel;
399 if (INVALID_KEY(master_iosram->tunnel, key)) {
404 tunnel = &master_iosram->tunnel->tunnel_keys[key];
405 if ((offset + size) > tunnel->size) {
410 sram_src = tunnel->base + offset;
429 IOSRAM_GET(tunnel, sram_src, buf, 16);
431 IOSRAM_GET(tunnel, sram_src, buf, 32);
433 IOSRAM_GET(tunnel, sram_src, buf, 64);
438 IOSRAM_GETB(tunnel, (uint8_t *)buf,
451 IOSRAM_PUT(tunnel, sram_src, buf, 16);
453 IOSRAM_PUT(tunnel, sram_src, buf, 32);
455 IOSRAM_PUT(tunnel, sram_src, buf, 64);
460 IOSRAM_PUTB(tunnel, (uint8_t *)buf,
481 if (!INVALID_KEY(master_iosram->tunnel, key))
482 size = master_iosram->tunnel->tunnel_keys[key].size;
509 * Grab the lock to prevent tunnel switch in the middle
788 * Switch master tunnel away from the specified instance.
798 * Find the candidate target of tunnel from the linked list.
815 /* Do the tunnel switch */
829 * Switch the tunnel to a different I/O board.
842 tunnel_t *new_tunnel; /* new tunnel */
849 /* Check the firmware for tunnel switch support */
850 if (prom_test("SUNW,switch-tunnel") != 0) {
851 cmn_err(CE_WARN, "Firmware does not support tunnel switch");
862 * create the new tunnel
865 cmn_err(CE_WARN, "Can't allocate space for new tunnel");
919 * move SC interrupts to the new tunnel
924 cmn_err(CE_WARN, "Failed to initialize new tunnel");
940 cmn_err(CE_WARN, "OBP failed to switch tunnel");
948 * Unmap new tunnel
954 orig_tunnel = master_iosram->tunnel;
965 * Unmap original tunnel
1048 * when doing tunnel switch.