X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/cbc8fdbfe473e23e19690204418e19999a9522d1..0fd474df7001837bde53da0e42e83081827c9641:/lunaix-os/hal/ahci/hbadev_export.c diff --git a/lunaix-os/hal/ahci/hbadev_export.c b/lunaix-os/hal/ahci/hbadev_export.c index 3fea81d..f6c52bf 100644 --- a/lunaix-os/hal/ahci/hbadev_export.c +++ b/lunaix-os/hal/ahci/hbadev_export.c @@ -3,14 +3,14 @@ #include void -__blk_rd_serial(struct twimap* map) +__twimap_read_serial(struct twimap* map) { struct hba_device* hbadev = twimap_data(map, struct hba_device*); twimap_printf(map, "%s", hbadev->serial_num); } void -__blk_rd_last_status(struct twimap* map) +__twimap_read_last_status(struct twimap* map) { struct hba_device* hbadev = twimap_data(map, struct hba_device*); twimap_printf(map, @@ -21,21 +21,21 @@ __blk_rd_last_status(struct twimap* map) } void -__blk_rd_capabilities(struct twimap* map) +__twimap_read_capabilities(struct twimap* map) { struct hba_device* hbadev = twimap_data(map, struct hba_device*); twimap_printf(map, "%p", hbadev->capabilities); } void -__blk_rd_aoffset(struct twimap* map) +__twimap_read_alignment(struct twimap* map) { struct hba_device* hbadev = twimap_data(map, struct hba_device*); twimap_printf(map, "%d", hbadev->alignment_offset); } void -__blk_rd_wwid(struct twimap* map) +__twimap_read_wwid(struct twimap* map) { struct hba_device* hbadev = twimap_data(map, struct hba_device*); u32_t h = hbadev->wwn >> 32; @@ -53,18 +53,9 @@ ahci_fsexport(struct block_dev* bdev, void* fs_node) struct twifs_node* dev_root = (struct twifs_node*)fs_node; struct twimap* map; - map = twifs_mapping(dev_root, bdev->driver, "serial"); - map->read = __blk_rd_serial; - - map = twifs_mapping(dev_root, bdev->driver, "last_status"); - map->read = __blk_rd_last_status; - - map = twifs_mapping(dev_root, bdev->driver, "wwid"); - map->read = __blk_rd_wwid; - - map = twifs_mapping(dev_root, bdev->driver, "capabilities"); - map->read = __blk_rd_capabilities; - - map = twifs_mapping(dev_root, bdev->driver, "alignment_offset"); - map->read = __blk_rd_aoffset; + twimap_export_value(dev_root, serial, FSACL_aR, bdev->driver); + twimap_export_value(dev_root, last_status, FSACL_aR, bdev->driver); + twimap_export_value(dev_root, wwid, FSACL_aR, bdev->driver); + twimap_export_value(dev_root, capabilities, FSACL_aR, bdev->driver); + twimap_export_value(dev_root, alignment, FSACL_aR, bdev->driver); } \ No newline at end of file