Merge pull request #4247 from Cacodemon345/modem_emu
Modem emulation (includinng SLIP connectivity)
This commit is contained in:
@@ -225,6 +225,9 @@ extern const device_t pcnet_am79c970a_device;
|
||||
extern const device_t pcnet_am79c973_device;
|
||||
extern const device_t pcnet_am79c973_onboard_device;
|
||||
|
||||
/* Modem */
|
||||
extern const device_t modem_device;
|
||||
|
||||
/* PLIP */
|
||||
#ifdef EMU_LPT_H
|
||||
extern const lpt_device_t lpt_plip_device;
|
||||
|
||||
24
src/include/86box/plat_netsocket.h
Normal file
24
src/include/86box/plat_netsocket.h
Normal file
@@ -0,0 +1,24 @@
|
||||
#ifndef _WIN32
|
||||
#define SOCKET int
|
||||
#else
|
||||
#include <winsock2.h>
|
||||
#include <ws2tcpip.h>
|
||||
#endif
|
||||
|
||||
enum net_socket_types
|
||||
{
|
||||
/* Only TCP is supported for now. */
|
||||
NET_SOCKET_TCP
|
||||
};
|
||||
|
||||
SOCKET plat_netsocket_create(int type);
|
||||
SOCKET plat_netsocket_create_server(int type, unsigned short port);
|
||||
void plat_netsocket_close(SOCKET socket);
|
||||
|
||||
SOCKET plat_netsocket_accept(SOCKET socket);
|
||||
int plat_netsocket_connected(SOCKET socket); /* Returns -1 on trouble. */
|
||||
int plat_netsocket_connect(SOCKET socket, const char* hostname, unsigned short port);
|
||||
|
||||
/* Returns 0 in case of inability to send. -1 in case of errors. */
|
||||
int plat_netsocket_send(SOCKET socket, const unsigned char* data, unsigned int size, int *wouldblock);
|
||||
int plat_netsocket_receive(SOCKET socket, unsigned char* data, unsigned int size, int *wouldblock);
|
||||
@@ -92,6 +92,7 @@ typedef struct serial_s {
|
||||
|
||||
typedef struct serial_device_s {
|
||||
void (*rcr_callback)(struct serial_s *serial, void *priv);
|
||||
void (*dtr_callback)(struct serial_s *serial, int status, void *priv);
|
||||
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data);
|
||||
void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t lcr);
|
||||
void (*transmit_period_callback)(struct serial_s *serial, void *priv, double transmit_period);
|
||||
@@ -112,6 +113,12 @@ extern serial_t *serial_attach_ex(int port,
|
||||
void (*lcr_callback)(struct serial_s *serial, void *priv, uint8_t data_bits),
|
||||
void *priv);
|
||||
|
||||
extern serial_t *serial_attach_ex_2(int port,
|
||||
void (*rcr_callback)(struct serial_s *serial, void *priv),
|
||||
void (*dev_write)(struct serial_s *serial, void *priv, uint8_t data),
|
||||
void (*dtr_callback)(struct serial_s *serial, int status, void *priv),
|
||||
void *priv);
|
||||
|
||||
#define serial_attach(port, rcr_callback, dev_write, priv) \
|
||||
serial_attach_ex(port, rcr_callback, dev_write, NULL, NULL, priv);
|
||||
|
||||
@@ -129,6 +136,7 @@ extern void serial_device_timeout(void *priv);
|
||||
extern void serial_set_cts(serial_t *dev, uint8_t enabled);
|
||||
extern void serial_set_dsr(serial_t *dev, uint8_t enabled);
|
||||
extern void serial_set_dcd(serial_t *dev, uint8_t enabled);
|
||||
extern void serial_set_ri(serial_t *dev, uint8_t enabled);
|
||||
|
||||
extern const device_t ns8250_device;
|
||||
extern const device_t ns8250_pcjr_device;
|
||||
|
||||
Reference in New Issue
Block a user