aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 12:02:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-03 12:02:32 -0400
commitea02259fdf47ca81ff3ca0c22906d989094fb8ff (patch)
tree5d3672aa246e016f695bc62a861902a50de7b461 /drivers/block
parent8fe74cf053de7ad2124a894996f84fa890a81093 (diff)
parenteae6c2b6414fc6673ac5415442fe463c01005366 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/linux-hdreg-h-cleanup
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/linux-hdreg-h-cleanup: remove <linux/ata.h> include from <linux/hdreg.h> include/linux/hdreg.h: remove unused defines isd200: use ATA_* defines instead of *_STAT and *_ERR ones include/linux/hdreg.h: cover WIN_* and friends with #ifndef/#endif __KERNEL__ aoe: WIN_* -> ATA_CMD_* isd200: WIN_* -> ATA_CMD_* include/linux/hdreg.h: cover struct hd_driveid with #ifndef/#endif __KERNEL__ xsysace: make it 'struct hd_driveid'-free ubd_kern: make it 'struct hd_driveid'-free isd200: make it 'struct hd_driveid'-free
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/aoe/aoecmd.c23
-rw-r--r--drivers/block/hd.c2
-rw-r--r--drivers/block/xsysace.c30
3 files changed, 27 insertions, 28 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 45c5a33daf49..31693bc24444 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -4,6 +4,7 @@
4 * Filesystem request handling methods 4 * Filesystem request handling methods
5 */ 5 */
6 6
7#include <linux/ata.h>
7#include <linux/hdreg.h> 8#include <linux/hdreg.h>
8#include <linux/blkdev.h> 9#include <linux/blkdev.h>
9#include <linux/skbuff.h> 10#include <linux/skbuff.h>
@@ -267,7 +268,7 @@ aoecmd_ata_rw(struct aoedev *d)
267 writebit = 0; 268 writebit = 0;
268 } 269 }
269 270
270 ah->cmdstat = WIN_READ | writebit | extbit; 271 ah->cmdstat = ATA_CMD_PIO_READ | writebit | extbit;
271 272
272 /* mark all tracking fields and load out */ 273 /* mark all tracking fields and load out */
273 buf->nframesout += 1; 274 buf->nframesout += 1;
@@ -362,10 +363,10 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
362 switch (ah->cmdstat) { 363 switch (ah->cmdstat) {
363 default: 364 default:
364 break; 365 break;
365 case WIN_READ: 366 case ATA_CMD_PIO_READ:
366 case WIN_READ_EXT: 367 case ATA_CMD_PIO_READ_EXT:
367 case WIN_WRITE: 368 case ATA_CMD_PIO_WRITE:
368 case WIN_WRITE_EXT: 369 case ATA_CMD_PIO_WRITE_EXT:
369 put_lba(ah, f->lba); 370 put_lba(ah, f->lba);
370 371
371 n = f->bcnt; 372 n = f->bcnt;
@@ -812,8 +813,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
812 d->htgt = NULL; 813 d->htgt = NULL;
813 n = ahout->scnt << 9; 814 n = ahout->scnt << 9;
814 switch (ahout->cmdstat) { 815 switch (ahout->cmdstat) {
815 case WIN_READ: 816 case ATA_CMD_PIO_READ:
816 case WIN_READ_EXT: 817 case ATA_CMD_PIO_READ_EXT:
817 if (skb->len - sizeof *hin - sizeof *ahin < n) { 818 if (skb->len - sizeof *hin - sizeof *ahin < n) {
818 printk(KERN_ERR 819 printk(KERN_ERR
819 "aoe: %s. skb->len=%d need=%ld\n", 820 "aoe: %s. skb->len=%d need=%ld\n",
@@ -823,8 +824,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
823 return; 824 return;
824 } 825 }
825 memcpy(f->bufaddr, ahin+1, n); 826 memcpy(f->bufaddr, ahin+1, n);
826 case WIN_WRITE: 827 case ATA_CMD_PIO_WRITE:
827 case WIN_WRITE_EXT: 828 case ATA_CMD_PIO_WRITE_EXT:
828 ifp = getif(t, skb->dev); 829 ifp = getif(t, skb->dev);
829 if (ifp) { 830 if (ifp) {
830 ifp->lost = 0; 831 ifp->lost = 0;
@@ -838,7 +839,7 @@ aoecmd_ata_rsp(struct sk_buff *skb)
838 goto xmit; 839 goto xmit;
839 } 840 }
840 break; 841 break;
841 case WIN_IDENTIFY: 842 case ATA_CMD_ID_ATA:
842 if (skb->len - sizeof *hin - sizeof *ahin < 512) { 843 if (skb->len - sizeof *hin - sizeof *ahin < 512) {
843 printk(KERN_INFO 844 printk(KERN_INFO
844 "aoe: runt data size in ataid. skb->len=%d\n", 845 "aoe: runt data size in ataid. skb->len=%d\n",
@@ -914,7 +915,7 @@ aoecmd_ata_id(struct aoedev *d)
914 915
915 /* set up ata header */ 916 /* set up ata header */
916 ah->scnt = 1; 917 ah->scnt = 1;
917 ah->cmdstat = WIN_IDENTIFY; 918 ah->cmdstat = ATA_CMD_ID_ATA;
918 ah->lba3 = 0xa0; 919 ah->lba3 = 0xa0;
919 920
920 skb->dev = t->ifp->nd; 921 skb->dev = t->ifp->nd;
diff --git a/drivers/block/hd.c b/drivers/block/hd.c
index 482c0c4b964f..3c11f062a18c 100644
--- a/drivers/block/hd.c
+++ b/drivers/block/hd.c
@@ -42,6 +42,8 @@
42#include <linux/ata.h> 42#include <linux/ata.h>
43#include <linux/hdreg.h> 43#include <linux/hdreg.h>
44 44
45#define HD_IRQ 14
46
45#define REALLY_SLOW_IO 47#define REALLY_SLOW_IO
46#include <asm/system.h> 48#include <asm/system.h>
47#include <asm/io.h> 49#include <asm/io.h>
diff --git a/drivers/block/xsysace.c b/drivers/block/xsysace.c
index 119be3442f28..6cccdc3f5220 100644
--- a/drivers/block/xsysace.c
+++ b/drivers/block/xsysace.c
@@ -89,6 +89,7 @@
89#include <linux/delay.h> 89#include <linux/delay.h>
90#include <linux/slab.h> 90#include <linux/slab.h>
91#include <linux/blkdev.h> 91#include <linux/blkdev.h>
92#include <linux/ata.h>
92#include <linux/hdreg.h> 93#include <linux/hdreg.h>
93#include <linux/platform_device.h> 94#include <linux/platform_device.h>
94#if defined(CONFIG_OF) 95#if defined(CONFIG_OF)
@@ -208,7 +209,7 @@ struct ace_device {
208 struct gendisk *gd; 209 struct gendisk *gd;
209 210
210 /* Inserted CF card parameters */ 211 /* Inserted CF card parameters */
211 struct hd_driveid cf_id; 212 u16 cf_id[ATA_ID_WORDS];
212}; 213};
213 214
214static int ace_major; 215static int ace_major;
@@ -402,21 +403,14 @@ static void ace_dump_regs(struct ace_device *ace)
402 ace_in32(ace, ACE_CFGLBA), ace_in(ace, ACE_FATSTAT)); 403 ace_in32(ace, ACE_CFGLBA), ace_in(ace, ACE_FATSTAT));
403} 404}
404 405
405void ace_fix_driveid(struct hd_driveid *id) 406void ace_fix_driveid(u16 *id)
406{ 407{
407#if defined(__BIG_ENDIAN) 408#if defined(__BIG_ENDIAN)
408 u16 *buf = (void *)id;
409 int i; 409 int i;
410 410
411 /* All half words have wrong byte order; swap the bytes */ 411 /* All half words have wrong byte order; swap the bytes */
412 for (i = 0; i < sizeof(struct hd_driveid); i += 2, buf++) 412 for (i = 0; i < ATA_ID_WORDS; i++, id++)
413 *buf = le16_to_cpu(*buf); 413 *id = le16_to_cpu(*id);
414
415 /* Some of the data values are 32bit; swap the half words */
416 id->lba_capacity = ((id->lba_capacity >> 16) & 0x0000FFFF) |
417 ((id->lba_capacity << 16) & 0xFFFF0000);
418 id->spg = ((id->spg >> 16) & 0x0000FFFF) |
419 ((id->spg << 16) & 0xFFFF0000);
420#endif 414#endif
421} 415}
422 416
@@ -614,7 +608,7 @@ static void ace_fsm_dostate(struct ace_device *ace)
614 break; 608 break;
615 609
616 case ACE_FSM_STATE_IDENTIFY_COMPLETE: 610 case ACE_FSM_STATE_IDENTIFY_COMPLETE:
617 ace_fix_driveid(&ace->cf_id); 611 ace_fix_driveid(&ace->cf_id[0]);
618 ace_dump_mem(&ace->cf_id, 512); /* Debug: Dump out disk ID */ 612 ace_dump_mem(&ace->cf_id, 512); /* Debug: Dump out disk ID */
619 613
620 if (ace->data_result) { 614 if (ace->data_result) {
@@ -627,9 +621,10 @@ static void ace_fsm_dostate(struct ace_device *ace)
627 ace->media_change = 0; 621 ace->media_change = 0;
628 622
629 /* Record disk parameters */ 623 /* Record disk parameters */
630 set_capacity(ace->gd, ace->cf_id.lba_capacity); 624 set_capacity(ace->gd,
625 ata_id_u32(&ace->cf_id, ATA_ID_LBA_CAPACITY));
631 dev_info(ace->dev, "capacity: %i sectors\n", 626 dev_info(ace->dev, "capacity: %i sectors\n",
632 ace->cf_id.lba_capacity); 627 ata_id_u32(&ace->cf_id, ATA_ID_LBA_CAPACITY));
633 } 628 }
634 629
635 /* We're done, drop to IDLE state and notify waiters */ 630 /* We're done, drop to IDLE state and notify waiters */
@@ -928,12 +923,13 @@ static int ace_release(struct gendisk *disk, fmode_t mode)
928static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo) 923static int ace_getgeo(struct block_device *bdev, struct hd_geometry *geo)
929{ 924{
930 struct ace_device *ace = bdev->bd_disk->private_data; 925 struct ace_device *ace = bdev->bd_disk->private_data;
926 u16 *cf_id = &ace->cf_id[0];
931 927
932 dev_dbg(ace->dev, "ace_getgeo()\n"); 928 dev_dbg(ace->dev, "ace_getgeo()\n");
933 929
934 geo->heads = ace->cf_id.heads; 930 geo->heads = cf_id[ATA_ID_HEADS];
935 geo->sectors = ace->cf_id.sectors; 931 geo->sectors = cf_id[ATA_ID_SECTORS];
936 geo->cylinders = ace->cf_id.cyls; 932 geo->cylinders = cf_id[ATA_ID_CYLS];
937 933
938 return 0; 934 return 0;
939} 935}