File: arch-generic.c

package info (click to toggle)
diskscan 0.21-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,656 kB
  • sloc: ansic: 11,136; python: 338; xml: 138; sh: 41; makefile: 34
file content (38 lines) | stat: -rw-r--r-- 719 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#include "arch.h"

#include <sys/types.h>
#include <unistd.h>

#include "arch-posix.c"

int disk_dev_read_cap(disk_dev_t *dev, uint64_t *size_bytes, uint64_t *sector_size)
{
	off_t end = lseek(dev->fd, 0, SEEK_END);

	if (end == (off_t)-1)
		return -1;

	*size_bytes = end;
	*sector_size = 512;

	return 0;
}

int disk_dev_identify(disk_dev_t *dev, char *vendor, char *model, char *fw_rev, char *serial, bool *is_ata, unsigned char *ata_buf, unsigned *ata_buf_len)
{
	(void)dev;
	strcpy(vendor, "UNKNOWN");
	strcpy(model, "UNKNOWN");
	strcpy(fw_rev, "UNKN");
	strcpy(serial, "UNKNOWN");
	*is_ata = 0;
	*ata_buf_len = 0;
	*ata_buf = 0;
	return 0;
}

void mac_read(unsigned char *buf, int len)
{
	(void)len;
	*buf = 0;
}