Drop the unused TTY bus_manager.
Just stubs and not actually used. We have a TTY module (and driver) which supplant it.
This commit is contained in:
@@ -1,139 +0,0 @@
|
|||||||
/*
|
|
||||||
* BeOS R5 compatible TTY module API
|
|
||||||
*
|
|
||||||
* Copyright 2008, Haiku Inc. All Rights Reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _TTY_TTYLAYER_H
|
|
||||||
#define _TTY_TTYLAYER_H
|
|
||||||
|
|
||||||
#include <module.h>
|
|
||||||
#include <termios.h>
|
|
||||||
|
|
||||||
|
|
||||||
// XXX: should go away or be opacised
|
|
||||||
struct str {
|
|
||||||
uchar *buffer;
|
|
||||||
uint bufsize, count, tail;
|
|
||||||
bool allocated;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ddrover {
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ddomain {
|
|
||||||
struct ddrover *r;
|
|
||||||
bool bg;
|
|
||||||
bool locked;
|
|
||||||
};
|
|
||||||
#define ddbackground(d) ((d)->bg = true)
|
|
||||||
|
|
||||||
|
|
||||||
typedef bool (*tty_service_func)(struct tty *tty, struct ddrover *rover, uint op);
|
|
||||||
|
|
||||||
struct tty {
|
|
||||||
uint nopen;
|
|
||||||
uint flags;
|
|
||||||
struct ddomain dd;
|
|
||||||
struct ddomain ddi; // used in interrupt context
|
|
||||||
pid_t pgid;
|
|
||||||
struct termios t;
|
|
||||||
uint iactivity;
|
|
||||||
bool ibusy;
|
|
||||||
struct str istr;
|
|
||||||
struct str rstr;
|
|
||||||
struct str ostr;
|
|
||||||
struct winsize wsize;
|
|
||||||
tty_service_func service;
|
|
||||||
struct sel *sel;
|
|
||||||
struct tty *ttysel;
|
|
||||||
};
|
|
||||||
|
|
||||||
struct ttyfile {
|
|
||||||
struct tty *tty;
|
|
||||||
uint flags;
|
|
||||||
bigtime_t vtime;
|
|
||||||
};
|
|
||||||
|
|
||||||
// flags
|
|
||||||
#define TTYCARRIER (1 << 0)
|
|
||||||
#define TTYWRITABLE (1 << 1)
|
|
||||||
#define TTYWRITING (1 << 2)
|
|
||||||
#define TTYREADING (1 << 3)
|
|
||||||
#define TTYOSTOPPED (1 << 4)
|
|
||||||
#define TTYEXCLUSIVE (1 << 5)
|
|
||||||
#define TTYHWDCD (1 << 6)
|
|
||||||
#define TTYHWCTS (1 << 7)
|
|
||||||
#define TTYHWDSR (1 << 8)
|
|
||||||
#define TTYHWRI (1 << 9)
|
|
||||||
#define TTYFLOWFORCED (1 << 10)
|
|
||||||
|
|
||||||
// ops
|
|
||||||
#define TTYENABLE 0
|
|
||||||
#define TTYDISABLE 1
|
|
||||||
#define TTYSETMODES 2
|
|
||||||
#define TTYOSTART 3
|
|
||||||
#define TTYOSYNC 4
|
|
||||||
#define TTYISTOP 5
|
|
||||||
#define TTYIRESUME 6
|
|
||||||
#define TTYSETBREAK 7
|
|
||||||
#define TTYCLRBREAK 8
|
|
||||||
#define TTYSETDTR 9
|
|
||||||
#define TTYCLRDTR 10
|
|
||||||
#define TTYGETSIGNALS 11
|
|
||||||
|
|
||||||
typedef struct tty_module_info tty_module_info;
|
|
||||||
|
|
||||||
// this version is compatible with BeOS R5
|
|
||||||
struct tty_module_info_r5 {
|
|
||||||
// not a real bus manager... no rescan() !
|
|
||||||
module_info mi;
|
|
||||||
status_t (*ttyopen)(struct ttyfile *, struct ddrover *, tty_service_func);
|
|
||||||
status_t (*ttyclose)(struct ttyfile *, struct ddrover *);
|
|
||||||
status_t (*ttyfree)(struct ttyfile *, struct ddrover *);
|
|
||||||
status_t (*ttyread)(struct ttyfile *, struct ddrover *, char *, size_t *);
|
|
||||||
status_t (*ttywrite)(struct ttyfile *, struct ddrover *, const char *, size_t *);
|
|
||||||
status_t (*ttycontrol)(struct ttyfile *, struct ddrover *, ulong, void *, size_t);
|
|
||||||
void (*ttyinit)(struct tty *, bool);
|
|
||||||
void (*ttyilock)(struct tty *, struct ddrover *, bool );
|
|
||||||
void (*ttyhwsignal)(struct tty *, struct ddrover *, int, bool);
|
|
||||||
int (*ttyin)(struct tty *, struct ddrover *, int);
|
|
||||||
int (*ttyout)(struct tty *, struct ddrover *);
|
|
||||||
struct ddrover *(*ddrstart)(struct ddrover *);
|
|
||||||
void (*ddrdone)(struct ddrover *);
|
|
||||||
void (*ddacquire)(struct ddrover *, struct ddomain *);
|
|
||||||
};
|
|
||||||
|
|
||||||
// BeOS R5.1d0 has a different module with the same version...
|
|
||||||
// we exort this module as version 1.1 to allow using select from drivers
|
|
||||||
struct tty_module_info_dano {
|
|
||||||
// not a real bus manager... no rescan() !
|
|
||||||
module_info mi;
|
|
||||||
status_t (*ttyopen)(struct ttyfile *, struct ddrover *, tty_service_func);
|
|
||||||
status_t (*ttyclose)(struct ttyfile *, struct ddrover *);
|
|
||||||
status_t (*ttyfree)(struct ttyfile *, struct ddrover *);
|
|
||||||
status_t (*ttyread)(struct ttyfile *, struct ddrover *, char *, size_t *);
|
|
||||||
status_t (*ttywrite)(struct ttyfile *, struct ddrover *, const char *, size_t *);
|
|
||||||
status_t (*ttycontrol)(struct ttyfile *, struct ddrover *, ulong, void *, size_t);
|
|
||||||
status_t (*ttyselect)(struct ttyfile *, struct ddrover *, uint8, uint32, selectsync *);
|
|
||||||
status_t (*ttydeselect)(struct ttyfile *, struct ddrover *, uint8, selectsync *);
|
|
||||||
|
|
||||||
void (*ttyinit)(struct tty *, bool);
|
|
||||||
void (*ttyilock)(struct tty *, struct ddrover *, bool );
|
|
||||||
void (*ttyhwsignal)(struct tty *, struct ddrover *, int, bool);
|
|
||||||
int (*ttyin)(struct tty *, struct ddrover *, int);
|
|
||||||
int (*ttyout)(struct tty *, struct ddrover *);
|
|
||||||
struct ddrover *(*ddrstart)(struct ddrover *);
|
|
||||||
void (*ddrdone)(struct ddrover *);
|
|
||||||
void (*ddacquire)(struct ddrover *, struct ddomain *);
|
|
||||||
};
|
|
||||||
|
|
||||||
#define B_TTY_MODULE_NAME_R5 "bus_managers/tty/v1"
|
|
||||||
#define B_TTY_MODULE_NAME_DANO "bus_managers/tty/v1.1"
|
|
||||||
|
|
||||||
#define B_TTY_MODULE_NAME B_TTY_MODULE_NAME_DANO
|
|
||||||
#define tty_module_info tty_module_info_dano
|
|
||||||
|
|
||||||
#endif /* _TTY_TTYLAYER_H */
|
|
||||||
@@ -12,6 +12,5 @@ SubInclude HAIKU_TOP src add-ons kernel bus_managers pci ;
|
|||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers ps2 ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers ps2 ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers random ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers random ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers scsi ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers scsi ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers tty ;
|
|
||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers usb ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers usb ;
|
||||||
SubInclude HAIKU_TOP src add-ons kernel bus_managers virtio ;
|
SubInclude HAIKU_TOP src add-ons kernel bus_managers virtio ;
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
SubDir HAIKU_TOP src add-ons kernel bus_managers tty ;
|
|
||||||
|
|
||||||
UsePrivateKernelHeaders ;
|
|
||||||
UsePrivateHeaders drivers ;
|
|
||||||
UsePrivateHeaders kernel shared ;
|
|
||||||
UsePrivateHeaders [ FDirName kernel util ] ;
|
|
||||||
|
|
||||||
KernelAddon <bus_manager>tty :
|
|
||||||
tty.cpp
|
|
||||||
kernel_cpp.cpp
|
|
||||||
:
|
|
||||||
;
|
|
||||||
|
|
||||||
SEARCH on [ FGristFiles
|
|
||||||
kernel_cpp.cpp
|
|
||||||
] = [ FDirName $(HAIKU_TOP) src system kernel util ] ;
|
|
||||||
|
|
||||||
@@ -1,251 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2008, François Revol, <[email protected]>.
|
|
||||||
* Copyright 2007-2008, Ingo Weinhold, [email protected].
|
|
||||||
* Copyright 2004-2006, Axel Dörfler, [email protected]. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include <ctype.h>
|
|
||||||
#include <errno.h>
|
|
||||||
#include <signal.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <sys/stat.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include <util/AutoLock.h>
|
|
||||||
#include <util/kernel_cpp.h>
|
|
||||||
|
|
||||||
#include <team.h>
|
|
||||||
|
|
||||||
#include <tty.h>
|
|
||||||
|
|
||||||
#include <KernelExport.h>
|
|
||||||
#include <device_manager.h>
|
|
||||||
#include <bus_manager.h>
|
|
||||||
#include <tty/ttylayer.h>
|
|
||||||
|
|
||||||
#include "tty_private.h"
|
|
||||||
|
|
||||||
//#define TTY_TRACE
|
|
||||||
#ifdef TTY_TRACE
|
|
||||||
# define TRACE(x) dprintf x
|
|
||||||
#else
|
|
||||||
# define TRACE(x) ;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_open(struct ttyfile *, struct ddrover *, tty_service_func)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_close(struct ttyfile *, struct ddrover *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_free(struct ttyfile *, struct ddrover *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_read(struct ttyfile *, struct ddrover *, char *, size_t *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_write(struct ttyfile *, struct ddrover *, const char *, size_t *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_control(struct ttyfile *, struct ddrover *, ulong, void *, size_t)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_select(struct ttyfile *, struct ddrover *, uint8, uint32, selectsync *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_deselect(struct ttyfile *, struct ddrover *, uint8, selectsync *)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_init(struct tty *, bool)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_ilock(struct tty *, struct ddrover *, bool )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_hwsignal(struct tty *, struct ddrover *, int, bool)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
tty_in(struct tty *, struct ddrover *, int)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
int
|
|
||||||
tty_out(struct tty *, struct ddrover *)
|
|
||||||
{
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark ddrover handling
|
|
||||||
|
|
||||||
|
|
||||||
struct ddrover *
|
|
||||||
tty_dd_rstart(struct ddrover *)
|
|
||||||
{
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_dd_rdone(struct ddrover *)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_dd_acquire(struct ddrover *, struct ddomain *)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark bus manager exports
|
|
||||||
|
|
||||||
|
|
||||||
status_t
|
|
||||||
tty_module_init(void)
|
|
||||||
{
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void
|
|
||||||
tty_module_uninit(void)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int32
|
|
||||||
tty_module_std_ops(int32 op, ...)
|
|
||||||
{
|
|
||||||
switch (op) {
|
|
||||||
case B_MODULE_INIT:
|
|
||||||
{
|
|
||||||
status_t status;
|
|
||||||
|
|
||||||
//TRACE(("TTY: tty_module_init\n"));
|
|
||||||
|
|
||||||
status = tty_module_init();
|
|
||||||
if (status < B_OK)
|
|
||||||
return status;
|
|
||||||
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
case B_MODULE_UNINIT:
|
|
||||||
//TRACE(("TTY: tty_module_uninit\n"));
|
|
||||||
tty_module_uninit();
|
|
||||||
return B_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
return B_BAD_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static struct tty_module_info_r5 sR5TTYModule = {
|
|
||||||
// ! this is *NOT* a real bus manager (no rescan call!)
|
|
||||||
//{
|
|
||||||
{
|
|
||||||
B_TTY_MODULE_NAME,
|
|
||||||
0, //B_KEEP_LOADED,
|
|
||||||
tty_module_std_ops
|
|
||||||
},
|
|
||||||
//NULL
|
|
||||||
//},
|
|
||||||
&tty_open,
|
|
||||||
&tty_close,
|
|
||||||
&tty_free,
|
|
||||||
&tty_read,
|
|
||||||
&tty_write,
|
|
||||||
&tty_control,
|
|
||||||
&tty_init,
|
|
||||||
&tty_ilock,
|
|
||||||
&tty_hwsignal,
|
|
||||||
&tty_in,
|
|
||||||
&tty_out,
|
|
||||||
&tty_dd_rstart,
|
|
||||||
&tty_dd_rdone,
|
|
||||||
&tty_dd_acquire
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct tty_module_info_dano sDanoTTYModule = {
|
|
||||||
// ! this is *NOT* a real bus manager (no rescan call!)
|
|
||||||
//{
|
|
||||||
{
|
|
||||||
B_TTY_MODULE_NAME_DANO,
|
|
||||||
0, //B_KEEP_LOADED,
|
|
||||||
tty_module_std_ops
|
|
||||||
},
|
|
||||||
//NULL
|
|
||||||
//},
|
|
||||||
&tty_open,
|
|
||||||
&tty_close,
|
|
||||||
&tty_free,
|
|
||||||
&tty_read,
|
|
||||||
&tty_write,
|
|
||||||
&tty_control,
|
|
||||||
&tty_select,
|
|
||||||
&tty_deselect,
|
|
||||||
&tty_init,
|
|
||||||
&tty_ilock,
|
|
||||||
&tty_hwsignal,
|
|
||||||
&tty_in,
|
|
||||||
&tty_out,
|
|
||||||
&tty_dd_rstart,
|
|
||||||
&tty_dd_rdone,
|
|
||||||
&tty_dd_acquire
|
|
||||||
};
|
|
||||||
|
|
||||||
module_info *modules[] = {
|
|
||||||
(module_info *)&sR5TTYModule,
|
|
||||||
(module_info *)&sDanoTTYModule,
|
|
||||||
NULL
|
|
||||||
};
|
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright 2008, François Revol, <[email protected]>.
|
|
||||||
* Copyright 2007-2008, Ingo Weinhold, [email protected].
|
|
||||||
* Copyright 2004-2006, Axel Dörfler, [email protected]. All rights reserved.
|
|
||||||
* Distributed under the terms of the MIT License.
|
|
||||||
*/
|
|
||||||
#ifndef _TTY_H_
|
|
||||||
#define _TTY_H_
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // _TTY_H_
|
|
||||||
Reference in New Issue
Block a user