Home
last modified time | relevance | path

Searched refs:chp (Results 1 – 25 of 85) sorted by relevance

1234

/netbsd-src/sys/dev/ata/
H A Data.c199 ata_channel_attach(struct ata_channel *chp) in ata_channel_attach() argument
201 if (chp->ch_flags & ATACH_DISABLED) in ata_channel_attach()
204 ata_channel_init(chp); in ata_channel_attach()
206 KASSERT(chp->ch_queue != NULL); in ata_channel_attach()
208 chp->atabus = config_found(chp->ch_atac->atac_dev, chp, atabusprint, in ata_channel_attach()
218 ata_channel_detach(struct ata_channel *chp) in ata_channel_detach() argument
220 if (chp->ch_flags & ATACH_DISABLED) in ata_channel_detach()
223 ata_channel_destroy(chp); in ata_channel_detach()
225 chp->ch_flags |= ATACH_DETACHED; in ata_channel_detach()
231 struct ata_channel *chp = atabus_sc->sc_chan; in atabusconfig() local
[all …]
H A Data_subr.c81 ata_queue_hwslot_to_xfer(struct ata_channel *chp, int hwslot) in ata_queue_hwslot_to_xfer() argument
83 struct ata_queue *chq = chp->ch_queue; in ata_queue_hwslot_to_xfer()
86 ata_channel_lock(chp); in ata_queue_hwslot_to_xfer()
99 ata_channel_unlock(chp); in ata_queue_hwslot_to_xfer()
109 ata_queue_get_active_xfer_locked(struct ata_channel *chp) in ata_queue_get_active_xfer_locked() argument
113 KASSERT(mutex_owned(&chp->ch_lock)); in ata_queue_get_active_xfer_locked()
114 xfer = TAILQ_FIRST(&chp->ch_queue->active_xfers); in ata_queue_get_active_xfer_locked()
131 ata_queue_get_active_xfer(struct ata_channel *chp) in ata_queue_get_active_xfer() argument
135 ata_channel_lock(chp); in ata_queue_get_active_xfer()
136 xfer = ata_queue_get_active_xfer_locked(chp); in ata_queue_get_active_xfer()
[all …]
H A Dsatapmp_subr.c51 satapmp_read_8(struct ata_channel *chp, int port, int reg, uint64_t *value, in satapmp_read_8() argument
54 struct atac_softc *atac = chp->ch_atac; in satapmp_read_8()
60 KASSERT(chp->ch_ndrives >= PMP_MAX_DRIVES); in satapmp_read_8()
61 drvp = &chp->ch_drive[PMP_PORT_CTL]; in satapmp_read_8()
63 ata_channel_lock_owned(chp); in satapmp_read_8()
74 ata_channel_unlock(chp); in satapmp_read_8()
77 ata_wait_cmd(chp, xfer); in satapmp_read_8()
80 aprint_error_dev(chp->atabus, in satapmp_read_8()
87 aprint_verbose_dev(chp->atabus, in satapmp_read_8()
100 ata_channel_lock(chp); in satapmp_read_8()
[all …]
H A Data_wdc.c148 struct ata_channel *chp = drvp->chnl_softc; in wdc_ata_bio() local
149 struct atac_softc *atac = chp->ch_atac; in wdc_ata_bio()
172 ata_exec_xfer(chp, xfer); in wdc_ata_bio()
176 wdc_ata_bio_start(struct ata_channel *chp, struct ata_xfer *xfer) in wdc_ata_bio_start() argument
178 struct atac_softc *atac = chp->ch_atac; in wdc_ata_bio_start()
179 struct wdc_softc *wdc = CHAN_TO_WDC(chp); in wdc_ata_bio_start()
180 struct wdc_regs *wdr = &wdc->regs[chp->ch_channel]; in wdc_ata_bio_start()
182 struct ata_drive_datas *drvp = &chp->ch_drive[xfer->c_drive]; in wdc_ata_bio_start()
193 device_xname(atac->atac_dev), chp->ch_channel, xfer->c_drive, in wdc_ata_bio_start()
194 drvp->state, drvp->drive_flags, xfer->c_flags, chp->ch_flags), in wdc_ata_bio_start()
[all …]
H A Dsata_subr.c82 sata_reset_interface(struct ata_channel *chp, bus_space_tag_t sata_t, in sata_reset_interface() argument
88 ata_channel_lock_owned(chp); in sata_reset_interface()
99 ata_delay(chp, 50, "sataup", flags); in sata_reset_interface()
103 ata_delay(chp, 50, "sataup", flags); in sata_reset_interface()
109 ata_delay(chp, 10, "sataup", flags); in sata_reset_interface()
117 ata_delay(chp, 10, "sataup", flags); in sata_reset_interface()
124 sata_interpret_det(chp, sstatus); in sata_reset_interface()
130 sata_interpret_det(struct ata_channel *chp, uint32_t sstatus) in sata_interpret_det() argument
140 device_xname(chp->ch_atac->atac_dev), chp->ch_channel); in sata_interpret_det()
145 device_xname(chp->ch_atac->atac_dev), chp->ch_channel); in sata_interpret_det()
[all …]
H A Data_recovery.c71 struct ata_channel *chp = drvp->chnl_softc; in ata_read_log_ext_ncq() local
72 struct ata_xfer *xfer = &chp->recovery_xfer; in ata_read_log_ext_ncq()
73 struct atac_softc *atac = chp->ch_atac; in ata_read_log_ext_ncq()
85 tb = chp->recovery_blk; in ata_read_log_ext_ncq()
86 memset(tb, 0, sizeof(chp->recovery_blk)); in ata_read_log_ext_ncq()
104 xfer->c_ata_c.bcount = sizeof(chp->recovery_blk); in ata_read_log_ext_ncq()
107 ata_wait_cmd(chp, xfer); in ata_read_log_ext_ncq()
115 for (int i = 0; i < sizeof(chp->recovery_blk); i++) in ata_read_log_ext_ncq()
160 ata_recovery_resume(struct ata_channel *chp, int drive, int tfd, int flags) in ata_recovery_resume() argument
166 const uint8_t ch_openings = ata_queue_openings(chp); in ata_recovery_resume()
[all …]
/netbsd-src/sys/dev/ic/
H A Dwdc.c205 wdc_sataprobe(struct ata_channel *chp) in wdc_sataprobe() argument
207 struct wdc_softc *wdc = CHAN_TO_WDC(chp); in wdc_sataprobe()
208 struct wdc_regs *wdr = CHAN_TO_WDC_REGS(chp); in wdc_sataprobe()
212 KASSERT(chp->ch_ndrives == 0 || chp->ch_drive != NULL); in wdc_sataprobe()
216 ata_channel_lock(chp); in wdc_sataprobe()
219 switch (sata_reset_interface(chp, wdr->sata_iot, wdr->sata_control, in wdc_sataprobe()
231 ata_delay(chp, 1, "sataprb", AT_WAIT); in wdc_sataprobe()
234 aprint_error_dev(chp->ch_atac->atac_dev, in wdc_sataprobe()
246 device_xname(chp->ch_atac->atac_dev), chp->ch_channel, in wdc_sataprobe()
248 if (atabus_alloc_drives(chp, wdc->wdc_maxdrives) != 0) { in wdc_sataprobe()
[all …]
H A Dsiisata.c244 siisata_disable_port_interrupt(struct ata_channel *chp) in siisata_disable_port_interrupt() argument
246 struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac; in siisata_disable_port_interrupt()
248 PRWRITE(sc, PRX(chp->ch_channel, PRO_PIEC), 0xffffffff); in siisata_disable_port_interrupt()
252 siisata_enable_port_interrupt(struct ata_channel *chp) in siisata_enable_port_interrupt() argument
254 struct siisata_softc *sc = (struct siisata_softc *)chp->ch_atac; in siisata_enable_port_interrupt()
257 (void)PRREAD(sc, PRX(chp->ch_channel, PRO_PSS)); in siisata_enable_port_interrupt()
258 PRWRITE(sc, PRX(chp->ch_channel, PRO_PIS), 0xffffffff); in siisata_enable_port_interrupt()
260 PRWRITE(sc, PRX(chp->ch_channel, PRO_PIES), in siisata_enable_port_interrupt()
268 struct ata_channel *chp; in siisata_init_port() local
272 chp = (struct ata_channel *)schp; in siisata_init_port()
[all …]
H A Dahcisata_core.c123 #define AHCISATA_DO_EXTRA_DELAY(sc, chp, msg, flags) \ argument
124 ata_delay(chp, AHCISATA_EXTRA_DELAY_MS, msg, flags)
126 #define AHCISATA_DO_EXTRA_DELAY(sc, chp, msg, flags) do { } while (0) argument
212 struct ata_channel *chp; in ahci_reprobe_drives() local
223 chp = &achp->ata_channel; in ahci_reprobe_drives()
225 ahci_probe_drive(chp); in ahci_reprobe_drives()
259 struct ata_channel *chp; in ahci_attach() local
408 chp = &achp->ata_channel; in ahci_attach()
409 sc->sc_chanarray[i] = chp; in ahci_attach()
410 chp->ch_channel = i; in ahci_attach()
[all …]
H A Dmvsata.c446 struct ata_channel *chp = &mvport->port_ata_channel; in mvsata_nondma_handle() local
455 xfer = ata_queue_get_active_xfer(chp); in mvsata_nondma_handle()
460 device_xname(MVSATA_DEV2(mvport)), chp->ch_channel, in mvsata_nondma_handle()
465 ret = xfer->ops->c_intr(chp, xfer, 1); in mvsata_nondma_handle()
543 struct ata_channel *chp = &mvport->port_ata_channel; in mvsata_error() local
549 ata_channel_lock(chp); in mvsata_error()
550 ata_thread_run(chp, 0, ATACH_TH_RECOVERY, in mvsata_error()
552 ata_channel_unlock(chp); in mvsata_error()
560 mvsata_channel_recover(struct ata_channel *chp, int flags, uint32_t tfd) in mvsata_channel_recover() argument
562 struct mvsata_port * const mvport = (struct mvsata_port *)chp; in mvsata_channel_recover()
[all …]
H A Dwdcvar.h134 #define CHAN_TO_WDC(chp) ((struct wdc_softc *)(chp)->ch_atac) argument
137 #define CHAN_TO_WDC_REGS(chp) (&CHAN_TO_WDC(chp)->regs[(chp)->ch_channel]) argument
184 #define wdc_wait_for_drq(chp, timeout, flags, tfd) \ argument
185 wdcwait((chp), WDCS_DRQ, WDCS_DRQ, (timeout), (flags), (tfd))
186 #define wdc_wait_for_unbusy(chp, timeout, flags, tfd) \ argument
187 wdcwait((chp), 0, 0, (timeout), (flags), (tfd))
188 #define wdc_wait_for_ready(chp, timeout, flags, tfd) \ argument
189 wdcwait((chp), WDCS_DRDY, WDCS_DRDY, (timeout), (flags), (tfd))
/netbsd-src/sys/arch/mmeye/stand/boot/
H A Dwdc.c55 static int wdcprobe(struct wdc_channel *chp);
56 static int wdc_wait_for_ready(struct wdc_channel *chp);
58 static int __wdcwait_reset(struct wdc_channel *chp, int drv_mask);
64 __wdcwait_reset(struct wdc_channel *chp, int drv_mask) in __wdcwait_reset() argument
71 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); /* master */ in __wdcwait_reset()
73 st0 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
74 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); /* slave */ in __wdcwait_reset()
76 st1 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
122 wdcprobe(struct wdc_channel *chp) in wdcprobe() argument
131 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); in wdcprobe()
[all …]
H A Dwdvar.h60 #define WDC_READ_REG(chp, reg) *(chp)->c_cmdreg[(reg)] argument
61 #define WDC_WRITE_REG(chp, reg, val) *(chp)->c_cmdreg[(reg)] = (val) argument
62 #define WDC_READ_CTLREG(chp, reg) (chp)->c_ctlbase[(reg)] argument
63 #define WDC_WRITE_CTLREG(chp, reg, val) (chp)->c_ctlbase[(reg)] = (val) argument
64 #define WDC_READ_DATA(chp) *(chp)->c_data argument
65 #define WDC_READ_DATA_STREAM(chp) *(chp)->c_data argument
73 #define WDC_READ_REG(chp, reg) ({ \ argument
75 *(chp)->c_cmdreg[(reg)]; \
77 #define WDC_WRITE_REG(chp, reg, val) do { \ argument
79 *(chp)->c_cmdreg[(reg)] = (val); \
[all …]
/netbsd-src/sys/arch/bebox/stand/boot/
H A Dwdc.c61 __wdcwait_reset(struct wdc_channel *chp, int drv_mask) in __wdcwait_reset() argument
68 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); /* master */ in __wdcwait_reset()
70 st0 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
71 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); /* slave */ in __wdcwait_reset()
73 st1 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
148 wdcprobe(struct wdc_channel *chp) in wdcprobe() argument
158 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); in wdcprobe()
160 st0 = WDC_READ_REG(chp, wd_status); in wdcprobe()
161 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); in wdcprobe()
163 st1 = WDC_READ_REG(chp, wd_status); in wdcprobe()
[all …]
H A Dwdvar.h53 #define WDC_READ_REG(chp, reg) inb((chp)->c_cmdreg[(reg)]) argument
54 #define WDC_WRITE_REG(chp, reg, val) outb((chp)->c_cmdreg[(reg)], (val)) argument
55 #define WDC_READ_CTLREG(chp, reg) inb((chp)->c_ctlbase) argument
56 #define WDC_WRITE_CTLREG(chp, reg, val) outb((chp)->c_ctlbase, (val)) argument
57 #define WDC_READ_DATA_STREAM(chp) inw((chp)->c_data) argument
58 #define WDC_READ_DATA(chp) inwrb((chp)->c_data) argument
/netbsd-src/sys/arch/cobalt/stand/boot/
H A Dwdc.c46 static int wdcprobe(struct wdc_channel *chp);
47 static int wdc_wait_for_ready(struct wdc_channel *chp);
49 static int __wdcwait_reset(struct wdc_channel *chp, int drv_mask);
55 __wdcwait_reset(struct wdc_channel *chp, int drv_mask) in __wdcwait_reset() argument
62 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); /* master */ in __wdcwait_reset()
64 st0 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
65 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM | 0x10); /* slave */ in __wdcwait_reset()
67 st1 = WDC_READ_REG(chp, wd_status); in __wdcwait_reset()
113 wdcprobe(struct wdc_channel *chp) in wdcprobe() argument
122 WDC_WRITE_REG(chp, wd_sdh, WDSD_IBM); in wdcprobe()
[all …]
H A Dpciide.c39 pciide_init(struct wdc_channel *chp, u_int *unit) in pciide_init() argument
63 chp->c_cmdbase = (uint8_t *)cmdreg; in pciide_init()
64 chp->c_data = (uint16_t *)(cmdreg + wd_data); in pciide_init()
66 chp->c_cmdreg[i] = chp->c_cmdbase + i; in pciide_init()
68 chp->c_cmdreg[wd_status] = chp->c_cmdreg[wd_command]; in pciide_init()
69 chp->c_cmdreg[wd_features] = chp->c_cmdreg[wd_precomp]; in pciide_init()
71 chp->c_ctlbase = (uint8_t *)ctlreg; in pciide_init()
H A Dwdvar.h60 #define WDC_READ_REG(chp, reg) *(chp)->c_cmdreg[(reg)] argument
61 #define WDC_WRITE_REG(chp, reg, val) *(chp)->c_cmdreg[(reg)] = (val) argument
62 #define WDC_READ_CTLREG(chp, reg) (chp)->c_ctlbase[(reg)] argument
63 #define WDC_WRITE_CTLREG(chp, reg, val) (chp)->c_ctlbase[(reg)] = (val) argument
64 #define WDC_READ_DATA(chp) *(chp)->c_data argument
/netbsd-src/sys/dev/scsipi/
H A Datapi_wdc.c115 struct ata_channel *chp = ata_sc->sc_chan; in wdc_atapibus_attach() local
116 struct atac_softc *atac = chp->ch_atac; in wdc_atapibus_attach()
118 struct scsipi_channel *chan = &chp->ch_atapi_channel; in wdc_atapibus_attach()
137 chan->chan_channel = chp->ch_channel; in wdc_atapibus_attach()
141 chan->chan_ntargets = chp->ch_ndrives; in wdc_atapibus_attach()
144 chp->atapibus = config_found(ata_sc->sc_dev, chan, atapiprint, in wdc_atapibus_attach()
167 struct ata_channel *chp = in wdc_atapi_kill_pending() local
170 ata_kill_pending(&chp->ch_drive[periph->periph_target]); in wdc_atapi_kill_pending()
174 wdc_atapi_kill_xfer(struct ata_channel *chp, struct ata_xfer *xfer, int reason) in wdc_atapi_kill_xfer() argument
197 ata_deactivate_xfer(chp, xfer); in wdc_atapi_kill_xfer()
[all …]
/netbsd-src/sys/dev/pci/
H A Dpdcide.c327 pdc202xx_setup_channel(struct ata_channel *chp) in pdc202xx_setup_channel() argument
333 struct pciide_channel *cp = CHAN_TO_PCHAN(chp); in pdc202xx_setup_channel()
334 struct pciide_softc *sc = CHAN_TO_PCIIDE(chp); in pdc202xx_setup_channel()
335 int channel = chp->ch_channel; in pdc202xx_setup_channel()
353 (chp->ch_drive[0].drive_flags & ATA_DRIVE_UDMA && in pdc202xx_setup_channel()
354 chp->ch_drive[0].UDMA_mode <= 2) || in pdc202xx_setup_channel()
355 (chp->ch_drive[1].drive_flags & ATA_DRIVE_UDMA && in pdc202xx_setup_channel()
356 chp->ch_drive[1].UDMA_mode <= 2)) { in pdc202xx_setup_channel()
357 if (chp->ch_drive[0].UDMA_mode > 2) in pdc202xx_setup_channel()
358 chp->ch_drive[0].UDMA_mode = 2; in pdc202xx_setup_channel()
[all …]
H A Drdcide.c201 rdcide_setup_channel(struct ata_channel *chp) in rdcide_setup_channel() argument
205 struct pciide_channel *cp = CHAN_TO_PCHAN(chp); in rdcide_setup_channel()
206 struct pciide_softc *sc = CHAN_TO_PCIIDE(chp); in rdcide_setup_channel()
219 psd1atr &= ~RDCIDE_PSD1ATR_SETUP_MASK(chp->ch_channel); in rdcide_setup_channel()
220 psd1atr &= ~RDCIDE_PSD1ATR_HOLD_MASK(chp->ch_channel); in rdcide_setup_channel()
222 udccr &= ~RDCIDE_UDCCR_EN(chp->ch_channel, drive); in rdcide_setup_channel()
223 udccr &= ~RDCIDE_UDCCR_TIM_MASK(chp->ch_channel, drive); in rdcide_setup_channel()
224 iiocr &= ~RDCIDE_IIOCR_CLK_MASK(chp->ch_channel, drive); in rdcide_setup_channel()
231 patr |= RDCIDE_PATR_ATA(chp->ch_channel, drive); in rdcide_setup_channel()
235 chp->ch_channel); in rdcide_setup_channel()
[all …]
H A Doptiide.c170 opti_setup_channel(struct ata_channel *chp) in opti_setup_channel() argument
173 struct pciide_channel *cp = CHAN_TO_PCHAN(chp); in opti_setup_channel()
174 struct pciide_softc *sc = CHAN_TO_PCIIDE(chp); in opti_setup_channel()
183 mr = opti_read_config(chp, OPTI_REG_MISC) & ~OPTI_MISC_INDEX_MASK; in opti_setup_channel()
189 opti_write_config(chp, OPTI_REG_CONTROL, OPTI_CONTROL_DISABLE); in opti_setup_channel()
192 spd = (int) opti_read_config(chp, OPTI_REG_STRAP); in opti_setup_channel()
199 drvp = &chp->ch_drive[drive]; in opti_setup_channel()
234 chp->ch_drive[d].PIO_mode = chp->ch_drive[1-d].PIO_mode; in opti_setup_channel()
235 chp->ch_drive[d].DMA_mode = 0; in opti_setup_channel()
237 chp->ch_drive[d].drive_flags &= ~ATA_DRIVE_DMA; in opti_setup_channel()
[all …]
H A Daceride.c237 acer_do_reset(struct ata_channel *chp, int poll) in acer_do_reset() argument
239 struct pciide_softc *sc = CHAN_TO_PCIIDE(chp); in acer_do_reset()
249 wdc_do_reset(chp, poll); in acer_do_reset()
253 ACER_PCIB_CTRL, reg & ~ACER_PCIB_CTRL_ENCHAN(chp->ch_channel)); in acer_do_reset()
260 acer_setup_channel(struct ata_channel *chp) in acer_setup_channel() argument
266 struct pciide_channel *cp = (struct pciide_channel*)chp; in acer_setup_channel()
267 struct pciide_softc *sc = CHAN_TO_PCIIDE(chp); in acer_setup_channel()
276 if ((chp->ch_drive[0].drive_flags | chp->ch_drive[1].drive_flags) & in acer_setup_channel()
279 ACER_0x4A_80PIN(chp->ch_channel)) { in acer_setup_channel()
280 if (chp->ch_drive[0].UDMA_mode > 2) in acer_setup_channel()
[all …]
/netbsd-src/sys/arch/sparc64/dev/
H A Dpcf8591_envctrl.c299 struct ecadc_channel *chp = &sc->sc_channels[i]; in ecadc_detach() local
301 if (chp->chan_type == PCF8591_SYS_FAN_CTRL) { in ecadc_detach()
304 chp->chan_speed = sc->sc_cpu_fan_spd[0]; in ecadc_detach()
305 if (!ecadc_set_fan_speed(sc, chp->chan_num, in ecadc_detach()
306 chp->chan_speed)) in ecadc_detach()
311 device_xname(sc->sc_dev), chp->chan_num); in ecadc_detach()
347 struct ecadc_channel *chp = &sc->sc_channels[i]; in ecadc_refresh() local
349 if (chp->chan_type == PCF8591_TEMP_SENS) { in ecadc_refresh()
352 if (chp->chan_xlate) { in ecadc_refresh()
356 chp->chan_xlate[data[1 + chp->chan_num]]; in ecadc_refresh()
[all …]
/netbsd-src/lib/libcurses/
H A Dadd_wchstr.c138 const cchar_t *chp; in wadd_wchnstr() local
158 for (chp = wchstr, cnt = 0; n && chp->vals[0]; in wadd_wchnstr()
159 n--, chp++, ++cnt); in wadd_wchnstr()
161 for (chp = wchstr, cnt = 0; chp->vals[0]; chp++, ++cnt); in wadd_wchnstr()
163 chp = wchstr; in wadd_wchnstr()
173 if (wcwidth(chp->vals[0])) { in wadd_wchnstr()
200 wc = chp in wadd_wchnstr()
[all...]

1234