Home | History | Annotate | Download | only in boot

Lines Matching refs:wd_c

57 static int  wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c);
234 wdc_read_block(struct wd_softc *sc, struct wdc_command *wd_c)
238 uint16_t *ptr = (uint16_t *)wd_c->data;
243 if (wd_c->r_command == WDCC_IDENTIFY)
244 for (i = wd_c->bcount; i > 0; i -= sizeof(uint16_t))
247 for (i = wd_c->bcount; i > 0; i -= sizeof(uint16_t))
257 wdccommand(struct wd_softc *sc, struct wdc_command *wd_c)
263 wd_c->drive, wd_c->r_command, wd_c->r_cyl,
264 wd_c->r_head, wd_c->r_sector, wd_c->bcount,
265 wd_c->r_precomp));
268 WDC_WRITE_REG(chp, wd_features, wd_c->r_features);
269 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
270 WDC_WRITE_REG(chp, wd_sector, wd_c->r_sector);
271 WDC_WRITE_REG(chp, wd_cyl_lo, wd_c->r_cyl);
272 WDC_WRITE_REG(chp, wd_cyl_hi, wd_c->r_cyl >> 8);
274 WDSD_IBM | (wd_c->drive << 4) | wd_c->r_head);
275 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
293 wdccommandext(struct wd_softc *wd, struct wdc_command *wd_c)
299 wd_c->drive, wd_c->r_command,
300 wd_c->r_blkno, wd_c->r_count));
304 WDC_WRITE_REG(chp, wd_sdh, (wd_c->drive << 4) | WDSD_LBA);
308 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count >> 8);
309 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 40);
310 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 32);
311 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno >> 24);
315 WDC_WRITE_REG(chp, wd_seccnt, wd_c->r_count);
316 WDC_WRITE_REG(chp, wd_lba_hi, wd_c->r_blkno >> 16);
317 WDC_WRITE_REG(chp, wd_lba_mi, wd_c->r_blkno >> 8);
318 WDC_WRITE_REG(chp, wd_lba_lo, wd_c->r_blkno);
321 WDC_WRITE_REG(chp, wd_command, wd_c->r_command);
342 struct wdc_command wd_c;
344 memset(&wd_c, 0, sizeof(wd_c));
346 wd_c.drive = 0;
347 wd_c.r_command = WDCC_IDENTIFY;
348 wd_c.bcount = DEV_BSIZE;
349 wd_c.data = data;
351 if ((error = wdccommand(wd, &wd_c)) != 0)
354 return wdc_read_block(wd, &wd_c);
364 struct wdc_command wd_c;
367 memset(&wd_c, 0, sizeof(wd_c));
371 wd_c.data = data;
372 wd_c.r_count = 1;
373 wd_c.r_features = 0;
374 wd_c.drive = 0;
375 wd_c.bcount = wd->sc_label.d_secsize;
384 wd_c.r_command = atacmd_to48(cmd);
385 wd_c.r_blkno = blkno;
388 wd_c.r_command = cmd;
389 wd_c.r_sector = (blkno >> 0) & 0xff;
390 wd_c.r_cyl = (blkno >> 8) & 0xffff;
391 wd_c.r_head = (blkno >> 24) & 0x0f;
392 wd_c.r_head |= WDSD_LBA;
395 wd_c.r_command = cmd;
396 wd_c.r_sector = blkno % wd->sc_label.d_nsectors;
397 wd_c.r_sector++; /* Sectors begin with 1, not 0. */
399 wd_c.r_head = blkno % wd->sc_label.d_ntracks;
401 wd_c.r_cyl = blkno;
402 wd_c.r_head |= WDSD_CHS;
406 error = wdccommandext(wd, &wd_c);
408 error = wdccommand(wd, &wd_c);
413 return wdc_read_block(wd, &wd_c);