Lines Matching refs:ch
84 struct cmp_host *ch; in cmp_register_opcr() local
87 ch = hpsb_get_hostinfo(&cmp_highlevel, host); in cmp_register_opcr()
89 if (opcr_number >= ch->u.ompr.nplugs || in cmp_register_opcr()
90 ch->opcr[opcr_number].update != NULL) in cmp_register_opcr()
93 plug = &ch->opcr[opcr_number]; in cmp_register_opcr()
107 struct cmp_host *ch; in cmp_unregister_opcr() local
110 ch = hpsb_get_hostinfo(&cmp_highlevel, host); in cmp_unregister_opcr()
112 if (plug - ch->opcr >= ch->u.ompr.nplugs) BUG(); in cmp_unregister_opcr()
118 static void reset_plugs(struct cmp_host *ch) in reset_plugs() argument
122 ch->u.ompr.non_persistent_ext = 0xff; in reset_plugs()
123 for (i = 0; i < ch->u.ompr.nplugs; i++) { in reset_plugs()
124 ch->opcr[i].u.pcr.bcast_count = 0; in reset_plugs()
125 ch->opcr[i].u.pcr.p2p_count = 0; in reset_plugs()
126 ch->opcr[i].u.pcr.overhead = 0; in reset_plugs()
132 struct cmp_host *ch = hpsb_create_hostinfo(&cmp_highlevel, host, sizeof (*ch)); in cmp_add_host() local
134 if (ch == NULL) { in cmp_add_host()
139 ch->host = host; in cmp_add_host()
140 ch->u.ompr.rate = IEEE1394_SPEED_100; in cmp_add_host()
141 ch->u.ompr.bcast_channel_base = 63; in cmp_add_host()
142 ch->u.ompr.nplugs = 2; in cmp_add_host()
144 reset_plugs(ch); in cmp_add_host()
149 struct cmp_host *ch; in cmp_host_reset() local
151 ch = hpsb_get_hostinfo(&cmp_highlevel, host); in cmp_host_reset()
152 if (ch == NULL) { in cmp_host_reset()
157 reset_plugs(ch); in cmp_host_reset()
165 struct cmp_host *ch; in pcr_read() local
170 ch = hpsb_get_hostinfo(&cmp_highlevel, host); in pcr_read()
172 *buf = cpu_to_be32(ch->u.ompr_quadlet); in pcr_read()
175 else if (csraddr < 0x904 + ch->u.ompr.nplugs * 4) { in pcr_read()
177 *buf = cpu_to_be32(ch->opcr[plug].u.quadlet); in pcr_read()
184 *buf = cpu_to_be32(ch->v.impr_quadlet); in pcr_read()
187 else if (csraddr < 0x984 + ch->v.impr.nplugs * 4) { in pcr_read()
189 *buf = cpu_to_be32(ch->ipcr[plug].u.quadlet); in pcr_read()
201 struct cmp_host *ch; in pcr_lock() local
203 ch = hpsb_get_hostinfo(&cmp_highlevel, host); in pcr_lock()
210 *store = cpu_to_be32(ch->u.ompr_quadlet); in pcr_lock()
211 if (arg == cpu_to_be32(ch->u.ompr_quadlet)) in pcr_lock()
212 ch->u.ompr_quadlet = be32_to_cpu(data); in pcr_lock()
216 if (csraddr < 0x904 + ch->u.ompr.nplugs * 4) { in pcr_lock()
218 *store = cpu_to_be32(ch->opcr[plug].u.quadlet); in pcr_lock()
221 ch->opcr[plug].u.quadlet = be32_to_cpu(data); in pcr_lock()
223 if (be32_to_cpu(*store) != ch->opcr[plug].u.quadlet && in pcr_lock()
224 ch->opcr[plug].update != NULL) in pcr_lock()
225 ch->opcr[plug].update(&ch->opcr[plug].u.pcr, in pcr_lock()
226 ch->opcr[plug].data); in pcr_lock()
235 *store = cpu_to_be32(ch->u.ompr_quadlet); in pcr_lock()
236 if (arg == cpu_to_be32(ch->u.ompr_quadlet)) in pcr_lock()
237 ch->u.ompr_quadlet = be32_to_cpu(data); in pcr_lock()
241 else if (csraddr < 0x984 + ch->v.impr.nplugs * 4) { in pcr_lock()
243 *store = cpu_to_be32(ch->ipcr[plug].u.quadlet); in pcr_lock()
246 ch->ipcr[plug].u.quadlet = be32_to_cpu(data); in pcr_lock()
248 if (be32_to_cpu(*store) != ch->ipcr[plug].u.quadlet && in pcr_lock()
249 ch->ipcr[plug].update != NULL) in pcr_lock()
250 ch->ipcr[plug].update(&ch->ipcr[plug].u.pcr, in pcr_lock()
251 ch->ipcr[plug].data); in pcr_lock()