aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBorislav Petkov <bbpetkov@yahoo.de>2008-02-02 13:56:36 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:36 -0500
commitf373bd820dd80ae079537afb9db511b8802bb9f7 (patch)
treee57d28dded109a3d500812fc2596aa6417a83d3b
parentae7e8ddc34d8cd302886a1f8d1db8a3400532d1f (diff)
ide-floppy: remove IDEFLOPPY_DEBUG_INFO
This info is already available through ioctl() and /proc Bart: - dump 'gcw.packet_size' for unsupported packet sizes Signed-off-by: Borislav Petkov <bbpetkov@yahoo.de> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r--drivers/ide/ide-floppy.c63
1 files changed, 13 insertions, 50 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 1a28b2e7bbb1..b56e37d01593 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -47,11 +47,8 @@
47#include <linux/io.h> 47#include <linux/io.h>
48#include <asm/unaligned.h> 48#include <asm/unaligned.h>
49 49
50/* 50/* define to see debug info */
51 * The following are used to debug the driver.
52 */
53#define IDEFLOPPY_DEBUG_LOG 0 51#define IDEFLOPPY_DEBUG_LOG 0
54#define IDEFLOPPY_DEBUG_INFO 0
55 52
56/* #define IDEFLOPPY_DEBUG(fmt, args...) printk(KERN_INFO fmt, ## args) */ 53/* #define IDEFLOPPY_DEBUG(fmt, args...) printk(KERN_INFO fmt, ## args) */
57#define IDEFLOPPY_DEBUG( fmt, args... ) 54#define IDEFLOPPY_DEBUG( fmt, args... )
@@ -1303,15 +1300,12 @@ static sector_t idefloppy_capacity (ide_drive_t *drive)
1303} 1300}
1304 1301
1305/* 1302/*
1306 * idefloppy_identify_device checks if we can support a drive, 1303 * Check whether we can support a drive, based on the ATAPI IDENTIFY command
1307 * based on the ATAPI IDENTIFY command results. 1304 * results.
1308 */ 1305 */
1309static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id) 1306static int idefloppy_identify_device(ide_drive_t *drive, struct hd_driveid *id)
1310{ 1307{
1311 struct idefloppy_id_gcw gcw; 1308 struct idefloppy_id_gcw gcw;
1312#if IDEFLOPPY_DEBUG_INFO
1313 char buffer[80];
1314#endif /* IDEFLOPPY_DEBUG_INFO */
1315 1309
1316 *((u16 *) &gcw) = id->config; 1310 *((u16 *) &gcw) = id->config;
1317 1311
@@ -1320,54 +1314,23 @@ static int idefloppy_identify_device (ide_drive_t *drive,struct hd_driveid *id)
1320 if ((gcw.device_type == 5) && 1314 if ((gcw.device_type == 5) &&
1321 !strstr(id->model, "CD-ROM") && 1315 !strstr(id->model, "CD-ROM") &&
1322 strstr(id->model, "ZIP")) 1316 strstr(id->model, "ZIP"))
1323 gcw.device_type = 0; 1317 gcw.device_type = 0;
1324#endif 1318#endif
1325 1319
1326#if IDEFLOPPY_DEBUG_INFO
1327 printk(KERN_INFO "Dumping ATAPI Identify Device floppy parameters\n");
1328 switch (gcw.protocol) {
1329 case 0: case 1: sprintf(buffer, "ATA");break;
1330 case 2: sprintf(buffer, "ATAPI");break;
1331 case 3: sprintf(buffer, "Reserved (Unknown to ide-floppy)");break;
1332 }
1333 printk(KERN_INFO "Protocol Type: %s\n", buffer);
1334 switch (gcw.device_type) {
1335 case 0: sprintf(buffer, "Direct-access Device");break;
1336 case 1: sprintf(buffer, "Streaming Tape Device");break;
1337 case 2: case 3: case 4: sprintf (buffer, "Reserved");break;
1338 case 5: sprintf(buffer, "CD-ROM Device");break;
1339 case 6: sprintf(buffer, "Reserved");
1340 case 7: sprintf(buffer, "Optical memory Device");break;
1341 case 0x1f: sprintf(buffer, "Unknown or no Device type");break;
1342 default: sprintf(buffer, "Reserved");
1343 }
1344 printk(KERN_INFO "Device Type: %x - %s\n", gcw.device_type, buffer);
1345 printk(KERN_INFO "Removable: %s\n",gcw.removable ? "Yes":"No");
1346 switch (gcw.drq_type) {
1347 case 0: sprintf(buffer, "Microprocessor DRQ");break;
1348 case 1: sprintf(buffer, "Interrupt DRQ");break;
1349 case 2: sprintf(buffer, "Accelerated DRQ");break;
1350 case 3: sprintf(buffer, "Reserved");break;
1351 }
1352 printk(KERN_INFO "Command Packet DRQ Type: %s\n", buffer);
1353 switch (gcw.packet_size) {
1354 case 0: sprintf(buffer, "12 bytes");break;
1355 case 1: sprintf(buffer, "16 bytes");break;
1356 default: sprintf(buffer, "Reserved");break;
1357 }
1358 printk(KERN_INFO "Command Packet Size: %s\n", buffer);
1359#endif /* IDEFLOPPY_DEBUG_INFO */
1360
1361 if (gcw.protocol != 2) 1320 if (gcw.protocol != 2)
1362 printk(KERN_ERR "ide-floppy: Protocol is not ATAPI\n"); 1321 printk(KERN_ERR "ide-floppy: Protocol (0x%02x) is not ATAPI\n",
1322 gcw.protocol);
1363 else if (gcw.device_type != 0) 1323 else if (gcw.device_type != 0)
1364 printk(KERN_ERR "ide-floppy: Device type is not set to floppy\n"); 1324 printk(KERN_ERR "ide-floppy: Device type (0x%02x) is not set "
1325 "to floppy\n", gcw.device_type);
1365 else if (!gcw.removable) 1326 else if (!gcw.removable)
1366 printk(KERN_ERR "ide-floppy: The removable flag is not set\n"); 1327 printk(KERN_ERR "ide-floppy: The removable flag is not set\n");
1367 else if (gcw.drq_type == 3) { 1328 else if (gcw.drq_type == 3) {
1368 printk(KERN_ERR "ide-floppy: Sorry, DRQ type %d not supported\n", gcw.drq_type); 1329 printk(KERN_ERR "ide-floppy: Sorry, DRQ type (0x%02x) not "
1330 "supported\n", gcw.drq_type);
1369 } else if (gcw.packet_size != 0) { 1331 } else if (gcw.packet_size != 0) {
1370 printk(KERN_ERR "ide-floppy: Packet size is not 12 bytes long\n"); 1332 printk(KERN_ERR "ide-floppy: Packet size (0x%02x) is not 12 "
1333 "bytes long\n", gcw.packet_size);
1371 } else 1334 } else
1372 return 1; 1335 return 1;
1373 return 0; 1336 return 0;