aboutsummaryrefslogtreecommitdiff
path: root/miscutils/hdparm.c
diff options
context:
space:
mode:
authortimr <timr@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-25 00:08:53 +0000
committertimr <timr@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-01-25 00:08:53 +0000
commitfd8222f9b9db2a783b17ec9c59cf3fc22a4e4586 (patch)
tree5f329b7d0c7f20ecced0dc7581a9ba6dc720d965 /miscutils/hdparm.c
parent45d75f9ecc8f2b582407059da7d414f990ced68a (diff)
downloadbusybox-w32-fd8222f9b9db2a783b17ec9c59cf3fc22a4e4586.tar.gz
busybox-w32-fd8222f9b9db2a783b17ec9c59cf3fc22a4e4586.tar.bz2
busybox-w32-fd8222f9b9db2a783b17ec9c59cf3fc22a4e4586.zip
just whitespace
git-svn-id: svn://busybox.net/trunk/busybox@13584 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'miscutils/hdparm.c')
-rw-r--r--miscutils/hdparm.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/miscutils/hdparm.c b/miscutils/hdparm.c
index 04ce073db..4bf0d45ce 100644
--- a/miscutils/hdparm.c
+++ b/miscutils/hdparm.c
@@ -74,8 +74,8 @@
74#define RW_LONG 22 /* extra bytes in R/W LONG cmd ( < ATA-4)*/ 74#define RW_LONG 22 /* extra bytes in R/W LONG cmd ( < ATA-4)*/
75#define START_FW_REV 23 /* ASCII firmware revision */ 75#define START_FW_REV 23 /* ASCII firmware revision */
76#define LENGTH_FW_REV 4 /* 4 words (8 bytes or characters) */ 76#define LENGTH_FW_REV 4 /* 4 words (8 bytes or characters) */
77#define START_MODEL 27 /* ASCII model number */ 77#define START_MODEL 27 /* ASCII model number */
78#define LENGTH_MODEL 20 /* 20 words (40 bytes or characters) */ 78#define LENGTH_MODEL 20 /* 20 words (40 bytes or characters) */
79#define SECTOR_XFER_MAX 47 /* r/w multiple: max sectors xfered */ 79#define SECTOR_XFER_MAX 47 /* r/w multiple: max sectors xfered */
80#define DWORD_IO 48 /* can do double-word IO (ATA-1 only) */ 80#define DWORD_IO 48 /* can do double-word IO (ATA-1 only) */
81#define CAPAB_0 49 /* capabilities */ 81#define CAPAB_0 49 /* capabilities */
@@ -121,12 +121,12 @@
121 in low byte, 0x40 in high byte. */ 121 in low byte, 0x40 in high byte. */
122#define PSWD_CODE 92 /* master password revision code */ 122#define PSWD_CODE 92 /* master password revision code */
123#define HWRST_RSLT 93 /* hardware reset result */ 123#define HWRST_RSLT 93 /* hardware reset result */
124#define ACOUSTIC 94 /* acoustic mgmt values ( >= ATA-6) */ 124#define ACOUSTIC 94 /* acoustic mgmt values ( >= ATA-6) */
125#define LBA_LSB 100 /* LBA: maximum. Currently only 48 */ 125#define LBA_LSB 100 /* LBA: maximum. Currently only 48 */
126#define LBA_MID 101 /* bits are used, but addr 103 */ 126#define LBA_MID 101 /* bits are used, but addr 103 */
127#define LBA_48_MSB 102 /* has been reserved for LBA in */ 127#define LBA_48_MSB 102 /* has been reserved for LBA in */
128#define LBA_64_MSB 103 /* the future. */ 128#define LBA_64_MSB 103 /* the future. */
129#define RM_STAT 127 /* removable media status notification feature set support */ 129#define RM_STAT 127 /* removable media status notification feature set support */
130#define SECU_STATUS 128 /* security status */ 130#define SECU_STATUS 128 /* security status */
131#define CFA_PWR_MODE 160 /* CFA power mode 1 */ 131#define CFA_PWR_MODE 160 /* CFA power mode 1 */
132#define START_MEDIA 176 /* media serial number */ 132#define START_MEDIA 176 /* media serial number */
@@ -229,7 +229,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
229 */ 229 */
230#define STBY_NID_VAL 0x37c8 /* (a) and (b) */ 230#define STBY_NID_VAL 0x37c8 /* (a) and (b) */
231#define STBY_ID_VAL 0x738c /* (a) and not (b) */ 231#define STBY_ID_VAL 0x738c /* (a) and not (b) */
232#define PWRD_NID_VAL 0x8c73 /* not (a) and (b) */ 232#define PWRD_NID_VAL 0x8c73 /* not (a) and (b) */
233#define PWRD_ID_VAL 0xc837 /* not (a) and not (b) */ 233#define PWRD_ID_VAL 0xc837 /* not (a) and not (b) */
234 234
235/* words 47 & 59: sector_xfer_max & sector_xfer_cur */ 235/* words 47 & 59: sector_xfer_max & sector_xfer_cur */
@@ -237,7 +237,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
237#define MULTIPLE_SETTING_VALID 0x0100 /* 1=multiple sector setting is valid */ 237#define MULTIPLE_SETTING_VALID 0x0100 /* 1=multiple sector setting is valid */
238 238
239/* word 49: capabilities 0 */ 239/* word 49: capabilities 0 */
240#define STD_STBY 0x2000 /* 1=standard values supported (ATA); 240#define STD_STBY 0x2000 /* 1=standard values supported (ATA);
241 0=vendor specific values */ 241 0=vendor specific values */
242#define IORDY_SUP 0x0800 /* 1=support; 0=may be supported */ 242#define IORDY_SUP 0x0800 /* 1=support; 0=may be supported */
243#define IORDY_OFF 0x0400 /* 1=may be disabled */ 243#define IORDY_OFF 0x0400 /* 1=may be disabled */
@@ -255,7 +255,7 @@ static const char * const ata1_cfg_str[] = { /* word 0 in ATA-1 mode */
255#define MODE 0xff00 /* the mode is in the MSBs */ 255#define MODE 0xff00 /* the mode is in the MSBs */
256 256
257/* word 53: whats_valid */ 257/* word 53: whats_valid */
258#define OK_W88 0x0004 /* the ultra_dma info is valid */ 258#define OK_W88 0x0004 /* the ultra_dma info is valid */
259#define OK_W64_70 0x0002 /* see above for word descriptions */ 259#define OK_W64_70 0x0002 /* see above for word descriptions */
260#define OK_W54_58 0x0001 /* current cyl, head, sector, cap. info valid */ 260#define OK_W54_58 0x0001 /* current cyl, head, sector, cap. info valid */
261 261
@@ -314,25 +314,25 @@ static const char * const minor_str[] = { /* word 81 value: */
314#endif 314#endif
315static const char actual_ver[] = { 315static const char actual_ver[] = {
316 /* word 81 value: */ 316 /* word 81 value: */
317 0, /* 0x0000 WARNING: */ 317 0, /* 0x0000 WARNING: */
318 1, /* 0x0001 WARNING: */ 318 1, /* 0x0001 WARNING: */
319 1, /* 0x0002 WARNING: */ 319 1, /* 0x0002 WARNING: */
320 1, /* 0x0003 WARNING: */ 320 1, /* 0x0003 WARNING: */
321 2, /* 0x0004 WARNING: This array */ 321 2, /* 0x0004 WARNING: This array */
322 2, /* 0x0005 WARNING: corresponds */ 322 2, /* 0x0005 WARNING: corresponds */
323 3, /* 0x0006 WARNING: *exactly* */ 323 3, /* 0x0006 WARNING: *exactly* */
324 2, /* 0x0007 WARNING: to the ATA/ */ 324 2, /* 0x0007 WARNING: to the ATA/ */
325 3, /* 0x0008 WARNING: ATAPI version */ 325 3, /* 0x0008 WARNING: ATAPI version */
326 2, /* 0x0009 WARNING: listed in */ 326 2, /* 0x0009 WARNING: listed in */
327 3, /* 0x000a WARNING: the */ 327 3, /* 0x000a WARNING: the */
328 3, /* 0x000b WARNING: minor_str */ 328 3, /* 0x000b WARNING: minor_str */
329 3, /* 0x000c WARNING: array */ 329 3, /* 0x000c WARNING: array */
330 4, /* 0x000d WARNING: above. */ 330 4, /* 0x000d WARNING: above. */
331 4, /* 0x000e WARNING: */ 331 4, /* 0x000e WARNING: */
332 4, /* 0x000f WARNING: if you change */ 332 4, /* 0x000f WARNING: if you change */
333 4, /* 0x0010 WARNING: that one, */ 333 4, /* 0x0010 WARNING: that one, */
334 4, /* 0x0011 WARNING: change this one */ 334 4, /* 0x0011 WARNING: change this one */
335 4, /* 0x0012 WARNING: too!!! */ 335 4, /* 0x0012 WARNING: too!!! */
336 5, /* 0x0013 WARNING: */ 336 5, /* 0x0013 WARNING: */
337 4, /* 0x0014 WARNING: */ 337 4, /* 0x0014 WARNING: */
338 5, /* 0x0015 WARNING: */ 338 5, /* 0x0015 WARNING: */
@@ -343,7 +343,7 @@ static const char actual_ver[] = {
343 0, /* 0x001a WARNING: */ 343 0, /* 0x001a WARNING: */
344 6, /* 0x001b WARNING: */ 344 6, /* 0x001b WARNING: */
345 6, /* 0x001c WARNING: */ 345 6, /* 0x001c WARNING: */
346 0 /* 0x001d-0xfffe */ 346 0 /* 0x001d-0xfffe */
347}; 347};
348 348
349/* words 82-84: cmds/feats supported */ 349/* words 82-84: cmds/feats supported */
@@ -387,7 +387,7 @@ static const char * const cmd_feat_str[] = {
387 "Adv. Power Management feature set",/* word 83 bit 3 */ 387 "Adv. Power Management feature set",/* word 83 bit 3 */
388 "CFA feature set", /* word 83 bit 2 */ 388 "CFA feature set", /* word 83 bit 2 */
389 "READ/WRITE DMA QUEUED", /* word 83 bit 1 */ 389 "READ/WRITE DMA QUEUED", /* word 83 bit 1 */
390 "DOWNLOAD MICROCODE cmd", /* word 83 bit 0 */ 390 "DOWNLOAD MICROCODE cmd", /* word 83 bit 0 */
391 /* --------------*/ 391 /* --------------*/
392 "", /* word 84 bit 15: !valid bit */ 392 "", /* word 84 bit 15: !valid bit */
393 "", /* word 84 bit 14: valid bit */ 393 "", /* word 84 bit 14: valid bit */
@@ -428,7 +428,7 @@ static const char * const cmd_feat_str[] = {
428#define CSEL_VAL 0x0004 /* device num determined by CSEL_VAL */ 428#define CSEL_VAL 0x0004 /* device num determined by CSEL_VAL */
429 429
430/* word 127: removable media status notification feature set support */ 430/* word 127: removable media status notification feature set support */
431#define RM_STAT_BITS 0x0003 431#define RM_STAT_BITS 0x0003
432#define RM_STAT_SUP 0x0001 432#define RM_STAT_SUP 0x0001
433 433
434/* word 128: security */ 434/* word 128: security */
@@ -774,7 +774,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
774 like_std = 6; 774 like_std = 6;
775 } 775 }
776 else if(((std == 4) || (!std && (like_std < 5))) && 776 else if(((std == 4) || (!std && (like_std < 5))) &&
777 ((((val[INTEGRITY] & SIG) == SIG_VAL) && !chksum) || 777 ((((val[INTEGRITY] & SIG) == SIG_VAL) && !chksum) ||
778 (( val[HWRST_RSLT] & VALID) == VALID_VAL) || 778 (( val[HWRST_RSLT] & VALID) == VALID_VAL) ||
779 ((( val[CMDS_SUPP_1] & VALID) == VALID_VAL) && 779 ((( val[CMDS_SUPP_1] & VALID) == VALID_VAL) &&
780 (( val[CMDS_SUPP_1] & CMDS_W83) > 0x001f)) ) ) 780 (( val[CMDS_SUPP_1] & CMDS_W83) > 0x001f)) ) )
@@ -805,14 +805,14 @@ static void identify (uint16_t *id_supplied, const char *devname)
805 if(!std) 805 if(!std)
806 printf("\n\tLikely used: %u\n",like_std); 806 printf("\n\tLikely used: %u\n",like_std);
807 else if(like_std > std) 807 else if(like_std > std)
808 printf("& some of %u\n",like_std); 808 printf("& some of %u\n",like_std);
809 else 809 else
810 printf("\n"); 810 printf("\n");
811 } 811 }
812 else 812 else
813 { 813 {
814 /* TBD: do CDROM stuff more thoroughly. For now... */ 814 /* TBD: do CDROM stuff more thoroughly. For now... */
815 kk = 0; 815 kk = 0;
816 if(val[CDR_MINOR] == 9) 816 if(val[CDR_MINOR] == 9)
817 { 817 {
818 kk = 1; 818 kk = 1;
@@ -886,7 +886,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
886 ll = (uint32_t)val[LBA_SECTS_MSB] << 16 | val[LBA_SECTS_LSB]; 886 ll = (uint32_t)val[LBA_SECTS_MSB] << 16 | val[LBA_SECTS_LSB];
887 mm = 0; bbbig = 0; 887 mm = 0; bbbig = 0;
888 if ( (ll > 0x00FBFC10) && (!val[LCYLS])) 888 if ( (ll > 0x00FBFC10) && (!val[LCYLS]))
889 printf("\tCHS addressing not supported\n"); 889 printf("\tCHS addressing not supported\n");
890 else 890 else
891 { 891 {
892 jj = val[WHATS_VALID] & OK_W54_58; 892 jj = val[WHATS_VALID] & OK_W54_58;
@@ -915,9 +915,9 @@ static void identify (uint16_t *id_supplied, const char *devname)
915 if( ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) && 915 if( ((val[CMDS_SUPP_1] & VALID) == VALID_VAL) &&
916 (val[CMDS_SUPP_1] & SUPPORT_48_BIT) ) 916 (val[CMDS_SUPP_1] & SUPPORT_48_BIT) )
917 { 917 {
918 bbbig = (__u64)val[LBA_64_MSB] << 48 | 918 bbbig = (__u64)val[LBA_64_MSB] << 48 |
919 (__u64)val[LBA_48_MSB] << 32 | 919 (__u64)val[LBA_48_MSB] << 32 |
920 (__u64)val[LBA_MID] << 16 | 920 (__u64)val[LBA_MID] << 16 |
921 val[LBA_LSB] ; 921 val[LBA_LSB] ;
922 printf("\tLBA48 user addressable sectors:%11llu\n",bbbig); 922 printf("\tLBA48 user addressable sectors:%11llu\n",bbbig);
923 } 923 }
@@ -1081,7 +1081,7 @@ static void identify (uint16_t *id_supplied, const char *devname)
1081 1081
1082 /* Programmed IO stuff */ 1082 /* Programmed IO stuff */
1083 printf("\tPIO: "); 1083 printf("\tPIO: ");
1084 /* If a drive supports mode n (e.g. 3), it also supports all modes less 1084 /* If a drive supports mode n (e.g. 3), it also supports all modes less
1085 * than n (e.g. 3, 2, 1 and 0). Print all the modes. */ 1085 * than n (e.g. 3, 2, 1 and 0). Print all the modes. */
1086 if((val[WHATS_VALID] & OK_W64_70) && (val[ADV_PIO_MODES] & PIO_SUP)) 1086 if((val[WHATS_VALID] & OK_W64_70) && (val[ADV_PIO_MODES] & PIO_SUP))
1087 { 1087 {
@@ -1349,8 +1349,8 @@ static void dump_identity (const struct hd_driveid *id)
1349 capacity = (id->cur_capacity1 << 16) | id->cur_capacity0; 1349 capacity = (id->cur_capacity1 << 16) | id->cur_capacity0;
1350#endif 1350#endif
1351 printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads, 1351 printf(" CurCHS=%u/%u/%u, CurSects=%lu, LBA=%s",id->cur_cyls, id->cur_heads,
1352 id->cur_sectors, capacity , 1352 id->cur_sectors, capacity ,
1353 ((id->capability&2)==0)?"no":"yes"); 1353 ((id->capability&2)==0)?"no":"yes");
1354 1354
1355 if_printf((id->capability&2),", LBAsects=%u", id->lba_capacity); 1355 if_printf((id->capability&2),", LBAsects=%u", id->lba_capacity);
1356 1356
@@ -1363,7 +1363,7 @@ static void dump_identity (const struct hd_driveid *id)
1363 if_strcat((id->dma_1word & 0x200), dmodes, "*"); 1363 if_strcat((id->dma_1word & 0x200), dmodes, "*");
1364 if_strcat((id->dma_1word & 2), dmodes, "sdma1 "); 1364 if_strcat((id->dma_1word & 2), dmodes, "sdma1 ");
1365 if_strcat((id->dma_1word & 0x400), dmodes, "*"); 1365 if_strcat((id->dma_1word & 0x400), dmodes, "*");
1366 if_strcat((id->dma_1word & 4), dmodes, "sdma2 "); 1366 if_strcat((id->dma_1word & 4), dmodes, "sdma2 ");
1367 if_strcat((id->dma_1word & 0xf800), dmodes, "*"); 1367 if_strcat((id->dma_1word & 0xf800), dmodes, "*");
1368 if_strcat((id->dma_1word & 0xf8), dmodes, "sdma? "); 1368 if_strcat((id->dma_1word & 0xf8), dmodes, "sdma? ");
1369 if_strcat((id->dma_mword & 0x100), dmodes, "*"); 1369 if_strcat((id->dma_mword & 0x100), dmodes, "*");
@@ -2346,7 +2346,7 @@ static void process_dev (char *devname)
2346 no_scsi(); 2346 no_scsi();
2347 if (ioctl(fd, HDIO_DRIVE_CMD, &args) 2347 if (ioctl(fd, HDIO_DRIVE_CMD, &args)
2348 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */ 2348 && (args[0] = WIN_CHECKPOWERMODE2) /* try again with 0x98 */
2349 && ioctl(fd, HDIO_DRIVE_CMD, &args)) 2349 && ioctl(fd, HDIO_DRIVE_CMD, &args))
2350 { 2350 {
2351 if (errno != EIO || args[0] != 0 || args[1] != 0) 2351 if (errno != EIO || args[0] != 0 || args[1] != 0)
2352 state = "unknown"; 2352 state = "unknown";
@@ -2456,7 +2456,7 @@ identify_abort:
2456 2456
2457 2457
2458 if (do_ctimings) 2458 if (do_ctimings)
2459 do_time(0,fd); /*time cache */ 2459 do_time(0,fd); /*time cache */
2460 if (do_timings) 2460 if (do_timings)
2461 do_time(1,fd); /*time device */ 2461 do_time(1,fd); /*time device */
2462 if (do_flush) 2462 if (do_flush)