+#ifdef __linux__
+static enum sp_return get_baudrate(int fd, int *baudrate)
+{
+ void *data;
+
+ if (!(data = malloc(get_termios_size())))
+ return SP_ERR_MEM;
+
+ if (ioctl(fd, get_termios_get_ioctl(), data) < 0)
+ return SP_ERR_FAIL;
+
+ *baudrate = get_termios_speed(data);
+
+ return SP_OK;
+}
+
+static enum sp_return set_baudrate(int fd, int baudrate)
+{
+ void *data;
+
+ if (!(data = malloc(get_termios_size())))
+ return SP_ERR_MEM;
+
+ if (ioctl(fd, get_termios_get_ioctl(), data) < 0)
+ return SP_ERR_FAIL;
+
+ set_termios_speed(data, baudrate);
+
+ if (ioctl(fd, get_termios_set_ioctl(), data) < 0)
+ return SP_ERR_FAIL;
+
+ return SP_OK;
+}
+
+#ifdef USE_TERMIOX
+static enum sp_return get_flow(int fd, int *flow)
+{
+ void *data;
+
+ if (!(data = malloc(get_termiox_size())))
+ return SP_ERR_MEM;
+
+ if (ioctl(fd, TCGETX, data) < 0)
+ return SP_ERR_FAIL;
+
+ *flow = get_termiox_flow(data);
+
+ return SP_OK;
+}
+
+static enum sp_return set_flow(int fd, int flow)
+{
+ void *data;
+
+ if (!(data = malloc(get_termiox_size())))
+ return SP_ERR_MEM;
+
+ if (ioctl(fd, TCGETX, data) < 0)
+ return SP_ERR_FAIL;
+
+ set_termiox_flow(data, flow);
+
+ if (ioctl(fd, TCSETX, data) < 0)
+ return SP_ERR_FAIL;
+
+ return SP_OK;
+}
+#endif /* USE_TERMIOX */
+#endif /* __linux__ */
+
+static enum sp_return get_config(struct sp_port *port, struct port_data *data,
+ struct sp_port_config *config)