Lines Matching refs:device

83     uint8_t         channel, device;
97 for (device=0; device<BX_MAX_ATA_DEVICES; device++) {
98 bios_dsk->devices[device].type = DSK_TYPE_NONE;
99 bios_dsk->devices[device].device = DSK_DEVICE_NONE;
100 bios_dsk->devices[device].removable = 0;
101 bios_dsk->devices[device].lock = 0;
102 bios_dsk->devices[device].mode = ATA_MODE_NONE;
103 bios_dsk->devices[device].blksize = 0x200;
104 bios_dsk->devices[device].translation = GEO_TRANSLATION_NONE;
105 bios_dsk->devices[device].lchs.heads = 0;
106 bios_dsk->devices[device].lchs.cylinders = 0;
107 bios_dsk->devices[device].lchs.spt = 0;
108 bios_dsk->devices[device].pchs.heads = 0;
109 bios_dsk->devices[device].pchs.cylinders = 0;
110 bios_dsk->devices[device].pchs.spt = 0;
111 bios_dsk->devices[device].sectors = 0;
115 for (device=0; device<BX_MAX_STORAGE_DEVICES; device++) {
116 bios_dsk->hdidmap[device] = BX_MAX_STORAGE_DEVICES;
117 bios_dsk->cdidmap[device] = BX_MAX_STORAGE_DEVICES;
130 void ata_reset(uint16_t device)
139 channel = device / 2;
140 slave = device % 2;
161 if (bios_dsk->devices[device].type != DSK_TYPE_NONE) {
163 // select device
214 uint16_t device;
219 device = bios_dsk->drqp.dev_id;
220 channel = device / 2;
221 slave = device % 2;
225 mode = bios_dsk->devices[device].mode;
226 blksize = bios_dsk->devices[device].blksize;
358 // ATA/ATAPI driver : device detection
364 uint8_t hdcount, cdcount, device, type;
403 for (device = 0; device < BX_MAX_ATA_DEVICES; device++) {
408 channel = device / 2;
409 slave = device % 2;
417 // Look for device
431 bios_dsk->devices[device].type = DSK_TYPE_UNKNOWN;
434 ata_reset(device);
446 bios_dsk->devices[device].type = DSK_TYPE_ATAPI;
448 bios_dsk->devices[device].type = DSK_TYPE_ATA;
450 bios_dsk->devices[device].type = DSK_TYPE_NONE;
458 type = bios_dsk->devices[device].type;
460 // Now we send a IDENTIFY command to ATA device
469 bios_dsk->devices[device].device = DSK_DEVICE_HD;
470 bios_dsk->devices[device].mode = ATA_MODE_PIO16;
472 bios_dsk->drqp.dev_id = device;
475 BX_PANIC("ata-detect: Failed to detect ATA device\n");
489 switch (device)
518 bios_dsk->devices[device].device = DSK_DEVICE_HD;
519 bios_dsk->devices[device].removable = removable;
520 bios_dsk->devices[device].mode = mode;
521 bios_dsk->devices[device].blksize = blksize;
522 bios_dsk->devices[device].pchs.heads = heads;
523 bios_dsk->devices[device].pchs.cylinders = cylinders;
524 bios_dsk->devices[device].pchs.spt = spt;
525 bios_dsk->devices[device].sectors = sectors;
526 bios_dsk->devices[device].lchs = lgeo;
527 if (device < 2)
532 if (device == 0)
556 bios_dsk->hdidmap[hdcount] = device;
560 // Now we send an IDENTIFY command to ATAPI device
566 bios_dsk->devices[device].device = DSK_DEVICE_CDROM;
567 bios_dsk->devices[device].mode = ATA_MODE_PIO16;
569 bios_dsk->drqp.dev_id = device;
572 BX_PANIC("ata-detect: Failed to detect ATAPI device\n");
579 bios_dsk->devices[device].device = type;
580 bios_dsk->devices[device].removable = removable;
581 bios_dsk->devices[device].mode = mode;
582 bios_dsk->devices[device].blksize = blksize;
585 bios_dsk->cdidmap[cdcount] = device;
597 sizeinmb = bios_dsk->devices[device].sectors;
641 if (bios_dsk->devices[device].device == DSK_DEVICE_CDROM)
647 printf("ata%d %s: Unknown device\n", channel , slave ? " slave" : "master");
691 uint16_t device;
695 device = bios_dsk->drqp.dev_id;
696 channel = device / 2;
697 slave = device % 2;
701 mode = bios_dsk->devices[device].mode;
702 blksize = 0x200; // was = bios_dsk->devices[device].blksize;
821 * Read sectors from an attached ATA device.
855 * Write sectors to an attached ATA device.
889 uint16_t ata_cmd_packet(uint16_t device, uint8_t cmdlen, char __far *cmdbuf,
901 channel = device / 2;
902 slave = device % 2;
918 mode = bios_dsk->devices[device].mode;
971 // Send command to device
1095 // Final check, device must be ready
1110 // ATA/ATAPI driver : reset device; intended for ATAPI devices
1115 uint16_t ata_soft_reset(uint16_t device)
1124 channel = device / 2;
1125 slave = device % 2;
1130 /* Send a reset command to the device. */
1135 /* Wait for the device to clear BSY. */
1141 /* Final check, device must be ready */