From: Francois B <mrs...@us...> - 2005-01-25 02:24:13
|
Update of /cvsroot/openneo/openneo/firmware/drivers In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9972 Modified Files: ata.c Log Message: Added check for devices that support the PACKET command Index: ata.c =================================================================== RCS file: /cvsroot/openneo/openneo/firmware/drivers/ata.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** ata.c 8 Sep 2004 00:33:57 -0000 1.12 --- ata.c 25 Jan 2005 02:23:57 -0000 1.13 *************** *** 68,71 **** --- 68,73 ---- #define STATUS_ERR 0x01 + #define ERROR_ABRT 0x04 + #define CONTROL_nIEN 0x02 #define CONTROL_SRST 0x04 *************** *** 73,76 **** --- 75,80 ---- #define CMD_READ_SECTORS 0x20 #define CMD_WRITE_SECTORS 0x30 + #define CMD_PACKET 0xA0 + #define CMD_IDENTIFY_PACKET 0xA1 #define CMD_READ_MULTIPLE 0xC4 #define CMD_WRITE_MULTIPLE 0xC5 *************** *** 84,87 **** --- 88,93 ---- #define CMD_SECURITY_FREEZE_LOCK 0xF5 + + //ATA/ATAPI-6 Commands #define CMD_READ_SECTORS_EXT 0x24 *************** *** 94,97 **** --- 100,116 ---- #define READ_TIMEOUT 5*HZ + /* FLAGS USED INTERNALLY + + + + + + + */ + + #define ATA_FLAGS_PACKET_DEV 0x01 + + unsigned int ata_flags = 0; + static struct mutex ata_mtx; char ata_device; /* device 0 (master) or 1 (slave) */ *************** *** 779,786 **** } ! for (i=0; i<SECTOR_SIZE/2; i++) ! /* the IDENTIFY words are already swapped */ ! identify_info[i] = ATA_DATA; return 0; } --- 798,832 ---- } ! /* Devices that implement the PACKET Command feature ! set shall post command aborted and place the PACKET Command ! feature set signature in the Command Block registers ! */ ! ! //Check for a packet device ! /* if( (ATA_ERROR & ERROR_ABRT) == ERROR_ABRT ) { ! ! ata_flags |= ATA_FLAGS_PACKET_DEV; ! ! if(!wait_for_rdy()) { ! DEBUGF("identify() - not RDY\n"); ! return -1; ! } ! ! ATA_COMMAND = CMD_IDENTIFY_PACKET; ! ! if (!wait_for_start_of_transfer()) { ! DEBUGF("identify() - CMD failed\n"); ! return -2; ! } ! }*/ + for (i=0; i<SECTOR_SIZE/2; i++) + /* the IDENTIFY words are already swapped */ + identify_info[i] = ATA_DATA; + + //Check bit 15 or first word + if( identify_info[0] & 0x8000 ) + ata_flags |= ATA_FLAGS_PACKET_DEV; + return 0; } *************** *** 945,948 **** --- 991,997 ---- return -70 + rc; + if(ata_flags & ATA_FLAGS_PACKET_DEV) + panicf( "ata PACKET not supported!" ); + return 0; } |