mirror of
https://github.com/aaru-dps/aaruremote.git
synced 2025-12-16 19:24:37 +00:00
Add FreeBSD skeleton.
This commit is contained in:
@@ -32,7 +32,7 @@ else ()
|
|||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
set(AARU_PORTS "linux;wii;win32" CACHE STRING "List of ports to build")
|
set(AARU_PORTS "linux;wii;win32;freebsd" CACHE STRING "List of ports to build")
|
||||||
foreach (PORT IN LISTS AARU_PORTS)
|
foreach (PORT IN LISTS AARU_PORTS)
|
||||||
add_subdirectory(${PORT})
|
add_subdirectory(${PORT})
|
||||||
endforeach (PORT)
|
endforeach (PORT)
|
||||||
|
|||||||
12
freebsd/CMakeLists.txt
Normal file
12
freebsd/CMakeLists.txt
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
project(aaruremote-fbsd C)
|
||||||
|
|
||||||
|
if (NOT "${CMAKE_SYSTEM}" MATCHES "FreeBSD")
|
||||||
|
return()
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(PLATFORM_SOURCES list_devices.c freebsd.h device.c scsi.c usb.c ieee1394.c pcmcia.c ata.c sdhci.c ../unix/hello.c
|
||||||
|
../unix/network.c ../unix/unix.c ../unix/unix.h)
|
||||||
|
|
||||||
|
add_executable(aaruremote ${PLATFORM_SOURCES})
|
||||||
|
|
||||||
|
target_link_libraries(aaruremote aaruremotecore)
|
||||||
66
freebsd/ata.c
Normal file
66
freebsd/ata.c
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
int32_t SendAtaChsCommand(void* device_ctx,
|
||||||
|
AtaRegistersChs registers,
|
||||||
|
AtaErrorRegistersChs* error_registers,
|
||||||
|
uint8_t protocol,
|
||||||
|
uint8_t transfer_register,
|
||||||
|
char* buffer,
|
||||||
|
uint32_t timeout,
|
||||||
|
uint8_t transfer_blocks,
|
||||||
|
uint32_t* duration,
|
||||||
|
uint32_t* sense,
|
||||||
|
uint32_t* buf_len)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t SendAtaLba28Command(void* device_ctx,
|
||||||
|
AtaRegistersLba28 registers,
|
||||||
|
AtaErrorRegistersLba28* error_registers,
|
||||||
|
uint8_t protocol,
|
||||||
|
uint8_t transfer_register,
|
||||||
|
char* buffer,
|
||||||
|
uint32_t timeout,
|
||||||
|
uint8_t transfer_blocks,
|
||||||
|
uint32_t* duration,
|
||||||
|
uint32_t* sense,
|
||||||
|
uint32_t* buf_len)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t SendAtaLba48Command(void* device_ctx,
|
||||||
|
AtaRegistersLba48 registers,
|
||||||
|
AtaErrorRegistersLba48* error_registers,
|
||||||
|
uint8_t protocol,
|
||||||
|
uint8_t transfer_register,
|
||||||
|
char* buffer,
|
||||||
|
uint32_t timeout,
|
||||||
|
uint8_t transfer_blocks,
|
||||||
|
uint32_t* duration,
|
||||||
|
uint32_t* sense,
|
||||||
|
uint32_t* buf_len)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
36
freebsd/device.c
Normal file
36
freebsd/device.c
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
void* DeviceOpen(const char* device_path)
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DeviceClose(void* device_ctx)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t GetDeviceType(void* device_ctx)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
27
freebsd/freebsd.h
Normal file
27
freebsd/freebsd.h
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef AARUREMOTE_FREEBSD_FREEBSD_H_
|
||||||
|
#define AARUREMOTE_FREEBSD_FREEBSD_H_
|
||||||
|
|
||||||
|
typedef struct
|
||||||
|
{
|
||||||
|
int fd;
|
||||||
|
char device_path[4096];
|
||||||
|
} DeviceContext;
|
||||||
|
|
||||||
|
#endif // AARUREMOTE_FREEBSD_FREEBSD_H_
|
||||||
31
freebsd/ieee1394.c
Normal file
31
freebsd/ieee1394.c
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
uint8_t GetFireWireData(void* device_ctx,
|
||||||
|
uint32_t* id_model,
|
||||||
|
uint32_t* id_vendor,
|
||||||
|
uint64_t* guid,
|
||||||
|
char* vendor,
|
||||||
|
char* model)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
26
freebsd/list_devices.c
Normal file
26
freebsd/list_devices.c
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
DeviceInfoList* ListDevices()
|
||||||
|
{
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
26
freebsd/pcmcia.c
Normal file
26
freebsd/pcmcia.c
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
uint8_t GetPcmciaData(void* device_ctx, uint16_t* cis_len, char* cis)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
36
freebsd/scsi.c
Normal file
36
freebsd/scsi.c
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
int32_t SendScsiCommand(void* device_ctx,
|
||||||
|
char* cdb,
|
||||||
|
char* buffer,
|
||||||
|
char** sense_buffer,
|
||||||
|
uint32_t timeout,
|
||||||
|
int32_t direction,
|
||||||
|
uint32_t* duration,
|
||||||
|
uint32_t* sense,
|
||||||
|
uint32_t cdb_len,
|
||||||
|
uint32_t* buf_len,
|
||||||
|
uint32_t* sense_len)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
52
freebsd/sdhci.c
Normal file
52
freebsd/sdhci.c
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
int32_t SendSdhciCommand(void* device_ctx,
|
||||||
|
uint8_t command,
|
||||||
|
uint8_t write,
|
||||||
|
uint8_t application,
|
||||||
|
uint32_t flags,
|
||||||
|
uint32_t argument,
|
||||||
|
uint32_t block_size,
|
||||||
|
uint32_t blocks,
|
||||||
|
char* buffer,
|
||||||
|
uint32_t buf_len,
|
||||||
|
uint32_t timeout,
|
||||||
|
uint32_t* response,
|
||||||
|
uint32_t* duration,
|
||||||
|
uint32_t* sense)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
int32_t GetSdhciRegisters(void* device_ctx,
|
||||||
|
char** csd,
|
||||||
|
char** cid,
|
||||||
|
char** ocr,
|
||||||
|
char** scr,
|
||||||
|
uint32_t* csd_len,
|
||||||
|
uint32_t* cid_len,
|
||||||
|
uint32_t* ocr_len,
|
||||||
|
uint32_t* scr_len)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
33
freebsd/usb.c
Normal file
33
freebsd/usb.c
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of the Aaru Remote Server.
|
||||||
|
* Copyright (c) 2019-2020 Natalia Portillo.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful, but
|
||||||
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||||
|
* General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "../aaruremote.h"
|
||||||
|
#include "freebsd.h"
|
||||||
|
|
||||||
|
uint8_t GetUsbData(void* device_ctx,
|
||||||
|
uint16_t* desc_len,
|
||||||
|
char* descriptors,
|
||||||
|
uint16_t* id_vendor,
|
||||||
|
uint16_t* id_product,
|
||||||
|
char* manufacturer,
|
||||||
|
char* product,
|
||||||
|
char* serial)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user