1 #include <hal/ahci/ahci.h>
2 #include <lunaix/block.h>
3 #include <lunaix/fs/twifs.h>
6 __twimap_read_serial(struct twimap* map)
8 struct hba_device* hbadev = twimap_data(map, struct hba_device*);
9 twimap_printf(map, "%s", hbadev->serial_num);
13 __twimap_read_last_status(struct twimap* map)
15 struct hba_device* hbadev = twimap_data(map, struct hba_device*);
18 hbadev->last_result.status,
19 hbadev->last_result.error,
20 hbadev->last_result.sense_key);
24 __twimap_read_capabilities(struct twimap* map)
26 struct hba_device* hbadev = twimap_data(map, struct hba_device*);
27 twimap_printf(map, "%p", hbadev->capabilities);
31 __twimap_read_alignment(struct twimap* map)
33 struct hba_device* hbadev = twimap_data(map, struct hba_device*);
34 twimap_printf(map, "%d", hbadev->alignment_offset);
38 __twimap_read_wwid(struct twimap* map)
40 struct hba_device* hbadev = twimap_data(map, struct hba_device*);
41 u32_t h = hbadev->wwn >> 32;
42 u32_t l = (u32_t)hbadev->wwn;
44 twimap_printf(map, "wwn:%x%x", h, l);
46 twimap_printf(map, "0");
51 ahci_fsexport(struct block_dev* bdev, void* fs_node)
53 struct twifs_node* dev_root = (struct twifs_node*)fs_node;
56 twimap_export_value(dev_root, serial, FSACL_aR, bdev->driver);
57 twimap_export_value(dev_root, last_status, FSACL_aR, bdev->driver);
58 twimap_export_value(dev_root, wwid, FSACL_aR, bdev->driver);
59 twimap_export_value(dev_root, capabilities, FSACL_aR, bdev->driver);
60 twimap_export_value(dev_root, alignment, FSACL_aR, bdev->driver);