Lines Matching defs:wd_c
48 static int wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c);
201 wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c)
205 uint16_t *ptr = (uint16_t *)wd_c->data;
210 for (i = wd_c->bcount; i > 0; i -= sizeof(uint16_t))
220 wdccommand(struct wd_softc *sc, struct wdc_command *wd_c)
226 wd_c->drive, wd_c->r_command, wd_c->r_cyl,
227 wd_c->r_head, wd_c->r_sector, wd_c->bcount,
228 wd_c->r_precomp));
231 WDC_WRITE_REG(chp, wd_features, wd_c->r_features);
232 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
233 WDC_WRITE_REG(chp, wd_sector, wd_c->r_sector);
234 WDC_WRITE_REG(chp, wd_cyl_lo, wd_c->r_cyl);
235 WDC_WRITE_REG(chp, wd_cyl_hi, wd_c->r_cyl >> 8);
237 WDSD_IBM | (wd_c->drive << 4) | wd_c->r_head);
238 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
256 wdccommandext(struct wd_softc *wd, struct wdc_command *wd_c)
262 wd_c->drive, wd_c->r_command,
263 wd_c->r_blkno, wd_c->r_count));
267 WDC_WRITE_REG(chp, wd_sdh, (wd_c->drive << 4) | WDSD_LBA);
271 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count >> 8);
272 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 40);
273 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 32);
274 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno >> 24);
278 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
279 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 16);
280 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 8);
281 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno);
284 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
305 struct wdc_command wd_c;
307 memset(&wd_c, 0, sizeof(wd_c));
309 wd_c.drive = wd->sc_unit;
310 wd_c.r_command = WDCC_IDENTIFY;
311 wd_c.bcount = DEV_BSIZE;
312 wd_c.data = data;
314 if ((error = wdccommand(wd, &wd_c)) != 0)
317 return wdc_read_block(wd, &wd_c);
327 struct wdc_command wd_c;
330 memset(&wd_c, 0, sizeof(wd_c));
334 wd_c.data = data;
335 wd_c.r_count = 1;
336 wd_c.r_features = 0;
337 wd_c.drive = wd->sc_unit;
338 wd_c.bcount = wd->sc_label.d_secsize;
347 wd_c.r_command = atacmd_to48(cmd);
348 wd_c.r_blkno = blkno;
351 wd_c.r_command = cmd;
352 wd_c.r_sector = (blkno >> 0) & 0xff;
353 wd_c.r_cyl = (blkno >> 8) & 0xffff;
354 wd_c.r_head = (blkno >> 24) & 0x0f;
355 wd_c.r_head |= WDSD_LBA;
358 wd_c.r_command = cmd;
359 wd_c.r_sector = blkno % wd->sc_label.d_nsectors;
360 wd_c.r_sector++; /* Sectors begin with 1, not 0. */
362 wd_c.r_head = blkno % wd->sc_label.d_ntracks;
364 wd_c.r_cyl = blkno;
365 wd_c.r_head |= WDSD_CHS;
369 error = wdccommandext(wd, &wd_c);
371 error = wdccommand(wd, &wd_c);
376 return wdc_read_block(wd, &wd_c);